@8wave/ai-elements 0.125.0-beta.24 → 0.125.0-beta.26

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 (40) hide show
  1. package/dist/_chunks/{PkFilePreview-CyWTOCZC.js → PkFilePreview-BPsD2P7s.js} +406 -395
  2. package/dist/_chunks/PkFilePreview-BPsD2P7s.js.map +1 -0
  3. package/dist/_chunks/{PkFilePreviewDialog-CUHwFDmH.js → PkFilePreviewDialog-BW-Rubk2.js} +2 -2
  4. package/dist/_chunks/{PkFilePreviewDialog-CUHwFDmH.js.map → PkFilePreviewDialog-BW-Rubk2.js.map} +1 -1
  5. package/dist/_chunks/PkSelectionActions-DkETXtSL.js +264 -0
  6. package/dist/_chunks/PkSelectionActions-DkETXtSL.js.map +1 -0
  7. package/dist/_chunks/{PkToolShowSources-BE3Zv_uz.js → PkToolShowSources-B3VpJBVE.js} +2 -2
  8. package/dist/_chunks/{PkToolShowSources-BE3Zv_uz.js.map → PkToolShowSources-B3VpJBVE.js.map} +1 -1
  9. package/dist/_chunks/{markdown-Ou0WulrH.js → markdown-B_D4YzWu.js} +7 -1
  10. package/dist/_chunks/{markdown-Ou0WulrH.js.map → markdown-B_D4YzWu.js.map} +1 -1
  11. package/dist/ai-elements.es.js +4 -4
  12. package/dist-vue/PkChatbot.js +1 -1
  13. package/dist-vue/PkChatbotMessages.js +1 -1
  14. package/dist-vue/PkChatbotViewChat.js +1 -1
  15. package/dist-vue/PkChatbotViewFiles.js +1 -1
  16. package/dist-vue/_chunks/{Document-DHBTrCuO.js → Document-D1x1WBr-.js} +7 -1
  17. package/dist-vue/_chunks/{Document-DHBTrCuO.js.map → Document-D1x1WBr-.js.map} +1 -1
  18. package/dist-vue/_chunks/{PkChatbot-D0uPiMhj.js → PkChatbot-DyzEuNED.js} +3 -3
  19. package/dist-vue/_chunks/{PkChatbot-D0uPiMhj.js.map → PkChatbot-DyzEuNED.js.map} +1 -1
  20. package/dist-vue/_chunks/{PkChatbotMessages-l-IzEWsN.js → PkChatbotMessages-BISaZu4z.js} +2 -2
  21. package/dist-vue/_chunks/{PkChatbotMessages-l-IzEWsN.js.map → PkChatbotMessages-BISaZu4z.js.map} +1 -1
  22. package/dist-vue/_chunks/{PkChatbotViewChat-Ckl03UkZ.js → PkChatbotViewChat-CIfotKyM.js} +3 -3
  23. package/dist-vue/_chunks/{PkChatbotViewChat-Ckl03UkZ.js.map → PkChatbotViewChat-CIfotKyM.js.map} +1 -1
  24. package/dist-vue/_chunks/{PkChatbotViewFiles-CtOhnFCc.js → PkChatbotViewFiles-C4oGN4Xj.js} +2 -2
  25. package/dist-vue/_chunks/{PkChatbotViewFiles-CtOhnFCc.js.map → PkChatbotViewFiles-C4oGN4Xj.js.map} +1 -1
  26. package/dist-vue/_chunks/{PkFilePreview-B26pY-C2.js → PkFilePreview-DEKgCMkr.js} +432 -399
  27. package/dist-vue/_chunks/PkFilePreview-DEKgCMkr.js.map +1 -0
  28. package/dist-vue/_chunks/{PkFilePreviewDialog-Dy5jmAom.js → PkFilePreviewDialog-0qrzDWID.js} +2 -2
  29. package/dist-vue/_chunks/{PkFilePreviewDialog-Dy5jmAom.js.map → PkFilePreviewDialog-0qrzDWID.js.map} +1 -1
  30. package/dist-vue/_chunks/{PkToolShowSources-BiP9fVV2.js → PkToolShowSources-BMo_i8sv.js} +2 -2
  31. package/dist-vue/_chunks/{PkToolShowSources-BiP9fVV2.js.map → PkToolShowSources-BMo_i8sv.js.map} +1 -1
  32. package/dist-vue/index.js +6 -6
  33. package/dist-vue/packages/components/src/chat/PkSelectionActions.d.ts +0 -10
  34. package/dist-vue/packages/models/src/schema/Document.d.ts +18 -0
  35. package/dist-vue/style.css +1 -1
  36. package/package.json +1 -1
  37. package/dist/_chunks/PkFilePreview-CyWTOCZC.js.map +0 -1
  38. package/dist/_chunks/PkSelectionActions-DDyt_ksY.js +0 -241
  39. package/dist/_chunks/PkSelectionActions-DDyt_ksY.js.map +0 -1
  40. package/dist-vue/_chunks/PkFilePreview-B26pY-C2.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
