@8wave/ai-elements 0.123.0-beta.14 → 0.123.0-beta.16

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 (149) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-Dgikkf9Y.js → PkChatbotFilePreview-Dk748hZ0.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-Dgikkf9Y.js.map → PkChatbotFilePreview-Dk748hZ0.js.map} +1 -1
  3. package/dist/_chunks/{PkFilePreview-CG9peejh.js → PkFilePreview-Bcdfci6i.js} +2 -2
  4. package/dist/_chunks/{PkFilePreview-CG9peejh.js.map → PkFilePreview-Bcdfci6i.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreviewDialog-jzUvrw9R.js → PkFilePreviewDialog-nibxELSF.js} +2 -2
  6. package/dist/_chunks/{PkFilePreviewDialog-jzUvrw9R.js.map → PkFilePreviewDialog-nibxELSF.js.map} +1 -1
  7. package/dist/_chunks/{PkStreamingMarkdown-DI1AjsVC.js → PkStreamingMarkdown-C6cFkf82.js} +4 -4
  8. package/dist/_chunks/{PkStreamingMarkdown-DI1AjsVC.js.map → PkStreamingMarkdown-C6cFkf82.js.map} +1 -1
  9. package/dist/_chunks/{PkToolChatFile-BKX_7nJp.js → PkToolChatFile-5t_1vL81.js} +3 -3
  10. package/dist/_chunks/{PkToolChatFile-BKX_7nJp.js.map → PkToolChatFile-5t_1vL81.js.map} +1 -1
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-BYXzi6XB.js → PkToolRequestOAuthConnection-ST3-OlS4.js} +2 -2
  12. package/dist/_chunks/{PkToolRequestOAuthConnection-BYXzi6XB.js.map → PkToolRequestOAuthConnection-ST3-OlS4.js.map} +1 -1
  13. package/dist/_chunks/{PkToolShareDocument-D2uV6p8t.js → PkToolShareDocument-1zhZDa0R.js} +2 -2
  14. package/dist/_chunks/{PkToolShareDocument-D2uV6p8t.js.map → PkToolShareDocument-1zhZDa0R.js.map} +1 -1
  15. package/dist/_chunks/{PkToolShowArtifact-CyKWxAff.js → PkToolShowArtifact-DV78g_yD.js} +2 -2
  16. package/dist/_chunks/{PkToolShowArtifact-CyKWxAff.js.map → PkToolShowArtifact-DV78g_yD.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowCalendarEvent-BF2aXrwP.js → PkToolShowCalendarEvent-Dvp1SwBY.js} +2 -2
  18. package/dist/_chunks/{PkToolShowCalendarEvent-BF2aXrwP.js.map → PkToolShowCalendarEvent-Dvp1SwBY.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowContactForm-C-U785n6.js → PkToolShowContactForm-Bnjy0g50.js} +4 -4
  20. package/dist/_chunks/{PkToolShowContactForm-C-U785n6.js.map → PkToolShowContactForm-Bnjy0g50.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowDiagram-Bs5Ri9df.js → PkToolShowDiagram-C1Q5jhbk.js} +3 -3
  22. package/dist/_chunks/{PkToolShowDiagram-Bs5Ri9df.js.map → PkToolShowDiagram-C1Q5jhbk.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShowForm-CN5jvQqQ.js → PkToolShowForm-CT5_ln9b.js} +3 -3
  24. package/dist/_chunks/{PkToolShowForm-CN5jvQqQ.js.map → PkToolShowForm-CT5_ln9b.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowImageGallery-BtgWr1lk.js → PkToolShowImageGallery-BMP-xuYr.js} +4 -4
  26. package/dist/_chunks/{PkToolShowImageGallery-BtgWr1lk.js.map → PkToolShowImageGallery-BMP-xuYr.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowLocation-COmQJbXp.js → PkToolShowLocation-Drq1nnwN.js} +2 -2
  28. package/dist/_chunks/{PkToolShowLocation-COmQJbXp.js.map → PkToolShowLocation-Drq1nnwN.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowProductList-CRy6jNPa.js → PkToolShowProductList-AkLG4dBV.js} +2 -2
  30. package/dist/_chunks/{PkToolShowProductList-CRy6jNPa.js.map → PkToolShowProductList-AkLG4dBV.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowSources-CQweChKW.js → PkToolShowSources-DhZ5I_J-.js} +3 -3
  32. package/dist/_chunks/{PkToolShowSources-CQweChKW.js.map → PkToolShowSources-DhZ5I_J-.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowVideo-C8dP8I-g.js → PkToolShowVideo-C5jqPYXw.js} +3 -3
  34. package/dist/_chunks/{PkToolShowVideo-C8dP8I-g.js.map → PkToolShowVideo-C5jqPYXw.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowWeather-sx72yMH6.js → PkToolShowWeather-7_f5k1pX.js} +2 -2
  36. package/dist/_chunks/{PkToolShowWeather-sx72yMH6.js.map → PkToolShowWeather-7_f5k1pX.js.map} +1 -1
  37. package/dist/_chunks/{PkToolShowWebPages-fXkqV27c.js → PkToolShowWebPages-BqL9PjpM.js} +3 -3
  38. package/dist/_chunks/{PkToolShowWebPages-fXkqV27c.js.map → PkToolShowWebPages-BqL9PjpM.js.map} +1 -1
  39. package/dist/_chunks/{browser-CwAulEhA.js → browser-DnbodHv5.js} +32 -18
  40. package/dist/_chunks/browser-DnbodHv5.js.map +1 -0
  41. package/dist/_chunks/{chatImagePolicy-B183jp31.js → chatImagePolicy-ZiVuD6nX.js} +2 -2
  42. package/dist/_chunks/{chatImagePolicy-B183jp31.js.map → chatImagePolicy-ZiVuD6nX.js.map} +1 -1
  43. package/dist/_chunks/{index.es-DYy-Q9hZ.js → index.es-DRbDRAW5.js} +2 -2
  44. package/dist/_chunks/{index.es-DYy-Q9hZ.js.map → index.es-DRbDRAW5.js.map} +1 -1
  45. package/dist/_chunks/src-JJyCGvqH.js +183 -0
  46. package/dist/_chunks/src-JJyCGvqH.js.map +1 -0
  47. package/dist/_chunks/{useLightbox-B575Qxeu.js → useLightbox-BigL4WLe.js} +2 -2
  48. package/dist/_chunks/{useLightbox-B575Qxeu.js.map → useLightbox-BigL4WLe.js.map} +1 -1
  49. package/dist/_chunks/{utils-COV6n6VV.js → utils-B5VcWm3g.js} +2 -2
  50. package/dist/_chunks/{utils-COV6n6VV.js.map → utils-B5VcWm3g.js.map} +1 -1
  51. package/dist/ai-elements.es.js +23 -23
  52. package/dist-vue/PkChatbot.js +1 -1
  53. package/dist-vue/PkChatbotAudioTranscript.js +1 -1
  54. package/dist-vue/PkChatbotEmptyState.js +1 -1
  55. package/dist-vue/PkChatbotFilePreview.js +1 -1
  56. package/dist-vue/PkChatbotInput.js +1 -1
  57. package/dist-vue/PkChatbotMessages.js +1 -1
  58. package/dist-vue/PkChatbotStepPayload.js +1 -1
  59. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  60. package/dist-vue/PkChatbotSteps.js +1 -1
  61. package/dist-vue/PkChatbotViewChat.js +1 -1
  62. package/dist-vue/PkChatbotViewConversations.js +1 -1
  63. package/dist-vue/PkChatbotViewFiles.js +1 -1
  64. package/dist-vue/PkChatbotViewProfile.js +1 -1
  65. package/dist-vue/_chunks/{PkChatbot-DGut25cv.js → PkChatbot-tq-fJUij.js} +8 -8
  66. package/dist-vue/_chunks/{PkChatbot-DGut25cv.js.map → PkChatbot-tq-fJUij.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkChatbotAudioTranscript-DiZ7BEEH.js → PkChatbotAudioTranscript-SSTh074Z.js} +2 -2
  68. package/dist-vue/_chunks/{PkChatbotAudioTranscript-DiZ7BEEH.js.map → PkChatbotAudioTranscript-SSTh074Z.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotEmptyState-DT9Pxyjt.js → PkChatbotEmptyState-Dp0_UPJm.js} +2 -2
  70. package/dist-vue/_chunks/{PkChatbotEmptyState-DT9Pxyjt.js.map → PkChatbotEmptyState-Dp0_UPJm.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotFilePreview-BiurawUn.js → PkChatbotFilePreview-KxVpL0UT.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotFilePreview-BiurawUn.js.map → PkChatbotFilePreview-KxVpL0UT.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkChatbotInput-liQNntaY.js → PkChatbotInput-B_kPnNNB.js} +3 -3
  74. package/dist-vue/_chunks/{PkChatbotInput-liQNntaY.js.map → PkChatbotInput-B_kPnNNB.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkChatbotMessages-CDhi_NvV.js → PkChatbotMessages-BTZOic9V.js} +22 -22
  76. package/dist-vue/_chunks/{PkChatbotMessages-CDhi_NvV.js.map → PkChatbotMessages-BTZOic9V.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkChatbotStepPayload-XMAC8eoc.js → PkChatbotStepPayload-CoGCHBhJ.js} +2 -2
  78. package/dist-vue/_chunks/{PkChatbotStepPayload-XMAC8eoc.js.map → PkChatbotStepPayload-CoGCHBhJ.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CPWnpmuB.js → PkChatbotStepToolDetail-BJtIZBF0.js} +3 -3
  80. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CPWnpmuB.js.map → PkChatbotStepToolDetail-BJtIZBF0.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkChatbotSteps-CyT4Ck3C.js → PkChatbotSteps-CEJNclG4.js} +5 -5
  82. package/dist-vue/_chunks/{PkChatbotSteps-CyT4Ck3C.js.map → PkChatbotSteps-CEJNclG4.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkChatbotViewChat-8Ss2bt2I.js → PkChatbotViewChat-CnEOSH32.js} +8 -8
  84. package/dist-vue/_chunks/{PkChatbotViewChat-8Ss2bt2I.js.map → PkChatbotViewChat-CnEOSH32.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkChatbotViewConversations-ImCdmkUi.js → PkChatbotViewConversations-D7j5P1RO.js} +4 -4
  86. package/dist-vue/_chunks/{PkChatbotViewConversations-ImCdmkUi.js.map → PkChatbotViewConversations-D7j5P1RO.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkChatbotViewFiles-Ccti1JAS.js → PkChatbotViewFiles-B1mncBOo.js} +2 -2
  88. package/dist-vue/_chunks/{PkChatbotViewFiles-Ccti1JAS.js.map → PkChatbotViewFiles-B1mncBOo.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkChatbotViewProfile-ChEItAHZ.js → PkChatbotViewProfile--TWIrhYk.js} +2 -2
  90. package/dist-vue/_chunks/{PkChatbotViewProfile-ChEItAHZ.js.map → PkChatbotViewProfile--TWIrhYk.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkFilePreview-CfzGAziV.js → PkFilePreview-BKwnNsyV.js} +2 -2
  92. package/dist-vue/_chunks/{PkFilePreview-CfzGAziV.js.map → PkFilePreview-BKwnNsyV.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkFilePreviewDialog-DXIGcmYa.js → PkFilePreviewDialog-Cic7gmVR.js} +2 -2
  94. package/dist-vue/_chunks/{PkFilePreviewDialog-DXIGcmYa.js.map → PkFilePreviewDialog-Cic7gmVR.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkStreamingMarkdown-BTcd7ku7.js → PkStreamingMarkdown-CYlCIfA0.js} +3 -3
  96. package/dist-vue/_chunks/{PkStreamingMarkdown-BTcd7ku7.js.map → PkStreamingMarkdown-CYlCIfA0.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkSvgViewer-CvKzI689.js → PkSvgViewer-DBYr0CUi.js} +2 -2
  98. package/dist-vue/_chunks/{PkSvgViewer-CvKzI689.js.map → PkSvgViewer-DBYr0CUi.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolChatFile-DHZjc9cf.js → PkToolChatFile-B_PeJef8.js} +3 -3
  100. package/dist-vue/_chunks/{PkToolChatFile-DHZjc9cf.js.map → PkToolChatFile-B_PeJef8.js.map} +1 -1
  101. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Dy0GXNwC.js → PkToolRequestOAuthConnection-C9_w8V0T.js} +2 -2
  102. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Dy0GXNwC.js.map → PkToolRequestOAuthConnection-C9_w8V0T.js.map} +1 -1
  103. package/dist-vue/_chunks/{PkToolShareDocument-DHrzH95L.js → PkToolShareDocument-CsS5OTDj.js} +2 -2
  104. package/dist-vue/_chunks/{PkToolShareDocument-DHrzH95L.js.map → PkToolShareDocument-CsS5OTDj.js.map} +1 -1
  105. package/dist-vue/_chunks/{PkToolShowArtifact-BDfqYsCD.js → PkToolShowArtifact-Bh-jIo0V.js} +2 -2
  106. package/dist-vue/_chunks/{PkToolShowArtifact-BDfqYsCD.js.map → PkToolShowArtifact-Bh-jIo0V.js.map} +1 -1
  107. package/dist-vue/_chunks/{PkToolShowCalendarEvent-75TaGeMf.js → PkToolShowCalendarEvent-BsAOYLjp.js} +2 -2
  108. package/dist-vue/_chunks/{PkToolShowCalendarEvent-75TaGeMf.js.map → PkToolShowCalendarEvent-BsAOYLjp.js.map} +1 -1
  109. package/dist-vue/_chunks/{PkToolShowContactForm-4f3q-cfC.js → PkToolShowContactForm-BjfRuNuj.js} +4 -4
  110. package/dist-vue/_chunks/{PkToolShowContactForm-4f3q-cfC.js.map → PkToolShowContactForm-BjfRuNuj.js.map} +1 -1
  111. package/dist-vue/_chunks/{PkToolShowDiagram-CwowbfOT.js → PkToolShowDiagram-_NnrFDGT.js} +4 -4
  112. package/dist-vue/_chunks/{PkToolShowDiagram-CwowbfOT.js.map → PkToolShowDiagram-_NnrFDGT.js.map} +1 -1
  113. package/dist-vue/_chunks/{PkToolShowForm-xFFBo17s.js → PkToolShowForm-AqEY4_do.js} +3 -3
  114. package/dist-vue/_chunks/{PkToolShowForm-xFFBo17s.js.map → PkToolShowForm-AqEY4_do.js.map} +1 -1
  115. package/dist-vue/_chunks/{PkToolShowImageGallery-_hd3FyqC.js → PkToolShowImageGallery-DM5AJNZ3.js} +4 -4
  116. package/dist-vue/_chunks/{PkToolShowImageGallery-_hd3FyqC.js.map → PkToolShowImageGallery-DM5AJNZ3.js.map} +1 -1
  117. package/dist-vue/_chunks/{PkToolShowLocation-C7hBRwq8.js → PkToolShowLocation-DAQEuCuQ.js} +2 -2
  118. package/dist-vue/_chunks/{PkToolShowLocation-C7hBRwq8.js.map → PkToolShowLocation-DAQEuCuQ.js.map} +1 -1
  119. package/dist-vue/_chunks/{PkToolShowProductList-BPSYoZVU.js → PkToolShowProductList-CAV8be9a.js} +2 -2
  120. package/dist-vue/_chunks/{PkToolShowProductList-BPSYoZVU.js.map → PkToolShowProductList-CAV8be9a.js.map} +1 -1
  121. package/dist-vue/_chunks/{PkToolShowSources-CzFNTuWy.js → PkToolShowSources-CriswKr_.js} +3 -3
  122. package/dist-vue/_chunks/{PkToolShowSources-CzFNTuWy.js.map → PkToolShowSources-CriswKr_.js.map} +1 -1
  123. package/dist-vue/_chunks/{PkToolShowVideo-Dr7UtU-3.js → PkToolShowVideo-FSWM5MOl.js} +3 -3
  124. package/dist-vue/_chunks/{PkToolShowVideo-Dr7UtU-3.js.map → PkToolShowVideo-FSWM5MOl.js.map} +1 -1
  125. package/dist-vue/_chunks/{PkToolShowWeather-Z6vCrhh9.js → PkToolShowWeather-BC-Rx-sI.js} +2 -2
  126. package/dist-vue/_chunks/{PkToolShowWeather-Z6vCrhh9.js.map → PkToolShowWeather-BC-Rx-sI.js.map} +1 -1
  127. package/dist-vue/_chunks/{PkToolShowWebPages-CAeOJ5xx.js → PkToolShowWebPages-CPhm2ba3.js} +3 -3
  128. package/dist-vue/_chunks/{PkToolShowWebPages-CAeOJ5xx.js.map → PkToolShowWebPages-CPhm2ba3.js.map} +1 -1
  129. package/dist-vue/_chunks/{createChatbotApiClient-CuqGJGHD.js → createChatbotApiClient-CFKeOgEA.js} +2 -2
  130. package/dist-vue/_chunks/{createChatbotApiClient-CuqGJGHD.js.map → createChatbotApiClient-CFKeOgEA.js.map} +1 -1
  131. package/dist-vue/_chunks/{mcpOAuthReport-BdegDfcz.js → mcpOAuthReport-D-MtFYwN.js} +2 -2
  132. package/dist-vue/_chunks/{mcpOAuthReport-BdegDfcz.js.map → mcpOAuthReport-D-MtFYwN.js.map} +1 -1
  133. package/dist-vue/_chunks/src-nb8MU1sh.js +183 -0
  134. package/dist-vue/_chunks/src-nb8MU1sh.js.map +1 -0
  135. package/dist-vue/_chunks/{useChatbotStore-C1lW6qXE.js → useChatbotStore--6ws3cew.js} +4 -4
  136. package/dist-vue/_chunks/{useChatbotStore-C1lW6qXE.js.map → useChatbotStore--6ws3cew.js.map} +1 -1
  137. package/dist-vue/_chunks/{useSafeLocalStorage-DImmddot.js → useSafeLocalStorage-Bn4SsL8C.js} +2 -2
  138. package/dist-vue/_chunks/{useSafeLocalStorage-DImmddot.js.map → useSafeLocalStorage-Bn4SsL8C.js.map} +1 -1
  139. package/dist-vue/_chunks/{utils-D9BAduwQ.js → utils-BgvjC1Pu.js} +2 -2
  140. package/dist-vue/_chunks/{utils-D9BAduwQ.js.map → utils-BgvjC1Pu.js.map} +1 -1
  141. package/dist-vue/api.js +1 -1
  142. package/dist-vue/composables.js +4 -4
  143. package/dist-vue/index.js +31 -31
  144. package/package.json +1 -1
  145. package/dist/_chunks/browser-CwAulEhA.js.map +0 -1
  146. package/dist/_chunks/src-Bg96usAF.js +0 -132
  147. package/dist/_chunks/src-Bg96usAF.js.map +0 -1
  148. package/dist-vue/_chunks/src-j7iLdNe4.js +0 -132
  149. package/dist-vue/_chunks/src-j7iLdNe4.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
