@8wave/ai-elements 0.125.0-beta.26 → 0.125.0-beta.28

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