@aleph-alpha/chat-kit 0.9.0 → 1.1.0

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 (263) hide show
  1. package/dist/{CkInput.vue_vue_type_script_setup_true_lang-DmcLXAgB.js → CkInput.vue_vue_type_script_setup_true_lang-DpYyyCgU.js} +481 -79
  2. package/dist/chat-kit.css +9 -14
  3. package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts +20 -0
  4. package/dist/components/base/CkAgentMessage/CkAgentMessage.stories.d.ts.map +1 -1
  5. package/dist/components/base/CkAgentMessage/CkAgentMessage.vue.d.ts.map +1 -1
  6. package/dist/components/base/CkAgentMessage/index.d.ts +1 -0
  7. package/dist/components/base/CkAgentMessage/index.d.ts.map +1 -1
  8. package/dist/components/base/CkAgentMessage/types.d.ts +12 -0
  9. package/dist/components/base/CkAgentMessage/types.d.ts.map +1 -0
  10. package/dist/components/base/CkConversationLayout/CkConversationLayout.stories.d.ts +13 -0
  11. package/dist/components/base/CkConversationLayout/CkConversationLayout.stories.d.ts.map +1 -1
  12. package/dist/components/base/CkConversationLayout/CkConversationLayout.vue.d.ts.map +1 -1
  13. package/dist/components/base/CkConversationLayout/types.d.ts +9 -2
  14. package/dist/components/base/CkConversationLayout/types.d.ts.map +1 -1
  15. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.stories.d.ts +8 -0
  16. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.stories.d.ts.map +1 -1
  17. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts +3 -15
  18. package/dist/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue.d.ts.map +1 -1
  19. package/dist/components/base/CkCopyMessageActionButton/index.d.ts +1 -0
  20. package/dist/components/base/CkCopyMessageActionButton/index.d.ts.map +1 -1
  21. package/dist/components/base/CkCopyMessageActionButton/types.d.ts +45 -0
  22. package/dist/components/base/CkCopyMessageActionButton/types.d.ts.map +1 -0
  23. package/dist/components/base/CkHistoryItem/CkHistoryItem.stories.d.ts +31 -0
  24. package/dist/components/base/CkHistoryItem/CkHistoryItem.stories.d.ts.map +1 -0
  25. package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts +31 -0
  26. package/dist/components/base/CkHistoryItem/CkHistoryItem.vue.d.ts.map +1 -0
  27. package/dist/components/base/CkHistoryItem/activeIndicator.d.ts +15 -0
  28. package/dist/components/base/CkHistoryItem/activeIndicator.d.ts.map +1 -0
  29. package/dist/components/base/CkHistoryItem/index.d.ts +3 -0
  30. package/dist/components/base/CkHistoryItem/index.d.ts.map +1 -0
  31. package/dist/components/base/CkHistoryItem/types.d.ts +96 -0
  32. package/dist/components/base/CkHistoryItem/types.d.ts.map +1 -0
  33. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.d.ts +16 -0
  34. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.d.ts.map +1 -0
  35. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.vue.d.ts +17 -0
  36. package/dist/components/base/CkHistoryWrapper/CkHistoryWrapper.vue.d.ts.map +1 -0
  37. package/dist/components/base/CkHistoryWrapper/index.d.ts +3 -0
  38. package/dist/components/base/CkHistoryWrapper/index.d.ts.map +1 -0
  39. package/dist/components/base/CkHistoryWrapper/types.d.ts +17 -0
  40. package/dist/components/base/CkHistoryWrapper/types.d.ts.map +1 -0
  41. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts +28 -0
  42. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.d.ts.map +1 -1
  43. package/dist/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue.d.ts.map +1 -1
  44. package/dist/components/base/CkMarkdownRenderer/index.d.ts +1 -1
  45. package/dist/components/base/CkMarkdownRenderer/index.d.ts.map +1 -1
  46. package/dist/components/base/CkMarkdownRenderer/types.d.ts +16 -0
  47. package/dist/components/base/CkMarkdownRenderer/types.d.ts.map +1 -1
  48. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.stories.d.ts +4 -0
  49. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.stories.d.ts.map +1 -1
  50. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.vue.d.ts +2 -5
  51. package/dist/components/base/CkMessageActionButton/CkMessageActionButton.vue.d.ts.map +1 -1
  52. package/dist/components/base/CkMessageActionButton/index.d.ts +1 -0
  53. package/dist/components/base/CkMessageActionButton/index.d.ts.map +1 -1
  54. package/dist/components/base/CkMessageActionButton/types.d.ts +22 -0
  55. package/dist/components/base/CkMessageActionButton/types.d.ts.map +1 -0
  56. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.stories.d.ts +12 -0
  57. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.stories.d.ts.map +1 -1
  58. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.vue.d.ts +2 -7
  59. package/dist/components/base/CkPromptActionButton/CkPromptActionButton.vue.d.ts.map +1 -1
  60. package/dist/components/base/CkPromptActionButton/index.d.ts +1 -0
  61. package/dist/components/base/CkPromptActionButton/index.d.ts.map +1 -1
  62. package/dist/components/base/CkPromptActionButton/types.d.ts +33 -0
  63. package/dist/components/base/CkPromptActionButton/types.d.ts.map +1 -0
  64. package/dist/components/base/CkPromptInput/CkPromptInput.stories.d.ts +17 -0
  65. package/dist/components/base/CkPromptInput/CkPromptInput.stories.d.ts.map +1 -1
  66. package/dist/components/base/CkPromptInput/CkPromptInput.vue.d.ts +3 -9
  67. package/dist/components/base/CkPromptInput/CkPromptInput.vue.d.ts.map +1 -1
  68. package/dist/components/base/CkPromptInput/index.d.ts +1 -0
  69. package/dist/components/base/CkPromptInput/index.d.ts.map +1 -1
  70. package/dist/components/base/CkPromptInput/types.d.ts +39 -0
  71. package/dist/components/base/CkPromptInput/types.d.ts.map +1 -0
  72. package/dist/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.stories.d.ts +12 -0
  73. package/dist/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.stories.d.ts.map +1 -1
  74. package/dist/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.vue.d.ts +2 -4
  75. package/dist/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.vue.d.ts.map +1 -1
  76. package/dist/components/base/CkPromptInputDisclaimer/index.d.ts +1 -0
  77. package/dist/components/base/CkPromptInputDisclaimer/index.d.ts.map +1 -1
  78. package/dist/components/base/CkPromptInputDisclaimer/types.d.ts +18 -0
  79. package/dist/components/base/CkPromptInputDisclaimer/types.d.ts.map +1 -0
  80. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.stories.d.ts +8 -0
  81. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.stories.d.ts.map +1 -1
  82. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.vue.d.ts +3 -6
  83. package/dist/components/base/CkPromptStopButton/CkPromptStopButton.vue.d.ts.map +1 -1
  84. package/dist/components/base/CkPromptStopButton/index.d.ts +1 -0
  85. package/dist/components/base/CkPromptStopButton/index.d.ts.map +1 -1
  86. package/dist/components/base/CkPromptStopButton/types.d.ts +28 -0
  87. package/dist/components/base/CkPromptStopButton/types.d.ts.map +1 -0
  88. package/dist/components/base/CkUserMessage/CkUserMessage.stories.d.ts +15 -0
  89. package/dist/components/base/CkUserMessage/CkUserMessage.stories.d.ts.map +1 -1
  90. package/dist/components/base/CkUserMessage/CkUserMessage.vue.d.ts.map +1 -1
  91. package/dist/components/base/CkUserMessage/types.d.ts +9 -2
  92. package/dist/components/base/CkUserMessage/types.d.ts.map +1 -1
  93. package/dist/components/base/icons/CkStopIcon.vue.d.ts.map +1 -1
  94. package/dist/components/base/index.d.ts +5 -1
  95. package/dist/components/base/index.d.ts.map +1 -1
  96. package/dist/components/composed/CkConversation/CkConversation.stories.d.ts +55 -0
  97. package/dist/components/composed/CkConversation/CkConversation.stories.d.ts.map +1 -1
  98. package/dist/components/composed/CkConversation/CkConversation.vue.d.ts.map +1 -1
  99. package/dist/components/composed/CkConversation/types.d.ts +25 -6
  100. package/dist/components/composed/CkConversation/types.d.ts.map +1 -1
  101. package/dist/components/composed/CkHistory/CkHistory.stories.d.ts +33 -0
  102. package/dist/components/composed/CkHistory/CkHistory.stories.d.ts.map +1 -0
  103. package/dist/components/composed/CkHistory/CkHistory.vue.d.ts +50 -0
  104. package/dist/components/composed/CkHistory/CkHistory.vue.d.ts.map +1 -0
  105. package/dist/components/composed/CkHistory/index.d.ts +3 -0
  106. package/dist/components/composed/CkHistory/index.d.ts.map +1 -0
  107. package/dist/components/composed/CkHistory/types.d.ts +71 -0
  108. package/dist/components/composed/CkHistory/types.d.ts.map +1 -0
  109. package/dist/components/composed/CkInput/CkInput.stories.d.ts +31 -1
  110. package/dist/components/composed/CkInput/CkInput.stories.d.ts.map +1 -1
  111. package/dist/components/composed/CkInput/CkInput.vue.d.ts +3 -12
  112. package/dist/components/composed/CkInput/CkInput.vue.d.ts.map +1 -1
  113. package/dist/components/composed/CkInput/index.d.ts +1 -0
  114. package/dist/components/composed/CkInput/index.d.ts.map +1 -1
  115. package/dist/components/composed/CkInput/types.d.ts +60 -0
  116. package/dist/components/composed/CkInput/types.d.ts.map +1 -0
  117. package/dist/components/composed/index.d.ts +2 -0
  118. package/dist/components/composed/index.d.ts.map +1 -1
  119. package/dist/components/index.d.ts +4 -4
  120. package/dist/components/index.d.ts.map +1 -1
  121. package/dist/components/index.js +14 -11
  122. package/dist/composables/index.d.ts +2 -0
  123. package/dist/composables/index.d.ts.map +1 -1
  124. package/dist/composables/index.js +3 -3
  125. package/dist/composables/useConversations.d.ts +72 -0
  126. package/dist/composables/useConversations.d.ts.map +1 -0
  127. package/dist/generateId-BHf0W4Rq.js +6 -0
  128. package/dist/handlers/index.js +2 -2
  129. package/dist/handlers/useChatKitLabels.d.ts +8 -0
  130. package/dist/handlers/useChatKitLabels.d.ts.map +1 -1
  131. package/dist/handlers/useMarkdownParser.d.ts.map +1 -1
  132. package/dist/helpers/conversationTree.d.ts.map +1 -1
  133. package/dist/helpers/index.d.ts +2 -0
  134. package/dist/helpers/index.d.ts.map +1 -1
  135. package/dist/helpers/secondsToDate.d.ts +6 -0
  136. package/dist/helpers/secondsToDate.d.ts.map +1 -0
  137. package/dist/helpers/toError.d.ts +7 -0
  138. package/dist/helpers/toError.d.ts.map +1 -0
  139. package/dist/index.d.ts +6 -6
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.js +20 -16
  142. package/dist/services/ChatService.d.ts.map +1 -1
  143. package/dist/services/MockChatService.d.ts.map +1 -1
  144. package/dist/services/index.d.ts +1 -1
  145. package/dist/services/index.d.ts.map +1 -1
  146. package/dist/services/index.js +4 -1
  147. package/dist/services/types.d.ts +53 -0
  148. package/dist/services/types.d.ts.map +1 -1
  149. package/dist/types.d.ts +13 -0
  150. package/dist/types.d.ts.map +1 -1
  151. package/dist/{useChatKitLabels-DNwoZ1x6.js → useChatKitLabels-Dvi2FmjE.js} +8 -2
  152. package/dist/useConversations-Ca242D2P.js +195 -0
  153. package/dist/{useMessageHandler-D7OdrrcB.js → useMessageHandler-uLHNac39.js} +1 -3
  154. package/package.json +5 -4
  155. package/src/components/base/CkAgentMessage/CkAgentMessage.spec.ts +91 -0
  156. package/src/components/base/CkAgentMessage/CkAgentMessage.stories.ts +215 -0
  157. package/src/components/base/CkAgentMessage/CkAgentMessage.vue +25 -0
  158. package/src/components/base/CkAgentMessage/index.ts +2 -0
  159. package/src/components/base/CkAgentMessage/types.ts +11 -0
  160. package/src/components/base/CkConversationLayout/CkConversationLayout.spec.ts +129 -0
  161. package/src/components/base/CkConversationLayout/CkConversationLayout.stories.ts +251 -0
  162. package/src/components/base/CkConversationLayout/CkConversationLayout.vue +206 -0
  163. package/src/components/base/CkConversationLayout/index.ts +2 -0
  164. package/src/components/base/CkConversationLayout/types.ts +18 -0
  165. package/src/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.spec.ts +89 -0
  166. package/src/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.stories.ts +70 -0
  167. package/src/components/base/CkCopyMessageActionButton/CkCopyMessageActionButton.vue +110 -0
  168. package/src/components/base/CkCopyMessageActionButton/index.ts +2 -0
  169. package/src/components/base/CkCopyMessageActionButton/types.ts +43 -0
  170. package/src/components/base/CkHistoryItem/CkHistoryItem.spec.ts +42 -0
  171. package/src/components/base/CkHistoryItem/CkHistoryItem.stories.ts +230 -0
  172. package/src/components/base/CkHistoryItem/CkHistoryItem.vue +285 -0
  173. package/src/components/base/CkHistoryItem/activeIndicator.ts +15 -0
  174. package/src/components/base/CkHistoryItem/index.ts +2 -0
  175. package/src/components/base/CkHistoryItem/types.ts +111 -0
  176. package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.spec.ts +26 -0
  177. package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.stories.ts +149 -0
  178. package/src/components/base/CkHistoryWrapper/CkHistoryWrapper.vue +36 -0
  179. package/src/components/base/CkHistoryWrapper/index.ts +2 -0
  180. package/src/components/base/CkHistoryWrapper/types.ts +16 -0
  181. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.spec.ts +348 -0
  182. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.stories.ts +382 -0
  183. package/src/components/base/CkMarkdownRenderer/CkMarkdownRenderer.vue +89 -0
  184. package/src/components/base/CkMarkdownRenderer/defaultMarkdownClasses.ts +19 -0
  185. package/src/components/base/CkMarkdownRenderer/index.ts +5 -0
  186. package/src/components/base/CkMarkdownRenderer/types.ts +53 -0
  187. package/src/components/base/CkMessageActionButton/CkMessageActionButton.spec.ts +40 -0
  188. package/src/components/base/CkMessageActionButton/CkMessageActionButton.stories.ts +56 -0
  189. package/src/components/base/CkMessageActionButton/CkMessageActionButton.vue +23 -0
  190. package/src/components/base/CkMessageActionButton/index.ts +2 -0
  191. package/src/components/base/CkMessageActionButton/types.ts +21 -0
  192. package/src/components/base/CkPromptActionButton/CkPromptActionButton.spec.ts +52 -0
  193. package/src/components/base/CkPromptActionButton/CkPromptActionButton.stories.ts +126 -0
  194. package/src/components/base/CkPromptActionButton/CkPromptActionButton.vue +25 -0
  195. package/src/components/base/CkPromptActionButton/index.ts +2 -0
  196. package/src/components/base/CkPromptActionButton/types.ts +32 -0
  197. package/src/components/base/CkPromptInput/CkPromptInput.spec.ts +181 -0
  198. package/src/components/base/CkPromptInput/CkPromptInput.stories.ts +224 -0
  199. package/src/components/base/CkPromptInput/CkPromptInput.vue +104 -0
  200. package/src/components/base/CkPromptInput/index.ts +2 -0
  201. package/src/components/base/CkPromptInput/types.ts +39 -0
  202. package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.spec.ts +40 -0
  203. package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.stories.ts +103 -0
  204. package/src/components/base/CkPromptInputDisclaimer/CkPromptInputDisclaimer.vue +16 -0
  205. package/src/components/base/CkPromptInputDisclaimer/index.ts +2 -0
  206. package/src/components/base/CkPromptInputDisclaimer/types.ts +17 -0
  207. package/src/components/base/CkPromptStopButton/CkPromptStopButton.spec.ts +64 -0
  208. package/src/components/base/CkPromptStopButton/CkPromptStopButton.stories.ts +81 -0
  209. package/src/components/base/CkPromptStopButton/CkPromptStopButton.vue +27 -0
  210. package/src/components/base/CkPromptStopButton/index.ts +2 -0
  211. package/src/components/base/CkPromptStopButton/types.ts +28 -0
  212. package/src/components/base/CkUserMessage/CkUserMessage.spec.ts +20 -0
  213. package/src/components/base/CkUserMessage/CkUserMessage.stories.ts +112 -0
  214. package/src/components/base/CkUserMessage/CkUserMessage.vue +19 -0
  215. package/src/components/base/CkUserMessage/index.ts +2 -0
  216. package/src/components/base/CkUserMessage/types.ts +14 -0
  217. package/src/components/base/icons/CkSendIcon.vue +22 -0
  218. package/src/components/base/icons/CkStopIcon.vue +18 -0
  219. package/src/components/base/icons/index.ts +2 -0
  220. package/src/components/base/index.ts +21 -0
  221. package/src/components/composed/CkConversation/CkConversation.spec.ts +439 -0
  222. package/src/components/composed/CkConversation/CkConversation.stories.ts +642 -0
  223. package/src/components/composed/CkConversation/CkConversation.vue +146 -0
  224. package/src/components/composed/CkConversation/index.ts +2 -0
  225. package/src/components/composed/CkConversation/types.ts +37 -0
  226. package/src/components/composed/CkHistory/CkHistory.spec.ts +327 -0
  227. package/src/components/composed/CkHistory/CkHistory.stories.ts +373 -0
  228. package/src/components/composed/CkHistory/CkHistory.vue +126 -0
  229. package/src/components/composed/CkHistory/index.ts +2 -0
  230. package/src/components/composed/CkHistory/types.ts +72 -0
  231. package/src/components/composed/CkInput/CkInput.spec.ts +191 -0
  232. package/src/components/composed/CkInput/CkInput.stories.ts +438 -0
  233. package/src/components/composed/CkInput/CkInput.vue +104 -0
  234. package/src/components/composed/CkInput/index.ts +2 -0
  235. package/src/components/composed/CkInput/types.ts +60 -0
  236. package/src/components/composed/index.ts +5 -0
  237. package/src/components/index.ts +34 -0
  238. package/src/composables/index.ts +9 -0
  239. package/src/composables/types.ts +36 -0
  240. package/src/composables/useChat.ts +18 -0
  241. package/src/composables/useConversations.spec.ts +557 -0
  242. package/src/composables/useConversations.ts +321 -0
  243. package/src/handlers/index.ts +9 -0
  244. package/src/handlers/useChatKitLabels.spec.ts +290 -0
  245. package/src/handlers/useChatKitLabels.ts +96 -0
  246. package/src/handlers/useMarkdownParser.spec.ts +112 -0
  247. package/src/handlers/useMarkdownParser.ts +47 -0
  248. package/src/handlers/useMessageHandler.spec.ts +535 -0
  249. package/src/handlers/useMessageHandler.ts +138 -0
  250. package/src/helpers/conversationTree.spec.ts +423 -0
  251. package/src/helpers/conversationTree.ts +117 -0
  252. package/src/helpers/generateId.ts +5 -0
  253. package/src/helpers/index.ts +4 -0
  254. package/src/helpers/secondsToDate.ts +7 -0
  255. package/src/helpers/toError.ts +8 -0
  256. package/src/index.ts +79 -0
  257. package/src/services/ChatService.ts +60 -0
  258. package/src/services/MockChatService.ts +47 -0
  259. package/src/services/index.ts +12 -0
  260. package/src/services/types.ts +92 -0
  261. package/src/test-setup.ts +12 -0
  262. package/src/test-utils/createTextPlugin.ts +9 -0
  263. package/src/types.ts +47 -0