- import { t } from "./PkFilePreview-B26pY-C2.js";
2
+ import { t } from "./PkFilePreview-DEKgCMkr.js";
3
3
  import { VvDialog as n } from "@volverjs/ui-vue/components";
4
4
  import { createBlock as r, createVNode as i, defineComponent as a, mergeModels as o, openBlock as s, useModel as c, withCtx as l } from "vue";
5
5
  // ../../packages/components/src/chat/PkFilePreviewDialog.vue?vue&type=script&setup=true&lang.ts
@@ -108,4 +108,4 @@ var u = /*@__PURE__*/ a({
108
108
  }), d = /* @__PURE__ */ e({ default: () => f }), f = u;
109
109
  export { d as n, f as t };
110
110
 
111
- //# sourceMappingURL=PkFilePreviewDialog-Dy5jmAom.js.map
111
+ //# sourceMappingURL=PkFilePreviewDialog-0qrzDWID.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkFilePreviewDialog-Dy5jmAom.js","names":["_useModel","__unplugin_components_0","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","_sfc_main","__exportAll","PkFilePreviewDialog_vue_vue_type_script_setup_true_lang_default","\"mode\"","\"modeModifiers\"","\"sheet\"","\"sheetModifiers\"","\"zoom\"","\"zoomModifiers\"","\"fit\"","\"fitModifiers\"","__emit","emit","mode","useModel","__props","sheet","zoom","fit","_component_VvDialog","VvDialog","openBlock","createBlock","_cache","$event","withCtx","createVNode","PkFilePreview_default","text","pointer","action","PkFilePreviewDialog_exports","PkFilePreviewDialog_default"],"sources":["../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCI,IAAMmB,IAAOD,GAaPE,IAAOpB,EAA4BsB,GAAC,MAAM,GAC1CC,IAAQvB,EAAmBsB,GAAC,OAAO,G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og-0qrzDWID.js","names":["_useModel","__unplugin_components_0","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","_sfc_main","__exportAll","PkFilePreviewDialog_vue_vue_type_script_setup_true_lang_default","\"mode\"","\"modeModifiers\"","\"sheet\"","\"sheetModifiers\"","\"zoom\"","\"zoomModifiers\"","\"fit\"","\"fitModifiers\"","__emit","emit","mode","useModel","__props","sheet","zoom","fit","_component_VvDialog","VvDialog","openBlock","createBlock","_cache","$event","withCtx","createVNode","PkFilePreview_default","text","pointer","action","PkFilePreviewDialog_exports","PkFilePreviewDialog_default"],"sources":["../../../../packages/components/src/chat/PkFilePreviewDialog.vue","../../../../packages/components/src/chat/PkFilePreviewDialog.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import type {\n ChatFilePreview,\n FilePointer,\n SelectionGroupCapability,\n } from 'models'\n import PkFilePreview from './PkFilePreview.vue'\n import type { ChatFilePreviewChanges } from './previewChanges'\n import type { ChatFilePreviewTarget, WordPreviewMode } from './utils'\n\n /**\n * The viewer of a file stored in a chat in a dialog over the page: the\n * chat's when it has no room for the panel beside it or the reader\n * expands it, the chat log's always. Open while it is mounted: `close`\n * asks the host to drop it. The viewer draws its own head, with the file\n * and the close button, so the dialog has no title and takes its name.\n */\n defineProps<{\n target: ChatFilePreviewTarget\n /** The authenticated download URL of the same version. */\n downloadUrl: string\n preview?: ChatFilePreview\n /** What the version changed from the one shown before, for a moment. */\n changes?: ChatFilePreviewChanges\n loading?: boolean\n error?: boolean\n /** Covers the screen, for a phone. */\n fullscreen?: boolean\n /** The versions of the file in the conversation, from 1. */\n versions?: number[]\n /** The shown version can be written again as the newest one. */\n restorable?: boolean\n /** Offers to go back to the panel beside the chat. */\n resize?: 'shrink'\n /** The selection bar's actions for this format: absent in the chat logs. */\n selectionActions?: SelectionGroupCapability\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n selectionSend: [\n text: string,\n pointer: FilePointer,\n action: { id: string; size: number },\n ]\n }>()\n\n // How the file is shown, kept by the host across panel and dialog\n const mode = defineModel<WordPreviewMode>('mode')\n const sheet = defineModel<number>('sheet')\n const zoom = defineModel<number>('zoom')\n // A boolean prop left out is false, not the viewer's default: the chat\n // logs keep no zoom, and their pages opened at 100% instead of fitted\n const fit = defineModel<boolean>('fit', { default: true })\n</script>\n\n<template>\n <VvDialog\n :model-value=\"true\"\n :aria-label=\"target.filename\"\n :modifiers=\"fullscreen ? 'fullscreen' : undefined\"\n class=\"pk-file-preview-dialog\"\n @update:model-value=\"!$event && emit('close')\">\n <PkFilePreview\n v-model:mode=\"mode\"\n v-model:sheet=\"sheet\"\n v-model:zoom=\"zoom\"\n v-model:fit=\"fit\"\n :kind=\"target.kind\"\n :filename=\"target.filename\"\n :version=\"target.version\"\n :versions\n :download-url\n :preview\n :changes\n :loading\n :error\n :restorable\n :resize\n :file-id=\"target.fileId\"\n :stored-file-name=\"target.storedFileName\"\n :selection-actions\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @selection-send=\"\n (text, pointer, action) =>\n emit('selectionSend', text, pointer, action)\n \"\n @close=\"emit('close')\" />\n </VvDialog>\n</template>\n\n<style lang=\"scss\">\n // Almost the whole window, room for a page of Word and a grid of Excel;\n // the viewer scrolls in its own box, so the content does not pad it.\n .pk-file-preview-dialog {\n &:not(.vv-dialog--fullscreen) > article {\n width: min(90rem, 94dvw);\n height: 92dvh;\n }\n\n // The library writes `max-height: auto`, which is no value: the\n // wrapper kept its 90dvh and the phone saw the chat around it\n &.vv-dialog--fullscreen > article {\n max-height: none;\n }\n\n .vv-dialog__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-height: 0;\n padding: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCI,IAAMmB,IAAOD,GAaPE,IAAOpB,EAA4BsB,GAAC,MAAM,GAC1CC,IAAQvB,EAAmBsB,GAAC,OAAO,GACnCE,IAAOxB,EAAmBsB,GAAC,MAAM,GAGjCG,IAAMzB,EAAoBsB,GAAC,KAAwB;;;GAIzD,OAAApB,EAAA,GAAAC,EAiCWuB,GAAA;IAhCN,eAAa;IACb,cAAYJ,EAAA,OAAO;IACnB,WAAWA,EAAA,aAAU,eAAkB,KAAA;IACxC,OAAM;IACL,uBAAkB,AAAAQ,EAAA,QAAA,MAAA,CAAGC,KAAUZ,EAAI,OAAA;;IACpC,SAAAf,QA0B6B,CA1B7BC,EA0B6BC,GAAA;KAzBjB,MAAMc,EAAA;KAAA,iBAAA,AAAAU,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,OAAOR,EAAA;KAAA,kBAAA,AAAAO,EAAA,QAAA,MAAA,EAAK,QAAAC;KACZ,MAAMP,EAAA;KAAA,iBAAA,AAAAM,EAAA,QAAA,MAAA,EAAI,QAAAC;KACV,KAAKN,EAAA;KAAA,gBAAA,AAAAK,EAAA,QAAA,MAAA,EAAG,QAAAC;KACf,MAAMT,EAAA,OAAO;KACb,UAAUA,EAAA,OAAO;KACjB,SAASA,EAAA,OAAO;KAChB,UAAAA,EAAA;KACA,gBAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,SAAAA,EAAA;KACA,OAAAA,EAAA;KACA,YAAAA,EAAA;KACA,QAAAA,EAAA;KACA,WAASA,EAAA,OAAO;KAChB,oBAAkBA,EAAA,OAAO;KACzB,qBAAAA,EAAA;KACA,WAAO,AAAAQ,EAAA,QAAA,MAAEX,EAAI,WAAYY,CAAM;KAC/B,WAAO,AAAAD,EAAA,QAAA,MAAEX,EAAI,SAAA;KACb,UAAM,AAAAW,EAAA,QAAA,MAAEX,EAAI,QAAA;KACZ,iBAAc,AAAAW,EAAA,QAAoB,GAAM,GAAS,MAA+BX,EAAI,iBAAkBgB,GAAMC,GAASC,CAAM;KAI3H,SAAK,AAAAP,EAAA,QAAA,MAAEX,EAAI,OAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
- import { i as t } from "./Document-DHBTrCuO.js";
2
+ import { i as t } from "./Document-D1x1WBr-.js";
3
3
  import { t as n } from "./VvButtonLocalized-C-vx25u4.js";
