@8wave/ai-elements 0.123.0-beta.2 → 0.123.0-beta.4

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 (117) hide show
  1. package/dist/_chunks/{Agent-BcmcalNN.js → Agent-C0JtGK2t.js} +3 -2
  2. package/dist/_chunks/{Agent-BcmcalNN.js.map → Agent-C0JtGK2t.js.map} +1 -1
  3. package/dist/_chunks/{PkStreamingMarkdown-Dc0R0GHe.js → PkStreamingMarkdown-De3ihxaM.js} +3 -3
  4. package/dist/_chunks/{PkStreamingMarkdown-Dc0R0GHe.js.map → PkStreamingMarkdown-De3ihxaM.js.map} +1 -1
  5. package/dist/_chunks/{PkToolChatFile-3fYhbFSi.js → PkToolChatFile-CRp81vG5.js} +2 -2
  6. package/dist/_chunks/{PkToolChatFile-3fYhbFSi.js.map → PkToolChatFile-CRp81vG5.js.map} +1 -1
  7. package/dist/_chunks/{PkToolRequestGeolocation-n1W_drCv.js → PkToolRequestGeolocation-GlUmGHpD.js} +2 -2
  8. package/dist/_chunks/{PkToolRequestGeolocation-n1W_drCv.js.map → PkToolRequestGeolocation-GlUmGHpD.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestOAuthConnection-DmMeSF2m.js → PkToolRequestOAuthConnection-7OvDQZe5.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DmMeSF2m.js.map → PkToolRequestOAuthConnection-7OvDQZe5.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-BUnSqAWQ.js → PkToolShowArtifact-DmVWtJit.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-BUnSqAWQ.js.map → PkToolShowArtifact-DmVWtJit.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShowContactForm-YX1BuolZ.js → PkToolShowContactForm-9Kv-ZdN9.js} +2 -2
  14. package/dist/_chunks/{PkToolShowContactForm-YX1BuolZ.js.map → PkToolShowContactForm-9Kv-ZdN9.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowForm-CkpMsrEo.js → PkToolShowForm-CbKhYut7.js} +3 -3
  16. package/dist/_chunks/{PkToolShowForm-CkpMsrEo.js.map → PkToolShowForm-CbKhYut7.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowImageGallery-BnUnjFeU.js → PkToolShowImageGallery-6rZZHDOj.js} +2 -2
  18. package/dist/_chunks/{PkToolShowImageGallery-BnUnjFeU.js.map → PkToolShowImageGallery-6rZZHDOj.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowProductList-CPqmqS-Q.js → PkToolShowProductList-U9hglluW.js} +2 -2
  20. package/dist/_chunks/{PkToolShowProductList-CPqmqS-Q.js.map → PkToolShowProductList-U9hglluW.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSources-BO1IhnmO.js → PkToolShowSources-BB7w_tMo.js} +3 -3
  22. package/dist/_chunks/{PkToolShowSources-BO1IhnmO.js.map → PkToolShowSources-BB7w_tMo.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowSuggestedReply-79UAjTL4.js → PkToolShowSuggestedReply-BxCeHVdn.js} +2 -2
  24. package/dist/_chunks/{PkToolShowSuggestedReply-79UAjTL4.js.map → PkToolShowSuggestedReply-BxCeHVdn.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowVideo-DYnH3VIc.js → PkToolShowVideo-BnLOMaQn.js} +2 -2
  26. package/dist/_chunks/{PkToolShowVideo-DYnH3VIc.js.map → PkToolShowVideo-BnLOMaQn.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowWebPages-Ci_Yut6X.js → PkToolShowWebPages-CBAQf2pg.js} +2 -2
  28. package/dist/_chunks/{PkToolShowWebPages-Ci_Yut6X.js.map → PkToolShowWebPages-CBAQf2pg.js.map} +1 -1
  29. package/dist/_chunks/{chatImagePolicy-B5-NwmIR.js → chatImagePolicy-B3-RzU9W.js} +2 -2
  30. package/dist/_chunks/{chatImagePolicy-B5-NwmIR.js.map → chatImagePolicy-B3-RzU9W.js.map} +1 -1
  31. package/dist/_chunks/{markdown-_sL6w03k.js → markdown-BxOlM5SY.js} +2 -2
  32. package/dist/_chunks/{markdown-_sL6w03k.js.map → markdown-BxOlM5SY.js.map} +1 -1
  33. package/dist/ai-elements.es.js +2674 -2593
  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-BWwjGG2f.js → Agent-Dsi_xGvV.js} +10 -9
  47. package/dist-vue/_chunks/{Agent-BWwjGG2f.js.map → Agent-Dsi_xGvV.js.map} +1 -1
  48. package/dist-vue/_chunks/{Document-DvRaziIf.js → Document-B5R1PJnc.js} +2 -2
  49. package/dist-vue/_chunks/{Document-DvRaziIf.js.map → Document-B5R1PJnc.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbot-D3KGDerg.js → PkChatbot-B0EC0aOA.js} +8 -8
  51. package/dist-vue/_chunks/{PkChatbot-D3KGDerg.js.map → PkChatbot-B0EC0aOA.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotEmptyState-B76oD7fB.js → PkChatbotEmptyState-yO8Z-3p4.js} +2 -2
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-B76oD7fB.js.map → PkChatbotEmptyState-yO8Z-3p4.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkChatbotInput-BT51V-v4.js → PkChatbotInput-CiNeclez.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotInput-BT51V-v4.js.map → PkChatbotInput-CiNeclez.js.map} +1 -1
  56. package/dist-vue/_chunks/PkChatbotMessages-CcR2PKp3.js +982 -0
  57. package/dist-vue/_chunks/PkChatbotMessages-CcR2PKp3.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotStepPayload-BYChvULZ.js → PkChatbotStepPayload-CWJmmF6k.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-BYChvULZ.js.map → PkChatbotStepPayload-CWJmmF6k.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BysPl2ko.js → PkChatbotStepToolDetail-gT-CpGZH.js} +3 -3
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BysPl2ko.js.map → PkChatbotStepToolDetail-gT-CpGZH.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotSteps-p8-SuGGe.js → PkChatbotSteps-CUznAYXB.js} +5 -5
  63. package/dist-vue/_chunks/{PkChatbotSteps-p8-SuGGe.js.map → PkChatbotSteps-CUznAYXB.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewChat-BNaSv86u.js → PkChatbotViewChat-DDnJ-2Ic.js} +377 -371
  65. package/dist-vue/_chunks/PkChatbotViewChat-DDnJ-2Ic.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotViewConversations-C1vl8z4o.js → PkChatbotViewConversations-D0I6g4QO.js} +3 -3
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-C1vl8z4o.js.map → PkChatbotViewConversations-D0I6g4QO.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotViewFiles-DiKHsdPE.js → PkChatbotViewFiles-UjuW1UGm.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-DiKHsdPE.js.map → PkChatbotViewFiles-UjuW1UGm.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkChatbotViewProfile-CuQ0MAX7.js → PkChatbotViewProfile-Dvqk0e3I.js} +2 -2
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-CuQ0MAX7.js.map → PkChatbotViewProfile-Dvqk0e3I.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkStreamingMarkdown-B-sEx8BP.js → PkStreamingMarkdown-C_4h85DA.js} +3 -3
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-B-sEx8BP.js.map → PkStreamingMarkdown-C_4h85DA.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolChatFile-BJsDSu1Q.js → PkToolChatFile-CMcJl0hu.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolChatFile-BJsDSu1Q.js.map → PkToolChatFile-CMcJl0hu.js.map} +1 -1
  76. package/dist-vue/_chunks/{PkToolRequestGeolocation-e8vyxTI_.js → PkToolRequestGeolocation-Bzu1fQ-X.js} +2 -2
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation-e8vyxTI_.js.map → PkToolRequestGeolocation-Bzu1fQ-X.js.map} +1 -1
  78. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-3zLvNF_c.js → PkToolRequestOAuthConnection-C8t_5YtB.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-3zLvNF_c.js.map → PkToolRequestOAuthConnection-C8t_5YtB.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowArtifact-BRwa5pGY.js → PkToolShowArtifact-Pvi63K3m.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowArtifact-BRwa5pGY.js.map → PkToolShowArtifact-Pvi63K3m.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowContactForm-xHBTmITM.js → PkToolShowContactForm-BNta1jh0.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowContactForm-xHBTmITM.js.map → PkToolShowContactForm-BNta1jh0.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowDiagram-DrJs92dg.js → PkToolShowDiagram-BRHpp_P-.js} +2 -2
  85. package/dist-vue/_chunks/{PkToolShowDiagram-DrJs92dg.js.map → PkToolShowDiagram-BRHpp_P-.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowForm-Fv4iV0VY.js → PkToolShowForm-DuX1By1C.js} +4 -4
  87. package/dist-vue/_chunks/{PkToolShowForm-Fv4iV0VY.js.map → PkToolShowForm-DuX1By1C.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowImageGallery-DD_RGcL6.js → PkToolShowImageGallery-9n-B5Jqo.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-DD_RGcL6.js.map → PkToolShowImageGallery-9n-B5Jqo.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowProductList-8UQSQvRr.js → PkToolShowProductList-BE_nXuEa.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolShowProductList-8UQSQvRr.js.map → PkToolShowProductList-BE_nXuEa.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowSources-C4rKpypf.js → PkToolShowSources-89OXReX8.js} +3 -3
  93. package/dist-vue/_chunks/{PkToolShowSources-C4rKpypf.js.map → PkToolShowSources-89OXReX8.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bnhgsh4l.js → PkToolShowSuggestedReply-CxOyvAB6.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bnhgsh4l.js.map → PkToolShowSuggestedReply-CxOyvAB6.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowVideo-NOwtZPgI.js → PkToolShowVideo-C3SbJ3Zb.js} +2 -2
  97. package/dist-vue/_chunks/{PkToolShowVideo-NOwtZPgI.js.map → PkToolShowVideo-C3SbJ3Zb.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowWebPages-DcPboNwp.js → PkToolShowWebPages-CjNhdQbq.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowWebPages-DcPboNwp.js.map → PkToolShowWebPages-CjNhdQbq.js.map} +1 -1
  100. package/dist-vue/_chunks/{createChatbotApiClient-DAh91HyT.js → createChatbotApiClient-CesweDUX.js} +4 -3
  101. package/dist-vue/_chunks/{createChatbotApiClient-DAh91HyT.js.map → createChatbotApiClient-CesweDUX.js.map} +1 -1
  102. package/dist-vue/_chunks/{useChatbotStore-D1U24qc8.js → useChatbotStore-CNcPLoPf.js} +695 -635
  103. package/dist-vue/_chunks/useChatbotStore-CNcPLoPf.js.map +1 -0
  104. package/dist-vue/_chunks/{utils-DaAIWTtt.js → utils-PU7OuUYN.js} +2 -2
  105. package/dist-vue/_chunks/{utils-DaAIWTtt.js.map → utils-PU7OuUYN.js.map} +1 -1
  106. package/dist-vue/api.js +1 -1
  107. package/dist-vue/composables.js +4 -4
  108. package/dist-vue/index.js +24 -24
  109. package/dist-vue/packages/components/src/chat/useVoiceSession.d.ts +6 -0
  110. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +2 -0
  111. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +61 -1
  112. package/dist-vue/packages/models/src/schema/Agent.d.ts +1 -0
  113. package/package.json +1 -1
  114. package/dist-vue/_chunks/PkChatbotMessages-qkodgdDE.js +0 -968
  115. package/dist-vue/_chunks/PkChatbotMessages-qkodgdDE.js.map +0 -1
  116. package/dist-vue/_chunks/PkChatbotViewChat-BNaSv86u.js.map +0 -1
  117. package/dist-vue/_chunks/useChatbotStore-D1U24qc8.js.map +0 -1