- import { r as t } from "./PkStreamingMarkdown-BTcd7ku7.js";
3
- import "./src-j7iLdNe4.js";
2
+ import { r as t } from "./PkStreamingMarkdown-CYlCIfA0.js";
3
+ import "./src-nb8MU1sh.js";
4
4
  import { n } from "./url-validation-CJV9pp4v.js";
5
5
  import { t as r } from "./useImageFallback-HUe4GHah.js";
6
- import { n as i, r as a } from "./PkChatbotFilePreview-BiurawUn.js";
6
+ import { n as i, r as a } from "./PkChatbotFilePreview-KxVpL0UT.js";
7
7
  import { t as o } from "./PkHeldImage-CK1xwkvq.js";
8
8
  import { VvIcon as s } from "@volverjs/ui-vue/components";
9
9
  import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, onMounted as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, watchEffect as C } from "vue";
@@ -84,4 +84,4 @@ var w = {
84
84
  }), N = /* @__PURE__ */ e({ default: () => P }), P = M;
85
85
  export { N as n, P as t };
86
86
 
87
- //# sourceMappingURL=PkToolShowImageGallery-_hd3FyqC.js.map
87
+ //# sourceMappingURL=PkToolShowImageGallery-DM5AJNZ3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowImageGallery-_hd3FyqC.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_normalizeClass","_Fragment","_renderList","_unref","_createBlock","PkHeldImage","_createCommentVNode","_sfc_main","__exportAll","useChatImageGate","useImageFallback","useImageSizes","useLightbox","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowImageGallery_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","galleryRef","ref","images","imageGate","isShown","url","canShowImage","measured","ready","image","gridCols","count","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","normalizeClass","Fragment","renderList","unref","getSize","isSameSite","onImageError","createBlock","createCommentVNode","PkToolShowImageGallery_exports","PkToolShowImageGallery_default"],"sources":["../../../../packages/components/src/chat/PkToolShowImageGallery.vue","../../../../packages/components/src/chat/PkToolShowImageGallery.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAM8B,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAUtB,GAEKI,IAAaC,EAAiB,GAC9B,EAAE,YAAS,eAAYjB,EAAc,GAErCkB,IAASH,QAAeD,EAAS,MAAM,OAAO,UAAU,CAAC,CAAC,GAE1D,EAAE,iBAAc,oBAAiBf,EAAiB,GAIlDoB,IAAYrB,EAAiB,GAC7BsB,KAAW,MAAgBD,EAAU,QAAQE,CAAG,KAAKC,EAAaD,CAAG,GAIrEE,oBAAW,IAAI,IAAY;EACjC,QAAkB;GACd,IAAMC,IAAQN,EAAO,MAAM,QACtB,MAAU,CAACK,EAAS,IAAIE,EAAM,GAAG,KAAKN,EAAU,QAAQM,EAAM,GAAG,CACtE;GACA,KAAK,IAAMA,KAASD,GAChB,EAAS,IAAIC,EAAM,GAAG;GAE1B,EAAQD,CAAK;EACjB,CAAC;EAED,IAAME,IAAWX,QAAe;GAC5B,IAAMY,IAAQT,EAAO,MAAM;GAO3B,OANIS,MAAU,IACH,qCAEPA,MAAU,IACH,gBAEJ;EACX,CAAC,GAEK,EAAE,YAAS1B,EAAY,EAAE,SAASe,EAAW,CAAC;E,OAEpDY,EAAU,YAAY;GAClB,MAAMC,EAAK;EACf,CA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,EAAA8B,CAAA,CAAY,CAACG,EAAM,GAAG,KADrCzC,EAAA,GAAAC,EAKuC,OAAA;;IAHlC,KAAKwC,EAAM;IACX,KAAKA,EAAM,OAAOA,EAAM,WAAO;IAChC,OAAM;IACL,UAAK,MAAEjC,EAAAoD,CAAA,CAAY,CAACnB,EAAM,GAAG;G,oBAClCzC,EAAA,GAAAC,EAOM,OAPNwB,GAOM,CAJFtB,EAAoD2C,GAAA;IAA5C,MAAK;IAAqB,OAAM;G,IACxC5C,EAES,QAFTwB,GAEStB,EADLN,EAAAA,GAAE,sBAAA,CAAA,GAAA,CAAA,C,OAhBVE,EAAA,GAAAS,EAI8CC,GAAA;;IAFzC,MAAMF,EAAA2B,CAAA,CAAS,CAAC,OAAOM,EAAM,GAAG;IACjC,MAAA;IACC,YAAO,MAAEjC,EAAA2B,CAAA,CAAS,CAAC,QAAQM,EAAM,GAAG"}
1
+ {"version":3,"file":"PkToolShowImageGallery-DM5AJNZ3.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_normalizeClass","_Fragment","_renderList","_unref","_createBlock","PkHeldImage","_createCommentVNode","_sfc_main","__exportAll","useChatImageGate","useImageFallback","useImageSizes","useLightbox","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowImageGallery_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","galleryRef","ref","images","imageGate","isShown","url","canShowImage","measured","ready","image","gridCols","count","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","normalizeClass","Fragment","renderList","unref","getSize","isSameSite","onImageError","createBlock","createCommentVNode","PkToolShowImageGallery_exports","PkToolShowImageGallery_default"],"sources":["../../../../packages/components/src/chat/PkToolShowImageGallery.vue","../../../../packages/components/src/chat/PkToolShowImageGallery.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAM8B,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAUtB,GAEKI,IAAaC,EAAiB,GAC9B,EAAE,YAAS,eAAYjB,EAAc,GAErCkB,IAASH,QAAeD,EAAS,MAAM,OAAO,UAAU,CAAC,CAAC,GAE1D,EAAE,iBAAc,oBAAiBf,EAAiB,GAIlDoB,IAAYrB,EAAiB,GAC7BsB,KAAW,MAAgBD,EAAU,QAAQE,CAAG,KAAKC,EAAaD,CAAG,GAIrEE,oBAAW,IAAI,IAAY;EACjC,QAAkB;GACd,IAAMC,IAAQN,EAAO,MAAM,QACtB,MAAU,CAACK,EAAS,IAAIE,EAAM,GAAG,KAAKN,EAAU,QAAQM,EAAM,GAAG,CACtE;GACA,KAAK,IAAMA,KAASD,GAChB,EAAS,IAAIC,EAAM,GAAG;GAE1B,EAAQD,CAAK;EACjB,CAAC;EAED,IAAME,IAAWX,QAAe;GAC5B,IAAMY,IAAQT,EAAO,MAAM;GAO3B,OANIS,MAAU,IACH,qCAEP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,KAA8BjC,EAAAmD,CAAA,CAAU,CAAClB,EAAM,GAAG,IAAgC,KAAA,I;G,IAMxEjC,EAAA2B,CAAA,CAAS,CAAC,QAAQM,EAAM,GAAG,IAKvBjC,EAAA8B,CAAA,CAAY,CAACG,EAAM,GAAG,KADrCzC,EAAA,GAAAC,EAKuC,OAAA;;IAHlC,KAAKwC,EAAM;IACX,KAAKA,EAAM,OAAOA,EAAM,WAAO;IAChC,OAAM;IACL,UAAK,MAAEjC,EAAAoD,CAAA,CAAY,CAACnB,EAAM,GAAG;G,oBAClCzC,EAAA,GAAAC,EAOM,OAPNwB,GAOM,CAJFtB,EAAoD2C,GAAA;IAA5C,MAAK;IAAqB,OAAM;G,IACxC5C,EAES,QAFTwB,GAEStB,EADLN,EAAAA,GAAE,sBAAA,CAAA,GAAA,CAAA,C,OAhBVE,EAAA,GAAAS,EAI8CC,GAAA;;IAFzC,MAAMF,EAAA2B,CAAA,CAAS,CAAC,OAAOM,EAAM,GAAG;IACjC,MAAA;IACC,YAAO,MAAEjC,EAAA2B,CAAA,CAAS,CAAC,QAAQM,EAAM,GAAG"}
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
2
  import { t } from "./VvButtonLocalized-C-vx25u4.js";