@@ -1,7 +1,7 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, toRefs, computed, h, useId, useTemplateRef, withModifiers, createTextVNode, useSlots, createSlots, normalizeProps, guardReactiveProps, normalizeClass } from "vue";
2
- import { a as useMarkdownParser, u as useChatKitLabels } from "./useChatKitLabels-DNwoZ1x6.js";
3
- import { UiIconButton, UiTooltip, UiIcon, UiButton, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback } from "@aleph-alpha/ui-library";
4
- const _hoisted_1$7 = {
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, ref, onMounted, nextTick, onUnmounted, watch, Fragment, renderList, normalizeStyle, createBlock, unref, mergeProps, withCtx, createVNode, Transition, toDisplayString, useAttrs, useSlots, computed, normalizeClass, withModifiers, resolveDynamicComponent, toRefs, h, useId, useTemplateRef, createTextVNode, createSlots, normalizeProps, guardReactiveProps } from "vue";
2
+ import { a as useMarkdownParser, u as useChatKitLabels } from "./useChatKitLabels-Dvi2FmjE.js";
3
+ import { UiButton, UiTooltip, UiIcon, Primitive, UiPopover, UiPopoverTrigger, UiPopoverContent, UiAvatar, UiAvatarImage, UiSpinner, UiAvatarFallback, UiSidebarPopoverMenu, UiSidebarPopoverMenuItem } from "@aleph-alpha/ui-library";
4
+ const _hoisted_1$8 = {
5
5
  xmlns: "http://www.w3.org/2000/svg",
6
6
  width: "16",
7
7
  height: "16",
@@ -12,31 +12,31 @@ const _hoisted_1$7 = {
12
12
  "stroke-linecap": "round",
13
13
  "stroke-linejoin": "round"
14
14
  };
15
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
15
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16
16
  ...{ name: "CkSendIcon" },
17
17
  __name: "CkSendIcon",
18
18
  setup(__props) {
19
19
  return (_ctx, _cache) => {
20
- return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
20
+ return openBlock(), createElementBlock("svg", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
21
21
  createElementVNode("path", { d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z" }, null, -1),
22
22
  createElementVNode("path", { d: "M6 12h16" }, null, -1)
23
23
  ])]);
24
24
  };
25
25
  }
