@8wave/ai-elements 0.115.0-beta.34 → 0.115.0-beta.52

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 (185) hide show
  1. package/README.md +1 -0
  2. package/dist/_chunks/{Agent-Cu04vBnd.js → Agent-CJbRpoZG.js} +133 -122
  3. package/dist/_chunks/Agent-CJbRpoZG.js.map +1 -0
  4. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js +256 -0
  5. package/dist/_chunks/PkChatbotFilePreview-DcqwX9nI.js.map +1 -0
  6. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js +42 -0
  7. package/dist/_chunks/PkHeldImage-BtaPh0Jr.js.map +1 -0
  8. package/dist/_chunks/{PkStreamingMarkdown-Qk9Tk_N7.js → PkStreamingMarkdown-B_qmgO9_.js} +801 -745
  9. package/dist/_chunks/PkStreamingMarkdown-B_qmgO9_.js.map +1 -0
  10. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js +41 -0
  11. package/dist/_chunks/PkToolEditSpreadsheet-BSxYLcys.js.map +1 -0
  12. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js → PkToolRequestGeolocation-YW0ilIxN.js} +2 -2
  13. package/dist/_chunks/{PkToolRequestGeolocation-BoKYkQ-Z.js.map → PkToolRequestGeolocation-YW0ilIxN.js.map} +1 -1
  14. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js → PkToolRequestOAuthConnection-Cx4aFL5g.js} +2 -2
  15. package/dist/_chunks/{PkToolRequestOAuthConnection-CDzpfBg6.js.map → PkToolRequestOAuthConnection-Cx4aFL5g.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js → PkToolShowArtifact-Bgj02cPe.js} +2 -2
  17. package/dist/_chunks/{PkToolShowArtifact-DB8JjN-b.js.map → PkToolShowArtifact-Bgj02cPe.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js → PkToolShowContactForm-Die8UpNv.js} +2 -2
  19. package/dist/_chunks/{PkToolShowContactForm-DHviNxDk.js.map → PkToolShowContactForm-Die8UpNv.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js → PkToolShowForm-Dmq95u6b.js} +5 -5
  21. package/dist/_chunks/{PkToolShowForm-B-R9fh3R.js.map → PkToolShowForm-Dmq95u6b.js.map} +1 -1
  22. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js +88 -0
  23. package/dist/_chunks/PkToolShowImageGallery-CKuyTxih.js.map +1 -0
  24. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js +72 -0
  25. package/dist/_chunks/PkToolShowProductList-DjS9nvXe.js.map +1 -0
  26. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js → PkToolShowSources-MJRFeqMA.js} +3 -3
  27. package/dist/_chunks/{PkToolShowSources-CfZEfleZ.js.map → PkToolShowSources-MJRFeqMA.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js → PkToolShowSuggestedReply-DPVS3C74.js} +2 -2
  29. package/dist/_chunks/{PkToolShowSuggestedReply-DsB35hRR.js.map → PkToolShowSuggestedReply-DPVS3C74.js.map} +1 -1
  30. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js +142 -0
  31. package/dist/_chunks/PkToolShowVideo-DnvvRE7H.js.map +1 -0
  32. package/dist/_chunks/{PkToolShowWebPages-BOxbTe2X.js → PkToolShowWebPages-CYbiGa7e.js} +31 -24
  33. package/dist/_chunks/PkToolShowWebPages-CYbiGa7e.js.map +1 -0
  34. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js +46 -0
  35. package/dist/_chunks/chatImagePolicy-C5eH4Cpq.js.map +1 -0
  36. package/dist/_chunks/{markdown-_p-gd9w8.js → markdown-qIVVfGoX.js} +146 -73
  37. package/dist/_chunks/markdown-qIVVfGoX.js.map +1 -0
  38. package/dist/ai-elements.es.js +2975 -3134
  39. package/dist/ai-elements.es.js.map +1 -1
  40. package/dist-vue/PkChatbot.js +1 -1
  41. package/dist-vue/PkChatbotEmptyState.js +1 -1
  42. package/dist-vue/PkChatbotFilePreview.js +1 -1
  43. package/dist-vue/PkChatbotInput.js +1 -1
  44. package/dist-vue/PkChatbotMessages.js +1 -1
  45. package/dist-vue/PkChatbotStepPayload.js +1 -1
  46. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  47. package/dist-vue/PkChatbotSteps.js +1 -1
  48. package/dist-vue/PkChatbotViewChat.js +1 -1
  49. package/dist-vue/PkChatbotViewConversations.js +1 -1
  50. package/dist-vue/PkChatbotViewFiles.js +1 -1
  51. package/dist-vue/PkChatbotViewProfile.js +1 -1
  52. package/dist-vue/_chunks/{Agent-KbZm8GvA.js → Agent---jwXeaB.js} +57 -46
  53. package/dist-vue/_chunks/Agent---jwXeaB.js.map +1 -0
  54. package/dist-vue/_chunks/{Document-DCSWwcRE.js → Document-DmBTgjd4.js} +150 -77
  55. package/dist-vue/_chunks/Document-DmBTgjd4.js.map +1 -0
  56. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js +275 -0
  57. package/dist-vue/_chunks/PkChatbot-W9tO1H9i.js.map +1 -0
  58. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js → PkChatbotEmptyState-BY3f3T0T.js} +2 -2
  59. package/dist-vue/_chunks/{PkChatbotEmptyState-CO7-vlsZ.js.map → PkChatbotEmptyState-BY3f3T0T.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkChatbotFilePreview-CwiVQDF2.js → PkChatbotFilePreview-Dq9JBX9U.js} +5 -3
  61. package/dist-vue/_chunks/PkChatbotFilePreview-Dq9JBX9U.js.map +1 -0
  62. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js → PkChatbotInput-C5l6QDQY.js} +3 -3
  63. package/dist-vue/_chunks/{PkChatbotInput-D8ykcHKJ.js.map → PkChatbotInput-C5l6QDQY.js.map} +1 -1
  64. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js +769 -0
  65. package/dist-vue/_chunks/PkChatbotMessages-3RZER9PO.js.map +1 -0
  66. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js → PkChatbotStepPayload-C-xnhmzZ.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotStepPayload-CSVHe7DP.js.map → PkChatbotStepPayload-C-xnhmzZ.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js → PkChatbotStepToolDetail-Cko1vU0N.js} +3 -3
  69. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ixte-rGB.js.map → PkChatbotStepToolDetail-Cko1vU0N.js.map} +1 -1
  70. package/dist-vue/_chunks/PkChatbotSteps-BkZ3Kq2M.js +191 -0
  71. package/dist-vue/_chunks/{PkChatbotSteps-Y6kQ00ui.js.map → PkChatbotSteps-BkZ3Kq2M.js.map} +1 -1
  72. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js +789 -0
  73. package/dist-vue/_chunks/PkChatbotViewChat-BFImSy1X.js.map +1 -0
  74. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js → PkChatbotViewConversations-C6T4ZxxX.js} +2 -2
  75. package/dist-vue/_chunks/{PkChatbotViewConversations-dpwDFyr_.js.map → PkChatbotViewConversations-C6T4ZxxX.js.map} +1 -1
  76. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js +125 -0
  77. package/dist-vue/_chunks/PkChatbotViewFiles-CMQdbZN6.js.map +1 -0
  78. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js → PkChatbotViewProfile-CDCy1LEX.js} +2 -2
  79. package/dist-vue/_chunks/{PkChatbotViewProfile-Brylm3We.js.map → PkChatbotViewProfile-CDCy1LEX.js.map} +1 -1
  80. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js +41 -0
  81. package/dist-vue/_chunks/PkHeldImage-BqnlurT_.js.map +1 -0
  82. package/dist-vue/_chunks/{PkStreamingMarkdown-CJlfq7ub.js → PkStreamingMarkdown-DJG-aPx2.js} +792 -780
  83. package/dist-vue/_chunks/PkStreamingMarkdown-DJG-aPx2.js.map +1 -0
  84. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js → PkSvgViewer-D1y8hZRW.js} +2 -2
  85. package/dist-vue/_chunks/{PkSvgViewer-D-0M5bqg.js.map → PkSvgViewer-D1y8hZRW.js.map} +1 -1
  86. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js +40 -0
  87. package/dist-vue/_chunks/PkToolEditSpreadsheet-BHh7NUdR.js.map +1 -0
  88. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js → PkToolRequestGeolocation-Ccbhljmn.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolRequestGeolocation-C8sLjD6g.js.map → PkToolRequestGeolocation-Ccbhljmn.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js → PkToolRequestOAuthConnection-BXf5ZRzR.js} +2 -2
  91. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-rbjNi_l0.js.map → PkToolRequestOAuthConnection-BXf5ZRzR.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js → PkToolShowArtifact-BsfbvfVC.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowArtifact-hBmAAfsd.js.map → PkToolShowArtifact-BsfbvfVC.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js → PkToolShowContactForm-C-YbtBlG.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowContactForm-BHsm_W2R.js.map → PkToolShowContactForm-C-YbtBlG.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js → PkToolShowDiagram-CIHVrQ3e.js} +3 -3
  97. package/dist-vue/_chunks/{PkToolShowDiagram-De2XvRnq.js.map → PkToolShowDiagram-CIHVrQ3e.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js → PkToolShowEmail-C591LR5N.js} +2 -2
  99. package/dist-vue/_chunks/{PkToolShowEmail-D1mXZrT-.js.map → PkToolShowEmail-C591LR5N.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js → PkToolShowForm-BwYJhEVO.js} +6 -6
  101. package/dist-vue/_chunks/{PkToolShowForm-Ce_GpcBt.js.map → PkToolShowForm-BwYJhEVO.js.map} +1 -1
  102. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js +88 -0
  103. package/dist-vue/_chunks/PkToolShowImageGallery-1A9zyOVn.js.map +1 -0
  104. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js → PkToolShowMessage-CbXERPHI.js} +2 -2
  105. package/dist-vue/_chunks/{PkToolShowMessage-lNPZxw2v.js.map → PkToolShowMessage-CbXERPHI.js.map} +1 -1
  106. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js +72 -0
  107. package/dist-vue/_chunks/PkToolShowProductList-D61i6AMs.js.map +1 -0
  108. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js → PkToolShowSources-BQpdJE_m.js} +4 -4
  109. package/dist-vue/_chunks/{PkToolShowSources-B1Nhrk7O.js.map → PkToolShowSources-BQpdJE_m.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js → PkToolShowSuggestedReply-D3jLsbKJ.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowSuggestedReply-Bmzygdww.js.map → PkToolShowSuggestedReply-D3jLsbKJ.js.map} +1 -1
  112. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js +141 -0
  113. package/dist-vue/_chunks/PkToolShowVideo-DUdkb3qb.js.map +1 -0
  114. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js +86 -0
  115. package/dist-vue/_chunks/PkToolShowWebPages-BeeBiv9R.js.map +1 -0
  116. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js → PkUrl-CN1kkZiH.js} +2 -2
  117. package/dist-vue/_chunks/{PkUrl-E12f7rn_.js.map → PkUrl-CN1kkZiH.js.map} +1 -1
  118. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js → createChatbotApiClient-CDrs7NwO.js} +13 -9
  119. package/dist-vue/_chunks/{createChatbotApiClient-B_mkyrEl.js.map → createChatbotApiClient-CDrs7NwO.js.map} +1 -1
  120. package/dist-vue/_chunks/{useChatbotStore-DEELIJ89.js → useChatbotStore-D6YNk8Rx.js} +6 -4
  121. package/dist-vue/_chunks/useChatbotStore-D6YNk8Rx.js.map +1 -0
  122. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js +71 -0
  123. package/dist-vue/_chunks/useShortUrlResolver-DI8ycJiO.js.map +1 -0
  124. package/dist-vue/_chunks/utils-roi6YVNC.js +199 -0
  125. package/dist-vue/_chunks/utils-roi6YVNC.js.map +1 -0
  126. package/dist-vue/api.js +1 -1
  127. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +2 -0
  128. package/dist-vue/composables.js +73 -13
  129. package/dist-vue/composables.js.map +1 -1
  130. package/dist-vue/index.js +3614 -3559
  131. package/dist-vue/index.js.map +1 -1
  132. package/dist-vue/locales.js +26 -14
  133. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -2
  134. package/dist-vue/packages/components/src/chat/PkChatbotFilePreview.d.ts +5 -0
  135. package/dist-vue/packages/components/src/chat/PkHeldImage.d.ts +21 -0
  136. package/dist-vue/packages/components/src/chat/PkToolEditSpreadsheet.d.ts +14 -0
  137. package/dist-vue/packages/components/src/chat/chatImagePolicy.d.ts +55 -0
  138. package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
  139. package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +17 -1
  140. package/dist-vue/packages/components/src/chat/utils.d.ts +8 -0
  141. package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +7 -1
  142. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -0
  143. package/dist-vue/packages/composable/src/useFileRow.d.ts +21 -0
  144. package/dist-vue/packages/models/src/schema/Agent.d.ts +28 -0
  145. package/dist-vue/packages/models/src/schema/Document.d.ts +173 -0
  146. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +2 -0
  147. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +2 -0
  148. package/dist-vue/packages/models/src/schema/Tabular.d.ts +181 -0
  149. package/dist-vue/packages/models/src/schema/index.d.ts +1 -0
  150. package/dist-vue/style.css +1 -1
  151. package/package.json +1 -1
  152. package/dist/_chunks/Agent-Cu04vBnd.js.map +0 -1
  153. package/dist/_chunks/PkStreamingMarkdown-Qk9Tk_N7.js.map +0 -1
  154. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js +0 -75
  155. package/dist/_chunks/PkToolShowImageGallery-FubPWFCb.js.map +0 -1
  156. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js +0 -65
  157. package/dist/_chunks/PkToolShowProductList-DFy2jxn4.js.map +0 -1
  158. package/dist/_chunks/PkToolShowVideo-DClps9oP.js +0 -123
  159. package/dist/_chunks/PkToolShowVideo-DClps9oP.js.map +0 -1
  160. package/dist/_chunks/PkToolShowWebPages-BOxbTe2X.js.map +0 -1
  161. package/dist/_chunks/markdown-_p-gd9w8.js.map +0 -1
  162. package/dist-vue/_chunks/Agent-KbZm8GvA.js.map +0 -1
  163. package/dist-vue/_chunks/Document-DCSWwcRE.js.map +0 -1
  164. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js +0 -272
  165. package/dist-vue/_chunks/PkChatbot-CRb-U8e3.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +0 -1
  167. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js +0 -769
  168. package/dist-vue/_chunks/PkChatbotMessages-UT72KC_z.js.map +0 -1
  169. package/dist-vue/_chunks/PkChatbotSteps-Y6kQ00ui.js +0 -191
  170. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js +0 -784
  171. package/dist-vue/_chunks/PkChatbotViewChat-D3PwREDw.js.map +0 -1
  172. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js +0 -111
  173. package/dist-vue/_chunks/PkChatbotViewFiles-BStYLY2B.js.map +0 -1
  174. package/dist-vue/_chunks/PkStreamingMarkdown-CJlfq7ub.js.map +0 -1
  175. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js +0 -75
  176. package/dist-vue/_chunks/PkToolShowImageGallery-DmhZLnBk.js.map +0 -1
  177. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js +0 -65
  178. package/dist-vue/_chunks/PkToolShowProductList-BW5pRFe4.js.map +0 -1
  179. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js +0 -122
  180. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js.map +0 -1
  181. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js +0 -79
  182. package/dist-vue/_chunks/PkToolShowWebPages-BiIBRV_n.js.map +0 -1
  183. package/dist-vue/_chunks/useChatbotStore-DEELIJ89.js.map +0 -1
  184. package/dist-vue/_chunks/utils-CtD8DCrq.js +0 -184
  185. package/dist-vue/_chunks/utils-CtD8DCrq.js.map +0 -1
