@8wave/ai-elements 0.117.0-beta.12 → 0.117.0-beta.14
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/{Agent-BxyaZeuL.js → Agent-CFkAjuTy.js} +204 -168
- package/dist/_chunks/Agent-CFkAjuTy.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-B8mvCNou.js → PkStreamingMarkdown-BoVR7gtl.js} +670 -644
- package/dist/_chunks/PkStreamingMarkdown-BoVR7gtl.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-Bp-ES8B0.js → PkToolEditSpreadsheet-BlfsM7Qp.js} +2 -2
- package/dist/_chunks/{PkToolEditSpreadsheet-Bp-ES8B0.js.map → PkToolEditSpreadsheet-BlfsM7Qp.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-DcPMMyJH.js → PkToolRequestGeolocation-DdQ91rpB.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-DcPMMyJH.js.map → PkToolRequestGeolocation-DdQ91rpB.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-Cc2qViGX.js → PkToolRequestOAuthConnection-yuTNMEFj.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-Cc2qViGX.js.map → PkToolRequestOAuthConnection-yuTNMEFj.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-CcwAlOFM.js → PkToolShowArtifact-DaTlDsDo.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-CcwAlOFM.js.map → PkToolShowArtifact-DaTlDsDo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-DByjGK_F.js → PkToolShowContactForm-Dxh6bEZt.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-DByjGK_F.js.map → PkToolShowContactForm-Dxh6bEZt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-CGrjJ-9k.js → PkToolShowForm-D1VzwMmq.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-CGrjJ-9k.js.map → PkToolShowForm-D1VzwMmq.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-C3ZaW1jQ.js → PkToolShowImageGallery-Cs8FxK9V.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-C3ZaW1jQ.js.map → PkToolShowImageGallery-Cs8FxK9V.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-BAHoB6mi.js → PkToolShowProductList-B4fxqFaf.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-BAHoB6mi.js.map → PkToolShowProductList-B4fxqFaf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BgnumOzQ.js → PkToolShowSources-DNiiBz9b.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BgnumOzQ.js.map → PkToolShowSources-DNiiBz9b.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CpixDpsJ.js → PkToolShowSuggestedReply-Bn1w6HdI.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CpixDpsJ.js.map → PkToolShowSuggestedReply-Bn1w6HdI.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-94-l_bBW.js → PkToolShowVideo-Be5bKhUf.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-94-l_bBW.js.map → PkToolShowVideo-Be5bKhUf.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-q1gLOgDl.js → PkToolShowWebPages-Bs251x0h.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-q1gLOgDl.js.map → PkToolShowWebPages-Bs251x0h.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-D4kQJejM.js → chatImagePolicy-BACuW8x3.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-D4kQJejM.js.map → chatImagePolicy-BACuW8x3.js.map} +1 -1
- package/dist/_chunks/{markdown-DCYDJNwF.js → markdown-Bk1clNA6.js} +13 -13
- package/dist/_chunks/{markdown-DCYDJNwF.js.map → markdown-Bk1clNA6.js.map} +1 -1
- package/dist/ai-elements.es.js +1963 -1881
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAudioTranscript.d.ts +2 -0
- package/dist-vue/PkChatbotAudioTranscript.js +1 -0
- package/dist-vue/PkChatbotAuth.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/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-CSXbmC44.js → Agent-CNJ3b9Je.js} +2 -2
- package/dist-vue/_chunks/{Agent-CSXbmC44.js.map → Agent-CNJ3b9Je.js.map} +1 -1
- package/dist-vue/_chunks/{Document-Ol8nGgij.js → Document-Bp3YJuQQ.js} +11 -11
- package/dist-vue/_chunks/{Document-Ol8nGgij.js.map → Document-Bp3YJuQQ.js.map} +1 -1
- package/dist-vue/_chunks/{Media-Cv7ou2tP.js → Media-C6Xsb1Lm.js} +77 -27
- package/dist-vue/_chunks/Media-C6Xsb1Lm.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-BmpFnkde.js → PkChatbot-CSMWib9A.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-BmpFnkde.js.map → PkChatbot-CSMWib9A.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js +52 -0
- package/dist-vue/_chunks/PkChatbotAudioTranscript-B-cSKvWR.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAuth-Dolfz0pa.js → PkChatbotAuth-C0qfDOGh.js} +8 -8
- package/dist-vue/_chunks/{PkChatbotAuth-Dolfz0pa.js.map → PkChatbotAuth-C0qfDOGh.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-BaiGfaAD.js → PkChatbotEmptyState-DjmF3dcI.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-BaiGfaAD.js.map → PkChatbotEmptyState-DjmF3dcI.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BjfW_bML.js → PkChatbotInput-B8hKYdD9.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BjfW_bML.js.map → PkChatbotInput-B8hKYdD9.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-DJmRPFB8.js +861 -0
- package/dist-vue/_chunks/PkChatbotMessages-DJmRPFB8.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-CGAdiGR5.js → PkChatbotStepPayload-BGYwwXaT.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CGAdiGR5.js.map → PkChatbotStepPayload-BGYwwXaT.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DQsmXnKT.js → PkChatbotStepToolDetail-BH07XycE.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DQsmXnKT.js.map → PkChatbotStepToolDetail-BH07XycE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DzajeHKc.js → PkChatbotSteps-qyUOh42z.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotSteps-DzajeHKc.js.map → PkChatbotSteps-qyUOh42z.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DZbQQNQn.js → PkChatbotViewChat-C7eA7hef.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-DZbQQNQn.js.map → PkChatbotViewChat-C7eA7hef.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BXtTZ3kb.js → PkChatbotViewConversations-ClJLe1bm.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-BXtTZ3kb.js.map → PkChatbotViewConversations-ClJLe1bm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles--wM5SVAl.js → PkChatbotViewFiles-Do6tpo9O.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles--wM5SVAl.js.map → PkChatbotViewFiles-Do6tpo9O.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B8T0AQC8.js → PkChatbotViewProfile-590b78yi.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B8T0AQC8.js.map → PkChatbotViewProfile-590b78yi.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-D6y6g6vP.js → PkStreamingMarkdown-NWO3WTw9.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-D6y6g6vP.js.map → PkStreamingMarkdown-NWO3WTw9.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BkjEQag2.js → PkToolEditSpreadsheet-BnMSzlCi.js} +2 -2
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-BkjEQag2.js.map → PkToolEditSpreadsheet-BnMSzlCi.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BWWUGKHJ.js → PkToolRequestGeolocation-B2UNj6dx.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BWWUGKHJ.js.map → PkToolRequestGeolocation-B2UNj6dx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DvvLZ8yi.js → PkToolRequestOAuthConnection-B262JqNh.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DvvLZ8yi.js.map → PkToolRequestOAuthConnection-B262JqNh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CP-dG3-Y.js → PkToolShowArtifact-Dr0NHXDG.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CP-dG3-Y.js.map → PkToolShowArtifact-Dr0NHXDG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-BK7B-Qzr.js → PkToolShowContactForm-BDm1w3UK.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BK7B-Qzr.js.map → PkToolShowContactForm-BDm1w3UK.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-9THUQfbg.js → PkToolShowDiagram-BKz7OPHC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-9THUQfbg.js.map → PkToolShowDiagram-BKz7OPHC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-CjN-_-1j.js → PkToolShowForm-cKgWwvPD.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-CjN-_-1j.js.map → PkToolShowForm-cKgWwvPD.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-8cmWigYT.js → PkToolShowImageGallery-DsAQhyOq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-8cmWigYT.js.map → PkToolShowImageGallery-DsAQhyOq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BxsK6LXl.js → PkToolShowProductList-OwGaM5qj.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BxsK6LXl.js.map → PkToolShowProductList-OwGaM5qj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BfWNsyLw.js → PkToolShowSources-BVOqH-ZV.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-BfWNsyLw.js.map → PkToolShowSources-BVOqH-ZV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-_bH3Jikn.js → PkToolShowSuggestedReply-CF31zmck.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-_bH3Jikn.js.map → PkToolShowSuggestedReply-CF31zmck.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-2_EdyT_U.js → PkToolShowVideo-BAqSAfdq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-2_EdyT_U.js.map → PkToolShowVideo-BAqSAfdq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-B0glenu5.js → PkToolShowWebPages-BeMJqIkW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-B0glenu5.js.map → PkToolShowWebPages-BeMJqIkW.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DgtSqixO.js → createChatbotApiClient-DmqgH9Ul.js} +3 -3
- package/dist-vue/_chunks/{createChatbotApiClient-DgtSqixO.js.map → createChatbotApiClient-DmqgH9Ul.js.map} +1 -1
- package/dist-vue/_chunks/message-BOiF6Bt5.js +59 -0
- package/dist-vue/_chunks/message-BOiF6Bt5.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-A33jT5Cp.js → useChatbotStore-CiF_gfIk.js} +656 -653
- package/dist-vue/_chunks/useChatbotStore-CiF_gfIk.js.map +1 -0
- package/dist-vue/_chunks/{utils-ByN6GORv.js → utils-DxuGvgWg.js} +37 -37
- package/dist-vue/_chunks/{utils-ByN6GORv.js.map → utils-DxuGvgWg.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +15 -5
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4754 -4749
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +52 -40
- package/dist-vue/packages/components/src/chat/PkChatbotAudioTranscript.d.ts +13 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +2 -2
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +4 -4
- package/dist-vue/packages/models/src/schema/Media.d.ts +21 -0
- package/dist-vue/packages/models/src/schema/Tabular.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-BxyaZeuL.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-B8mvCNou.js.map +0 -1
- package/dist-vue/_chunks/Media-Cv7ou2tP.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CztL_AMB.js +0 -837
- package/dist-vue/_chunks/PkChatbotMessages-CztL_AMB.js.map +0 -1
- package/dist-vue/_chunks/message-RohfrdWS.js +0 -33
- package/dist-vue/_chunks/message-RohfrdWS.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-A33jT5Cp.js.map +0 -1
|
@@ -0,0 +1,861 @@
|
|
|
1
|
+
import { T as e, k as t, n, v as r, x as i } from "./schemas-COXYARAA.js";
|
|
2
|
+
import { a } from "./Media-C6Xsb1Lm.js";
|
|
3
|
+
import { k as o } from "./Agent-CNJ3b9Je.js";
|
|
4
|
+
import { t as s } from "./PkStreamingMarkdown-NWO3WTw9.js";
|
|
5
|
+
import "./src-DCfvejyT.js";
|
|
6
|
+
import { c, i as l, l as u, n as d, o as f, s as p, t as m } from "./message-BOiF6Bt5.js";
|
|
7
|
+
import { t as h } from "./PkChatbotError-CRGbK09-.js";
|
|
8
|
+
import { t as g } from "./PkRelativeTime--1cIphlA.js";
|
|
9
|
+
import { C as _, S as ee, a as te, b as v, d as y, f as ne, i as re, l as ie, m as ae, n as b, p as oe, t as x, v as se, w as ce, x as le } from "./utils-DxuGvgWg.js";
|
|
10
|
+
import { t as ue } from "./PkChatbotFilePreview-DIP8KLkS.js";
|
|
11
|
+
import { t as de } from "./PkChatbotFeedbackForm-DrPKjh-0.js";
|
|
12
|
+
import { t as fe } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
|
|
13
|
+
import { t as pe } from "./PkChatbotAudioTranscript-B-cSKvWR.js";
|
|
14
|
+
import { n as me, t as he } from "./PkChatbotSteps-qyUOh42z.js";
|
|
15
|
+
import { t as ge } from "./PkChatbotOutlineRail-np4g6vsz.js";
|
|
16
|
+
import { VvButton as _e, VvButtonGroup as ve, VvIcon as ye } from "@volverjs/ui-vue/components";
|
|
17
|
+
import { Fragment as S, Transition as C, computed as w, createBlock as T, createCommentVNode as E, createElementBlock as D, createElementVNode as O, createTextVNode as be, createVNode as k, defineAsyncComponent as A, defineComponent as j, mergeProps as xe, nextTick as M, normalizeClass as N, normalizeStyle as P, onBeforeUnmount as F, onMounted as Se, openBlock as I, ref as L, renderList as Ce, renderSlot as we, resolveDynamicComponent as Te, toDisplayString as R, unref as z, useSlots as Ee, useTemplateRef as De, watch as B, withCtx as V, withModifiers as H } from "vue";
|
|
18
|
+
import { useI18n as Oe } from "vue-i18n";
|
|
19
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
20
|
+
function U(e) {
|
|
21
|
+
return t(n, e);
|
|
22
|
+
}
|
|
23
|
+
r({
|
|
24
|
+
platform: i(),
|
|
25
|
+
threadId: i()
|
|
26
|
+
});
|
|
27
|
+
var ke = r({
|
|
28
|
+
wakeId: e(),
|
|
29
|
+
dueAt: U(),
|
|
30
|
+
reason: i()
|
|
31
|
+
});
|
|
32
|
+
r({ pendingWakeup: ke.nullable() }), r({ wakeId: e() });
|
|
33
|
+
var W = (e) => e?.role === "user" && !!e.metadata?.wakeup, Ae = /* @__PURE__ */ new Set([
|
|
34
|
+
"input-streaming",
|
|
35
|
+
"input-available",
|
|
36
|
+
"approval-requested"
|
|
37
|
+
]), je = (e) => {
|
|
38
|
+
if (e?.role !== "assistant") return !1;
|
|
39
|
+
let t = !1;
|
|
40
|
+
for (let n of e.parts) {
|
|
41
|
+
if (n.type === "text" && n.text.trim() || n.type === "file") return !1;
|
|
42
|
+
let e = n.state;
|
|
43
|
+
if (e && Ae.has(e)) return !1;
|
|
44
|
+
n.type === "tool-scheduleWakeup" && (t = e === "output-available" && n.input?.noop === !0);
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
}, G = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Me = (e) => e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ") : "", Ne = (e) => e ? G(e).replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase() : "", Pe = (e) => e ? G(e).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase() : "", K = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", Fe = {
|
|
48
|
+
requestOAuthConnection: A(() => import("./PkToolRequestOAuthConnection-B262JqNh.js")),
|
|
49
|
+
showArtifact: A(() => import("./PkToolShowArtifact-Dr0NHXDG.js").then((e) => e.n)),
|
|
50
|
+
showCalendarEvent: A(() => import("./PkToolShowCalendarEvent-Dv_rss26.js").then((e) => e.n)),
|
|
51
|
+
showComparison: A(() => import("./PkToolShowComparison-DQs3E6-k.js").then((e) => e.n)),
|
|
52
|
+
showContactForm: A(() => import("./PkToolShowContactForm-BDm1w3UK.js").then((e) => e.n)),
|
|
53
|
+
showDiagram: A(() => import("./PkToolShowDiagram-BKz7OPHC.js")),
|
|
54
|
+
showEmail: A(() => import("./PkToolShowEmail-C591LR5N.js").then((e) => e.n)),
|
|
55
|
+
showImageGallery: A(() => import("./PkToolShowImageGallery-DsAQhyOq.js").then((e) => e.n)),
|
|
56
|
+
showLocation: A(() => import("./PkToolShowLocation-Dyz6h_0n.js").then((e) => e.n)),
|
|
57
|
+
showMessage: A(() => import("./PkToolShowMessage-CbXERPHI.js").then((e) => e.n)),
|
|
58
|
+
showForm: A(() => import("./PkToolShowForm-cKgWwvPD.js").then((e) => e.n)),
|
|
59
|
+
showMultipleChoice: A(() => import("./PkToolShowForm-cKgWwvPD.js").then((e) => e.n)),
|
|
60
|
+
showProductList: A(() => import("./PkToolShowProductList-OwGaM5qj.js").then((e) => e.n)),
|
|
61
|
+
showQrCode: A(() => import("./PkToolShowQrCode-DEAvfLFu.js").then((e) => e.n)),
|
|
62
|
+
showSources: A(() => import("./PkToolShowSources-BVOqH-ZV.js").then((e) => e.n)),
|
|
63
|
+
showSuggestedReply: A(() => import("./PkToolShowSuggestedReply-CF31zmck.js").then((e) => e.n)),
|
|
64
|
+
showVideo: A(() => import("./PkToolShowVideo-BAqSAfdq.js")),
|
|
65
|
+
showWeather: A(() => import("./PkToolShowWeather-BH-FtLpk.js")),
|
|
66
|
+
showWebPages: A(() => import("./PkToolShowWebPages-BeMJqIkW.js").then((e) => e.n))
|
|
67
|
+
}, Ie = {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "text-12 text-word-3 m-0 mb-xs"
|
|
70
|
+
}, Le = /* @__PURE__ */ j({
|
|
71
|
+
__name: "PkToolApprovalPreviewMessage",
|
|
72
|
+
props: { input: {} },
|
|
73
|
+
setup(e) {
|
|
74
|
+
let t = e, n = w(() => {
|
|
75
|
+
let e = t.input;
|
|
76
|
+
return typeof e?.message == "string" ? e.message : "";
|
|
77
|
+
});
|
|
78
|
+
return (e, t) => n.value ? (I(), D("p", Ie, R(n.value), 1)) : E("", !0);
|
|
79
|
+
}
|
|
80
|
+
}), Re = { [x]: Le }, ze = {
|
|
81
|
+
key: 0,
|
|
82
|
+
class: "text-12 text-word-3 m-0 mb-xs"
|
|
83
|
+
}, Be = /* @__PURE__ */ j({
|
|
84
|
+
__name: "PkToolApprovalCard",
|
|
85
|
+
props: {
|
|
86
|
+
part: {},
|
|
87
|
+
actionable: { type: Boolean },
|
|
88
|
+
callVerdict: { type: Boolean }
|
|
89
|
+
},
|
|
90
|
+
emits: ["respond"],
|
|
91
|
+
setup(e, { emit: t }) {
|
|
92
|
+
let n = e, r = t, { t: i } = Oe({ useScope: "global" }), a = w(() => n.part), s = w(() => l(n.part)), c = w(() => s.value === x), u = w(() => c.value ? (a.value.state === "input-available" || o(a.value.output)) && n.callVerdict === void 0 : a.value.state === "approval-requested"), d = w(() => u.value && n.actionable === !0), f = w(() => u.value && n.actionable !== !0), p = w(() => c.value ? a.value.output === "confirmed" || n.callVerdict === !0 : a.value.approval?.approved === !0), m = w(() => c.value ? a.value.output === "cancelled" || n.callVerdict === !1 : a.value.approval?.approved === !1 || a.value.state === "output-denied"), h = w(() => Re[s.value]), g = w(() => {
|
|
93
|
+
if (f.value) return {
|
|
94
|
+
icon: "ri:time-line",
|
|
95
|
+
message: i("toolApproval.expired")
|
|
96
|
+
};
|
|
97
|
+
if (p.value) return {
|
|
98
|
+
icon: "ri:check-line",
|
|
99
|
+
message: i(c.value ? "toolApproval.confirmed" : "toolApproval.approved")
|
|
100
|
+
};
|
|
101
|
+
if (m.value) return {
|
|
102
|
+
icon: "ri:close-line",
|
|
103
|
+
message: i(c.value ? "toolApproval.cancelled" : "toolApproval.denied")
|
|
104
|
+
};
|
|
105
|
+
}), _ = w(() => !!g.value && !h.value);
|
|
106
|
+
return (t, n) => {
|
|
107
|
+
let o = _e, s = ve, l = ye;
|
|
108
|
+
return I(), D("div", { class: N(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !_.value }]) }, [
|
|
109
|
+
k(C, null, {
|
|
110
|
+
default: V(() => [!c.value && u.value ? (I(), D("p", ze, R(z(i)("toolApproval.prompt")), 1)) : E("", !0)]),
|
|
111
|
+
_: 1
|
|
112
|
+
}),
|
|
113
|
+
h.value ? (I(), T(Te(h.value), {
|
|
114
|
+
key: 0,
|
|
115
|
+
part: e.part,
|
|
116
|
+
input: a.value.input
|
|
117
|
+
}, null, 8, ["part", "input"])) : E("", !0),
|
|
118
|
+
k(C, { mode: "out-in" }, {
|
|
119
|
+
default: V(() => [g.value ? (I(), D("p", {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: N(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": h.value }])
|
|
122
|
+
}, [k(l, {
|
|
123
|
+
name: g.value.icon,
|
|
124
|
+
class: "shrink-0"
|
|
125
|
+
}, null, 8, ["name"]), be(" " + R(g.value.message), 1)], 2)) : (I(), T(s, { key: 0 }, {
|
|
126
|
+
default: V(() => [k(o, {
|
|
127
|
+
modifiers: "primary-small",
|
|
128
|
+
disabled: !d.value,
|
|
129
|
+
icon: "ri:check-line",
|
|
130
|
+
label: z(i)("action.proceed"),
|
|
131
|
+
onClick: n[0] ||= H((e) => r("respond", !0), ["stop"])
|
|
132
|
+
}, null, 8, ["disabled", "label"]), k(o, {
|
|
133
|
+
modifiers: "action-quiet-small",
|
|
134
|
+
disabled: !d.value,
|
|
135
|
+
icon: "ri:close-line",
|
|
136
|
+
label: z(i)("action.cancel"),
|
|
137
|
+
onClick: n[1] ||= H((e) => r("respond", !1), ["stop"])
|
|
138
|
+
}, null, 8, ["disabled", "label"])]),
|
|
139
|
+
_: 1
|
|
140
|
+
}))]),
|
|
141
|
+
_: 1
|
|
142
|
+
})
|
|
143
|
+
], 2);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}), Ve = 30, q = 500;
|
|
147
|
+
function He(e) {
|
|
148
|
+
let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = L(!1), u = L(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
|
|
149
|
+
!t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
|
|
150
|
+
top: t.value.scrollHeight,
|
|
151
|
+
behavior: e
|
|
152
|
+
}), setTimeout(() => {
|
|
153
|
+
d = !1;
|
|
154
|
+
}, e === "instant" ? 0 : q));
|
|
155
|
+
}, ee = (e) => {
|
|
156
|
+
e.deltaY < 0 && (l.value = !0);
|
|
157
|
+
}, te = 0, v = (e) => {
|
|
158
|
+
te = e.touches[0]?.clientY ?? 0;
|
|
159
|
+
}, y = (e) => {
|
|
160
|
+
let t = e.touches[0]?.clientY ?? 0;
|
|
161
|
+
t > te && (l.value = !0), te = t;
|
|
162
|
+
}, ne = () => {
|
|
163
|
+
if (!t.value) return;
|
|
164
|
+
let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
|
|
165
|
+
u.value = n - r - e < Ve, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
|
|
166
|
+
}, re = () => {
|
|
167
|
+
if (d || l.value || !t.value) return;
|
|
168
|
+
let e = t.value, n = e.scrollHeight - e.clientHeight;
|
|
169
|
+
n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
|
|
170
|
+
d = !1;
|
|
171
|
+
}));
|
|
172
|
+
}, ie = () => {
|
|
173
|
+
!f && t.value && (f = new MutationObserver(re), f.observe(t.value, {
|
|
174
|
+
childList: !0,
|
|
175
|
+
subtree: !0,
|
|
176
|
+
characterData: !0
|
|
177
|
+
}));
|
|
178
|
+
}, ae = () => {
|
|
179
|
+
f?.disconnect(), f = null;
|
|
180
|
+
};
|
|
181
|
+
B(n, (e, t) => {
|
|
182
|
+
e === "streaming" || e === "submitted" ? ie() : (e !== "ready" || t !== "streaming") && ae();
|
|
183
|
+
}), B(r, async () => {
|
|
184
|
+
if (r() && i() !== "assistant") {
|
|
185
|
+
x(), l.value = !1, d = !0;
|
|
186
|
+
try {
|
|
187
|
+
await M(), await o?.(), await M();
|
|
188
|
+
} finally {
|
|
189
|
+
_();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
let b = null, oe = () => {
|
|
194
|
+
t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, b && clearTimeout(b), b = setTimeout(x, 300)));
|
|
195
|
+
}, x = () => {
|
|
196
|
+
p?.disconnect(), p = null, m?.disconnect(), m = null, b &&= (clearTimeout(b), null);
|
|
197
|
+
};
|
|
198
|
+
return Se(() => {
|
|
199
|
+
if (!t.value) return;
|
|
200
|
+
t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", v, { passive: !0 }), t.value.addEventListener("touchmove", y, { passive: !0 });
|
|
201
|
+
let e = n() === "submitted" || n() === "streaming";
|
|
202
|
+
e ? ie() : (p = new ResizeObserver(oe), p.observe(t.value), m = new MutationObserver(oe), m.observe(t.value, {
|
|
203
|
+
childList: !0,
|
|
204
|
+
subtree: !0
|
|
205
|
+
}));
|
|
206
|
+
let r = a?.() ?? t.value.firstElementChild;
|
|
207
|
+
r && (h = new ResizeObserver(re), h.observe(r)), e || oe();
|
|
208
|
+
}), F(() => {
|
|
209
|
+
t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", v), t.value?.removeEventListener("touchmove", y), h?.disconnect(), h = null, ae(), x();
|
|
210
|
+
}), {
|
|
211
|
+
handleScroll: ne,
|
|
212
|
+
scrollToBottom: _,
|
|
213
|
+
userScrolledUp: l,
|
|
214
|
+
isAtBottom: u
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region ../../packages/components/src/chat/wakeupFeed.ts
|
|
219
|
+
function Ue(e, t = () => !1) {
|
|
220
|
+
let n = (e) => je(e) && !t(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map(), a = 0;
|
|
221
|
+
for (; a < e.length;) {
|
|
222
|
+
let t = e[a];
|
|
223
|
+
if (W(t) && n(e[a + 1])) {
|
|
224
|
+
let o = t.id, s = 0, c;
|
|
225
|
+
for (; W(e[a]) && n(e[a + 1]);) s += 1, c = e[a].metadata?.createdAt ?? c, r.add(e[a].id), r.add(e[a + 1].id), a += 2;
|
|
226
|
+
i.set(o, {
|
|
227
|
+
count: s,
|
|
228
|
+
lastAt: c
|
|
229
|
+
});
|
|
230
|
+
} else n(t) && r.add(t.id), a += 1;
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
hidden: r,
|
|
234
|
+
quietRuns: i
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
//#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
|
|
239
|
+
var We = ["aria-busy"], Ge = {
|
|
240
|
+
key: 0,
|
|
241
|
+
class: "pk-chatbot-messages__outline"
|
|
242
|
+
}, Ke = {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "pk-chatbot-divider vv-separator"
|
|
245
|
+
}, qe = { class: "pk-chatbot-divider__label" }, Je = {
|
|
246
|
+
key: 1,
|
|
247
|
+
class: "pk-chatbot-wakeup"
|
|
248
|
+
}, Ye = ["title"], Xe = { class: "pk-chatbot-message__text" }, Ze = ["title"], Qe = {
|
|
249
|
+
key: 0,
|
|
250
|
+
class: "pk-chatbot-message__reaction-emoji"
|
|
251
|
+
}, $e = {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: "flex flex-col gap-8"
|
|
254
|
+
}, et = {
|
|
255
|
+
key: 0,
|
|
256
|
+
class: "pk-chatbot-message__loading-info"
|
|
257
|
+
}, tt = { class: "flex gap-8 items-center" }, nt = { class: "font-mono rounded text-12" }, rt = { class: "flex gap-8 items-center" }, it = {
|
|
258
|
+
key: 0,
|
|
259
|
+
class: "pk-chatbot-message__footer"
|
|
260
|
+
}, at = {
|
|
261
|
+
key: 0,
|
|
262
|
+
class: "pk-chatbot-message__hover-meta"
|
|
263
|
+
}, ot = ["datetime", "title"], st = { class: "truncate" }, ct = {
|
|
264
|
+
key: 0,
|
|
265
|
+
class: "flex items-center gap-4 min-w-0"
|
|
266
|
+
}, lt = { class: "truncate" }, ut = ["title"], dt = {
|
|
267
|
+
key: 2,
|
|
268
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
269
|
+
}, ft = { class: "truncate" }, pt = ["datetime"], mt = { class: "truncate" }, ht = {
|
|
270
|
+
key: 4,
|
|
271
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
272
|
+
}, gt = { class: "pk-chatbot-message__loading-info" }, _t = { class: "flex gap-8 items-center" }, vt = { class: "text-12" }, yt = ["title", "aria-label"], bt = /* @__PURE__ */ j({
|
|
273
|
+
__name: "PkChatbotMessages",
|
|
274
|
+
props: {
|
|
275
|
+
status: {},
|
|
276
|
+
messages: {},
|
|
277
|
+
error: {},
|
|
278
|
+
actions: {},
|
|
279
|
+
mainColor: {},
|
|
280
|
+
textColor: {},
|
|
281
|
+
revisedAnswers: {},
|
|
282
|
+
messageFeedbacks: {},
|
|
283
|
+
readonlyFeedback: { type: Boolean },
|
|
284
|
+
disableHeightAdjustment: { type: Boolean },
|
|
285
|
+
showMessageDateTime: { type: Boolean },
|
|
286
|
+
showMessageTokensCount: { type: Boolean },
|
|
287
|
+
showMessageNumber: { type: Boolean },
|
|
288
|
+
showAllMessageParts: { type: Boolean },
|
|
289
|
+
interactive: { type: Boolean },
|
|
290
|
+
showExtendedSteps: { type: Boolean },
|
|
291
|
+
awaitingSpokenAnswer: { type: Boolean },
|
|
292
|
+
confirmVerdictsOnCall: {},
|
|
293
|
+
isDark: { type: Boolean },
|
|
294
|
+
showScrollToBottom: { type: Boolean },
|
|
295
|
+
feedbackMessageId: {},
|
|
296
|
+
feedbackLoading: { type: Boolean },
|
|
297
|
+
feedbackSubmitted: { type: Boolean },
|
|
298
|
+
feedbackError: {}
|
|
299
|
+
},
|
|
300
|
+
emits: [
|
|
301
|
+
"show-info",
|
|
302
|
+
"regenerate",
|
|
303
|
+
"revise",
|
|
304
|
+
"upvote",
|
|
305
|
+
"downvote",
|
|
306
|
+
"feedback",
|
|
307
|
+
"feedback-submit",
|
|
308
|
+
"feedback-close",
|
|
309
|
+
"scroll-up",
|
|
310
|
+
"scroll-down",
|
|
311
|
+
"auto-retry",
|
|
312
|
+
"reset-chat",
|
|
313
|
+
"approval-respond",
|
|
314
|
+
"confirm-respond"
|
|
315
|
+
],
|
|
316
|
+
setup(e, { emit: t }) {
|
|
317
|
+
let n = e, r = t, { t: i, d: o, n: x } = Oe({ useScope: "global" }), A = Ee(), j = (e, t) => {
|
|
318
|
+
if (le(e)) {
|
|
319
|
+
let n = e.toolCallId;
|
|
320
|
+
n && r("confirm-respond", {
|
|
321
|
+
toolCallId: n,
|
|
322
|
+
confirmed: t
|
|
323
|
+
});
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
let n = oe(e);
|
|
327
|
+
n && r("approval-respond", {
|
|
328
|
+
id: n,
|
|
329
|
+
approved: t
|
|
330
|
+
});
|
|
331
|
+
}, F = De("scrollEl"), U = De("wrapperEl"), ke = w(() => ce(n.textColor, n.mainColor)), { handleScroll: Ae, scrollToBottom: je, userScrolledUp: G, isAtBottom: Me } = He({
|
|
332
|
+
scrollEl: F,
|
|
333
|
+
status: () => n.status,
|
|
334
|
+
messagesLength: () => n.messages?.length,
|
|
335
|
+
lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
|
|
336
|
+
contentEl: () => U.value,
|
|
337
|
+
beforeNewMessageScroll: () => xt(),
|
|
338
|
+
onScrollUp: () => r("scroll-up"),
|
|
339
|
+
onScrollDown: () => r("scroll-down")
|
|
340
|
+
}), Pe = () => {
|
|
341
|
+
G.value = !1, je();
|
|
342
|
+
}, K = w(() => (n.messages ?? []).filter((e) => e.role === "user" && !W(e)).map((e) => ({
|
|
343
|
+
id: e.id,
|
|
344
|
+
preview: e.parts.find(c)?.text.trim().slice(0, 120) || "…"
|
|
345
|
+
}))), Ie = L(), Le = () => F.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], Re = () => {
|
|
346
|
+
let e = F.value;
|
|
347
|
+
if (!e || !n.showScrollToBottom) return;
|
|
348
|
+
let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = K.value[0]?.id;
|
|
349
|
+
Le().forEach((e, n) => {
|
|
350
|
+
e.getBoundingClientRect().top <= t && (r = K.value[n]?.id);
|
|
351
|
+
}), Ie.value = r;
|
|
352
|
+
};
|
|
353
|
+
B(K, async () => {
|
|
354
|
+
await M(), Re();
|
|
355
|
+
});
|
|
356
|
+
let ze = () => {
|
|
357
|
+
Ae(), Re();
|
|
358
|
+
}, Ve = (e) => {
|
|
359
|
+
let t = F.value, n = K.value.findIndex((t) => t.id === e), r = Le()[n];
|
|
360
|
+
t && r && (G.value = !0, t.scrollTo({
|
|
361
|
+
top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
|
|
362
|
+
behavior: "smooth"
|
|
363
|
+
}));
|
|
364
|
+
}, q = L(0), bt = L(!1), xt = async () => {
|
|
365
|
+
let e = n.messages;
|
|
366
|
+
if (!e?.length || n.disableHeightAdjustment || e[e.length - 1].role !== "user" && n.status !== "submitted" && n.status !== "streaming" || (bt.value = !1, await M(), !F.value)) return;
|
|
367
|
+
let { paddingTop: t, paddingBottom: r } = getComputedStyle(F.value), i = F.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(r), a = U.value && Number.parseFloat(getComputedStyle(U.value).rowGap) || 0, o = Le(), s = i - (o[o.length - 1]?.clientHeight ?? 0) - a;
|
|
368
|
+
i > 0 && (q.value = Math.max(s, 0)), await M();
|
|
369
|
+
};
|
|
370
|
+
B(() => [n.messages?.length, n.messages?.[n.messages.length - 1]?.id], () => xt()), Se(() => {
|
|
371
|
+
(n.status === "submitted" || n.status === "streaming" || n.awaitingSpokenAnswer) && xt();
|
|
372
|
+
}), B(() => n.status, (e) => {
|
|
373
|
+
(e === "ready" || e === "error") && (bt.value = !0, q.value = 0);
|
|
374
|
+
});
|
|
375
|
+
let St = (e) => n.revisedAnswers?.some((t) => t.messageId === e), J = (e) => n.messageFeedbacks?.find((t) => t.messageId === e), Ct = (e, t) => !n.readonlyFeedback && Vt(e, t), wt = (e) => n.readonlyFeedback ? J(e) : void 0, Tt = (e) => wt(e)?.vote, Et = (e) => {
|
|
376
|
+
let t = wt(e);
|
|
377
|
+
if (t?.vote) return;
|
|
378
|
+
let n = t?.metadata?.reactionEmoji;
|
|
379
|
+
return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
|
|
380
|
+
}, Dt = (e) => !!(Tt(e) || Et(e)), Ot = (e) => {
|
|
381
|
+
if (Et(e)) return "pk-chatbot-message__reaction--neutral";
|
|
382
|
+
let t = Tt(e);
|
|
383
|
+
return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
|
|
384
|
+
}, kt = (e) => {
|
|
385
|
+
let t = Tt(e);
|
|
386
|
+
return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
|
|
387
|
+
}, At = (e) => {
|
|
388
|
+
let t = Nt(e);
|
|
389
|
+
for (let e = t.length - 1; e >= 0; --e) if (c(t[e])) return e;
|
|
390
|
+
return -1;
|
|
391
|
+
}, jt = w(() => n.messages?.[n.messages.length - 1]), Y = w(() => {
|
|
392
|
+
let e = jt.value;
|
|
393
|
+
return e ? e.parts[e.parts.length - 1] : null;
|
|
394
|
+
}), Mt = w(() => {
|
|
395
|
+
let e = /* @__PURE__ */ new Map();
|
|
396
|
+
for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, _(re(ee(t.parts))));
|
|
397
|
+
return e;
|
|
398
|
+
}), Nt = (e) => Mt.value.get(e.id) ?? e.parts, X = w(() => n.status === "submitted" || n.status === "streaming"), Pt = w(() => n.status === "error"), Ft = w(() => n.awaitingSpokenAnswer === !0 && !X.value), It = w(() => Ft.value && jt.value?.role === "user" && !Pt.value), Lt = w(() => {
|
|
399
|
+
let e = Y.value;
|
|
400
|
+
return ae(i, e);
|
|
401
|
+
}), Rt = w(() => {
|
|
402
|
+
let e = Y.value;
|
|
403
|
+
return y(e);
|
|
404
|
+
}), zt = (e) => n.messages?.findIndex((t) => t.id === e), Z = (e) => e === void 0 || !n.messages ? !1 : e === n.messages.length - 1, Bt = (e) => Z(e) && n.status === "ready" && !!n.actions?.includes("regenerate"), Vt = (e, t) => (!Z(t) || n.status === "ready") && !!n.actions?.includes(e), Ht = (e) => {
|
|
405
|
+
let t = e.parts[e.parts.length - 1];
|
|
406
|
+
return c(t);
|
|
407
|
+
}, Ut = (e) => e.parts.some((e) => p(e) || u(e)), Wt = (e) => !!n.showExtendedSteps && Q(e) && Ut(e), Gt = (e) => u(e) && !v(e) && !!(Fe[l(e)] || A[e.type] || n.showAllMessageParts), Kt = (e) => e.parts.some((e) => c(e) && !!e.text.trim() || f(e) || se(e) && !v(e) || Gt(e)), Q = (e) => e.role === "assistant", qt = (e) => e.role === "user", Jt = (e) => n.messages?.slice(0, e).reverse().find((e) => Q(e)), Yt = (e) => n.messages?.slice(e + 1).find((e) => Q(e)), Xt = (e) => {
|
|
408
|
+
let t = Jt(e)?.metadata?.createdAt, n = Yt(e)?.metadata?.createdAt;
|
|
409
|
+
if (!t || !n) return;
|
|
410
|
+
let r = new Date(t), i = new Date(n);
|
|
411
|
+
return r.toDateString() === i.toDateString() ? void 0 : i;
|
|
412
|
+
}, $ = w(() => n.showAllMessageParts ? Ue([]) : Ue(n.messages ?? [], Kt)), Zt = w(() => {
|
|
413
|
+
let e = 0;
|
|
414
|
+
return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
|
|
415
|
+
}), Qt = (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), $t = (e) => {
|
|
416
|
+
let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
417
|
+
return o(t, n ? "time" : "date-time");
|
|
418
|
+
}, en = (e) => {
|
|
419
|
+
let { createdAt: t, completedAt: n } = e.metadata ?? {};
|
|
420
|
+
if (t && n) return ie(x, n - t);
|
|
421
|
+
}, tn = De("feedbackMessageEl");
|
|
422
|
+
return B(() => n.feedbackMessageId, async () => {
|
|
423
|
+
if (await M(), !n.feedbackMessageId) return;
|
|
424
|
+
let e = tn.value?.[0]?.$el;
|
|
425
|
+
e && (Z(zt(n.feedbackMessageId)) ? je() : e.scrollIntoView({
|
|
426
|
+
behavior: "smooth",
|
|
427
|
+
block: "center"
|
|
428
|
+
}));
|
|
429
|
+
}), (t, n) => {
|
|
430
|
+
let r = ye, u = _e, p = ve;
|
|
431
|
+
return I(), D("div", {
|
|
432
|
+
ref_key: "scrollEl",
|
|
433
|
+
ref: F,
|
|
434
|
+
class: N(["pk-chatbot-messages scrollbar-thin", { "pk-chatbot-messages--settling": bt.value }]),
|
|
435
|
+
role: "log",
|
|
436
|
+
"aria-live": "polite",
|
|
437
|
+
"aria-relevant": "additions text",
|
|
438
|
+
"aria-busy": X.value,
|
|
439
|
+
style: P({
|
|
440
|
+
"--chatbot-main-color": e.mainColor,
|
|
441
|
+
"--chatbot-contrast-color": ke.value
|
|
442
|
+
}),
|
|
443
|
+
onScroll: ze
|
|
444
|
+
}, [
|
|
445
|
+
e.showScrollToBottom && K.value.length > 1 ? (I(), D("div", Ge, [k(ge, {
|
|
446
|
+
items: K.value,
|
|
447
|
+
"active-id": Ie.value,
|
|
448
|
+
onSelect: Ve
|
|
449
|
+
}, null, 8, ["items", "active-id"])])) : E("", !0),
|
|
450
|
+
O("div", {
|
|
451
|
+
ref_key: "wrapperEl",
|
|
452
|
+
ref: U,
|
|
453
|
+
class: "pk-chatbot-messages__wrapper"
|
|
454
|
+
}, [
|
|
455
|
+
(I(!0), D(S, null, Ce(e.messages, (h, _) => (I(), D(S, { key: h.id }, [
|
|
456
|
+
qt(h) && Xt(_) ? (I(), D("div", Ke, [O("span", qe, R(z(o)(Xt(_), "short")), 1)])) : E("", !0),
|
|
457
|
+
$.value.quietRuns.has(h.id) ? (I(), D("div", Je, [k(r, {
|
|
458
|
+
name: "ri:alarm-line",
|
|
459
|
+
class: "shrink-0"
|
|
460
|
+
}), O("span", null, R(z(i)("label.wakeupQuietRun", {
|
|
461
|
+
count: $.value.quietRuns.get(h.id).count,
|
|
462
|
+
time: z(o)($.value.quietRuns.get(h.id).lastAt ?? Date.now(), "time")
|
|
463
|
+
}, $.value.quietRuns.get(h.id).count)), 1)])) : z(W)(h) && !$.value.hidden.has(h.id) && !e.showAllMessageParts ? (I(), D("div", {
|
|
464
|
+
key: 2,
|
|
465
|
+
class: "pk-chatbot-wakeup",
|
|
466
|
+
title: h.metadata?.wakeup?.reason
|
|
467
|
+
}, [k(r, {
|
|
468
|
+
name: "ri:alarm-line",
|
|
469
|
+
class: "shrink-0"
|
|
470
|
+
}), O("span", null, [be(R(z(i)("label.wakeupCheck")) + " ", 1), h.metadata?.createdAt ? (I(), D(S, { key: 0 }, [be(" · " + R(z(o)(h.metadata.createdAt, "time")), 1)], 64)) : E("", !0)])], 8, Ye)) : E("", !0),
|
|
471
|
+
(!z(W)(h) || e.showAllMessageParts) && (!$.value.hidden.has(h.id) || X.value && Z(_)) && (h.parts.length || Z(_) && X.value && Q(h)) ? (I(), D("div", {
|
|
472
|
+
key: 3,
|
|
473
|
+
class: N(["pk-chatbot-message", [`pk-chatbot-message--${h.role}`, { "pk-chatbot-message--loading": X.value && Z(_) && Q(h) }]]),
|
|
474
|
+
style: P({ minHeight: Z(_) && Q(h) && !Pt.value ? `${q.value}px` : void 0 })
|
|
475
|
+
}, [
|
|
476
|
+
k(C, {
|
|
477
|
+
appear: "",
|
|
478
|
+
name: "pk-chatbot-part"
|
|
479
|
+
}, {
|
|
480
|
+
default: V(() => [Wt(h) ? (I(), T(he, {
|
|
481
|
+
key: 0,
|
|
482
|
+
message: h,
|
|
483
|
+
"is-streaming": X.value && Z(_),
|
|
484
|
+
"has-content": Kt(h),
|
|
485
|
+
"is-dark": e.isDark
|
|
486
|
+
}, null, 8, [
|
|
487
|
+
"message",
|
|
488
|
+
"is-streaming",
|
|
489
|
+
"has-content",
|
|
490
|
+
"is-dark"
|
|
491
|
+
])) : E("", !0)]),
|
|
492
|
+
_: 2
|
|
493
|
+
}, 1024),
|
|
494
|
+
(I(!0), D(S, null, Ce(Nt(h), (n, i) => (I(), D(S, { key: z(te)(n, i) }, [z(c)(n) && n.text.trim() ? (I(), T(C, {
|
|
495
|
+
key: 0,
|
|
496
|
+
appear: "",
|
|
497
|
+
name: "pk-chatbot-part"
|
|
498
|
+
}, {
|
|
499
|
+
default: V(() => [O("div", Xe, [we(t.$slots, "text", xe({ ref_for: !0 }, {
|
|
500
|
+
message: h,
|
|
501
|
+
part: n,
|
|
502
|
+
index: _,
|
|
503
|
+
isLoading: X.value
|
|
504
|
+
}), () => [Q(h) ? (I(), T(s, {
|
|
505
|
+
key: 0,
|
|
506
|
+
class: "wysiwyg",
|
|
507
|
+
markdown: n.text,
|
|
508
|
+
"is-dark": e.isDark,
|
|
509
|
+
loading: Z(_) && e.status === "streaming"
|
|
510
|
+
}, null, 8, [
|
|
511
|
+
"markdown",
|
|
512
|
+
"is-dark",
|
|
513
|
+
"loading"
|
|
514
|
+
])) : (I(), D(S, { key: 1 }, [be(R(n.text), 1)], 64))]), Dt(h.id) && !J(h.id)?.comment && i === At(h) ? (I(), D("span", {
|
|
515
|
+
key: 0,
|
|
516
|
+
class: N(["pk-chatbot-message__reaction", Ot(h.id)]),
|
|
517
|
+
title: kt(h.id)
|
|
518
|
+
}, [Et(h.id) ? (I(), D("span", Qe, R(Et(h.id)), 1)) : (I(), T(r, {
|
|
519
|
+
key: 1,
|
|
520
|
+
name: Tt(h.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
|
|
521
|
+
}, null, 8, ["name"]))], 10, Ze)) : E("", !0)])]),
|
|
522
|
+
_: 2
|
|
523
|
+
}, 1024)) : z(f)(n) ? (I(), T(C, {
|
|
524
|
+
key: 1,
|
|
525
|
+
appear: "",
|
|
526
|
+
name: "pk-chatbot-part"
|
|
527
|
+
}, {
|
|
528
|
+
default: V(() => [z(a)(n.filename, n.mediaType) ? (I(), D("div", $e, [k(ue, {
|
|
529
|
+
"media-type": n.mediaType,
|
|
530
|
+
url: n.url,
|
|
531
|
+
filename: n.filename,
|
|
532
|
+
size: z(m)(n)?.bytesCount
|
|
533
|
+
}, null, 8, [
|
|
534
|
+
"media-type",
|
|
535
|
+
"url",
|
|
536
|
+
"filename",
|
|
537
|
+
"size"
|
|
538
|
+
]), k(pe, {
|
|
539
|
+
url: n.url,
|
|
540
|
+
transcript: z(d)(n),
|
|
541
|
+
pending: e.status === "submitted" && Z(_)
|
|
542
|
+
}, null, 8, [
|
|
543
|
+
"url",
|
|
544
|
+
"transcript",
|
|
545
|
+
"pending"
|
|
546
|
+
])])) : (I(), T(ue, {
|
|
547
|
+
key: 1,
|
|
548
|
+
"media-type": n.mediaType,
|
|
549
|
+
url: n.url,
|
|
550
|
+
filename: n.filename,
|
|
551
|
+
size: z(m)(n)?.bytesCount
|
|
552
|
+
}, null, 8, [
|
|
553
|
+
"media-type",
|
|
554
|
+
"url",
|
|
555
|
+
"filename",
|
|
556
|
+
"size"
|
|
557
|
+
]))]),
|
|
558
|
+
_: 2
|
|
559
|
+
}, 1024)) : z(se)(n) && !z(v)(n) ? (I(), T(C, {
|
|
560
|
+
key: 2,
|
|
561
|
+
appear: "",
|
|
562
|
+
name: "pk-chatbot-part"
|
|
563
|
+
}, {
|
|
564
|
+
default: V(() => [(I(), T(Be, {
|
|
565
|
+
key: `approval-${i}`,
|
|
566
|
+
part: n,
|
|
567
|
+
actionable: e.interactive === !0 && (z(le)(n) || Z(_)),
|
|
568
|
+
"call-verdict": e.confirmVerdictsOnCall?.get(n.toolCallId ?? ""),
|
|
569
|
+
onRespond: (e) => j(n, e)
|
|
570
|
+
}, null, 8, [
|
|
571
|
+
"part",
|
|
572
|
+
"actionable",
|
|
573
|
+
"call-verdict",
|
|
574
|
+
"onRespond"
|
|
575
|
+
]))]),
|
|
576
|
+
_: 2
|
|
577
|
+
}, 1024)) : Gt(n) ? (I(), T(C, {
|
|
578
|
+
key: 3,
|
|
579
|
+
appear: "",
|
|
580
|
+
name: "pk-chatbot-part"
|
|
581
|
+
}, {
|
|
582
|
+
default: V(() => [!z(A)[n.type] && z(Fe)[z(l)(n)] ? (I(), T(Te(z(Fe)[z(l)(n)]), {
|
|
583
|
+
key: `component-${i}-${z(ne)(n)}`,
|
|
584
|
+
part: n
|
|
585
|
+
}, null, 8, ["part"])) : we(t.$slots, n.type, xe({ ref_for: !0 }, {
|
|
586
|
+
message: h,
|
|
587
|
+
part: n,
|
|
588
|
+
index: _,
|
|
589
|
+
isLoading: X.value
|
|
590
|
+
}), () => [e.showAllMessageParts ? (I(), D("div", et, [O("div", tt, [z(y)(n) ? (I(), T(r, {
|
|
591
|
+
key: 0,
|
|
592
|
+
name: z(y)(n),
|
|
593
|
+
class: "shrink-0"
|
|
594
|
+
}, null, 8, ["name"])) : E("", !0), O("code", nt, R(z(Ne)(n.type)), 1)])])) : E("", !0)], void 0, 1)]),
|
|
595
|
+
_: 2
|
|
596
|
+
}, 1024)) : E("", !0), k(C, { mode: "out-in" }, {
|
|
597
|
+
default: V(() => [i === At(h) && e.readonlyFeedback && J(h.id)?.comment ? (I(), T(fe, {
|
|
598
|
+
key: 0,
|
|
599
|
+
feedback: J(h.id)
|
|
600
|
+
}, null, 8, ["feedback"])) : E("", !0)]),
|
|
601
|
+
_: 2
|
|
602
|
+
}, 1024)], 64))), 128)),
|
|
603
|
+
k(C, {
|
|
604
|
+
name: "fade-in",
|
|
605
|
+
mode: "out-in"
|
|
606
|
+
}, {
|
|
607
|
+
default: V(() => [X.value && Z(_) && !Ht(h) && Q(h) && (!Wt(h) || Kt(h)) ? (I(), D("div", {
|
|
608
|
+
key: `loading-info-${h.id}`,
|
|
609
|
+
class: "pk-chatbot-message__loading-info"
|
|
610
|
+
}, [O("div", rt, [
|
|
611
|
+
k(r, {
|
|
612
|
+
name: "loading-loop",
|
|
613
|
+
class: "shrink-0"
|
|
614
|
+
}),
|
|
615
|
+
k(C, { mode: "out-in" }, {
|
|
616
|
+
default: V(() => [Rt.value ? (I(), T(r, {
|
|
617
|
+
key: Rt.value,
|
|
618
|
+
class: "shrink-0",
|
|
619
|
+
name: Rt.value
|
|
620
|
+
}, null, 8, ["name"])) : E("", !0)]),
|
|
621
|
+
_: 1
|
|
622
|
+
}),
|
|
623
|
+
k(C, { mode: "out-in" }, {
|
|
624
|
+
default: V(() => [Lt.value ? (I(), D("span", {
|
|
625
|
+
key: Lt.value,
|
|
626
|
+
class: "text-12"
|
|
627
|
+
}, R(Lt.value), 1)) : E("", !0)]),
|
|
628
|
+
_: 1
|
|
629
|
+
})
|
|
630
|
+
]), k(C, {
|
|
631
|
+
name: "fade-in",
|
|
632
|
+
mode: "out-in"
|
|
633
|
+
}, {
|
|
634
|
+
default: V(() => [!Wt(h) && Y.value && "text" in Y.value && Y.value.text.trim() ? (I(), T(me, {
|
|
635
|
+
key: 0,
|
|
636
|
+
markdown: Y.value.text,
|
|
637
|
+
"is-dark": e.isDark,
|
|
638
|
+
"tail-length": z(b),
|
|
639
|
+
"inner-class": "wysiwyg",
|
|
640
|
+
class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
|
|
641
|
+
}, null, 8, [
|
|
642
|
+
"markdown",
|
|
643
|
+
"is-dark",
|
|
644
|
+
"tail-length"
|
|
645
|
+
])) : E("", !0)]),
|
|
646
|
+
_: 2
|
|
647
|
+
}, 1024)])) : E("", !0)]),
|
|
648
|
+
_: 2
|
|
649
|
+
}, 1024),
|
|
650
|
+
k(C, { mode: "out-in" }, {
|
|
651
|
+
default: V(() => [Qt(h, _) ? (I(), D("div", it, [
|
|
652
|
+
k(p, {
|
|
653
|
+
modifiers: "compact",
|
|
654
|
+
class: "mr-auto shrink-0"
|
|
655
|
+
}, {
|
|
656
|
+
default: V(() => [
|
|
657
|
+
k(C, { mode: "out-in" }, {
|
|
658
|
+
default: V(() => [Bt(_) ? (I(), T(u, {
|
|
659
|
+
key: 0,
|
|
660
|
+
icon: "ri:reset-right-line",
|
|
661
|
+
modifiers: "action-quiet-small",
|
|
662
|
+
title: z(i)("action.regenerate"),
|
|
663
|
+
"aria-label": z(i)("action.regenerate"),
|
|
664
|
+
onClick: n[0] ||= H((e) => t.$emit("regenerate"), ["stop"])
|
|
665
|
+
}, null, 8, ["title", "aria-label"])) : E("", !0)]),
|
|
666
|
+
_: 2
|
|
667
|
+
}, 1024),
|
|
668
|
+
k(C, { mode: "out-in" }, {
|
|
669
|
+
default: V(() => [Vt("show-info", _) ? (I(), T(u, {
|
|
670
|
+
key: 0,
|
|
671
|
+
icon: "ri:information-line",
|
|
672
|
+
title: z(i)("action.getMoreInfo"),
|
|
673
|
+
"aria-label": z(i)("action.getMoreInfo"),
|
|
674
|
+
modifiers: "action-quiet-small",
|
|
675
|
+
onClick: H((e) => t.$emit("show-info", h), ["stop"])
|
|
676
|
+
}, null, 8, [
|
|
677
|
+
"title",
|
|
678
|
+
"aria-label",
|
|
679
|
+
"onClick"
|
|
680
|
+
])) : E("", !0)]),
|
|
681
|
+
_: 2
|
|
682
|
+
}, 1024),
|
|
683
|
+
k(C, { mode: "out-in" }, {
|
|
684
|
+
default: V(() => [Vt("revise", _) ? (I(), T(u, {
|
|
685
|
+
key: 0,
|
|
686
|
+
icon: St(h.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
|
|
687
|
+
title: St(h.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
688
|
+
"aria-label": St(h.id) ? z(i)("action.editRevise") : z(i)("action.createRevise"),
|
|
689
|
+
modifiers: "action-quiet-small",
|
|
690
|
+
class: N({ "text-brand-graphic": St(h.id) }),
|
|
691
|
+
onClick: H((e) => t.$emit("revise", h), ["stop"])
|
|
692
|
+
}, null, 8, [
|
|
693
|
+
"icon",
|
|
694
|
+
"title",
|
|
695
|
+
"aria-label",
|
|
696
|
+
"class",
|
|
697
|
+
"onClick"
|
|
698
|
+
])) : E("", !0)]),
|
|
699
|
+
_: 2
|
|
700
|
+
}, 1024),
|
|
701
|
+
k(C, { mode: "out-in" }, {
|
|
702
|
+
default: V(() => [Ct("upvote", _) ? (I(), T(u, {
|
|
703
|
+
key: 0,
|
|
704
|
+
icon: J(h.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
|
|
705
|
+
title: z(i)("action.upvote"),
|
|
706
|
+
"aria-label": z(i)("action.upvote"),
|
|
707
|
+
modifiers: "action-quiet-small",
|
|
708
|
+
onClick: H((e) => t.$emit("upvote", h), ["stop"])
|
|
709
|
+
}, null, 8, [
|
|
710
|
+
"icon",
|
|
711
|
+
"title",
|
|
712
|
+
"aria-label",
|
|
713
|
+
"onClick"
|
|
714
|
+
])) : E("", !0)]),
|
|
715
|
+
_: 2
|
|
716
|
+
}, 1024),
|
|
717
|
+
k(C, { mode: "out-in" }, {
|
|
718
|
+
default: V(() => [Ct("downvote", _) ? (I(), T(u, {
|
|
719
|
+
key: 0,
|
|
720
|
+
icon: J(h.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
|
|
721
|
+
title: z(i)("action.downvote"),
|
|
722
|
+
"aria-label": z(i)("action.downvote"),
|
|
723
|
+
modifiers: "action-quiet-small",
|
|
724
|
+
onClick: H((e) => t.$emit("downvote", h), ["stop"])
|
|
725
|
+
}, null, 8, [
|
|
726
|
+
"icon",
|
|
727
|
+
"title",
|
|
728
|
+
"aria-label",
|
|
729
|
+
"onClick"
|
|
730
|
+
])) : E("", !0)]),
|
|
731
|
+
_: 2
|
|
732
|
+
}, 1024),
|
|
733
|
+
k(C, { mode: "out-in" }, {
|
|
734
|
+
default: V(() => [Ct("feedback", _) ? (I(), T(u, {
|
|
735
|
+
key: 0,
|
|
736
|
+
icon: J(h.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
|
|
737
|
+
title: z(i)("action.feedback"),
|
|
738
|
+
"aria-label": z(i)("action.feedback"),
|
|
739
|
+
modifiers: "action-quiet-small",
|
|
740
|
+
onClick: H((e) => t.$emit("feedback", h), ["stop"])
|
|
741
|
+
}, null, 8, [
|
|
742
|
+
"icon",
|
|
743
|
+
"title",
|
|
744
|
+
"aria-label",
|
|
745
|
+
"onClick"
|
|
746
|
+
])) : E("", !0)]),
|
|
747
|
+
_: 2
|
|
748
|
+
}, 1024)
|
|
749
|
+
]),
|
|
750
|
+
_: 2
|
|
751
|
+
}, 1024),
|
|
752
|
+
!e.showMessageDateTime && h.metadata?.createdAt && h.metadata?.completedAt ? (I(), D("div", at, [O("time", {
|
|
753
|
+
datetime: new Date(h.metadata.createdAt).toISOString(),
|
|
754
|
+
title: z(o)(new Date(h.metadata.createdAt), "date-time"),
|
|
755
|
+
class: "flex items-center gap-4 min-w-0"
|
|
756
|
+
}, [k(r, {
|
|
757
|
+
name: "ri:time-line",
|
|
758
|
+
class: "shrink-0"
|
|
759
|
+
}), O("span", st, R($t(h.metadata.createdAt)), 1)], 8, ot), en(h) ? (I(), D("span", ct, [k(r, {
|
|
760
|
+
name: "ri:hourglass-line",
|
|
761
|
+
class: "shrink-0"
|
|
762
|
+
}), O("span", lt, R(en(h)), 1)])) : E("", !0)])) : E("", !0),
|
|
763
|
+
e.showMessageNumber ? (I(), D("span", {
|
|
764
|
+
key: 1,
|
|
765
|
+
title: z(i)("label.messageNumber", { n: Zt.value[_] }),
|
|
766
|
+
class: "text-12 text-word-3 tabular-nums"
|
|
767
|
+
}, " #" + R(Zt.value[_]), 9, ut)) : E("", !0),
|
|
768
|
+
e.showMessageTokensCount && h.metadata?.totalTokens ? (I(), D("span", dt, [k(r, {
|
|
769
|
+
name: "ri:ai-generate-2-line",
|
|
770
|
+
class: "shrink-0"
|
|
771
|
+
}), O("span", ft, R(z(x)(h.metadata.totalTokens, "integer")) + " " + R(z(i)("label.tokens")), 1)])) : E("", !0),
|
|
772
|
+
e.showMessageDateTime && h.metadata?.createdAt ? (I(), D("time", {
|
|
773
|
+
key: 3,
|
|
774
|
+
datetime: new Date(h.metadata?.createdAt).toISOString(),
|
|
775
|
+
class: "flex items-center gap-4 text-12 text-word-3"
|
|
776
|
+
}, [k(r, {
|
|
777
|
+
name: "ri:time-line",
|
|
778
|
+
class: "shrink-0"
|
|
779
|
+
}), O("span", mt, R(z(o)(new Date(h.metadata?.createdAt), "date-time")), 1)], 8, pt)) : E("", !0),
|
|
780
|
+
e.showMessageDateTime && h?.metadata?.completedAt && h?.metadata?.createdAt ? (I(), D("div", ht, [k(r, {
|
|
781
|
+
name: "ri:hourglass-line",
|
|
782
|
+
class: "shrink-0"
|
|
783
|
+
}), k(g, {
|
|
784
|
+
class: "truncate",
|
|
785
|
+
date: h.metadata?.createdAt,
|
|
786
|
+
"end-date": h.metadata?.completedAt
|
|
787
|
+
}, null, 8, ["date", "end-date"])])) : E("", !0)
|
|
788
|
+
])) : E("", !0)]),
|
|
789
|
+
_: 2
|
|
790
|
+
}, 1024),
|
|
791
|
+
k(C, { mode: "out-in" }, {
|
|
792
|
+
default: V(() => [h.id === e.feedbackMessageId ? (I(), T(de, {
|
|
793
|
+
key: 0,
|
|
794
|
+
ref_for: !0,
|
|
795
|
+
ref_key: "feedbackMessageEl",
|
|
796
|
+
ref: tn,
|
|
797
|
+
loading: e.feedbackLoading,
|
|
798
|
+
submitted: e.feedbackSubmitted,
|
|
799
|
+
error: e.feedbackError,
|
|
800
|
+
onSubmit: n[1] ||= (e) => t.$emit("feedback-submit", e),
|
|
801
|
+
onClose: n[2] ||= (e) => t.$emit("feedback-close")
|
|
802
|
+
}, null, 8, [
|
|
803
|
+
"loading",
|
|
804
|
+
"submitted",
|
|
805
|
+
"error"
|
|
806
|
+
])) : E("", !0)]),
|
|
807
|
+
_: 2
|
|
808
|
+
}, 1024)
|
|
809
|
+
], 6)) : E("", !0)
|
|
810
|
+
], 64))), 128)),
|
|
811
|
+
k(C, {
|
|
812
|
+
appear: "",
|
|
813
|
+
name: "pk-chatbot-part"
|
|
814
|
+
}, {
|
|
815
|
+
default: V(() => [Ft.value ? (I(), D("div", {
|
|
816
|
+
key: 0,
|
|
817
|
+
class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
|
|
818
|
+
style: P({ minHeight: It.value ? `${q.value}px` : void 0 })
|
|
819
|
+
}, [O("div", gt, [O("div", _t, [k(r, {
|
|
820
|
+
name: "loading-loop",
|
|
821
|
+
class: "shrink-0"
|
|
822
|
+
}), O("span", vt, R(z(i)("label.answeringOnTheCall")), 1)])])], 4)) : E("", !0)]),
|
|
823
|
+
_: 1
|
|
824
|
+
}),
|
|
825
|
+
k(C, {
|
|
826
|
+
appear: "",
|
|
827
|
+
name: "pk-chatbot-part"
|
|
828
|
+
}, {
|
|
829
|
+
default: V(() => [Pt.value ? (I(), T(h, {
|
|
830
|
+
key: 0,
|
|
831
|
+
error: e.error,
|
|
832
|
+
onRetry: n[3] ||= (e) => t.$emit("auto-retry"),
|
|
833
|
+
onReset: n[4] ||= (e) => t.$emit("reset-chat")
|
|
834
|
+
}, null, 8, ["error"])) : E("", !0)]),
|
|
835
|
+
_: 1
|
|
836
|
+
}),
|
|
837
|
+
jt.value?.role === "user" && !It.value || Pt.value ? (I(), D("div", {
|
|
838
|
+
key: 0,
|
|
839
|
+
class: "pk-chatbot-messages__spacer",
|
|
840
|
+
style: P({ minHeight: `${q.value}px` })
|
|
841
|
+
}, null, 4)) : E("", !0)
|
|
842
|
+
], 512),
|
|
843
|
+
k(C, { name: "pk-chatbot-messages-fab" }, {
|
|
844
|
+
default: V(() => [e.showScrollToBottom && (z(G) || !z(Me)) ? (I(), D("button", {
|
|
845
|
+
key: 0,
|
|
846
|
+
type: "button",
|
|
847
|
+
class: "pk-chatbot-messages__scroll-to-bottom",
|
|
848
|
+
title: z(i)("action.scrollToBottom"),
|
|
849
|
+
"aria-label": z(i)("action.scrollToBottom"),
|
|
850
|
+
onClick: Pe
|
|
851
|
+
}, [k(r, { name: "ri:arrow-down-line" })], 8, yt)) : E("", !0)]),
|
|
852
|
+
_: 1
|
|
853
|
+
})
|
|
854
|
+
], 46, We);
|
|
855
|
+
};
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
//#endregion
|
|
859
|
+
export { Pe as a, Ne as i, K as n, Me as r, bt as t };
|
|
860
|
+
|
|
861
|
+
//# sourceMappingURL=PkChatbotMessages-DJmRPFB8.js.map
|