26
26
  });
27
- const _hoisted_1$6 = {
27
+ const _hoisted_1$7 = {
28
28
  xmlns: "http://www.w3.org/2000/svg",
29
29
  width: "16",
30
30
  height: "16",
31
31
  viewBox: "0 0 16 16",
32
32
  fill: "none"
33
33
  };
34
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
34
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
35
35
  ...{ name: "CkStopIcon" },
36
36
  __name: "CkStopIcon",
37
37
  setup(__props) {
38
38
  return (_ctx, _cache) => {
39
- return openBlock(), createElementBlock("svg", _hoisted_1$6, [..._cache[0] || (_cache[0] = [
39
+ return openBlock(), createElementBlock("svg", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
40
40
  createElementVNode("path", {
41
41
  d: "M13.3335 3.33301C13.3335 2.96482 13.035 2.66634 12.6668 2.66634H3.3335C2.96531 2.66634 2.66683 2.96482 2.66683 3.33301V12.6663C2.66683 13.0345 2.96531 13.333 3.3335 13.333H12.6668C13.035 13.333 13.3335 13.0345 13.3335 12.6663V3.33301ZM14.6668 12.6663C14.6668 13.7709 13.7714 14.6663 12.6668 14.6663H3.3335C2.22893 14.6663 1.3335 13.7709 1.3335 12.6663V3.33301C1.3335 2.22844 2.22893 1.33301 3.3335 1.33301H12.6668C13.7714 1.33301 14.6668 2.22844 14.6668 3.33301V12.6663Z",
42
42
  fill: "#1D1D1B"
@@ -45,37 +45,37 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
45
45
  };
46
46
  }
47
47
  });
48
- const _hoisted_1$5 = { class: "flex w-full items-start gap-2" };
49
- const _hoisted_2$3 = {
48
+ const _hoisted_1$6 = { class: "flex w-full items-start gap-2" };
49
+ const _hoisted_2$4 = {
50
50
  key: 0,
51
51
  class: "flex flex-shrink-0 items-center justify-center"
52
52
  };
53
- const _hoisted_3$2 = { class: "text-core-content-primary flex min-w-0 flex-1 flex-col gap-2" };
54
- const _hoisted_4$1 = {
53
+ const _hoisted_3$3 = { class: "text-core-content-primary flex min-w-0 flex-1 flex-col gap-2" };
54
+ const _hoisted_4$2 = {
55
55
  key: 0,
56
56
  class: "text-sm font-bold"
57
57
  };
58
- const _hoisted_5$1 = {
58
+ const _hoisted_5$2 = {
59
59
  key: 1,
60
60
  class: "flex items-center"
61
61
  };
62
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
62
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
63
63
  ...{ name: "CkAgentMessage" },
64
64
  __name: "CkAgentMessage",
65
65
  setup(__props) {
66
66
  return (_ctx, _cache) => {
67
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
68
- _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
67
+ return openBlock(), createElementBlock("div", _hoisted_1$6, [
68
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_2$4, [
69
69
  renderSlot(_ctx.$slots, "icon")
70
70
  ])) : createCommentVNode("", true),
71
- createElementVNode("div", _hoisted_3$2, [
72
- _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
71
+ createElementVNode("div", _hoisted_3$3, [
72
+ _ctx.$slots.header ? (openBlock(), createElementBlock("span", _hoisted_4$2, [
73
73
  renderSlot(_ctx.$slots, "header")
74
74
  ])) : createCommentVNode("", true),
75
75
  createElementVNode("div", null, [
76
76
  renderSlot(_ctx.$slots, "default")
77
77
  ]),
78
- _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$1, [
78
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
79
79
  renderSlot(_ctx.$slots, "footer")
80
80
  ])) : createCommentVNode("", true)
81
81
  ])
@@ -83,16 +83,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
83
83
  };
84
84
  }
85
85
  });
86
- const _hoisted_1$4 = ["data-message-row"];
87
- const _hoisted_2$2 = {
86
+ const _hoisted_1$5 = ["data-message-row"];
87
+ const _hoisted_2$3 = {
88
88
  key: 0,
89
89
  class: "flex justify-end"
90
90
  };
91
- const _hoisted_3$1 = {
91
+ const _hoisted_3$2 = {
92
92
  key: 1,
93
93
  class: "flex justify-start"
94
94
  };
95
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
95
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
96
96
  ...{ name: "CkConversationLayout" },
97
97
  __name: "CkConversationLayout",
98
98
  props: {
@@ -143,7 +143,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
143
143
  spacerHeight.value = 0;
144
144
  return;
145
145
  }
146
- const userRows = container.querySelectorAll('[data-message-row="user"]');
146
+ const userRows = container.querySelectorAll(
147
+ '[data-message-row="user"]'
148
+ );
147
149
  const lastUserRow = userRows[userRows.length - 1];
148
150
  if (!lastUserRow) {
149
151
  spacerHeight.value = 0;
@@ -159,7 +161,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
159
161
  const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
160
162
  const contentFromUserToEnd = lastRowBottom - lastUserTop;
161
163
  const gap = parseFloat(getComputedStyle(container).rowGap) || 0;
162
- spacerHeight.value = Math.max(0, containerHeight.value - contentFromUserToEnd - gap);
164
+ spacerHeight.value = Math.max(
165
+ 0,
166
+ containerHeight.value - contentFromUserToEnd - gap
167
+ );
163
168
  }
164
169
  function scrollUserMessageToTop() {
165
170
  const container = scrollContainerRef.value;
@@ -167,7 +172,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
167
172
  hasBottomSpacer.value = true;
168
173
  spacerHeight.value = containerHeight.value;
169
174
  nextTick(() => {
170
- const userRows = container.querySelectorAll('[data-message-row="user"]');
175
+ const userRows = container.querySelectorAll(
176
+ '[data-message-row="user"]'
177
+ );
171
178
  const lastUserRow = userRows[userRows.length - 1];
172
179
  if (lastUserRow) {
173
180
  lastUserRow.scrollIntoView({ behavior: "smooth", block: "start" });
@@ -225,12 +232,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
225
232
  key: message.id,
226
233
  "data-message-row": message.role
227
234
  }, [
228
- message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
235
+ message.role === "user" ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
229
236
  renderSlot(_ctx.$slots, "user-message", { message })
230
- ])) : (openBlock(), createElementBlock("div", _hoisted_3$1, [
237
+ ])) : (openBlock(), createElementBlock("div", _hoisted_3$2, [
231
238
  renderSlot(_ctx.$slots, "agent-message", { message })
232
239
  ]))
233
- ], 8, _hoisted_1$4);
240
+ ], 8, _hoisted_1$5);
234
241
  }), 128)),
235
242
  hasBottomSpacer.value ? (openBlock(), createElementBlock("div", {
236
243
  key: 0,
@@ -241,7 +248,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
241
248
  };
242
249
  }
243
250
  });
244
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
251
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
245
252
  ...{
246
253
  name: "CkMessageActionButton"
247
254
  },
@@ -252,32 +259,24 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
252
259
  },