4
4
  import { t as r } from "./PkStreamingMarkdown-2FN4WMQD.js";
5
5
  import "./src-nb8MU1sh.js";
@@ -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-BiP9fVV2.js.map
263
+ //# sourceMappingURL=PkToolShowSources-BMo_i8sv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowSources-BiP9fVV2.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;KAA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AA,GAAA,CAAA,C,YAGMgF,EAAY,IAAImB,EAAM,OAAO,KAD5ChG,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-BMo_i8sv.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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"./_chunks/rolldown-runtime-CGnMp29N.js";
2
2
  import { t } from "./_chunks/PkEditorRadioButtons-Bw576DPQ.js";
3
3
  import { E as n, S as r, T as i, _ as a, f as o, m as s, o as c, r as l, s as u, u as d, v as f, w as p, x as m, y as h } from "./_chunks/schemas-BO5QlXAp.js";
4
- import { t as g } from "./_chunks/PkChatbotMessages-l-IzEWsN.js";
4
+ import { t as g } from "./_chunks/PkChatbotMessages-BISaZu4z.js";
5
5
  import { a as _, i as v, l as y, n as b, r as x } from "./_chunks/Media-DylqhvaF.js";
6
6
  import { $ as S, B as C, D as w, E as ee, F as te, G as ne, I as re, J as ie, K as ae, L as oe, N as se, P as ce, Q as le, R as ue, S as de, T as fe, U as pe, X as me, Z as he, _t as ge, a as _e, ct as ve, d as ye, dt as be, et as xe, f as Se, ft as Ce, i as we, lt as Te, mt as Ee, p as De, pt as Oe, q as ke, r as T, s as Ae, st as je, t as Me, tt as Ne, ut as Pe, w as Fe, x as Ie, y as Le, z as Re } from "./_chunks/Agent-Cm1LrkYm.js";
