@8wave/ai-elements 0.119.0-beta.31 → 0.119.0-beta.33

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