253
260
  setup(__props) {
254
261
  return (_ctx, _cache) => {
255
- return openBlock(), createBlock(unref(UiIconButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
262
+ return openBlock(), createBlock(unref(UiButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
256
263
  disabled: __props.disabled,
257
264
  variant: "ghost",
258
- class: "message-action-button box-border w-8 h-8 transition-colors hover:bg-background-surface-muted hover:border-border-button-outlined focus-visible:bg-background-surface-muted focus-visible:border-border-button-outlined active:bg-background-surface-muted active:border-border-button-outlined"
265
+ size: "icon-sm"
259
266
  }), {
260
267
  default: withCtx(() => [
261
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
268
+ renderSlot(_ctx.$slots, "default")
262
269
  ]),
263
270
  _: 3
264
271
  }, 16, ["disabled"]);
265
272
  };
266
273
  }
267
274
  });
268
- const _export_sfc = (sfc, props) => {
269
- const target = sfc.__vccOpts || sfc;
270
- for (const [key, val] of props) {
271
- target[key] = val;
272
- }
273
- return target;
274
- };
275
- const CkMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-ee7595cc"]]);
276
- const _hoisted_1$3 = {
275
+ const _hoisted_1$4 = {
277
276
  class: "sr-only",
278
277
  "aria-live": "polite"
279
278
  };
280
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
279
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
281
280
  ...{
282
281
  name: "CkCopyMessageActionButton"
283
282
  },
@@ -334,7 +333,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
334
333
  "delay-duration": 0
335
334
  }, {
336
335
  default: withCtx(() => [
337
- createVNode(unref(CkMessageActionButton), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
336
+ createVNode(unref(_sfc_main$c), mergeProps({ ariaLabel: copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy }, {
338
337
  disabled: __props.disabled,
339
338
  onClick: handleClick
340
339
  }), {
@@ -361,14 +360,315 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
361
360
  ]),
362
361
  _: 1
363
362
  }, 16, ["disabled"]),
364
- createElementVNode("span", _hoisted_1$3, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
363
+ createElementVNode("span", _hoisted_1$4, toDisplayString(copied.value ? __props.ariaLabelCopied : __props.ariaLabelCopy), 1)
365
364
  ]),
366
365
  _: 1
367
366
  }, 8, ["open", "content"]);