7
- import { c as ze, d as Be, l as Ve, r as He, s as Ue, t as We, u as Ge } from "./_chunks/Document-DHBTrCuO.js";
7
+ import { c as ze, d as Be, l as Ve, r as He, s as Ue, t as We, u as Ge } from "./_chunks/Document-D1x1WBr-.js";
8
8
  import { a as Ke, i as qe, n as Je } from "./_chunks/createChatbotApiClient-DO4_I5hT.js";
9
9
  import { t as Ye } from "./_chunks/PkChatbotAuth-Btxg3TF0.js";
10
10
  import { t as Xe } from "./_chunks/VvButtonLocalized-C-vx25u4.js";
@@ -17,7 +17,7 @@ import { B as ct, E as lt, F as ut, L as dt, M as ft, X as pt, Y as mt, Z as ht,
17
17
  import { t as xt } from "./_chunks/useSafeLocalStorage-Bn4SsL8C.js";
18
18
  import { t as St } from "./_chunks/useDialogConfirm-fn7iV-iE.js";
19
19
  import { i as Ct, n as wt, r as Tt, t as Et } from "./_chunks/PkChatbotViewConversations-DjhiHp8-.js";
20
- import { a as Dt, i as Ot, n as kt, o as At, s as jt, t as Mt } from "./_chunks/PkChatbotViewChat-Ckl03UkZ.js";
20
+ import { a as Dt, i as Ot, n as kt, o as At, s as jt, t as Mt } from "./_chunks/PkChatbotViewChat-CIfotKyM.js";
21
21
  import { t as Nt } from "./_chunks/PkChatbotError-BS84xuiu.js";
22
22
  import { t as Pt } from "./_chunks/useImageFallback-HUe4GHah.js";
23
23
  import { t as Ft } from "./_chunks/useLocalizedString-Dmn92nix.js";
@@ -39,8 +39,8 @@ import { t as sr } from "./_chunks/PkChatbotStepToolDetail-Yd8cUQJP.js";
39
39
  import { n as cr, t as lr } from "./_chunks/PkChatbotInput-D0KUEkAs.js";
40
40
  import { t as ur } from "./_chunks/PkChatbotEmptyState-COya3H3C.js";
41
41
  import { t as dr } from "./_chunks/PkChatbotViewProfile-NfTamy9j.js";
42
- import { t as fr } from "./_chunks/PkChatbot-D0uPiMhj.js";
43
- import { i as pr, r as mr, t as hr } from "./_chunks/PkToolShowSources-BiP9fVV2.js";
42
+ import { t as fr } from "./_chunks/PkChatbot-DyzEuNED.js";
43
+ import { i as pr, r as mr, t as hr } from "./_chunks/PkToolShowSources-BMo_i8sv.js";
44
44
  import { t as gr } from "./_chunks/mcpOAuthReport-D-MtFYwN.js";
45
45
  import { t as _r } from "./_chunks/PkToolShowEmail-BehvoNsz.js";
46
46
  import { t as vr } from "./_chunks/PkToolShowMessage-Cca7K7GQ.js";
@@ -55,7 +55,7 @@ import { t as Er } from "./_chunks/PkToolShowImageGallery-DLTn6JmU.js";
55
55
  import { t as Dr } from "./_chunks/PkToolShowSuggestedReply-BRIzGNwx.js";
56
56
  import { t as Or } from "./_chunks/PkToolShareDocument-Qb2Lu5vh.js";
57
57
  import { t as kr } from "./_chunks/PkToolChatFile-DAT1tv52.js";
58
- import { t as Ar } from "./_chunks/PkFilePreviewDialog-Dy5jmAom.js";
58
+ import { t as Ar } from "./_chunks/PkFilePreviewDialog-0qrzDWID.js";
59
59
  import { t as jr } from "./_chunks/PkToolRequestGeolocation-p7Ip17F7.js";
60
60
  import { VvAccordion as Mr, VvAccordionGroup as Nr, VvAlert as Pr, VvAlertGroup as Fr, VvBadge as Ir, VvButtonGroup as Lr, VvCheckbox as Rr, VvCombobox as zr, VvDialog as Br, VvDropdown as Vr, VvDropdownAction as Hr, VvIcon as Ur, VvInputFile as Wr, VvInputRange as Gr, VvInputText as Kr, VvTab as qr } from "@volverjs/ui-vue/components";
61
61
  import { Fragment as k, Teleport as Jr, Transition as Yr, TransitionGroup as Xr, cloneVNode as Zr, computed as A, createApp as Qr, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createSlots as $r, createStaticVNode as ei, createTextVNode as F, createVNode as I, defineComponent as L, guardReactiveProps as ti, h as ni, inject as R, isRef as ri, isVNode as ii, mergeModels as ai, mergeProps as oi, nextTick as si, normalizeClass as ci, normalizeProps as li, normalizeStyle as ui, onBeforeUnmount as di, onMounted as fi, onUnmounted as pi, openBlock as z, provide as mi, reactive as hi, readonly as gi, ref as B, renderList as _i, renderSlot as vi, resolveComponent as yi, resolveDynamicComponent as bi, shallowRef as xi, toDisplayString as V, toRef as Si, toRefs as Ci, unref as H, useId as wi, useModel as U, useSlots as Ti, useTemplateRef as Ei, vModelSelect as Di, vModelText as Oi, watch as W, withCtx as G, withDirectives as ki, withKeys as Ai, withModifiers as ji } from "vue";
@@ -1,14 +1,4 @@
1
1
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
- /**
3
- * The bar of actions on a selection (spec `selection-actions.md`, "Cosa
4
- * è comune"), on the page that embeds the widget and in the chat's file
5
- * viewer: the agent's actions, then "Ask…", which turns the bar into a
6
- * field. An action may ask for a word first (`asks`: "Translate" asks the
7
- * language). It sits above the start of the selection, below it without
8
- * room there (`selectionBarPosition`). Its buttons take no focus on a
9
- * click, so the selection stays and Cmd+C still copies it; the keyboard
10
- * reaches them with Tab.
11
- */
12
2
  export type SelectionBarAction = {
13
3
  id: string;
14
4
  label: string;
@@ -936,6 +936,12 @@ export declare const DocumentMetadataSchema: z.ZodObject<{
936
936
  ocrPages: z.ZodOptional<z.ZodString>;
937
937
  ocrCost: z.ZodOptional<z.ZodNumber>;
938
938
  ocrError: z.ZodOptional<z.ZodString>;
939
+ ocrFigures: z.ZodOptional<z.ZodObject<{
940
+ found: z.ZodNumber;
941
+ extracted: z.ZodNumber;
942
+ skipped: z.ZodRecord<z.ZodString, z.ZodNumber>;
943
+ }, z.core.$strip>>;
944
+ extractedMedia: z.ZodOptional<z.ZodArray<z.ZodString>>;
939
945
  chunksCount: z.ZodOptional<z.ZodNumber>;
940
946
  redundantChunksCount: z.ZodOptional<z.ZodNumber>;
941
947
  hasRedundantChunks: z.ZodOptional<z.ZodBoolean>;
@@ -1420,6 +1426,12 @@ export declare const DocumentSchema: z.ZodObject<{
1420
1426
  ocrPages: z.ZodOptional<z.ZodString>;
1421
1427
  ocrCost: z.ZodOptional<z.ZodNumber>;
1422
1428
  ocrError: z.ZodOptional<z.ZodString>;
1429
+ ocrFigures: z.ZodOptional<z.ZodObject<{
1430
+ found: z.ZodNumber;
1431
+ extracted: z.ZodNumber;
1432
+ skipped: z.ZodRecord<z.ZodString, z.ZodNumber>;
1433
+ }, z.core.$strip>>;
1434
+ extractedMedia: z.ZodOptional<z.ZodArray<z.ZodString>>;
1423
1435
  chunksCount: z.ZodOptional<z.ZodNumber>;
1424
1436
  redundantChunksCount: z.ZodOptional<z.ZodNumber>;
1425
1437
  hasRedundantChunks: z.ZodOptional<z.ZodBoolean>;
@@ -1920,6 +1932,12 @@ export declare const DocumentRestoreResultSchema: z.ZodObject<{
1920
1932
  ocrPages: z.ZodOptional<z.ZodString>;
1921
1933
  ocrCost: z.ZodOptional<z.ZodNumber>;
1922
1934
  ocrError: z.ZodOptional<z.ZodString>;
1935
+ ocrFigures: z.ZodOptional<z.ZodObject<{
1936
+ found: z.ZodNumber;
1937
+ extracted: z.ZodNumber;
1938
+ skipped: z.ZodRecord<z.ZodString, z.ZodNumber>;
1939
+ }, z.core.$strip>>;
1940
+ extractedMedia: z.ZodOptional<z.ZodArray<z.ZodString>>;
1923
1941
  chunksCount: z.ZodOptional<z.ZodNumber>;
1924
1942
  redundantChunksCount: z.ZodOptional<z.ZodNumber>;
1925
1943
  hasRedundantChunks: z.ZodOptional<z.ZodBoolean>;