3
3
  import { n, t as r } from "./cdn-css-C3_zuSx6.js";
4
- import "./src-j7iLdNe4.js";
4
+ import "./src-nb8MU1sh.js";
5
5
  import { VvButtonGroup as i, VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
6
6
  import { computed as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, guardReactiveProps as g, normalizeProps as _, onMounted as v, openBlock as y, ref as b, toDisplayString as x, unref as S, watchEffect as C, withCtx as w } from "vue";
7
7
  import { useClipboard as T } from "@vueuse/core";
@@ -141,4 +141,4 @@ var M = {
141
141
  }), W = /* @__PURE__ */ e({ default: () => G }), G = U;
142
142
  export { W as n, G as t };
143
143
 
144
- //# sourceMappingURL=PkToolShowLocation-C7hBRwq8.js.map
144
+ //# sourceMappingURL=PkToolShowLocation-DAQEuCuQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowLocation-C7hBRwq8.js","names":["$t","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","_createCommentVNode","_sfc_main","__exportAll","getShadowRoot","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","PkToolShowLocation_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","geocodedCoords","ref","MAP_STYLES","getCurrentInstance","mapStyle","input","result","hasCoords","center","getNavDestination","openGoogleMaps","openAppleMaps","openWaze","copyLocation","copy","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","normalizeProps","guardReactiveProps","_cache","createTextVNode","MglMap","MglNavigationControl","MglGeolocateControl","MglScaleControl","MglMarker","MglPopup","createCommentVNode","PkToolShowLocation_exports","PkToolShowLocation_default"],"sources":["../../../../packages/components/src/chat/PkToolShowLocation.vue","../../../../packages/components/src/chat/PkToolShowLocation.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBI,IAAMgC,IAAQC,GAaR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAUtB,GAEKK,IAAiBC,EAA6B,IAAI,GAElDC,IAAa;GACf,OAAO;GACP,MAAM;EACV;EAEA,QAAgB;GACZ,EACI,mEACApB,EAAcqB,EAAmB,CAAC,EAAE,OAAO,GAAG,CAClD;EACJ,CAAC;EAED,IAAMC,IAAWL,QACbJ,EAAM,SAASO,EAAW,OAAOA,EAAW,KAChD;EAEA,EAAY,YAAY;GACpB,IAAMG,IAAQP,EAAS,MAAM;GAC7B,IAAKO,KAASA,EAAM,YAAY,QAASA,EAAM,WAG1CV,EAAM,gBAIX,IAAI;IACA,IAAMW,IAAS,MAAMX,EAAM,eAAeU,EAAM,OAAO;IACvD,AAAIC,MAEA,EAAe,QAAQ,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AAA;OADxB,UAAS;OACR,gBAAc;;MACnBnE,EAA4CG,EAAAiE,CAAA,GAAA,EAAvB,UAAS,YAAW,CAAA;MACzCpE,EAA0CG,EAAAkE,CAAA,GAAA,EAAzB,UAAS,cAAa,CAAA;MACvCrE,EAaYG,EAAAmE,CAAA,GAAA;OAbA,aAAalC,EAAA;OAAS,OAAOZ,EAAA;;OACrC,SAAAtB,QAWW,CAXXF,EAWWG,EAAAoE,CAAA,GAAA,EAXA,gBAAc,GAAK,GAAA;QAC1B,SAAArE,QASM,CATNH,EASM,OATNgB,GASM,CARFhB,EAEI,KAFJiB,GAEIf,EADGyB,EAAA,MAAS,MAAM,IAAI,GAAA,CAAA,GAGhBA,EAAA,MAAS,MAAM,WADzB7B,EAAA,GAAAC,EAII,KAJJmB,GAIIhB,EADGyB,EAAA,MAAS,MAAM,OAAO,GAAA,CAAA,K;;;;;;;;IAOjD3B,EAQM,OARNmB,GAQM;KAPFnB,EAEI,KAFJoB,GAEIlB,EADGyB,EAAA,MAAS,MAAM,IAAI,GAAA,CAAA;KAE1B3B,EAA+D,KAA/DqB,GAA+DnB,EAA7ByB,EAAA,MAAS,MAAM,OAAO,GAAA,CAAA;KAC/CA,EAAA,MAAS,MAAM,kBAAxB7B,EAAA,GAAAC,EAEI,KAFJuB,GAEIpB,EADGyB,EAAA,MAAS,MAAM,cAAc,GAAA,CAAA,K"}
1
+ {"version":3,"file":"PkToolShowLocation-DAQEuCuQ.js","names":["$t","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","_createCommentVNode","_sfc_main","__exportAll","getShadowRoot","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","PkToolShowLocation_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","geocodedCoords","ref","MAP_STYLES","getCurrentInstance","mapStyle","input","result","hasCoords","center","getNavDestination","openGoogleMaps","openAppleMaps","openWaze","copyLocation","copy","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","normalizeProps","guardReactiveProps","_cache","createTextVNode","MglMap","MglNavigationControl","MglGeolocateControl","MglScaleControl","MglMarker","MglPopup","createCommentVNode","PkToolShowLocation_exports","PkToolShowLocation_default"],"sources":["../../../../packages/components/src/chat/PkToolShowLocation.vue","../../../../packages/components/src/chat/PkToolShowLocation.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBI,IAAMgC,IAAQC,GAaR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAUtB,GAEKK,IAAiBC,EAA6B,IAAI,GAElDC,IAAa;GACf,OAAO;GACP,MAAM;EACV;EAEA,QAAgB;GACZ,EACI,mEACApB,EAAcqB,EAAmB,CAAC,EAAE,OAAO,GAAG,CAClD;EACJ,CAAC;EAED,IAAMC,IAAWL,QACbJ,EAAM,SAASO,EAAW,OAAOA,EAAW,KAChD;EAEA,EAAY,YAAY;GACpB,IAAMG,IAAQP,EAAS,MAAM;GAC7B,IAAKO,KAASA,EAAM,YAAY,QAASA,EAAM,WAG1CV,EAAM,gBAIX,IAAI;IACA,IAAMW,IAAS,MAAMX,EAAM,eAAeU,EAAM,OAAO;IACvD,AAAIC,MAEA,EAAe,QAAQ,CAACA,EAAO,WAAWA,EAAO,QAAQ;GAEjE,QAAQ,CAER;EACJ,CAAC;EAED,IAAMC,IAAYR,QAETD,EAAS,MAAM,OAAO,YAAY,QAC/BA,EAAS,MAAM,OAAO,aAAa,QACvCE,EAAe,SAAS,IAChC,GAEMQ,IAAST,QAEPD,EAAS,MAAM,OAAO,YAAY,QAClCA,EAAS,MAAM,OAAO,aAAa,OAG5B,CACHA,EAAS,MAAM,MAAM,WACrBA,EAAS,MAAM,MAAM,QACzB,IAEGE,EAAe,SAAS,CAAC,GAAG,CAAC,CACvC,GAGKS,UACFF,EAAU,QACJ,GAAGC,EAAO,MAAM,GAAG,GAAGA,EAAO,MAAM,OAClCV,EAAS,MAAM,OAAO,WAAW,IAEtCY,UAAuB;GAEzB,AADcZ,EAAS,MAAM,SAI7B,O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AAA,MAAS,MAAM,OAAO,GAAA,CAAA,K;;;;;;;;IAOjD3B,EAQM,OARNmB,GAQM;KAPFnB,EAEI,KAFJoB,GAEIlB,EADGyB,EAAA,MAAS,MAAM,IAAI,GAAA,CAAA;KAE1B3B,EAA+D,KAA/DqB,GAA+DnB,EAA7ByB,EAAA,MAAS,MAAM,OAAO,GAAA,CAAA;KAC/CA,EAAA,MAAS,MAAM,kBAAxB7B,EAAA,GAAAC,EAEI,KAFJuB,GAEIpB,EADGyB,EAAA,MAAS,MAAM,cAAc,GAAA,CAAA,K"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
- import { r as t } from "./PkStreamingMarkdown-BTcd7ku7.js";
2
+ import { r as t } from "./PkStreamingMarkdown-CYlCIfA0.js";
3
3
  import { t as n } from "./PkLazyImg-D_Tmtfz3.js";
4
4
  import { t as r } from "./PkUrl-IFszepUi.js";
5
5
  import { t as i } from "./PkHeldImage-CK1xwkvq.js";
@@ -68,4 +68,4 @@ var x = {
68
68
  }), A = /* @__PURE__ */ e({ default: () => j }), j = k;
69
69
  export { A as n, j as t };
70
70
 
71
- //# sourceMappingURL=PkToolShowProductList-BPSYoZVU.js.map
71
+ //# sourceMappingURL=PkToolShowProductList-CAV8be9a.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowProductList-BPSYoZVU.js","names":["__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_unref","PkHeldImage","PkLazyImg","_createCommentVNode","_createElementVNode","_toDisplayString","_createVNode","PkUrl","_sfc_main","__exportAll","useChatImageGate","PkLazyImg_default","PkUrl_default","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowProductList_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","imageGate","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","renderList","index","normalizeClass","product","createBlock","resolveDynamicComponent","withCtx","unref","createCommentVNode","createElementVNode","toDisplayString","createVNode","PkToolShowProductList_exports","PkToolShowProductList_default"],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOI,IAAMgC,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAatB,GAIKI,IAAYjB,EAAiB;;;GAKzB,OAAAe,EAAA,OAAU,OAAO,UAAU,UADrCjC,EAAA,GAAAC,EA6DK,MA7DLqB,GA6DK,EA1DDtB,EAAA,EAAA,GAAAC,EAyDKC,GAAA,MAAAC,EAxD0B8B,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrBjC,EAAA,GAAAC,EAyDK,MAAA;IAvDA,KAAKy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":3,"file":"PkToolShowProductList-CAV8be9a.js","names":["__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_unref","PkHeldImage","PkLazyImg","_createCommentVNode","_createElementVNode","_toDisplayString","_createVNode","PkUrl","_sfc_main","__exportAll","useChatImageGate","PkLazyImg_default","PkUrl_default","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowProductList_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","imageGate","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","renderList","index","normalizeClass","product","createBlock","resolveDynamicComponent","withCtx","unref","createCommentVNode","createElementVNode","toDisplayString","createVNode","PkToolShowProductList_exports","PkToolShowProductList_default"],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line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B,GAAA;MAA1C,MAAK;MAAU,OAAM;K,IAC7BtB,EAA4BC,GAAA,EAApB,KAAK6B,EAAQ,I;KAEzBhC,EAcM,OAdNc,GAcM,CAZQkB,EAAQ,SADlB5C,EAAA,GAAAC,EAIO,QAJP0B,GAIOd,EADA+B,EAAQ,KAAK,GAAA,CAAA,K,WAMVA,EAAQ,gBADlB5C,EAAA,GAAAC,EAIO,QAJP2B,GAIOf,EADA+B,EAAQ,YAAY,GAAA,CAAA,K;KAIrBA,EAAQ,eADlB5C,EAAA,GAAAC,EAII,KAJJ4B,GAIIhB,EADG+B,EAAQ,WAAW,GAAA,CAAA,K"}
@@ -1,8 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
2
  import { i as t } from "./Document-D5FVOcP9.js";
3
3
  import { t as n } from "./VvButtonLocalized-C-vx25u4.js";
4
- import { t as r } from "./PkStreamingMarkdown-BTcd7ku7.js";
5
- import "./src-j7iLdNe4.js";
4
+ import { t as r } from "./PkStreamingMarkdown-CYlCIfA0.js";
5
+ import "./src-nb8MU1sh.js";
6
6
  import { t as i } from "./markdown-BiG_7-9D.js";
7
7
  import { t as a } from "./PkUrl-IFszepUi.js";
8
8
  import { VvIcon as o } from "@volverjs/ui-vue/components";
@@ -260,4 +260,4 @@ var T = ["title"], E = {
260
260
  }), Q = /* @__PURE__ */ e({ default: () => $ }), $ = Z;