368
367
  };
369
368
  }
370
369
  });
371
- const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-141343e6"]]);
370
+ const _export_sfc = (sfc, props) => {
371
+ const target = sfc.__vccOpts || sfc;
372
+ for (const [key, val] of props) {
373
+ target[key] = val;
374
+ }
375
+ return target;
376
+ };
377
+ const CkCopyMessageActionButton = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-f77a1193"]]);
378
+ const CHAT_HISTORY_ACTIVE_INDICATOR_CLASS = 'before:absolute before:z-10 before:top-1/2 before:left-0 before:h-1/2 before:w-0.5 before:-translate-y-1/2 before:origin-left before:scale-x-0 before:rounded-full before:bg-background-accent-default before:opacity-0 before:transition-[transform,opacity] before:duration-200 before:ease-linear before:content-[""] data-[active=true]:before:scale-x-100 data-[active=true]:before:opacity-100';
379
+ const _hoisted_1$3 = ["data-active"];
380
+ const _hoisted_2$2 = { class: "min-w-0 flex-1" };
381
+ const _hoisted_3$1 = { class: "truncate body-14-regular text-content-on-surface-primary" };
382
+ const _hoisted_4$1 = {
383
+ key: 0,
384
+ class: "mt-0.5 flex min-w-0 items-center gap-1 label-12-medium text-content-on-surface-muted"
385
+ };
386
+ const _hoisted_5$1 = {
387
+ key: 0,
388
+ class: "truncate"
389
+ };
390
+ const _hoisted_6$1 = {
391
+ key: 1,
392
+ "aria-hidden": "true"
393
+ };
394
+ const _hoisted_7$1 = {
395
+ key: 2,
396
+ class: "truncate"
397
+ };
398
+ const _hoisted_8 = ["aria-label"];
399
+ const _hoisted_9 = ["aria-label"];
400
+ const _hoisted_10 = ["aria-label"];
401
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
402
+ ...{
403
+ name: "CkHistoryItem",
404
+ inheritAttrs: false
405
+ },
406
+ __name: "CkHistoryItem",
407
+ props: {
408
+ title: {},
409
+ metaStart: {},
410
+ metaEnd: {},
411
+ isActive: { type: Boolean, default: false },
412
+ showAction: { type: Boolean, default: true },
413
+ showActionOnHover: { type: Boolean, default: true },
414
+ actionTooltip: { default: "" },
415
+ actionAriaLabel: { default: "History item action" },
416
+ actionIcon: {},
417
+ actionPopover: { type: Boolean, default: false },
418
+ actionPopoverSide: { default: "right" },
419
+ actionPopoverAlign: { default: "start" },
420
+ actionPopoverSideOffset: { default: 8 },
421
+ actionPopoverContentClass: {}
422
+ },
423
+ emits: ["action-click"],
424
+ setup(__props, { emit: __emit }) {
425
+ const emit = __emit;
426
+ const props = __props;
427
+ const attrs = useAttrs();
428
+ const slots = useSlots();
429
+ const hasMeta = computed(
430
+ () => Boolean(props.metaStart || props.metaEnd || slots.meta)
431
+ );
432
+ const pointerOnAction = ref(false);
433
+ function onActionPointerEnter() {
434
+ pointerOnAction.value = true;
435
+ }
436
+ function onActionPointerLeave() {
437
+ pointerOnAction.value = false;
438
+ }
439
+ function onActionFocusIn() {
440
+ pointerOnAction.value = true;
441
+ }
442
+ function onActionFocusOut() {
443
+ pointerOnAction.value = false;
444
+ }
445
+ watch(
446
+ () => props.showAction,
447
+ (show) => {
448
+ if (!show) {
449
+ pointerOnAction.value = false;
450
+ }
451
+ }
452
+ );
453
+ const containerClass = computed(() => [
454
+ "group/ck-history-item relative flex w-full min-w-0 items-stretch gap-2 rounded-md border border-transparent px-2 py-1.5 transition-colors",
455
+ hasMeta.value ? "h-12" : "h-10",
456
+ // Whole-row focus ring: first tab lands on the main row control; second tab on the action button — both are inside this container.
457
+ // `:has(:focus-visible)` instead of `:focus-within` so mouse clicks on the row don't flash a keyboard focus ring.
458
+ "has-[:focus-visible]:border-border-surface-focus-ring has-[:focus-visible]:ring-[3px] has-[:focus-visible]:ring-ring/50",
459
+ // Row hover/active fill. Hover is suppressed while the
460
+ // pointer/focus is on the action column so the icon's own fill does not stack on top.
461
+ (props.isActive || !pointerOnAction.value) && "hover:bg-background-surface-muted-subtle",
462
+ props.isActive && "bg-background-surface-muted-subtle",
463
+ CHAT_HISTORY_ACTIVE_INDICATOR_CLASS
464
+ ]);
465
+ const itemClass = computed(() => [
466
+ "text-left outline-hidden transition-colors",
467
+ "body-14-regular text-content-on-surface-primary",
468
+ "!hover:bg-transparent !active:bg-transparent",
469
+ // Suppress a second ring on the primary control; the row ring is on the outer container.
470
+ "focus-visible:ring-0 focus-visible:outline-none",
471
+ "data-[active=true]:text-content-on-surface-primary",
472
+ // Stretched-link: extend the primary control's hit area to cover the full row
473
+ // container (including its `px-2 py-1.5` padding and the gap before the action
474
+ // column) so clicks anywhere on the row activate the item. The action button
475
+ // stays interactive because it comes later in the DOM and is `relative`.
476
+ 'before:content-[""] before:absolute before:inset-0 before:z-0',
477
+ "flex min-w-0 flex-1 items-center",
478
+ attrs.class
479
+ ]);
480
+ const actionColumnClass = computed(() => [
481
+ "ml-auto flex shrink-0 items-center self-stretch",
482
+ props.showActionOnHover ? "[&_button]:opacity-0 [&_button]:transition-opacity group-hover/ck-history-item:[&_button]:opacity-100 group-focus-within/ck-history-item:[&_button]:opacity-100" : ""
483
+ ]);
484
+ const actionButtonClass = computed(() => [
485
+ "relative z-10 inline-flex size-8 shrink-0 items-center justify-center rounded-sm border border-transparent text-content-on-surface-primary outline-hidden transition-colors",
486
+ "[&_svg]:size-4 [&_svg]:shrink-0",
487
+ "focus-visible:ring-0 focus-visible:outline-none",
488
+ pointerOnAction.value && "bg-background-surface-muted-subtle border-border-button-outlined"
489
+ ]);
490
+ const actionPopoverPanelClass = computed(() => [
491
+ "w-auto min-w-48 max-w-sm p-0 bg-background-surface-secondary",
492
+ props.actionPopoverContentClass
493
+ ]);
494
+ const passthroughAttrs = computed(() => {
495
+ const {
496
+ class: _class,
497
+ as: _as,
498
+ asChild: _asChild,
499
+ "as-child": _asChildAttr,
500
+ ...rest
501
+ } = attrs;
502
+ return rest;
503
+ });
504
+ const primitiveAs = computed(() => attrs.as ?? "button");
505
+ const primitiveAsChild = computed(
506
+ () => attrs.asChild === true || attrs.asChild === "" || attrs["as-child"] === true || attrs["as-child"] === ""
507
+ );
508
+ function onActionClick(event) {
509
+ event.stopPropagation();
510
+ const el = event.currentTarget;
511
+ if (el instanceof HTMLElement && el.focus) {
512
+ queueMicrotask(() => el.focus({ preventScroll: true }));
513
+ }
514
+ if (!props.actionPopover) {
515
+ emit("action-click", event);
516
+ }
517
+ }
518
+ return (_ctx, _cache) => {
519
+ return openBlock(), createElementBlock("div", {
520
+ "data-active": props.isActive,
521
+ class: normalizeClass(containerClass.value)
522
+ }, [
523
+ createVNode(unref(Primitive), mergeProps(passthroughAttrs.value, {
524
+ as: primitiveAs.value,
525
+ "as-child": primitiveAsChild.value,
526
+ "data-active": props.isActive,
527
+ class: itemClass.value
528
+ }), {
529
+ default: withCtx(() => [
530
+ createElementVNode("div", _hoisted_2$2, [
531
+ createElementVNode("div", _hoisted_3$1, toDisplayString(props.title), 1),
532
+ props.metaStart || props.metaEnd || _ctx.$slots.meta ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
533
+ renderSlot(_ctx.$slots, "meta", {}, () => [
534
+ props.metaStart ? (openBlock(), createElementBlock("span", _hoisted_5$1, toDisplayString(props.metaStart), 1)) : createCommentVNode("", true),
535
+ props.metaStart && props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_6$1, "|")) : createCommentVNode("", true),
536
+ props.metaEnd ? (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(props.metaEnd), 1)) : createCommentVNode("", true)
537
+ ])
538
+ ])) : createCommentVNode("", true)
539
+ ])
540
+ ]),
541
+ _: 3
542
+ }, 16, ["as", "as-child", "data-active", "class"]),
543
+ props.showAction ? (openBlock(), createElementBlock("div", {
544
+ key: 0,
545
+ class: normalizeClass(actionColumnClass.value),
546
+ onPointerenter: onActionPointerEnter,
547
+ onPointerleave: onActionPointerLeave
548
+ }, [
549
+ props.actionPopover ? (openBlock(), createBlock(unref(UiPopover), { key: 0 }, {
550
+ default: withCtx(() => [
551
+ createVNode(unref(UiPopoverTrigger), { "as-child": "" }, {
552
+ default: withCtx(() => [
553
+ createElementVNode("button", {
554
+ type: "button",
555
+ "aria-label": props.actionAriaLabel,
556
+ "aria-haspopup": "dialog",
557
+ class: normalizeClass(actionButtonClass.value),
558
+ onFocusin: onActionFocusIn,
559
+ onFocusout: onActionFocusOut,
560
+ onClick: withModifiers(onActionClick, ["stop"])
561
+ }, [
562
+ props.actionIcon ? (openBlock(), createBlock(resolveDynamicComponent(props.actionIcon), {
563
+ key: 0,
564
+ size: 16,
565
+ "aria-hidden": "true"
566
+ })) : (openBlock(), createBlock(unref(UiIcon), {
567
+ key: 1,
568
+ name: "more-vertical",
569
+ size: 16,
570
+ "aria-hidden": "true"
571
+ }))
572
+ ], 42, _hoisted_8)
573
+ ]),
574
+ _: 1
575
+ }),
576
+ createVNode(unref(UiPopoverContent), {
577
+ side: props.actionPopoverSide,
578
+ align: props.actionPopoverAlign,
579
+ "side-offset": props.actionPopoverSideOffset,
580
+ class: normalizeClass(actionPopoverPanelClass.value)
581
+ }, {
582
+ default: withCtx(() => [
583
+ renderSlot(_ctx.$slots, "action-popover")
584
+ ]),
585
+ _: 3
586
+ }, 8, ["side", "align", "side-offset", "class"])
587
+ ]),
588
+ _: 3
589
+ })) : props.actionTooltip ? (openBlock(), createBlock(unref(UiTooltip), {
590
+ key: 1,
591
+ content: props.actionTooltip,
592
+ side: "right"
593
+ }, {
594
+ default: withCtx(() => [
595
+ createElementVNode("button", {
596
+ type: "button",
597
+ "aria-label": props.actionAriaLabel,
598
+ class: normalizeClass(actionButtonClass.value),
599
+ onFocusin: onActionFocusIn,
600
+ onFocusout: onActionFocusOut,
601
+ onClick: withModifiers(onActionClick, ["stop"])
602
+ }, [
603
+ props.actionIcon ? (openBlock(), createBlock(resolveDynamicComponent(props.actionIcon), {
604
+ key: 0,
605
+ size: 16,
606
+ "aria-hidden": "true"
607
+ })) : (openBlock(), createBlock(unref(UiIcon), {
608
+ key: 1,
609
+ name: "more-vertical",
610
+ size: 16,
611
+ "aria-hidden": "true"
612
+ }))
613
+ ], 42, _hoisted_9)
614
+ ]),
615
+ _: 1
616
+ }, 8, ["content"])) : (openBlock(), createElementBlock("button", {
617
+ key: 2,
618
+ type: "button",
619
+ "aria-label": props.actionAriaLabel,
620
+ class: normalizeClass(actionButtonClass.value),
621
+ onFocusin: onActionFocusIn,
622
+ onFocusout: onActionFocusOut,
623
+ onClick: withModifiers(onActionClick, ["stop"])
624
+ }, [
625
+ props.actionIcon ? (openBlock(), createBlock(resolveDynamicComponent(props.actionIcon), {
626
+ key: 0,
627
+ size: 16,
628
+ "aria-hidden": "true"
629
+ })) : (openBlock(), createBlock(unref(UiIcon), {
630
+ key: 1,
631
+ name: "more-vertical",
632
+ size: 16,
633
+ "aria-hidden": "true"
634
+ }))
635
+ ], 42, _hoisted_10))
636
+ ], 34)) : createCommentVNode("", true)
637
+ ], 10, _hoisted_1$3);
638
+ };
639
+ }
640
+ });
641
+ const baseClass = "flex w-full min-w-0 flex-col p-2";
642
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
643
+ ...{
644
+ name: "CkHistoryWrapper",
645
+ inheritAttrs: false
646
+ },
647
+ __name: "CkHistoryWrapper",
648
+ props: {
649
+ withGap: { type: Boolean, default: true }
650
+ },
651
+ setup(__props) {
652
+ const props = __props;
653
+ const attrs = useAttrs();
654
+ const rootClass = computed(() => {
655
+ const consumerClass = typeof attrs.class === "string" ? attrs.class : void 0;
656
+ return [baseClass, props.withGap ? "gap-1" : void 0, consumerClass].filter(Boolean).join(" ");
657
+ });
658
+ const passthroughAttrs = computed(() => {
659
+ const { class: _class, ...rest } = attrs;
660
+ return rest;
661
+ });
662
+ return (_ctx, _cache) => {
663
+ return openBlock(), createElementBlock("div", mergeProps(passthroughAttrs.value, {
664
+ "data-slot": "chat-history",
665
+ class: rootClass.value
666
+ }), [
667
+ renderSlot(_ctx.$slots, "default")
668
+ ], 16);
669
+ };
670
+ }
671
+ });
372
672
  const defaultMarkdownClasses = {
373
673
  p: "my-1 leading-7",
374
674
  a: "underline underline-offset-4",
@@ -410,11 +710,14 @@ function domToVNode(node, slots, classes) {
410
710
  }
411
711
  return h(tag, attrs, children);
412
712
  }