@@ -0,0 +1,769 @@
1
+ import { k as e } from "./Agent---jwXeaB.js";
2
+ import { t } from "./PkStreamingMarkdown-DJG-aPx2.js";
3
+ import "./src-DT8FLE4_.js";
4
+ import { a as n, c as r, o as i, r as a, s as o, t as s } from "./message-RohfrdWS.js";
5
+ import { t as c } from "./PkChatbotError-CRGbK09-.js";
6
+ import { t as l } from "./PkRelativeTime--1cIphlA.js";
7
+ import { C as u, S as d, a as f, b as p, d as m, f as h, i as g, l as _, m as ee, n as te, p as ne, t as v, v as re, w as ie, x as ae } from "./utils-roi6YVNC.js";
8
+ import { t as oe } from "./PkChatbotFilePreview-Dq9JBX9U.js";
9
+ import { t as y } from "./PkChatbotFeedbackForm-h4mjmVTG.js";
10
+ import { t as b } from "./PkChatbotMessageFeedback-BYmrVaCE.js";
11
+ import { n as se, t as ce } from "./PkChatbotSteps-BkZ3Kq2M.js";
12
+ import { t as le } from "./PkChatbotOutlineRail-np4g6vsz.js";
13
+ import { VvButton as ue, VvButtonGroup as de, VvIcon as fe } from "@volverjs/ui-vue/components";
14
+ import { Fragment as x, Transition as S, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createTextVNode as pe, createVNode as O, defineAsyncComponent as k, defineComponent as A, mergeProps as me, nextTick as j, normalizeClass as M, normalizeStyle as N, onBeforeUnmount as P, onMounted as he, openBlock as F, ref as I, renderList as ge, renderSlot as _e, resolveDynamicComponent as ve, toDisplayString as L, unref as R, useSlots as ye, useTemplateRef as be, watch as z, withCtx as B, withModifiers as V } from "vue";
15
+ import { useI18n as xe } from "vue-i18n";
16
+ //#region ../../packages/utils/src/text.ts
17
+ var H = (e) => e.normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Se = (e) => e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[-_]+/g, " ") : "", Ce = (e) => e ? H(e).replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[^a-zA-Z0-9]+/g, "-").toLowerCase() : "", we = (e) => e ? H(e).replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").toLowerCase() : "", Te = (e) => e ? e.charAt(0).toUpperCase() + e.slice(1) : "", Ee = {
18
+ requestOAuthConnection: k(() => import("./PkToolRequestOAuthConnection-BXf5ZRzR.js")),
19
+ showArtifact: k(() => import("./PkToolShowArtifact-BsfbvfVC.js").then((e) => e.n)),
20
+ showCalendarEvent: k(() => import("./PkToolShowCalendarEvent-yttlTHiX.js").then((e) => e.n)),
21
+ showComparison: k(() => import("./PkToolShowComparison-DQs3E6-k.js").then((e) => e.n)),
22
+ showContactForm: k(() => import("./PkToolShowContactForm-C-YbtBlG.js").then((e) => e.n)),
23
+ showDiagram: k(() => import("./PkToolShowDiagram-CIHVrQ3e.js")),
24
+ showEmail: k(() => import("./PkToolShowEmail-C591LR5N.js").then((e) => e.n)),
25
+ showImageGallery: k(() => import("./PkToolShowImageGallery-1A9zyOVn.js").then((e) => e.n)),
26
+ showLocation: k(() => import("./PkToolShowLocation-Bv6sLN5P.js").then((e) => e.n)),
27
+ showMessage: k(() => import("./PkToolShowMessage-CbXERPHI.js").then((e) => e.n)),
28
+ showForm: k(() => import("./PkToolShowForm-BwYJhEVO.js").then((e) => e.n)),
29
+ showMultipleChoice: k(() => import("./PkToolShowForm-BwYJhEVO.js").then((e) => e.n)),
30
+ showProductList: k(() => import("./PkToolShowProductList-D61i6AMs.js").then((e) => e.n)),
31
+ showQrCode: k(() => import("./PkToolShowQrCode-DEAvfLFu.js").then((e) => e.n)),
32
+ showSources: k(() => import("./PkToolShowSources-BQpdJE_m.js").then((e) => e.n)),
33
+ showSuggestedReply: k(() => import("./PkToolShowSuggestedReply-D3jLsbKJ.js").then((e) => e.n)),
34
+ showVideo: k(() => import("./PkToolShowVideo-DUdkb3qb.js")),
35
+ showWeather: k(() => import("./PkToolShowWeather-Bzqalzh8.js")),
36
+ showWebPages: k(() => import("./PkToolShowWebPages-BeeBiv9R.js").then((e) => e.n))
37
+ }, U = {
38
+ key: 0,
39
+ class: "text-12 text-word-3 m-0 mb-xs"
40
+ }, W = /* @__PURE__ */ A({
41
+ __name: "PkToolApprovalPreviewMessage",
42
+ props: { input: {} },
43
+ setup(e) {
44
+ let t = e, n = C(() => {
45
+ let e = t.input;
46
+ return typeof e?.message == "string" ? e.message : "";
47
+ });
48
+ return (e, t) => n.value ? (F(), E("p", U, L(n.value), 1)) : T("", !0);
49
+ }
50
+ }), De = { [v]: W }, Oe = {
51
+ key: 0,
52
+ class: "text-12 text-word-3 m-0 mb-xs"
53
+ }, ke = /* @__PURE__ */ A({
54
+ __name: "PkToolApprovalCard",
55
+ props: {
56
+ part: {},
57
+ actionable: { type: Boolean },
58
+ callVerdict: { type: Boolean }
59
+ },
60
+ emits: ["respond"],
61
+ setup(t, { emit: n }) {
62
+ let r = t, i = n, { t: o } = xe({ useScope: "global" }), s = C(() => r.part), c = C(() => a(r.part)), l = C(() => c.value === v), u = C(() => l.value ? (s.value.state === "input-available" || e(s.value.output)) && r.callVerdict === void 0 : s.value.state === "approval-requested"), d = C(() => u.value && r.actionable === !0), f = C(() => u.value && r.actionable !== !0), p = C(() => l.value ? s.value.output === "confirmed" || r.callVerdict === !0 : s.value.approval?.approved === !0), m = C(() => l.value ? s.value.output === "cancelled" || r.callVerdict === !1 : s.value.approval?.approved === !1 || s.value.state === "output-denied"), h = C(() => De[c.value]), g = C(() => {
63
+ if (f.value) return {
64
+ icon: "ri:time-line",
65
+ message: o("toolApproval.expired")
66
+ };
67
+ if (p.value) return {
68
+ icon: "ri:check-line",
69
+ message: o(l.value ? "toolApproval.confirmed" : "toolApproval.approved")
70
+ };
71
+ if (m.value) return {
72
+ icon: "ri:close-line",
73
+ message: o(l.value ? "toolApproval.cancelled" : "toolApproval.denied")
74
+ };
75
+ }), _ = C(() => !!g.value && !h.value);
76
+ return (e, n) => {
77
+ let r = ue, a = de, c = fe;
78
+ return F(), E("div", { class: M(["w-full overflow-hidden transition-all duration-300", { "bg-surface p-sm rounded-xl border border-surface-3": !_.value }]) }, [
79
+ O(S, null, {
80
+ default: B(() => [!l.value && u.value ? (F(), E("p", Oe, L(R(o)("toolApproval.prompt")), 1)) : T("", !0)]),
81
+ _: 1
82
+ }),
83
+ h.value ? (F(), w(ve(h.value), {
84
+ key: 0,
85
+ part: t.part,
86
+ input: s.value.input
87
+ }, null, 8, ["part", "input"])) : T("", !0),
88
+ O(S, { mode: "out-in" }, {
89
+ default: B(() => [g.value ? (F(), E("p", {
90
+ key: 1,
91
+ class: M(["flex items-center gap-4 text-12 text-word-3 m-0", { "mt-xs": h.value }])
92
+ }, [O(c, {
93
+ name: g.value.icon,
94
+ class: "shrink-0"
95
+ }, null, 8, ["name"]), pe(" " + L(g.value.message), 1)], 2)) : (F(), w(a, { key: 0 }, {
96
+ default: B(() => [O(r, {
97
+ modifiers: "primary-small",
98
+ disabled: !d.value,
99
+ icon: "ri:check-line",
100
+ label: R(o)("action.proceed"),
101
+ onClick: n[0] ||= V((e) => i("respond", !0), ["stop"])
102
+ }, null, 8, ["disabled", "label"]), O(r, {
103
+ modifiers: "action-quiet-small",
104
+ disabled: !d.value,
105
+ icon: "ri:close-line",
106
+ label: R(o)("action.cancel"),
107
+ onClick: n[1] ||= V((e) => i("respond", !1), ["stop"])
108
+ }, null, 8, ["disabled", "label"])]),
109
+ _: 1
110
+ }))]),
111
+ _: 1
112
+ })
113
+ ], 2);
114
+ };
115
+ }
116
+ }), Ae = 30, G = 500;
117
+ function je(e) {
118
+ let { scrollEl: t, status: n, messagesLength: r, lastMessageRole: i, contentEl: a, beforeNewMessageScroll: o, onScrollUp: s, onScrollDown: c } = e, l = I(!1), u = I(!0), d = !1, f = null, p = null, m = null, h = null, g = 0, _ = (e = "smooth") => {
119
+ !t.value || l.value ? d = !1 : (d = !0, t.value.scrollTo({
120
+ top: t.value.scrollHeight,
121
+ behavior: e
122
+ }), setTimeout(() => {
123
+ d = !1;
124
+ }, e === "instant" ? 0 : G));
125
+ }, ee = (e) => {
126
+ e.deltaY < 0 && (l.value = !0);
127
+ }, te = 0, ne = (e) => {
128
+ te = e.touches[0]?.clientY ?? 0;
129
+ }, v = (e) => {
130
+ let t = e.touches[0]?.clientY ?? 0;
131
+ t > te && (l.value = !0), te = t;
132
+ }, re = () => {
133
+ if (!t.value) return;
134
+ let { scrollTop: e, scrollHeight: n, clientHeight: r } = t.value;
135
+ u.value = n - r - e < Ae, d || (e < g && s?.(), e > g && (u.value && (l.value = !1), c?.())), g = e;
136
+ }, ie = () => {
137
+ if (d || l.value || !t.value) return;
138
+ let e = t.value, n = e.scrollHeight - e.clientHeight;
139
+ n <= e.scrollTop || (u.value = !0, d = !0, e.scrollTop = n, requestAnimationFrame(() => {
140
+ d = !1;
141
+ }));
142
+ }, ae = () => {
143
+ !f && t.value && (f = new MutationObserver(ie), f.observe(t.value, {
144
+ childList: !0,
145
+ subtree: !0,
146
+ characterData: !0
147
+ }));
148
+ }, oe = () => {
149
+ f?.disconnect(), f = null;
150
+ };
151
+ z(n, (e, t) => {
152
+ e === "streaming" || e === "submitted" ? ae() : (e !== "ready" || t !== "streaming") && oe();
153
+ }), z(r, async () => {
154
+ if (r() && i() !== "assistant") {
155
+ se(), l.value = !1, d = !0;
156
+ try {
157
+ await j(), await o?.(), await j();
158
+ } finally {
159
+ _();
160
+ }
161
+ }
162
+ });
163
+ let y = null, b = () => {
164
+ t.value && (t.value.scrollHeight <= t.value.clientHeight || (t.value.scrollTop = t.value.scrollHeight, y && clearTimeout(y), y = setTimeout(se, 300)));
165
+ }, se = () => {
166
+ p?.disconnect(), p = null, m?.disconnect(), m = null, y &&= (clearTimeout(y), null);
167
+ };
168
+ return he(() => {
169
+ if (!t.value) return;
170
+ t.value.addEventListener("wheel", ee, { passive: !0 }), t.value.addEventListener("touchstart", ne, { passive: !0 }), t.value.addEventListener("touchmove", v, { passive: !0 });
171
+ let e = n() === "submitted" || n() === "streaming";
172
+ e ? ae() : (p = new ResizeObserver(b), p.observe(t.value), m = new MutationObserver(b), m.observe(t.value, {
173
+ childList: !0,
174
+ subtree: !0
175
+ }));
176
+ let r = a?.() ?? t.value.firstElementChild;
177
+ r && (h = new ResizeObserver(ie), h.observe(r)), e || b();
178
+ }), P(() => {
179
+ t.value?.removeEventListener("wheel", ee), t.value?.removeEventListener("touchstart", ne), t.value?.removeEventListener("touchmove", v), h?.disconnect(), h = null, oe(), se();
180
+ }), {
181
+ handleScroll: re,
182
+ scrollToBottom: _,
183
+ userScrolledUp: l,
184
+ isAtBottom: u
185
+ };
186
+ }
187
+ //#endregion
188
+ //#region ../../packages/components/src/chat/PkChatbotMessages.vue?vue&type=script&setup=true&lang.ts
189
+ var Me = ["aria-busy"], Ne = {
190
+ key: 0,
191
+ class: "pk-chatbot-messages__outline"
192
+ }, Pe = {
193
+ key: 0,
194
+ class: "pk-chatbot-divider"
195
+ }, Fe = { class: "pk-chatbot-divider__label" }, Ie = { class: "pk-chatbot-message__text" }, Le = ["title"], Re = {
196
+ key: 0,
197
+ class: "pk-chatbot-message__reaction-emoji"
198
+ }, ze = {
199
+ key: 0,
200
+ class: "pk-chatbot-message__loading-info"
201
+ }, Be = { class: "flex gap-8 items-center" }, Ve = { class: "font-mono rounded text-12" }, He = { class: "flex gap-8 items-center" }, Ue = {
202
+ key: 0,
203
+ class: "pk-chatbot-message__footer"
204
+ }, We = {
205
+ key: 0,
206
+ class: "pk-chatbot-message__hover-meta"
207
+ }, Ge = ["datetime", "title"], Ke = { class: "truncate" }, qe = {
208
+ key: 0,
209
+ class: "flex items-center gap-4 min-w-0"
210
+ }, Je = { class: "truncate" }, Ye = ["title"], Xe = {
211
+ key: 2,
212
+ class: "flex items-center gap-4 text-12 text-word-3"
213
+ }, Ze = { class: "truncate" }, Qe = ["datetime"], $e = { class: "truncate" }, et = {
214
+ key: 4,
215
+ class: "flex items-center gap-4 text-12 text-word-3"
216
+ }, tt = { class: "pk-chatbot-message__loading-info" }, nt = { class: "flex gap-8 items-center" }, rt = { class: "text-12" }, it = ["title", "aria-label"], at = /* @__PURE__ */ A({
217
+ __name: "PkChatbotMessages",
218
+ props: {
219
+ status: {},
220
+ messages: {},
221
+ error: {},
222
+ actions: {},
223
+ mainColor: {},
224
+ textColor: {},
225
+ revisedAnswers: {},
226
+ messageFeedbacks: {},
227
+ readonlyFeedback: { type: Boolean },
228
+ disableHeightAdjustment: { type: Boolean },
229
+ showMessageDateTime: { type: Boolean },
230
+ showMessageTokensCount: { type: Boolean },
231
+ showMessageNumber: { type: Boolean },
232
+ showAllMessageParts: { type: Boolean },
233
+ interactive: { type: Boolean },
234
+ showExtendedSteps: { type: Boolean },
235
+ awaitingSpokenAnswer: { type: Boolean },
236
+ confirmVerdictsOnCall: {},
237
+ isDark: { type: Boolean },
238
+ showScrollToBottom: { type: Boolean },
239
+ feedbackMessageId: {},
240
+ feedbackLoading: { type: Boolean },
241
+ feedbackSubmitted: { type: Boolean },
242
+ feedbackError: {}
243
+ },
244
+ emits: [
245
+ "show-info",
246
+ "regenerate",
247
+ "revise",
248
+ "upvote",
249
+ "downvote",
250
+ "feedback",
251
+ "feedback-submit",
252
+ "feedback-close",
253
+ "scroll-up",
254
+ "scroll-down",
255
+ "auto-retry",
256
+ "reset-chat",
257
+ "approval-respond",
258
+ "confirm-respond"
259
+ ],
260
+ setup(e, { emit: v }) {
261
+ let k = e, A = v, { t: P, d: H, n: Se } = xe({ useScope: "global" }), we = ye(), Te = (e, t) => {
262
+ if (ae(e)) {
263
+ let n = e.toolCallId;
264
+ n && A("confirm-respond", {
265
+ toolCallId: n,
266
+ confirmed: t
267
+ });
268
+ return;
269
+ }
270
+ let n = ne(e);
271
+ n && A("approval-respond", {
272
+ id: n,
273
+ approved: t
274
+ });
275
+ }, U = be("scrollEl"), W = be("wrapperEl"), De = C(() => ie(k.textColor, k.mainColor)), { handleScroll: Oe, scrollToBottom: Ae, userScrolledUp: G, isAtBottom: at } = je({
276
+ scrollEl: U,
277
+ status: () => k.status,
278
+ messagesLength: () => k.messages?.length,
279
+ lastMessageRole: () => k.messages?.[k.messages.length - 1]?.role,
280
+ contentEl: () => W.value,
281
+ beforeNewMessageScroll: () => pt(),
282
+ onScrollUp: () => A("scroll-up"),
283
+ onScrollDown: () => A("scroll-down")
284
+ }), ot = () => {
285
+ G.value = !1, Ae();
286
+ }, K = C(() => (k.messages ?? []).filter((e) => e.role === "user").map((e) => ({
287
+ id: e.id,
288
+ preview: e.parts.find(o)?.text.trim().slice(0, 120) || "…"
289
+ }))), st = I(), ct = () => U.value?.querySelectorAll(".pk-chatbot-message--user") ?? [], lt = () => {
290
+ let e = U.value;
291
+ if (!e || !k.showScrollToBottom) return;
292
+ let t = e.getBoundingClientRect().top + e.clientHeight / 2, n = K.value[0]?.id;
293
+ ct().forEach((e, r) => {
294
+ e.getBoundingClientRect().top <= t && (n = K.value[r]?.id);
295
+ }), st.value = n;
296
+ };
297
+ z(K, async () => {
298
+ await j(), lt();
299
+ });
300
+ let ut = () => {
301
+ Oe(), lt();
302
+ }, dt = (e) => {
303
+ let t = U.value, n = K.value.findIndex((t) => t.id === e), r = ct()[n];
304
+ t && r && (G.value = !0, t.scrollTo({
305
+ top: t.scrollTop + r.getBoundingClientRect().top - t.getBoundingClientRect().top - Number.parseFloat(getComputedStyle(t).paddingTop),
306
+ behavior: "smooth"
307
+ }));
308
+ }, q = I(0), ft = I(!1), pt = async () => {
309
+ let e = k.messages;
310
+ if (!e?.length || k.disableHeightAdjustment || e[e.length - 1].role !== "user" && k.status !== "submitted" && k.status !== "streaming" || (ft.value = !1, await j(), !U.value)) return;
311
+ let { paddingTop: t, paddingBottom: n } = getComputedStyle(U.value), r = U.value.clientHeight - Number.parseFloat(t) - Number.parseFloat(n), i = W.value && Number.parseFloat(getComputedStyle(W.value).rowGap) || 0, a = ct(), o = r - (a[a.length - 1]?.clientHeight ?? 0) - i;
312
+ r > 0 && (q.value = Math.max(o, 0)), await j();
313
+ };
314
+ z(() => [k.messages?.length, k.messages?.[k.messages.length - 1]?.id], () => pt()), he(() => {
315
+ (k.status === "submitted" || k.status === "streaming" || k.awaitingSpokenAnswer) && pt();
316
+ }), z(() => k.status, (e) => {
317
+ (e === "ready" || e === "error") && (ft.value = !0, q.value = 0);
318
+ });
319
+ let J = (e) => k.revisedAnswers?.some((t) => t.messageId === e), Y = (e) => k.messageFeedbacks?.find((t) => t.messageId === e), mt = (e, t) => !k.readonlyFeedback && Mt(e, t), ht = (e) => k.readonlyFeedback ? Y(e) : void 0, gt = (e) => ht(e)?.vote, _t = (e) => {
320
+ let t = ht(e);
321
+ if (t?.vote) return;
322
+ let n = t?.metadata?.reactionEmoji;
323
+ return typeof n == "string" && /\p{Extended_Pictographic}/u.test(n) ? n : void 0;
324
+ }, vt = (e) => !!(gt(e) || _t(e)), yt = (e) => {
325
+ if (_t(e)) return "pk-chatbot-message__reaction--neutral";
326
+ let t = gt(e);
327
+ return t === "upvote" ? "pk-chatbot-message__reaction--positive" : t === "downvote" ? "pk-chatbot-message__reaction--negative" : "pk-chatbot-message__reaction--neutral";
328
+ }, bt = (e) => {
329
+ let t = gt(e);
330
+ return P(t === "upvote" ? "hint.userFeedbackPositive" : t === "downvote" ? "hint.userFeedbackNegative" : "hint.userFeedbackReaction");
331
+ }, xt = (e) => {
332
+ let t = wt(e);
333
+ for (let e = t.length - 1; e >= 0; --e) if (o(t[e])) return e;
334
+ return -1;
335
+ }, St = C(() => k.messages?.[k.messages.length - 1]), X = C(() => {
336
+ let e = St.value;
337
+ return e ? e.parts[e.parts.length - 1] : null;
338
+ }), Ct = C(() => {
339
+ let e = /* @__PURE__ */ new Map();
340
+ for (let t of k.messages ?? []) t.role === "assistant" && e.set(t.id, u(g(d(t.parts))));
341
+ return e;
342
+ }), wt = (e) => Ct.value.get(e.id) ?? e.parts, Z = C(() => k.status === "submitted" || k.status === "streaming"), Tt = C(() => k.status === "error"), Et = C(() => k.awaitingSpokenAnswer === !0 && !Z.value), Dt = C(() => Et.value && St.value?.role === "user" && !Tt.value), Ot = C(() => {
343
+ let e = X.value;
344
+ return ee(P, e);
345
+ }), kt = C(() => {
346
+ let e = X.value;
347
+ return m(e);
348
+ }), At = (e) => k.messages?.findIndex((t) => t.id === e), Q = (e) => e === void 0 || !k.messages ? !1 : e === k.messages.length - 1, jt = (e) => Q(e) && k.status === "ready" && !!k.actions?.includes("regenerate"), Mt = (e, t) => (!Q(t) || k.status === "ready") && !!k.actions?.includes(e), Nt = (e) => {
349
+ let t = e.parts[e.parts.length - 1];
350
+ return o(t);
351
+ }, Pt = (e) => e.parts.some((e) => i(e) || r(e)), Ft = (e) => !!k.showExtendedSteps && $(e) && Pt(e), It = (e) => r(e) && !p(e) && !!(Ee[a(e)] || we[e.type] || k.showAllMessageParts), Lt = (e) => e.parts.some((e) => o(e) && !!e.text.trim() || n(e) || re(e) && !p(e) || It(e)), $ = (e) => e.role === "assistant", Rt = (e) => e.role === "user", zt = (e) => k.messages?.slice(0, e).reverse().find((e) => $(e)), Bt = (e) => k.messages?.slice(e + 1).find((e) => $(e)), Vt = (e) => {
352
+ let t = zt(e)?.metadata?.createdAt, n = Bt(e)?.metadata?.createdAt;
353
+ if (!t || !n) return;
354
+ let r = new Date(t), i = new Date(n);
355
+ return r.toDateString() === i.toDateString() ? void 0 : i;
356
+ }, Ht = C(() => {
357
+ let e = 0;
358
+ return (k.messages ?? []).map((t) => t.parts.length > 0 ? ++e : void 0);
359
+ }), Ut = (e, t) => t === 0 || e.role !== "assistant" ? !1 : !!(k.actions?.length || k.showMessageNumber || k.showMessageDateTime && e.metadata?.createdAt !== void 0 || e.metadata?.completedAt !== void 0 || k.showMessageTokensCount && e.metadata?.totalTokens !== void 0), Wt = (e) => {
360
+ let t = new Date(e), n = t.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
361
+ return H(t, n ? "time" : "date-time");
362
+ }, Gt = (e) => {
363
+ let { createdAt: t, completedAt: n } = e.metadata ?? {};
364
+ if (t && n) return _(Se, n - t);
365
+ }, Kt = be("feedbackMessageEl");
366
+ return z(() => k.feedbackMessageId, async () => {
367
+ if (await j(), !k.feedbackMessageId) return;
368
+ let e = Kt.value?.[0]?.$el;
369
+ e && (Q(At(k.feedbackMessageId)) ? Ae() : e.scrollIntoView({
370
+ behavior: "smooth",
371
+ block: "center"
372
+ }));
373
+ }), (r, i) => {
374
+ let u = fe, d = ue, g = de;
375
+ return F(), E("div", {
376
+ ref_key: "scrollEl",
377
+ ref: U,
378
+ class: M(["pk-chatbot-messages", { "pk-chatbot-messages--settling": ft.value }]),
379
+ role: "log",
380
+ "aria-live": "polite",
381
+ "aria-relevant": "additions text",
382
+ "aria-busy": Z.value,
383
+ style: N({
384
+ "--chatbot-main-color": e.mainColor,
385
+ "--chatbot-contrast-color": De.value
386
+ }),
387
+ onScroll: ut
388
+ }, [
389
+ e.showScrollToBottom && K.value.length > 1 ? (F(), E("div", Ne, [O(le, {
390
+ items: K.value,
391
+ "active-id": st.value,
392
+ onSelect: dt
393
+ }, null, 8, ["items", "active-id"])])) : T("", !0),
394
+ D("div", {
395
+ ref_key: "wrapperEl",
396
+ ref: W,
397
+ class: "pk-chatbot-messages__wrapper"
398
+ }, [
399
+ (F(!0), E(x, null, ge(e.messages, (c, _) => (F(), E(x, { key: c.id }, [Rt(c) && Vt(_) ? (F(), E("div", Pe, [D("span", Fe, L(R(H)(Vt(_), "short")), 1)])) : T("", !0), c.parts.length || Q(_) && Z.value && $(c) ? (F(), E("div", {
400
+ key: 1,
401
+ class: M(["pk-chatbot-message", [`pk-chatbot-message--${c.role}`, { "pk-chatbot-message--loading": Z.value && Q(_) && $(c) }]]),
402
+ style: N({ minHeight: Q(_) && $(c) && !Tt.value ? `${q.value}px` : void 0 })
403
+ }, [
404
+ O(S, {
405
+ appear: "",
406
+ name: "pk-chatbot-part"
407
+ }, {
408
+ default: B(() => [Ft(c) ? (F(), w(ce, {
409
+ key: 0,
410
+ message: c,
411
+ "is-streaming": Z.value && Q(_),
412
+ "has-content": Lt(c),
413
+ "is-dark": e.isDark
414
+ }, null, 8, [
415
+ "message",
416
+ "is-streaming",
417
+ "has-content",
418
+ "is-dark"
419
+ ])) : T("", !0)]),
420
+ _: 2
421
+ }, 1024),
422
+ (F(!0), E(x, null, ge(wt(c), (i, l) => (F(), E(x, { key: R(f)(i, l) }, [R(o)(i) && i.text.trim() ? (F(), w(S, {
423
+ key: 0,
424
+ appear: "",
425
+ name: "pk-chatbot-part"
426
+ }, {
427
+ default: B(() => [D("div", Ie, [_e(r.$slots, "text", me({ ref_for: !0 }, {
428
+ message: c,
429
+ part: i,
430
+ index: _,
431
+ isLoading: Z.value
432
+ }), () => [$(c) ? (F(), w(t, {
433
+ key: 0,
434
+ class: "wysiwyg",
435
+ markdown: i.text,
436
+ "is-dark": e.isDark,
437
+ loading: Q(_) && e.status === "streaming"
438
+ }, null, 8, [
439
+ "markdown",
440
+ "is-dark",
441
+ "loading"
442
+ ])) : (F(), E(x, { key: 1 }, [pe(L(i.text), 1)], 64))]), vt(c.id) && !Y(c.id)?.comment && l === xt(c) ? (F(), E("span", {
443
+ key: 0,
444
+ class: M(["pk-chatbot-message__reaction", yt(c.id)]),
445
+ title: bt(c.id)
446
+ }, [_t(c.id) ? (F(), E("span", Re, L(_t(c.id)), 1)) : (F(), w(u, {
447
+ key: 1,
448
+ name: gt(c.id) === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-up-fill"
449
+ }, null, 8, ["name"]))], 10, Le)) : T("", !0)])]),
450
+ _: 2
451
+ }, 1024)) : R(n)(i) ? (F(), w(S, {
452
+ key: 1,
453
+ appear: "",
454
+ name: "pk-chatbot-part"
455
+ }, {
456
+ default: B(() => [O(oe, {
457
+ "media-type": i.mediaType,
458
+ url: i.url,
459
+ filename: i.filename,
460
+ size: R(s)(i)?.bytesCount
461
+ }, null, 8, [
462
+ "media-type",
463
+ "url",
464
+ "filename",
465
+ "size"
466
+ ])]),
467
+ _: 2
468
+ }, 1024)) : R(re)(i) && !R(p)(i) ? (F(), w(S, {
469
+ key: 2,
470
+ appear: "",
471
+ name: "pk-chatbot-part"
472
+ }, {
473
+ default: B(() => [(F(), w(ke, {
474
+ key: `approval-${l}`,
475
+ part: i,
476
+ actionable: e.interactive === !0 && (R(ae)(i) || Q(_)),
477
+ "call-verdict": e.confirmVerdictsOnCall?.get(i.toolCallId ?? ""),
478
+ onRespond: (e) => Te(i, e)
479
+ }, null, 8, [
480
+ "part",
481
+ "actionable",
482
+ "call-verdict",
483
+ "onRespond"
484
+ ]))]),
485
+ _: 2
486
+ }, 1024)) : It(i) ? (F(), w(S, {
487
+ key: 3,
488
+ appear: "",
489
+ name: "pk-chatbot-part"
490
+ }, {
491
+ default: B(() => [!R(we)[i.type] && R(Ee)[R(a)(i)] ? (F(), w(ve(R(Ee)[R(a)(i)]), {
492
+ key: `component-${l}-${R(h)(i)}`,
493
+ part: i
494
+ }, null, 8, ["part"])) : _e(r.$slots, i.type, me({ ref_for: !0 }, {
495
+ message: c,
496
+ part: i,
497
+ index: _,
498
+ isLoading: Z.value
499
+ }), () => [e.showAllMessageParts ? (F(), E("div", ze, [D("div", Be, [R(m)(i) ? (F(), w(u, {
500
+ key: 0,
501
+ name: R(m)(i),
502
+ class: "shrink-0"
503
+ }, null, 8, ["name"])) : T("", !0), D("code", Ve, L(R(Ce)(i.type)), 1)])])) : T("", !0)], void 0, 1)]),
504
+ _: 2
505
+ }, 1024)) : T("", !0), O(S, { mode: "out-in" }, {
506
+ default: B(() => [l === xt(c) && e.readonlyFeedback && Y(c.id)?.comment ? (F(), w(b, {
507
+ key: 0,
508
+ feedback: Y(c.id)
509
+ }, null, 8, ["feedback"])) : T("", !0)]),
510
+ _: 2
511
+ }, 1024)], 64))), 128)),
512
+ O(S, {
513
+ name: "fade-in",
514
+ mode: "out-in"
515
+ }, {
516
+ default: B(() => [Z.value && Q(_) && !Nt(c) && $(c) && (!Ft(c) || Lt(c)) ? (F(), E("div", {
517
+ key: `loading-info-${c.id}`,
518
+ class: "pk-chatbot-message__loading-info"
519
+ }, [D("div", He, [
520
+ O(u, {
521
+ name: "loading-loop",
522
+ class: "shrink-0"
523
+ }),
524
+ O(S, { mode: "out-in" }, {
525
+ default: B(() => [kt.value ? (F(), w(u, {
526
+ key: kt.value,
527
+ class: "shrink-0",
528
+ name: kt.value
529
+ }, null, 8, ["name"])) : T("", !0)]),
530
+ _: 1
531
+ }),
532
+ O(S, { mode: "out-in" }, {
533
+ default: B(() => [Ot.value ? (F(), E("span", {
534
+ key: Ot.value,
535
+ class: "text-12"
536
+ }, L(Ot.value), 1)) : T("", !0)]),
537
+ _: 1
538
+ })
539
+ ]), O(S, {
540
+ name: "fade-in",
541
+ mode: "out-in"
542
+ }, {
543
+ default: B(() => [!Ft(c) && X.value && "text" in X.value && X.value.text.trim() ? (F(), w(se, {
544
+ key: 0,
545
+ markdown: X.value.text,
546
+ "is-dark": e.isDark,
547
+ "tail-length": R(te),
548
+ "inner-class": "wysiwyg",
549
+ class: "border border-surface-3 rounded-md p-4 mt-8 bg-surface-1 max-h-64 text-12 w-full"
550
+ }, null, 8, [
551
+ "markdown",
552
+ "is-dark",
553
+ "tail-length"
554
+ ])) : T("", !0)]),
555
+ _: 2
556
+ }, 1024)])) : T("", !0)]),
557
+ _: 2
558
+ }, 1024),
559
+ O(S, { mode: "out-in" }, {
560
+ default: B(() => [Ut(c, _) ? (F(), E("div", Ue, [
561
+ O(g, {
562
+ modifiers: "compact",
563
+ class: "mr-auto shrink-0"
564
+ }, {
565
+ default: B(() => [
566
+ O(S, { mode: "out-in" }, {
567
+ default: B(() => [jt(_) ? (F(), w(d, {
568
+ key: 0,
569
+ icon: "ri:reset-right-line",
570
+ modifiers: "action-quiet-small",
571
+ title: R(P)("action.regenerate"),
572
+ "aria-label": R(P)("action.regenerate"),
573
+ onClick: i[0] ||= V((e) => r.$emit("regenerate"), ["stop"])
574
+ }, null, 8, ["title", "aria-label"])) : T("", !0)]),
575
+ _: 2
576
+ }, 1024),
577
+ O(S, { mode: "out-in" }, {
578
+ default: B(() => [Mt("show-info", _) ? (F(), w(d, {
579
+ key: 0,
580
+ icon: "ri:information-line",
581
+ title: R(P)("action.getMoreInfo"),
582
+ "aria-label": R(P)("action.getMoreInfo"),
583
+ modifiers: "action-quiet-small",
584
+ onClick: V((e) => r.$emit("show-info", c), ["stop"])
585
+ }, null, 8, [
586
+ "title",
587
+ "aria-label",
588
+ "onClick"
589
+ ])) : T("", !0)]),
590
+ _: 2
591
+ }, 1024),
592
+ O(S, { mode: "out-in" }, {
593
+ default: B(() => [Mt("revise", _) ? (F(), w(d, {
594
+ key: 0,
595
+ icon: J(c.id) ? "ri:file-edit-fill" : "ri:file-edit-line",
596
+ title: J(c.id) ? R(P)("action.editRevise") : R(P)("action.createRevise"),
597
+ "aria-label": J(c.id) ? R(P)("action.editRevise") : R(P)("action.createRevise"),
598
+ modifiers: "action-quiet-small",
599
+ class: M({ "text-brand": J(c.id) }),
600
+ onClick: V((e) => r.$emit("revise", c), ["stop"])
601
+ }, null, 8, [
602
+ "icon",
603
+ "title",
604
+ "aria-label",
605
+ "class",
606
+ "onClick"
607
+ ])) : T("", !0)]),
608
+ _: 2
609
+ }, 1024),
610
+ O(S, { mode: "out-in" }, {
611
+ default: B(() => [mt("upvote", _) ? (F(), w(d, {
612
+ key: 0,
613
+ icon: Y(c.id)?.vote === "upvote" ? "ri:thumb-up-fill" : "ri:thumb-up-line",
614
+ title: R(P)("action.upvote"),
615
+ "aria-label": R(P)("action.upvote"),
616
+ modifiers: "action-quiet-small",
617
+ onClick: V((e) => r.$emit("upvote", c), ["stop"])
618
+ }, null, 8, [
619
+ "icon",
620
+ "title",
621
+ "aria-label",
622
+ "onClick"
623
+ ])) : T("", !0)]),
624
+ _: 2
625
+ }, 1024),
626
+ O(S, { mode: "out-in" }, {
627
+ default: B(() => [mt("downvote", _) ? (F(), w(d, {
628
+ key: 0,
629
+ icon: Y(c.id)?.vote === "downvote" ? "ri:thumb-down-fill" : "ri:thumb-down-line",
630
+ title: R(P)("action.downvote"),
631
+ "aria-label": R(P)("action.downvote"),
632
+ modifiers: "action-quiet-small",
633
+ onClick: V((e) => r.$emit("downvote", c), ["stop"])
634
+ }, null, 8, [
635
+ "icon",
636
+ "title",
637
+ "aria-label",
638
+ "onClick"
639
+ ])) : T("", !0)]),
640
+ _: 2
641
+ }, 1024),
642
+ O(S, { mode: "out-in" }, {
643
+ default: B(() => [mt("feedback", _) ? (F(), w(d, {
644
+ key: 0,
645
+ icon: Y(c.id)?.comment ? "ri:feedback-fill" : "ri:feedback-line",
646
+ title: R(P)("action.feedback"),
647
+ "aria-label": R(P)("action.feedback"),
648
+ modifiers: "action-quiet-small",
649
+ onClick: V((e) => r.$emit("feedback", c), ["stop"])
650
+ }, null, 8, [
651
+ "icon",
652
+ "title",
653
+ "aria-label",
654
+ "onClick"
655
+ ])) : T("", !0)]),
656
+ _: 2
657
+ }, 1024)
658
+ ]),
659
+ _: 2
660
+ }, 1024),
661
+ !e.showMessageDateTime && c.metadata?.createdAt && c.metadata?.completedAt ? (F(), E("div", We, [D("time", {
662
+ datetime: new Date(c.metadata.createdAt).toISOString(),
663
+ title: R(H)(new Date(c.metadata.createdAt), "date-time"),
664
+ class: "flex items-center gap-4 min-w-0"
665
+ }, [O(u, {
666
+ name: "ri:time-line",
667
+ class: "shrink-0"
668
+ }), D("span", Ke, L(Wt(c.metadata.createdAt)), 1)], 8, Ge), Gt(c) ? (F(), E("span", qe, [O(u, {
669
+ name: "ri:hourglass-line",
670
+ class: "shrink-0"
671
+ }), D("span", Je, L(Gt(c)), 1)])) : T("", !0)])) : T("", !0),
672
+ e.showMessageNumber ? (F(), E("span", {
673
+ key: 1,
674
+ title: R(P)("label.messageNumber", { n: Ht.value[_] }),
675
+ class: "text-12 text-word-3 tabular-nums"
676
+ }, " #" + L(Ht.value[_]), 9, Ye)) : T("", !0),
677
+ e.showMessageTokensCount && c.metadata?.totalTokens ? (F(), E("span", Xe, [O(u, {
678
+ name: "ri:ai-generate-2-line",
679
+ class: "shrink-0"
680
+ }), D("span", Ze, L(R(Se)(c.metadata.totalTokens, "integer")) + " " + L(R(P)("label.tokens")), 1)])) : T("", !0),
681
+ e.showMessageDateTime && c.metadata?.createdAt ? (F(), E("time", {
682
+ key: 3,
683
+ datetime: new Date(c.metadata?.createdAt).toISOString(),
684
+ class: "flex items-center gap-4 text-12 text-word-3"
685
+ }, [O(u, {
686
+ name: "ri:time-line",
687
+ class: "shrink-0"
688
+ }), D("span", $e, L(R(H)(new Date(c.metadata?.createdAt), "date-time")), 1)], 8, Qe)) : T("", !0),
689
+ e.showMessageDateTime && c?.metadata?.completedAt && c?.metadata?.createdAt ? (F(), E("div", et, [O(u, {
690
+ name: "ri:hourglass-line",
691
+ class: "shrink-0"
692
+ }), O(l, {
693
+ class: "truncate",
694
+ date: c.metadata?.createdAt,
695
+ "end-date": c.metadata?.completedAt
696
+ }, null, 8, ["date", "end-date"])])) : T("", !0)
697
+ ])) : T("", !0)]),
698
+ _: 2
699
+ }, 1024),
700
+ O(S, { mode: "out-in" }, {
701
+ default: B(() => [c.id === e.feedbackMessageId ? (F(), w(y, {
702
+ key: 0,
703
+ ref_for: !0,
704
+ ref_key: "feedbackMessageEl",
705
+ ref: Kt,
706
+ loading: e.feedbackLoading,
707
+ submitted: e.feedbackSubmitted,
708
+ error: e.feedbackError,
709
+ onSubmit: i[1] ||= (e) => r.$emit("feedback-submit", e),
710
+ onClose: i[2] ||= (e) => r.$emit("feedback-close")
711
+ }, null, 8, [
712
+ "loading",
713
+ "submitted",
714
+ "error"
715
+ ])) : T("", !0)]),
716
+ _: 2
717
+ }, 1024)
718
+ ], 6)) : T("", !0)], 64))), 128)),
719
+ O(S, {
720
+ appear: "",
721
+ name: "pk-chatbot-part"
722
+ }, {
723
+ default: B(() => [Et.value ? (F(), E("div", {
724
+ key: 0,
725
+ class: "pk-chatbot-message pk-chatbot-message--assistant pk-chatbot-message--loading",
726
+ style: N({ minHeight: Dt.value ? `${q.value}px` : void 0 })
727
+ }, [D("div", tt, [D("div", nt, [O(u, {
728
+ name: "loading-loop",
729
+ class: "shrink-0"
730
+ }), D("span", rt, L(R(P)("label.answeringOnTheCall")), 1)])])], 4)) : T("", !0)]),
731
+ _: 1
732
+ }),
733
+ O(S, {
734
+ appear: "",
735
+ name: "pk-chatbot-part"
736
+ }, {
737
+ default: B(() => [Tt.value ? (F(), w(c, {
738
+ key: 0,
739
+ error: e.error,
740
+ onRetry: i[3] ||= (e) => r.$emit("auto-retry"),
741
+ onReset: i[4] ||= (e) => r.$emit("reset-chat")
742
+ }, null, 8, ["error"])) : T("", !0)]),
743
+ _: 1
744
+ }),
745
+ St.value?.role === "user" && !Dt.value || Tt.value ? (F(), E("div", {
746
+ key: 0,
747
+ class: "pk-chatbot-messages__spacer",
748
+ style: N({ minHeight: `${q.value}px` })
749
+ }, null, 4)) : T("", !0)
750
+ ], 512),
751
+ O(S, { name: "pk-chatbot-messages-fab" }, {
752
+ default: B(() => [e.showScrollToBottom && (R(G) || !R(at)) ? (F(), E("button", {
753
+ key: 0,
754
+ type: "button",
755
+ class: "pk-chatbot-messages__scroll-to-bottom",
756
+ title: R(P)("action.scrollToBottom"),
757
+ "aria-label": R(P)("action.scrollToBottom"),
758
+ onClick: ot
759
+ }, [O(u, { name: "ri:arrow-down-line" })], 8, it)) : T("", !0)]),
760
+ _: 1
761
+ })
762
+ ], 46, Me);
763
+ };
764
+ }
765
+ });
766
+ //#endregion
767
+ export { we as a, Ce as i, Te as n, Se as r, at as t };
768
+
769
+ //# sourceMappingURL=PkChatbotMessages-3RZER9PO.js.map