261
261
  export { D as i, Q as n, M as r, $ as t };
262
262
 
263
- //# sourceMappingURL=PkToolShowSources-CzFNTuWy.js.map
263
+ //# sourceMappingURL=PkToolShowSources-CriswKr_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowSources-CzFNTuWy.js","names":["_hoisted_1","_hoisted_2","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_createVNode","_createElementVNode","_toDisplayString","_unref","_createCommentVNode","_sfc_main","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_createVNode","_unref","_createElementVNode","_toDisplayString","_createCommentVNode","PkUrl","_sfc_main","$t","__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createCommentVNode","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","_sfc_main","__exportAll","getTypeIcon","VvButtonLocalized","PkStreamingMarkdown_default","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","defineComponent","props","__props","similarityPercent","computed","max","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","createVNode","createElementVNode","toDisplayString","unref","createCommentVNode","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","PkDocumentHeader_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","PkToolShowSources_vue_vue_type_script_setup_true_lang_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","reactive","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","ref","visibleGroups","hasMore","_component_VvButton","createTextVNode","_ctx","renderList","group","createBlock","chunk","Transition","withCtx","normalizeClass","_cache","PkToolShowSources_exports","PkToolShowSources_default"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAMyD,IAAQC,GAORC,IAAoBC,QAAe;GACrC,IAAIH,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMI,IACFJ,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaI,IAAO,GAAG;EACpD,CAAC;;;;IAIDvD,EAAsEwD,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrCvD,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAOmD,EA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EAAA,GAAAC,EAQS,UAAA;;MANL,OAAM;MACL,UAAK,MAAEoF,EAAaW,EAAM,OAAO;K,IAClC7F,EAEsB6B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAY5B,EAAA,MACtBC,EAAGR,EAAAA,GAAE,uBAAA,CAAA,GAAA,CAAA,C;KAKCmG,EAAM,aADhBhG,EAAA,GAAAC,EAUI,KAAA;;MARC,MAAM+F,EAAM;MACb,QAAO;MACP,KAAI;MACJ,OAAM;K,IACN7F,EAEsB6B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAY5B,EAAA,MACtBC,EAAGR,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,C;KAK0C+B,EAAA,cAAsDoE,EAAM,iBAAY,UAD3HhG,EAAA,GAAAC,EAcS,UAAA;;MATL,OAAKc,EAAA,CAAC,gFAA8E,EACtB,WAAA,CAAAiF,EAAM,U;MAGnE,UAAK,MAAEpE,EAAA,WAAWoE,EAAM,UAAU;K,IACnC7F,EAEsB6B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAY5B,EAAA,MACtBC,EAAGR,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvB4F,GAAA,SADVzF,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAmG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAId,EAAA;I,IACpBnF,EAEsB6B,GAAA;KADjB,MAAMsD,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAYlF,EAAA,MACtBC,EACIiF,EAAA,QAA+BzF,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAAuE,EAAA,MAAe,SAAM,E"}
1
+ {"version":3,"file":"PkToolShowSources-CriswKr_.js","names":["_hoisted_1","_hoisted_2","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_createVNode","_createElementVNode","_toDisplayString","_unref","_createCommentVNode","_sfc_main","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_createVNode","_unref","_createElementVNode","_toDisplayString","_createCommentVNode","PkUrl","_sfc_main","$t","__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createCommentVNode","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","_sfc_main","__exportAll","getTypeIcon","VvButtonLocalized","PkStreamingMarkdown_default","stripMarkdown","PkUrl_default","_hoisted_1$2","_hoisted_2$2","PkChunkPreview_default","defineComponent","props","__props","similarityPercent","computed","max","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","createVNode","createElementVNode","toDisplayString","unref","createCommentVNode","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","PkDocumentHeader_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","PkToolShowSources_vue_vue_type_script_setup_true_lang_default","toolPart","sources","groupedSources","groups","source","existing","maxSimilarity","s","expandedDocuments","reactive","expandedChunks","contextData","loadingContext","toggleDocument","documentId","toggleChunk","chunkId","handleExpandContext","content","clearContext","showMore","ref","visibleGroups","hasMore","_component_VvButton","createTextVNode","_ctx","renderList","group","createBlock","chunk","Transition","withCtx","normalizeClass","_cache","PkToolShowSources_exports","PkToolShowSources_default"],"sources":["../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkChunkPreview.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkDocumentHeader.vue","../../../../packages/components/src/chat/PkToolShowSources.vue","../../../../packages/components/src/chat/PkToolShowSources.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { stripMarkdown } from 'utils'\n\n const props = defineProps<{\n content: string\n similarity?: number\n maxSimilarity?: number\n expanded: boolean\n }>()\n\n const similarityPercent = computed(() => {\n if (props.similarity == null) {\n return null\n }\n const max =\n props.maxSimilarity && props.maxSimilarity > 0\n ? props.maxSimilarity\n : 1\n return Math.round((props.similarity / max) * 100)\n })\n</script>\n\n<template>\n <VvIcon name=\"ri:text-snippet\" class=\"shrink-0 text-12 text-word-4\" />\n <span class=\"text-10 text-word-2 truncate flex-1\" :title=\"content\">\n {{ stripMarkdown(content) }}\n </span>\n <span v-if=\"similarityPercent != null\" class=\"text-10 text-word-4 shrink-0\">\n {{ similarityPercent }}%\n </span>\n <VvIcon\n :name=\"expanded ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-14 text-word-4 shrink-0\" />\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import type { DocumentType } from 'models'\n import { getTypeIcon } from 'models'\n import PkUrl from '../PkUrl.vue'\n\n defineProps<{\n type: string\n name: string\n url?: string\n filename?: string\n /**\n * The address as text, not a link: for a header drawn inside a button,\n * where a link is invalid HTML and its click also toggles the row\n */\n mutedUrl?: boolean\n }>()\n</script>\n\n<template>\n <VvIcon\n :name=\"getTypeIcon(type as DocumentType)\"\n class=\"shrink-0 text-14 text-word-3\" />\n <div class=\"flex flex-col gap-2 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate block\">\n {{ name }}\n </strong>\n <span v-if=\"filename\" class=\"text-10 text-word-4 truncate\">\n {{ filename }}\n </span>\n <span\n v-if=\"url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-10\" />\n <PkUrl :url=\"url\" :muted=\"mutedUrl\" />\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive } from 'vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChunkPreview from './PkChunkPreview.vue'\n import PkDocumentHeader from './PkDocumentHeader.vue'\n\n interface SourceItem {\n chunkId: string\n documentId: string\n documentName: string\n documentType: string\n language: string\n content: string\n chunkIndex?: number | null\n similarity?: number\n sourceUrl?: string\n sourceFilename?: string\n sourceDescription?: string\n sourceImageUrl?: string\n }\n\n const props = defineProps<{\n part: unknown\n onExpandContext?: (payload: {\n documentId: string\n chunkIndex: number\n }) => Promise<string>\n onDownload?: (documentId: string) => void\n }>()\n\n const toolPart = computed(() => {\n return props.part as {\n input?: {\n sources: SourceItem[]\n }\n }\n })\n\n const sources = computed(() => toolPart.value.input?.sources || [])\n\n const groupedSources = computed(() => {\n const groups = new Map<\n string,\n { document: SourceItem; chunks: SourceItem[] }\n >()\n for (const source of sources.value) {\n const existing = groups.get(source.documentId)\n if (existing) {\n existing.chunks.push(source)\n } else {\n groups.set(source.documentId, {\n document: source,\n chunks: [source],\n })\n }\n }\n return [...groups.values()]\n })\n\n const maxSimilarity = computed(() => {\n return Math.max(...sources.value.map((s) => s.similarity ?? 0), 0)\n })\n\n const expandedDocuments = reactive(new Set<string>())\n const expandedChunks = reactive(new Set<string>())\n const contextData = reactive(new Map<string, string>())\n const loadingContext = reactive(new Set<string>())\n\n const toggleDocument = (documentId: string) => {\n if (expandedDocuments.has(documentId)) {\n expandedDocuments.delete(documentId)\n } else {\n expandedDocuments.add(documentId)\n }\n }\n\n const toggleChunk = (chunkId: string) => {\n if (expandedChunks.has(chunkId)) {\n expandedChunks.delete(chunkId)\n } else {\n expandedChunks.add(chunkId)\n }\n }\n\n const handleExpandContext = async (source: SourceItem) => {\n if (source.chunkIndex == null || !props.onExpandContext) {\n return\n }\n loadingContext.add(source.chunkId)\n try {\n const content = await props.onExpandContext({\n documentId: source.documentId,\n chunkIndex: source.chunkIndex,\n })\n contextData.set(source.chunkId, content)\n } finally {\n loadingContext.delete(source.chunkId)\n }\n }\n\n const clearContext = (chunkId: string) => {\n contextData.delete(chunkId)\n }\n\n const showMore = ref(false)\n const visibleGroups = computed(() => {\n if (showMore.value) {\n return groupedSources.value\n }\n return groupedSources.value.slice(0, 3)\n })\n const hasMore = computed(() => groupedSources.value.length > 3)\n</script>\n\n<template>\n <div v-if=\"sources.length\" class=\"flex flex-col gap-xs w-full\">\n <div class=\"flex items-center gap-4 text-12 text-word-3 font-semibold\">\n <VvIcon name=\"ri:article-line\" class=\"text-14\" />\n {{ $t('label.sources') }}\n <span class=\"text-word-4 font-normal\">\n ({{ groupedSources.length }})\n </span>\n </div>\n\n <ul class=\"flex flex-col gap-xs\">\n <li\n v-for=\"group in visibleGroups\"\n :key=\"group.document.documentId\"\n class=\"border border-surface-3 rounded-xl overflow-hidden\">\n <!-- Document header: the toggle, and beside it the link to\n the source, because a link inside a button is invalid\n HTML and its click also toggled the row -->\n <div\n class=\"flex items-center hover:bg-surface-1 transition-colors\">\n <button\n type=\"button\"\n class=\"flex items-center gap-8 p-8 flex-1 min-w-0 text-left cursor-pointer\"\n :aria-expanded=\"\n expandedDocuments.has(group.document.documentId)\n \"\n @click=\"toggleDocument(group.document.documentId)\">\n <PkDocumentHeader\n :type=\"group.document.documentType\"\n :name=\"group.document.documentName\"\n :url=\"group.document.sourceUrl\"\n :filename=\"group.document.sourceFilename\"\n muted-url />\n <div class=\"flex items-center gap-4 shrink-0\">\n <span\n v-if=\"group.chunks.length > 1\"\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2\">\n {{ group.chunks.length }}\n </span>\n <span\n class=\"text-10 text-word-4 bg-surface-2 rounded px-4 py-2 uppercase\">\n {{ group.document.language }}\n </span>\n <VvIcon\n :name=\"\n expandedDocuments.has(\n group.document.documentId,\n )\n ? 'ri:arrow-up-s-line'\n : 'ri:arrow-down-s-line'\n \"\n class=\"text-16 text-word-3\" />\n </div>\n </button>\n <VvButton\n v-if=\"group.document.sourceUrl\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:external-link-line\"\n class=\"text-10 shrink-0 mr-8\"\n :href=\"group.document.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n :title=\"$t('action.open')\"\n :aria-label=\"$t('action.open')\" />\n </div>\n\n <!-- Expanded content -->\n <div\n v-if=\"expandedDocuments.has(group.document.documentId)\"\n class=\"border-t border-surface-3\">\n <PkStreamingMarkdown\n v-if=\"group.document.sourceDescription\"\n :markdown=\"group.document.sourceDescription\"\n class=\"px-8 py-4 text-10 text-word-3 bg-surface-1 border-b border-surface-3\" />\n\n <!-- Chunk excerpts -->\n <div\n v-for=\"chunk in group.chunks\"\n :key=\"chunk.chunkId\"\n class=\"border-b border-surface-3 last:border-b-0\">\n <button\n class=\"flex items-center gap-8 px-8 py-6 w-full text-left hover:bg-surface-1 transition-colors cursor-pointer\"\n @click=\"toggleChunk(chunk.chunkId)\">\n <PkChunkPreview\n :content=\"chunk.content\"\n :similarity=\"chunk.similarity\"\n :max-similarity=\"maxSimilarity\"\n :expanded=\"expandedChunks.has(chunk.chunkId)\" />\n </button>\n\n <!-- Expanded chunk content -->\n <div\n v-if=\"expandedChunks.has(chunk.chunkId)\"\n class=\"bg-surface-1 border-t border-surface-3\">\n <div class=\"p-8 text-10 text-word-3\">\n <transition mode=\"out-in\">\n <!-- Context expansion -->\n <PkStreamingMarkdown\n v-if=\"contextData.has(chunk.chunkId)\"\n :markdown=\"\n contextData.get(chunk.chunkId)!\n \"\n class=\"wysiwyg\" />\n\n <!-- Chunk content -->\n <PkStreamingMarkdown\n v-else\n :markdown=\"chunk.content\"\n class=\"wysiwyg\" />\n </transition>\n </div>\n\n <!-- Actions bar -->\n <div\n class=\"flex items-center gap-8 px-8 py-6 border-t border-surface-3 bg-surface\">\n <!-- Expand / collapse context -->\n <button\n v-if=\"\n onExpandContext &&\n chunk.chunkIndex != null &&\n !contextData.has(chunk.chunkId)\n \"\n class=\"text-10 text-word-3 hover:text-word flex items-center gap-4 cursor-pointer\"\n :disabled=\"\n loadingContext.has(chunk.chunkId)\n \"\n @click=\"handleExpandContext(chunk)\">\n <VvIcon\n :name=\"\n loadingContext.has(chunk.chunkId)\n ? 'loading-loop'\n : 'ri:expand-up-down-line'\n \"\n class=\"text-12\" />\n {{ $t('label.expandContext') }}\n </button>\n <button\n v-else-if=\"contextData.has(chunk.chunkId)\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n @click=\"clearContext(chunk.chunkId)\">\n <VvIcon\n name=\"ri:collapse-vertical-line\"\n class=\"text-12\" />\n {{ $t('label.collapseContext') }}\n </button>\n\n <!-- Open source URL -->\n <a\n v-if=\"chunk.sourceUrl\"\n :href=\"chunk.sourceUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 ml-auto\">\n <VvIcon\n name=\"ri:external-link-line\"\n class=\"text-12\" />\n {{ $t('label.openSource') }}\n </a>\n\n <!-- Download file -->\n <button\n v-if=\"\n onDownload &&\n chunk.documentType === 'file'\n \"\n class=\"text-10 text-word-3 hover:text-word-1 flex items-center gap-4 cursor-pointer\"\n :class=\"{\n 'ml-auto': !chunk.sourceUrl,\n }\"\n @click=\"onDownload(chunk.documentId)\">\n <VvIcon\n name=\"ri:download-line\"\n class=\"text-12\" />\n {{ $t('label.downloadFile') }}\n </button>\n </div>\n </div>\n </div>\n </div>\n </li>\n </ul>\n\n <!-- Show more -->\n <button\n v-if=\"hasMore\"\n class=\"text-12 text-word-3 cursor-pointer hover:underline flex items-center gap-4 mx-auto\"\n @click=\"showMore = !showMore\">\n <VvIcon\n :name=\"showMore ? 'ri:arrow-up-s-line' : 'ri:arrow-down-s-line'\"\n class=\"text-16\" />\n {{\n showMore\n ? $t('action.showLess')\n : $t('action.showMore', {\n count: groupedSources.length - 3,\n })\n }}\n </button>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAMyD,IAAQC,GAORC,IAAoBC,QAAe;GACrC,IAAIH,EAAM,cAAc,MACpB,OAAO;GAEX,IAAMI,IACFJ,EAAM,iBAAiBA,EAAM,gBAAgB,IACvCA,EAAM,gBACN;GACV,OAAO,KAAK,MAAOA,EAAM,aAAaI,IAAO,GAAG;EACpD,CAAC;;;;IAIDvD,EAAsEwD,GAAA;KAA9D,MAAK;KAAkB,OA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YlCIfA0.js";
2
+ import "./src-nb8MU1sh.js";
3
3
  import { t } from "./PkHeldImage-CK1xwkvq.js";
4
4
  import { VvIcon as n } from "@volverjs/ui-vue/components";
5
5
  import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, renderList as f, toDisplayString as p, unref as m } from "vue";
@@ -135,4 +135,4 @@ var b = {
135
135
  });
136
136
  export { M as default };
137
137
 
138
- //# sourceMappingURL=PkToolShowVideo-Dr7UtU-3.js.map
138
+ //# sourceMappingURL=PkToolShowVideo-FSWM5MOl.js.map