413
- const _sfc_main$7 = defineComponent({
713
+ const _sfc_main$8 = defineComponent({
414
714
  name: "CkMarkdownRenderer",
415
715
  props: {
416
716
  content: { type: String, required: true },
417
- classes: { type: Object, default: () => ({}) },
717
+ classes: {
718
+ type: Object,
719
+ default: () => ({})
720
+ },
418
721
  plugins: { type: Array, default: void 0 }
419
722
  },
420
723
  setup(props, { slots }) {
@@ -437,7 +740,7 @@ const _sfc_main$7 = defineComponent({
437
740
  };
438
741
  }
439
742
  });
440
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
743
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
441
744
  ...{ name: "CkPromptActionButton" },
442
745
  __name: "CkPromptActionButton",
443
746
  props: {
@@ -463,7 +766,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
463
766
  };
464
767
  }
465
768
  });
466
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
769
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
467
770
  ...{ name: "CkPromptStopButton" },
468
771
  __name: "CkPromptStopButton",
469
772
  props: {
@@ -474,7 +777,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
474
777
  setup(__props) {
475
778
  const props = __props;
476
779
  return (_ctx, _cache) => {
477
- return openBlock(), createBlock(unref(UiIconButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
780
+ return openBlock(), createBlock(unref(UiButton), mergeProps({ ariaLabel: __props.ariaLabel }, {
781
+ size: "icon-sm",
478
782
  disabled: props.disabled,
479
783
  class: "!bg-brand-bg-brand hover:!bg-brand-bg-brand-hover !text-brand-content-default !rounded-md",
480
784
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
@@ -494,7 +798,7 @@ const _hoisted_4 = { class: "flex items-center justify-between" };
494
798
  const _hoisted_5 = { key: 0 };
495
799
  const _hoisted_6 = { key: 1 };
496
800
  const _hoisted_7 = { class: "ml-auto" };
497
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
801
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
498
802
  ...{ name: "CkPromptInput" },
499
803
  __name: "CkPromptInput",
500
804
  props: {
@@ -590,7 +894,7 @@ const _hoisted_1$1 = {
590
894
  key: 0,
591
895
  class: "text-core-content-tertiary text-center text-xs leading-3.5"
592
896
  };
593
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
897
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
594
898
  ...{ name: "CkPromptInputDisclaimer" },
595
899
  __name: "CkPromptInputDisclaimer",
596
900
  props: {
@@ -608,7 +912,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
608
912
  });
609
913
  const _hoisted_1 = { class: "bg-background-surface-primary inline-flex max-w-[600px] flex-col items-end justify-start gap-4 rounded-xl p-6" };
610
914
  const _hoisted_2 = { class: "text-content-on-surface-primary justify-start self-stretch text-base leading-6 font-normal" };
611
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
915
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
612
916
  ...{ name: "CkUserMessage" },
613
917
  __name: "CkUserMessage",
614
918
  props: {
@@ -626,7 +930,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
626
930
  };
627
931
  }
628
932
  });
629
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
933
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
630
934
  ...{ name: "CkConversation" },
631
935
  __name: "CkConversation",
632
936
  props: {
@@ -645,13 +949,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
645
949
  );
646
950
  const isLoading = (message) => message.status === "started" || message.status === "sending";
647
951
  return (_ctx, _cache) => {
648
- return openBlock(), createBlock(_sfc_main$a, { messages: __props.messages }, {
952
+ return openBlock(), createBlock(_sfc_main$d, { messages: __props.messages }, {
649
953
  "user-message": withCtx(({ message }) => [
650
954
  createElementVNode("div", {
651
955
  class: normalizeClass({ "ml-8": hasIcon.value })
652
956
  }, [
653
957
  renderSlot(_ctx.$slots, "user-message", { message }, () => [
654
- createVNode(_sfc_main$2, {
958
+ createVNode(_sfc_main$3, {
655
959
  message: message.content
656
960
  }, {
657
961
  default: withCtx(() => [
@@ -666,7 +970,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
666
970
  ]),
667
971
  "agent-message": withCtx(({ message }) => [
668
972
  renderSlot(_ctx.$slots, "agent-message", { message }, () => [
669
- createVNode(_sfc_main$b, null, createSlots({
973
+ createVNode(_sfc_main$e, null, createSlots({
670
974
  footer: withCtx(() => [
671
975
  renderSlot(_ctx.$slots, "agent-message-footer", { message }, () => [
672
976
  message.content && !isLoading(message) ? (openBlock(), createBlock(CkCopyMessageActionButton, {
@@ -679,7 +983,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
679
983
  ]),
680
984
  default: withCtx(() => [
681
985
  renderSlot(_ctx.$slots, "agent-message-content", { message }, () => [
682
- createVNode(_sfc_main$7, {
986
+ createVNode(_sfc_main$8, {
683
987
  content: message.content,
684
988
  classes: __props.agentMarkdownClasses
685
989
  }, createSlots({ _: 2 }, [
@@ -757,6 +1061,101 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
757
1061
  };
758
1062
  }
759
1063
  });
1064
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1065
+ ...{ name: "CkHistory" },
1066
+ __name: "CkHistory",
1067
+ props: {
1068
+ conversations: {},
1069
+ hrefResolver: {},
1070
+ activeId: { default: void 0 },
1071
+ showAction: { type: Boolean, default: true },
1072
+ showActionOnHover: { type: Boolean, default: true }
1073
+ },
1074
+ emits: ["select", "edit", "delete"],
1075
+ setup(__props, { emit: __emit }) {
1076
+ const props = __props;
1077
+ const emit = __emit;
1078
+ const labels = useChatKitLabels();
1079
+ function hrefFor(c) {
1080
+ return props.hrefResolver(c.id);
1081
+ }
1082
+ function titleFor(c) {
1083
+ const title = c.title?.trim();
1084
+ return title ? title : labels.value.historyItemUntitled;
1085
+ }
1086
+ function handleRowClick(c, event) {
1087
+ if (event.defaultPrevented) return;
1088
+ if (event.button !== 0) return;
1089
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
1090
+ event.preventDefault();
1091
+ emit("select", c, event);
1092
+ }
1093
+ return (_ctx, _cache) => {
1094
+ return openBlock(), createBlock(_sfc_main$9, null, {
1095
+ default: withCtx(() => [
1096
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.conversations, (conversation) => {
1097
+ return renderSlot(_ctx.$slots, "item", {
1098
+ key: conversation.id,
1099
+ conversation,
1100
+ href: hrefFor(conversation),
1101
+ isActive: conversation.id === props.activeId,
1102
+ title: titleFor(conversation),
1103
+ select: (event) => handleRowClick(conversation, event),
1104
+ edit: () => emit("edit", conversation),
1105
+ delete: () => emit("delete", conversation)
1106
+ }, () => [
1107
+ createVNode(_sfc_main$a, {
1108
+ as: "a",
1109
+ href: hrefFor(conversation),
1110
+ "is-active": conversation.id === props.activeId,
1111
+ title: titleFor(conversation),
1112
+ "show-action": props.showAction,
1113
+ "show-action-on-hover": props.showActionOnHover,
1114
+ "action-popover": props.showAction,
1115
+ "action-aria-label": unref(labels).historyItemActionAriaLabel,
1116
+ onClick: ($event) => handleRowClick(conversation, $event)
1117
+ }, {
1118
+ "action-popover": withCtx(() => [
1119
+ createVNode(unref(UiSidebarPopoverMenu), { "show-footer-separator": false }, {
1120
+ default: withCtx(() => [
1121
+ createVNode(unref(UiSidebarPopoverMenuItem), {
1122
+ label: unref(labels).historyItemEditAction,
1123
+ onClick: ($event) => emit("edit", conversation)
1124
+ }, {
1125
+ icon: withCtx(() => [
1126
+ createVNode(unref(UiIcon), {
1127
+ name: "pencil",
1128
+ size: "s"
1129
+ })
1130
+ ]),
1131
+ _: 1
1132
+ }, 8, ["label", "onClick"]),
1133
+ createVNode(unref(UiSidebarPopoverMenuItem), {
1134
+ label: unref(labels).historyItemDeleteAction,
1135
+ onClick: ($event) => emit("delete", conversation)
1136
+ }, {
1137
+ icon: withCtx(() => [
1138
+ createVNode(unref(UiIcon), {
1139
+ name: "trash",
1140
+ size: "s"
1141
+ })
1142
+ ]),
1143
+ _: 1
1144
+ }, 8, ["label", "onClick"])
1145
+ ]),
1146
+ _: 2
1147
+ }, 1024)
1148
+ ]),
1149
+ _: 2
1150
+ }, 1032, ["href", "is-active", "title", "show-action", "show-action-on-hover", "action-popover", "action-aria-label", "onClick"])
1151
+ ]);
1152
+ }), 128))
1153
+ ]),
1154
+ _: 3
1155
+ });
1156
+ };
1157
+ }
1158
+ });
760
1159
  const _sfc_main = /* @__PURE__ */ defineComponent({
761
1160
  ...{ name: "CkInput" },
762
1161
  __name: "CkInput",
@@ -793,7 +1192,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
793
1192
  }
794
1193
  __expose({ focus, submit });
795
1194
  return (_ctx, _cache) => {
796
- return openBlock(), createBlock(_sfc_main$4, {
1195
+ return openBlock(), createBlock(_sfc_main$5, {
797
1196
  ref_key: "promptInputRef",
798
1197
  ref: promptInputRef,
799
1198
  "model-value": __props.modelValue,
@@ -806,7 +1205,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
806
1205
  }, createSlots({
807
1206
  "toolbar-right": withCtx((scope) => [
808
1207
  renderSlot(_ctx.$slots, "toolbar-right", normalizeProps(guardReactiveProps(scope)), () => [
809
- __props.loading ? (openBlock(), createBlock(_sfc_main$5, {
1208
+ __props.loading ? (openBlock(), createBlock(_sfc_main$6, {
810
1209
  key: 0,
811
1210
  "aria-label": __props.stopAriaLabel,
812
1211
  disabled: __props.disabled,
@@ -814,17 +1213,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
814
1213
  }, {
815
1214
  default: withCtx(() => [
816
1215
  renderSlot(_ctx.$slots, "stop-icon", {}, () => [
817
- createVNode(_sfc_main$c)
1216
+ createVNode(_sfc_main$f)
818
1217
  ])
819
1218
  ]),
820
1219
  _: 3
821
- }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$6, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
1220
+ }, 8, ["aria-label", "disabled"])) : (openBlock(), createBlock(_sfc_main$7, mergeProps({ key: 1 }, { ariaLabel: "Send message" }, {
822
1221
  type: "submit",
823
1222
  disabled: scope.disabled
824
1223
  }), {
825
1224
  default: withCtx(() => [
826
1225
  renderSlot(_ctx.$slots, "send-icon", {}, () => [
827
- createVNode(_sfc_main$d)
1226
+ createVNode(_sfc_main$g)
828
1227
  ])
829
1228
  ]),
830
1229
  _: 3
@@ -833,7 +1232,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
833
1232
  ]),
834
1233
  footer: withCtx(() => [
835
1234
  renderSlot(_ctx.$slots, "footer", {}, () => [
836
- __props.disclaimer ? (openBlock(), createBlock(_sfc_main$3, {
1235
+ __props.disclaimer ? (openBlock(), createBlock(_sfc_main$4, {
837
1236
  key: 0,
838
1237
  text: __props.disclaimer
839
1238
  }, null, 8, ["text"])) : createCommentVNode("", true)
@@ -854,17 +1253,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
854
1253
  });
855
1254
  export {
856
1255
  CkCopyMessageActionButton as C,
857
- _sfc_main$b as _,
858
- _sfc_main$1 as a,
859
- _sfc_main$a as b,
860
- _sfc_main as c,
861
- _sfc_main$7 as d,
862
- CkMessageActionButton as e,
863
- _sfc_main$6 as f,
864
- _sfc_main$4 as g,
865
- _sfc_main$3 as h,
866
- _sfc_main$5 as i,
867
- _sfc_main$d as j,
868
- _sfc_main$c as k,
869
- _sfc_main$2 as l
1256
+ _sfc_main$e as _,
1257
+ _sfc_main$2 as a,
1258
+ _sfc_main$d as b,
1259
+ _sfc_main$1 as c,
1260
+ _sfc_main$a as d,
1261
+ _sfc_main$9 as e,
1262
+ _sfc_main as f,
1263
+ _sfc_main$8 as g,
1264
+ _sfc_main$c as h,
1265
+ _sfc_main$7 as i,
1266
+ _sfc_main$5 as j,
1267
+ _sfc_main$4 as k,
1268
+ _sfc_main$6 as l,
1269
+ _sfc_main$g as m,
1270
+ _sfc_main$f as n,
1271
+ _sfc_main$3 as o
870
1272
  };