@@ -1,968 +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 { O as o, V as s, _ as c, k as l, r as u } from "./Agent-BWwjGG2f.js";
4
- import { t as d } from "./VvButtonLocalized-C-vx25u4.js";
5
- import { t as f } from "./PkStreamingMarkdown-B-sEx8BP.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-DaAIWTtt.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-p8-SuGGe.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-3zLvNF_c.js")),
59
- shareDocument: N(() => import("./PkToolShareDocument-CRghPfep.js").then((e) => e.n)),
60
- showArtifact: N(() => import("./PkToolShowArtifact-BRwa5pGY.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-xHBTmITM.js").then((e) => e.n)),
64
- showDiagram: N(() => import("./PkToolShowDiagram-DrJs92dg.js")),
65
- showEmail: N(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
66
- showImageGallery: N(() => import("./PkToolShowImageGallery-DD_RGcL6.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-Fv4iV0VY.js").then((e) => e.n)),
70
- showMultipleChoice: N(() => import("./PkToolShowForm-Fv4iV0VY.js").then((e) => e.n)),
71
- showProductList: N(() => import("./PkToolShowProductList-8UQSQvRr.js").then((e) => e.n)),
72
- showQrCode: N(() => import("./PkToolShowQrCode-skWaARYV.js").then((e) => e.n)),
73
- showSources: N(() => import("./PkToolShowSources-C4rKpypf.js").then((e) => e.n)),
74
- showSuggestedReply: N(() => import("./PkToolShowSuggestedReply-Bnhgsh4l.js").then((e) => e.n)),
75
- showVideo: N(() => import("./PkToolShowVideo-NOwtZPgI.js")),
76
- showWeather: N(() => import("./PkToolShowWeather-BZaeG1cY.js")),
77
- showWebPages: N(() => import("./PkToolShowWebPages-DcPboNwp.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
- hideReasoning: { type: Boolean },
344
- awaitingSpokenAnswer: { type: Boolean },
345
- hostWorking: { type: Boolean },
346
- hostConfirmation: {},
347
- confirmVerdictsOnCall: {},
348
- isDark: { type: Boolean },
349
- showScrollToBottom: { type: Boolean },
350
- parentScrolls: { type: Boolean },
351
- feedbackMessageId: {},
352
- feedbackLoading: { type: Boolean },
353
- feedbackSubmitted: { type: Boolean },
354
- feedbackError: {}
355
- },
356
- emits: [
357
- "show-info",
358
- "regenerate",
359
- "revise",
360
- "upvote",
361
- "downvote",
362
- "feedback",
363
- "feedback-submit",
364
- "feedback-close",
365
- "scroll-up",
366
- "scroll-down",
367
- "auto-retry",
368
- "reset-chat",
369
- "approval-respond",
370
- "confirm-respond",
371
- "host-confirm-respond"
372
- ],
373
- setup(e, { emit: t }) {
374
- 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) => {
375
- if (ne(e)) {
376
- let n = e.toolCallId;
377
- n && r("confirm-respond", {
378
- toolCallId: n,
379
- confirmed: t
380
- });
381
- return;
382
- }
383
- let n = ae(e);
384
- n && r("approval-respond", {
385
- id: n,
386
- approved: t
387
- });
388
- }, w = Be("scrollEl"), N = Be("wrapperEl"), Oe = D(() => le(n.textColor, n.mainColor)), { handleScroll: Me, scrollToBottom: Ue, userScrolledUp: We, isAtBottom: Ge } = at({
389
- scrollEl: w,
390
- status: () => n.status,
391
- messagesLength: () => n.messages?.length,
392
- lastMessageRole: () => n.messages?.[n.messages.length - 1]?.role,
393
- contentEl: () => N.value,
394
- beforeNewMessageScroll: () => q(),
395
- onScrollUp: () => r("scroll-up"),
396
- onScrollDown: () => r("scroll-down")
397
- }), Ke = () => {
398
- We.value = !1, Ue();
399
- }, U = D(() => (n.messages ?? []).filter((e) => e.role === "user" && !H(e)).map((e) => ({
400
- id: e.id,
401
- preview: e.parts.find(h)?.text.trim().slice(0, 120) || "…"
402
- }))), qe = Pe(), Je = () => w.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], Ye = () => {
403
- let e = w.value;
404
- if (!e || !n.showScrollToBottom) return;
405
- let t = e.getBoundingClientRect().top + e.clientHeight / 2, r = U.value[0]?.id;
406
- Je().forEach((e, n) => {
407
- e.getBoundingClientRect().top <= t && (r = U.value[n]?.id);
408
- }), qe.value = r;
409
- };
410
- z(U, async () => {
411
- await P(), Ye();
412
- });
413
- let Ze = () => {
414
- Me(), Ye();
415
- }, Qe = (e) => {
416
- let t = w.value, n = U.value.findIndex((t) => t.id === e), r = Je()[n];
417
- t && r && (We.value = !0, t.scrollTo({
418
- top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
419
- behavior: "smooth"
420
- }));
421
- }, 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 = () => {
422
- K = !1, et.value = !0, G.value = 0;
423
- }, q = async () => {
424
- if (!n.messages?.length || n.disableHeightAdjustment) return;
425
- if (!nt()) {
426
- K && (await P(), w.value?.scrollHeight, nt() || it());
427
- return;
428
- }
429
- if (K = !0, et.value = !1, await P(), !w.value) return;
430
- 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();
431
- tt.value = a[a.length - 1];
432
- let o = r - (tt.value?.clientHeight ?? 0) - i;
433
- r > 0 && (G.value = Math.max(o, 0)), await P();
434
- };
435
- z([() => n.messages?.length, () => n.messages?.[n.messages.length - 1]?.id], () => q()), He([w, tt], () => {
436
- K && q();
437
- }), Ne(() => {
438
- (W.value || n.awaitingSpokenAnswer) && q();
439
- }), z(W, (e) => {
440
- e || it();
441
- });
442
- 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) => {
443
- let t = Ut(e);
444
- if (t?.vote) return;
445
- let n = t?.metadata?.reactionEmoji;
446
- return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
447
- }, Kt = (e) => !!(Wt(e) || Gt(e)), qt = (e) => {
448
- if (Gt(e)) return "pk-chatbot-message__reaction--neutral";
449
- let t = Wt(e);
450
- return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
451
- }, Jt = (e) => {
452
- let t = Wt(e);
453
- return i(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
454
- }, Yt = (e) => {
455
- let t = Qt(e);
456
- for (let e = t.length - 1; e >= 0; --e) if (h(t[e])) return e;
457
- return -1;
458
- }, Xt = D(() => n.messages?.[n.messages.length - 1]), X = D(() => {
459
- let e = Xt.value;
460
- return e ? e.parts[e.parts.length - 1] : null;
461
- }), Zt = D(() => {
462
- let e = /* @__PURE__ */ new Map();
463
- for (let t of n.messages ?? []) t.role === "assistant" && e.set(t.id, ue(pe(ie(t.parts))));
464
- return e;
465
- }), 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(() => {
466
- let e = X.value;
467
- return ge(i, e, l?.value);
468
- }), an = D(() => {
469
- let e = X.value;
470
- return de(e);
471
- }), 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) => {
472
- let t = e.parts[e.parts.length - 1];
473
- return h(t);
474
- }, 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) => {
475
- if (!C(n) || dn(e)) return !1;
476
- let i = pn(t, n);
477
- return i && r === Qt(e).length - 1 ? !1 : i || b(n) || !_(e);
478
- }, hn = (e, t) => {
479
- let n = C(t);
480
- 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;
481
- }, 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) => {
482
- let t = yn(e)?.metadata?.createdAt, n = bn(e)?.metadata?.createdAt;
483
- if (!t || !n) return;
484
- let r = new Date(t), i = new Date(n);
485
- return r.toDateString() === i.toDateString() ? void 0 : i;
486
- }, $ = D(() => n.showAllMessageParts ? ot([]) : ot(n.messages ?? [], _n)), Sn = D(() => {
487
- let e = 0;
488
- return (n.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
489
- }), 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) => {
490
- let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
491
- return s(t, n ? "time" : "date-time");
492
- }, Tn = (e) => {
493
- let { createdAt: t, completedAt: n } = e.metadata ?? {};
494
- if (t && n) return oe(c, n - t);
495
- }, En = Be("feedbackMessageEl");
496
- return z(() => n.feedbackMessageId, async () => {
497
- if (await P(), !n.feedbackMessageId) return;
498
- let e = En.value?.[0]?.$el;
499
- e && (Z(on(n.feedbackMessageId)) ? Ue() : e.scrollIntoView({
500
- behavior: "smooth",
501
- block: "center"
502
- }));
503
- }), (t, n) => {
504
- let p = Ee, _ = d, y = Te;
505
- return I(), A("div", {
506
- ref_key: "scrollEl",
507
- ref: w,
508
- class: F(["pk-chatbot-messages scrollbar-thin", {
509
- "pk-chatbot-messages--settling": et.value,
510
- "pk-chatbot-messages--parent-scrolls": e.parentScrolls
511
- }]),
512
- role: "log",
513
- "aria-live": "polite",
514
- "aria-relevant": "additions text",
515
- "aria-busy": W.value,
516
- style: je({
517
- "--chatbot-main-color": e.mainColor,
518
- "--chatbot-contrast-color": Oe.value
519
- }),
520
- onScroll: Ze
521
- }, [
522
- e.showScrollToBottom && U.value.length > 1 ? (I(), A("div", ct, [M(we, {
523
- items: U.value,
524
- "active-id": qe.value,
525
- onSelect: Qe
526
- }, null, 8, ["items", "active-id"])])) : k("", !0),
527
- j("div", {
528
- ref_key: "wrapperEl",
529
- ref: N,
530
- class: "pk-chatbot-messages__wrapper"
531
- }, [
532
- (I(!0), A(T, null, Fe(e.messages, (d, b) => (I(), A(T, { key: d.id }, [
533
- vn(d) && xn(b) ? (I(), A("div", lt, [j("span", ut, L(R(s)(xn(b), "short")), 1)])) : k("", !0),
534
- $.value.quietRuns.has(d.id) ? (I(), A("div", dt, [M(p, {
535
- name: "ri:alarm-line",
536
- class: "shrink-0"
537
- }), j("span", null, L(R(i)("label.wakeupQuietRun", {
538
- count: $.value.quietRuns.get(d.id).count,
539
- time: R(s)($.value.quietRuns.get(d.id).lastAt ?? Date.now(), "time")
540
- }, $.value.quietRuns.get(d.id).count)), 1)])) : R(H)(d) && !$.value.hidden.has(d.id) && !e.showAllMessageParts ? (I(), A("div", {
541
- key: 2,
542
- class: "pk-chatbot-wakeup",
543
- title: d.metadata?.wakeup?.reason
544
- }, [M(p, {
545
- name: "ri:alarm-line",
546
- class: "shrink-0"
547
- }), 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),
548
- (!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", {
549
- key: 3,
550
- class: F(["pk-chatbot-message", [`pk-chatbot-message--${d.role}`, { "pk-chatbot-message--loading": W.value && Z(b) && Q(d) }]]),
551
- style: je({ minHeight: Z(b) && Q(d) && !$t.value ? `${G.value}px` : void 0 })
552
- }, [
553
- M(E, {
554
- appear: "",
555
- name: "pk-chatbot-part"
556
- }, {
557
- default: B(() => [dn(d) ? (I(), O(Ce, {
558
- key: 0,
559
- message: d,
560
- "is-streaming": W.value && Z(b),
561
- "has-content": _n(d),
562
- "hide-reasoning": e.hideReasoning,
563
- "is-dark": e.isDark
564
- }, null, 8, [
565
- "message",
566
- "is-streaming",
567
- "has-content",
568
- "hide-reasoning",
569
- "is-dark"
570
- ])) : k("", !0)]),
571
- _: 2
572
- }, 1024),
573
- (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, {
574
- key: 0,
575
- appear: "",
576
- name: "pk-chatbot-part"
577
- }, {
578
- default: B(() => [j("div", pt, [Ie(t.$slots, "text", Ae({ ref_for: !0 }, {
579
- message: d,
580
- part: s,
581
- index: b,
582
- isLoading: W.value
583
- }), () => [Q(d) ? (I(), O(f, {
584
- key: 0,
585
- class: "wysiwyg",
586
- markdown: s.text,
587
- "is-dark": e.isDark,
588
- loading: Z(b) && e.status === "streaming"
589
- }, null, 8, [
590
- "markdown",
591
- "is-dark",
592
- "loading"
593
- ])) : (I(), A(T, { key: 1 }, [De(L(s.text), 1)], 64))]), Kt(d.id) && !Y(d.id)?.comment && c === Yt(d) ? (I(), A("span", {
594
- key: 0,
595
- class: F(["pk-chatbot-message__reaction", qt(d.id)]),
596
- title: Jt(d.id)
597
- }, [Gt(d.id) ? (I(), A("span", ht, L(Gt(d.id)), 1)) : (I(), O(p, {
598
- key: 1,
599
- name: Wt(d.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
600
- }, null, 8, ["name"]))], 10, mt)) : k("", !0)])]),
601
- _: 2
602
- }, 1024)) : R(ee)(s) ? (I(), O(E, {
603
- key: 1,
604
- appear: "",
605
- name: "pk-chatbot-part"
606
- }, {
607
- default: B(() => [R(a)(s.filename, s.mediaType) ? (I(), A("div", gt, [M(ye, {
608
- "media-type": s.mediaType,
609
- url: s.url,
610
- filename: s.filename,
611
- size: R(v)(s)?.bytesCount
612
- }, null, 8, [
613
- "media-type",
614
- "url",
615
- "filename",
616
- "size"
617
- ]), M(te, {
618
- url: s.url,
619
- transcript: R(g)(s),
620
- pending: e.status === "submitted" && Z(b)
621
- }, null, 8, [
622
- "url",
623
- "transcript",
624
- "pending"
625
- ])])) : (I(), O(ye, {
626
- key: 1,
627
- "media-type": s.mediaType,
628
- url: s.url,
629
- filename: s.filename,
630
- size: R(v)(s)?.bytesCount
631
- }, null, 8, [
632
- "media-type",
633
- "url",
634
- "filename",
635
- "size"
636
- ]))]),
637
- _: 2
638
- }, 1024)) : R(x)(s) && !R(S)(s) ? (I(), O(E, {
639
- key: 2,
640
- appear: "",
641
- name: "pk-chatbot-part"
642
- }, {
643
- default: B(() => [(I(), O($e, {
644
- key: `approval-${c}`,
645
- part: s,
646
- actionable: e.interactive === !0 && (R(ne)(s) || Z(b)),
647
- "call-verdict": e.confirmVerdictsOnCall?.get(s.toolCallId ?? ""),
648
- onRespond: (e) => re(s, e)
649
- }, null, 8, [
650
- "part",
651
- "actionable",
652
- "call-verdict",
653
- "onRespond"
654
- ]))]),
655
- _: 2
656
- }, 1024)) : fn(s) ? (I(), O(E, {
657
- key: 3,
658
- appear: "",
659
- name: "pk-chatbot-part"
660
- }, {
661
- default: B(() => [M(rt, {
662
- question: e.hostConfirmation?.question ?? R(i)("toolApproval.hostCall", { name: R(ge)(R(i), s) }),
663
- details: e.hostConfirmation?.details,
664
- onRespond: n[0] ||= (e) => r("host-confirm-respond", e)
665
- }, null, 8, ["question", "details"])]),
666
- _: 2
667
- }, 1024)) : mn(d, b, s, c) ? (I(), O(E, {
668
- key: 4,
669
- appear: "",
670
- name: "pk-chatbot-part"
671
- }, {
672
- default: B(() => [j("div", _t, [
673
- M(p, {
674
- name: pn(b, s) ? "loading-loop" : R(de)(s) ?? "ri:apps-line",
675
- class: "shrink-0"
676
- }, null, 8, ["name"]),
677
- j("span", vt, L(R(ge)(R(i), s, R(l))), 1),
678
- hn(b, s) ? (I(), A("span", yt, " · " + L(hn(b, s)), 1)) : k("", !0)
679
- ])]),
680
- _: 2
681
- }, 1024)) : gn(s) ? (I(), O(E, {
682
- key: 5,
683
- appear: "",
684
- name: "pk-chatbot-part"
685
- }, {
686
- default: B(() => [!R(u)[s.type] && R(Xe)[R(m)(s)] ? (I(), O(Le(R(Xe)[R(m)(s)]), Ae({
687
- key: `component-${c}-${R(ce)(s)}`,
688
- part: s
689
- }, { ref_for: !0 }, Vt(s)), null, 16, ["part"])) : Ie(t.$slots, s.type, Ae({ ref_for: !0 }, {
690
- message: d,
691
- part: s,
692
- index: b,
693
- isLoading: W.value
694
- }), () => [e.showAllMessageParts ? (I(), A("div", bt, [j("div", xt, [R(de)(s) ? (I(), O(p, {
695
- key: 0,
696
- name: R(de)(s),
697
- class: "shrink-0"
698
- }, null, 8, ["name"])) : k("", !0), j("span", St, L(R(se)(s, {
699
- t: R(i),
700
- te: R(o)
701
- })), 1)])])) : k("", !0)], void 0, 1)]),
702
- _: 2
703
- }, 1024)) : k("", !0), M(E, { mode: "out-in" }, {
704
- default: B(() => [c === Yt(d) && e.readonlyFeedback && Y(d.id)?.comment ? (I(), O(xe, {
705
- key: 0,
706
- feedback: Y(d.id)
707
- }, null, 8, ["feedback"])) : k("", !0)]),
708
- _: 2
709
- }, 1024)], 64))), 128)),
710
- M(E, {
711
- name: "fade-in",
712
- mode: "out-in"
713
- }, {
714
- default: B(() => [W.value && Z(b) && !ln(d) && !e.hostConfirmation && Q(d) && (!dn(d) || _n(d)) ? (I(), A("div", {
715
- key: `loading-info-${d.id}`,
716
- class: "pk-chatbot-message__loading-info"
717
- }, [j("div", Ct, [
718
- M(p, {
719
- name: "loading-loop",
720
- class: "shrink-0"
721
- }),
722
- M(E, { mode: "out-in" }, {
723
- default: B(() => [an.value ? (I(), O(p, {
724
- key: an.value,
725
- class: "shrink-0",
726
- name: an.value
727
- }, null, 8, ["name"])) : k("", !0)]),
728
- _: 1
729
- }),
730
- M(E, { mode: "out-in" }, {
731
- default: B(() => [rn.value ? (I(), A("span", {
732
- key: rn.value,
733
- class: "text-12"
734
- }, L(rn.value), 1)) : k("", !0)]),
735
- _: 1
736
- })
737
- ]), M(E, {
738
- name: "fade-in",
739
- mode: "out-in"
740
- }, {
741
- default: B(() => [!e.hideReasoning && !dn(d) && X.value && "text" in X.value && X.value.text.trim() ? (I(), O(Se, {
742
- key: 0,
743
- markdown: X.value.text,
744
- "is-dark": e.isDark,
745
- "tail-length": R(me),
746
- "inner-class": "wysiwyg",
747
- class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
748
- }, null, 8, [
749
- "markdown",
750
- "is-dark",
751
- "tail-length"
752
- ])) : k("", !0)]),
753
- _: 2
754
- }, 1024)])) : k("", !0)]),
755
- _: 2
756
- }, 1024),
757
- M(E, { mode: "out-in" }, {
758
- default: B(() => [Cn(d, b) ? (I(), A("div", wt, [
759
- M(y, {
760
- modifiers: "compact",
761
- class: "mr-auto shrink-0"
762
- }, {
763
- default: B(() => [
764
- M(E, { mode: "out-in" }, {
765
- default: B(() => [sn(b) ? (I(), O(_, {
766
- key: 0,
767
- icon: "ri:reset-right-line",
768
- modifiers: "action-quiet-small",
769
- title: R(i)("action.regenerate"),
770
- "aria-label": R(i)("action.regenerate"),
771
- onClick: n[1] ||= V((e) => t.$emit("regenerate"), ["stop"])
772
- }, null, 8, ["title", "aria-label"])) : k("", !0)]),
773
- _: 2
774
- }, 1024),
775
- M(E, { mode: "out-in" }, {
776
- default: B(() => [cn("show-info", b) ? (I(), O(_, {
777
- key: 0,
778
- icon: "ri:information-line",
779
- title: R(i)("action.getMoreInfo"),
780
- "aria-label": R(i)("action.getMoreInfo"),
781
- modifiers: "action-quiet-small",
782
- onClick: V((e) => t.$emit("show-info", d), ["stop"])
783
- }, null, 8, [
784
- "title",
785
- "aria-label",
786
- "onClick"
787
- ])) : k("", !0)]),
788
- _: 2
789
- }, 1024),
790
- M(E, { mode: "out-in" }, {
791
- default: B(() => [cn("revise", b) ? (I(), O(_, {
792
- key: 0,
793
- icon: J(d.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
794
- title: J(d.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
795
- "aria-label": J(d.id) ? R(i)("action.editRevise") : R(i)("action.createRevise"),
796
- modifiers: "action-quiet-small",
797
- class: F({ "text-brand-graphic": J(d.id) }),
798
- onClick: V((e) => t.$emit("revise", d), ["stop"])
799
- }, null, 8, [
800
- "icon",
801
- "title",
802
- "aria-label",
803
- "class",
804
- "onClick"
805
- ])) : k("", !0)]),
806
- _: 2
807
- }, 1024),
808
- M(E, { mode: "out-in" }, {
809
- default: B(() => [Ht("upvote", b) ? (I(), O(_, {
810
- key: 0,
811
- icon: Y(d.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
812
- title: R(i)("action.upvote"),
813
- "aria-label": R(i)("action.upvote"),
814
- modifiers: "action-quiet-small",
815
- onClick: V((e) => t.$emit("upvote", d), ["stop"])
816
- }, null, 8, [
817
- "icon",
818
- "title",
819
- "aria-label",
820
- "onClick"
821
- ])) : k("", !0)]),
822
- _: 2
823
- }, 1024),
824
- M(E, { mode: "out-in" }, {
825
- default: B(() => [Ht("downvote", b) ? (I(), O(_, {
826
- key: 0,
827
- icon: Y(d.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
828
- title: R(i)("action.downvote"),
829
- "aria-label": R(i)("action.downvote"),
830
- modifiers: "action-quiet-small",
831
- onClick: V((e) => t.$emit("downvote", d), ["stop"])
832
- }, null, 8, [
833
- "icon",
834
- "title",
835
- "aria-label",
836
- "onClick"
837
- ])) : k("", !0)]),
838
- _: 2
839
- }, 1024),
840
- M(E, { mode: "out-in" }, {
841
- default: B(() => [Ht("feedback", b) ? (I(), O(_, {
842
- key: 0,
843
- icon: Y(d.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
844
- title: R(i)("action.feedback"),
845
- "aria-label": R(i)("action.feedback"),
846
- modifiers: "action-quiet-small",
847
- onClick: V((e) => t.$emit("feedback", d), ["stop"])
848
- }, null, 8, [
849
- "icon",
850
- "title",
851
- "aria-label",
852
- "onClick"
853
- ])) : k("", !0)]),
854
- _: 2
855
- }, 1024)
856
- ]),
857
- _: 2
858
- }, 1024),
859
- !e.showMessageDateTime && d.metadata?.createdAt && d.metadata?.completedAt ? (I(), A("div", Tt, [j("time", {
860
- datetime: new Date(d.metadata.createdAt).toISOString(),
861
- title: R(s)(new Date(d.metadata.createdAt), "date-time"),
862
- class: "flex items-center gap-4 min-w-0"
863
- }, [M(p, {
864
- name: "ri:time-line",
865
- class: "shrink-0"
866
- }), j("span", Dt, L(wn(d.metadata.createdAt)), 1)], 8, Et), Tn(d) ? (I(), A("span", Ot, [M(p, {
867
- name: "ri:hourglass-line",
868
- class: "shrink-0"
869
- }), j("span", kt, L(Tn(d)), 1)])) : k("", !0)])) : k("", !0),
870
- e.showMessageNumber ? (I(), A("span", {
871
- key: 1,
872
- title: R(i)("label.messageNumber", { n: Sn.value[b] }),
873
- class: "text-12 text-word-3 tabular-nums"
874
- }, " #" + L(Sn.value[b]), 9, At)) : k("", !0),
875
- e.showMessageTokensCount && d.metadata?.totalTokens ? (I(), A("span", jt, [M(p, {
876
- name: "ri:ai-generate-2-line",
877
- class: "shrink-0"
878
- }), j("span", Mt, L(R(c)(d.metadata.totalTokens, "integer")) + " " + L(R(i)("label.tokens")), 1)])) : k("", !0),
879
- e.showMessageDateTime && d.metadata?.createdAt ? (I(), A("time", {
880
- key: 3,
881
- datetime: new Date(d.metadata?.createdAt).toISOString(),
882
- class: "flex items-center gap-4 text-12 text-word-3"
883
- }, [M(p, {
884
- name: "ri:time-line",
885
- class: "shrink-0"
886
- }), j("span", Pt, L(R(s)(new Date(d.metadata?.createdAt), "date-time")), 1)], 8, Nt)) : k("", !0),
887
- e.showMessageDateTime && d?.metadata?.completedAt && d?.metadata?.createdAt ? (I(), A("div", Ft, [M(p, {
888
- name: "ri:hourglass-line",
889
- class: "shrink-0"
890
- }), M(ve, {
891
- class: "truncate",
892
- date: d.metadata?.createdAt,
893
- "end-date": d.metadata?.completedAt
894
- }, null, 8, ["date", "end-date"])])) : k("", !0)
895
- ])) : k("", !0)]),
896
- _: 2
897
- }, 1024),
898
- M(E, { mode: "out-in" }, {
899
- default: B(() => [d.id === e.feedbackMessageId ? (I(), O(be, {
900
- key: 0,
901
- ref_for: !0,
902
- ref_key: "feedbackMessageEl",
903
- ref: En,
904
- loading: e.feedbackLoading,
905
- submitted: e.feedbackSubmitted,
906
- error: e.feedbackError,
907
- onSubmit: n[2] ||= (e) => t.$emit("feedback-submit", e),
908
- onClose: n[3] ||= (e) => t.$emit("feedback-close")
909
- }, null, 8, [
910
- "loading",
911
- "submitted",
912
- "error"
913
- ])) : k("", !0)]),
914
- _: 2
915
- }, 1024)
916
- ], 6)) : k("", !0)
917
- ], 64))), 128)),
918
- M(E, {
919
- appear: "",
920
- name: "pk-chatbot-part",
921
- onLeave: nn
922
- }, {
923
- default: B(() => [en.value ? (I(), A("div", {
924
- key: 0,
925
- class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
926
- style: je({ minHeight: tn.value ? `${G.value}px` : void 0 })
927
- }, [j("div", It, [j("div", Lt, [M(p, {
928
- name: "loading-loop",
929
- class: "shrink-0"
930
- }), j("span", Rt, L(R(i)("label.answeringOnTheCall")), 1)])])], 4)) : k("", !0)]),
931
- _: 1
932
- }),
933
- M(E, {
934
- appear: "",
935
- name: "pk-chatbot-part"
936
- }, {
937
- default: B(() => [$t.value ? (I(), O(_e, {
938
- key: 0,
939
- error: e.error,
940
- onRetry: n[4] ||= (e) => t.$emit("auto-retry"),
941
- onReset: n[5] ||= (e) => t.$emit("reset-chat")
942
- }, null, 8, ["error"])) : k("", !0)]),
943
- _: 1
944
- }),
945
- Xt.value?.role === "user" && !tn.value || $t.value ? (I(), A("div", {
946
- key: 0,
947
- class: "pk-chatbot-messages__spacer",
948
- style: je({ minHeight: `${G.value}px` })
949
- }, null, 4)) : k("", !0)
950
- ], 512),
951
- M(E, { name: "pk-chatbot-messages-fab" }, {
952
- default: B(() => [e.showScrollToBottom && (R(We) || !R(Ge)) ? (I(), A("button", {
953
- key: 0,
954
- type: "button",
955
- class: "pk-chatbot-messages__scroll-to-bottom",
956
- title: R(i)("action.scrollToBottom"),
957
- "aria-label": R(i)("action.scrollToBottom"),
958
- onClick: Ke
959
- }, [M(p, { name: "ri:arrow-down-line" })], 8, zt)) : k("", !0)]),
960
- _: 1
961
- })
962
- ], 46, st);
963
- };
964
- }
965
- });
966
- export { J as t };
967
-
968
- //# sourceMappingURL=PkChatbotMessages-qkodgdDE.js.map