@8wave/ai-elements 0.121.0-beta.55 → 0.121.0-beta.57

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