@8wave/ai-elements 0.126.0-beta.28 → 0.126.0-beta.29

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 (31) hide show
  1. package/dist/_chunks/{PkToolShowSources-YDHIZ6Ly.js → PkToolShowSources-CRk-MOoE.js} +2 -2
  2. package/dist/_chunks/{PkToolShowSources-YDHIZ6Ly.js.map → PkToolShowSources-CRk-MOoE.js.map} +1 -1
  3. package/dist/_chunks/{markdown-BeFZwXWu.js → markdown-DHayRAiy.js} +2 -2
  4. package/dist/_chunks/{markdown-BeFZwXWu.js.map → markdown-DHayRAiy.js.map} +1 -1
  5. package/dist/ai-elements.es.js +9 -17
  6. package/dist/ai-elements.es.js.map +1 -1
  7. package/dist-vue/PkChatbot.js +1 -1
  8. package/dist-vue/PkChatbotMessages.js +1 -1
  9. package/dist-vue/PkChatbotViewChat.js +1 -1
  10. package/dist-vue/PkChatbotViewFiles.js +1 -1
  11. package/dist-vue/_chunks/{Document-DDEEtB3q.js → Document-Bp-qpa8v.js} +2 -2
  12. package/dist-vue/_chunks/{Document-DDEEtB3q.js.map → Document-Bp-qpa8v.js.map} +1 -1
  13. package/dist-vue/_chunks/{PkChatbot-CrMfACoz.js → PkChatbot-CtrcDgBe.js} +3 -3
  14. package/dist-vue/_chunks/{PkChatbot-CrMfACoz.js.map → PkChatbot-CtrcDgBe.js.map} +1 -1
  15. package/dist-vue/_chunks/{PkChatbotMessages-MVffK20j.js → PkChatbotMessages-10eBKpC5.js} +2 -2
  16. package/dist-vue/_chunks/{PkChatbotMessages-MVffK20j.js.map → PkChatbotMessages-10eBKpC5.js.map} +1 -1
  17. package/dist-vue/_chunks/{PkChatbotViewChat-BhM8dmSf.js → PkChatbotViewChat-U6T-gG-c.js} +3 -3
  18. package/dist-vue/_chunks/{PkChatbotViewChat-BhM8dmSf.js.map → PkChatbotViewChat-U6T-gG-c.js.map} +1 -1
  19. package/dist-vue/_chunks/{PkChatbotViewFiles-Bj5Nkzst.js → PkChatbotViewFiles-BwfAnywk.js} +2 -2
  20. package/dist-vue/_chunks/{PkChatbotViewFiles-Bj5Nkzst.js.map → PkChatbotViewFiles-BwfAnywk.js.map} +1 -1
  21. package/dist-vue/_chunks/{PkFilePreview-DhGWTdm6.js → PkFilePreview-qizsvSVW.js} +2 -2
  22. package/dist-vue/_chunks/{PkFilePreview-DhGWTdm6.js.map → PkFilePreview-qizsvSVW.js.map} +1 -1
  23. package/dist-vue/_chunks/{PkFilePreviewDialog-Dmlk7W8w.js → PkFilePreviewDialog-WsVzH9hg.js} +2 -2
  24. package/dist-vue/_chunks/{PkFilePreviewDialog-Dmlk7W8w.js.map → PkFilePreviewDialog-WsVzH9hg.js.map} +1 -1
  25. package/dist-vue/_chunks/{PkToolShowSources-ChGsGtb3.js → PkToolShowSources-q9gQIuam.js} +2 -2
  26. package/dist-vue/_chunks/{PkToolShowSources-ChGsGtb3.js.map → PkToolShowSources-q9gQIuam.js.map} +1 -1
  27. package/dist-vue/composables.js +6 -14
  28. package/dist-vue/composables.js.map +1 -1
  29. package/dist-vue/index.js +7 -7
  30. package/dist-vue/packages/models/src/schema/Document.d.ts +8 -0
  31. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
- import { t } from "./PkFilePreview-DhGWTdm6.js";
2
+ import { t } from "./PkFilePreview-qizsvSVW.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
@@ -113,4 +113,4 @@ var u = /*@__PURE__*/ a({
113
113
  }), d = /* @__PURE__ */ e({ default: () => f }), f = u;
114
114
  export { d as n, f as t };
115
115
 
116
- //# sourceMappingURL=PkFilePreviewDialog-Dmlk7W8w.js.map
116
+ //# sourceMappingURL=PkFilePreviewDialog-WsVzH9hg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkFilePreviewDialog-Dmlk7W8w.js","names":["_useModel","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","__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"],"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 /** The agent answers in the chat the dialog covers. */\n working?: boolean\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n showChat: []\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 :working\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @show-chat=\"emit('showChat')\"\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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f,iBAAc,AAAAW,EAAA,QAAoB,GAAM,GAAS,MAA+BX,EAAI,iBAAkBgB,GAAMC,GAASC,CAAM;KAI3H,SAAK,AAAAP,EAAA,QAAA,MAAEX,EAAI,OAAA"}
1
+ {"version":3,"file":"PkFilePreviewDialog-WsVzH9hg.js","names":["_useModel","_openBlock","_createBlock","_withCtx","_createVNode","PkFilePreview","__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"],"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 /** The agent answers in the chat the dialog covers. */\n working?: boolean\n }>()\n\n const emit = defineEmits<{\n close: []\n version: [version: number]\n restore: []\n resize: []\n showChat: []\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 :working\n @version=\"emit('version', $event)\"\n @restore=\"emit('restore')\"\n @resize=\"emit('resize')\"\n @show-chat=\"emit('showChat')\"\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: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,AAAAW,EAAA,QAAA,MAAEX,EAAI,QAAA;KACZ,YAAS,AAAAW,EAAA,QAAA,MAAEX,EAAI,UAAA;KACf,iBAAc,AAAAW,EAAA,QAAoB,GAAM,GAAS,MAA+BX,EAAI,iBAAkBgB,GAAMC,GAASC,CAAM;KAI3H,SAAK,AAAAP,EAAA,QAAA,MAAEX,EAAI,OAAA"}
@@ -2,7 +2,7 @@ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
2
  import { t } from "./VvButtonLocalized-C-vx25u4.js";
3
3
  import { t as n } from "./PkStreamingMarkdown-CMxiJTMR.js";
4
4
  import "./src-nb8MU1sh.js";
5
- import { i as r } from "./Document-DDEEtB3q.js";
5
+ import { i as r } from "./Document-Bp-qpa8v.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-ChGsGtb3.js.map
263
+ //# sourceMappingURL=PkToolShowSources-q9gQIuam.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowSources-ChGsGtb3.js","names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_toDisplayString","PkUrl","$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","__exportAll","PkStreamingMarkdown_default","getTypeIcon","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","VvButtonLocalized","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/PkDocumentHeader.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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAM4C,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;;;;IAID5C,EAAsE6C,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC5C,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAOwC,EAAA;IACnD,GAAAvC,EAAAC,EAAA+B,CAAA,CAAa,CAACO,EAAA,OAAO,CAAA,GAAA,GAAA7C,CAAA;IAEhB8C,EAAA,SAAiB,O,aAA7B5C,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADAwC,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA1C,EAE2C6C,GAAA;KADtC,MAAMJ,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;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AO;MACP,KAAI;MACJ,OAAM;K,IACN3F,EAEsB0B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAYzB,EAAA,MACtBC,EAAGN,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,C;KAK0C0B,EAAA,cAAsDqE,EAAM,iBAAY,UAD3H9F,EAAA,GAAAC,EAcS,UAAA;;MATL,OAAKa,EAAA,CAAC,gFAA8E,EACtB,WAAA,CAAAgF,EAAM,U;MAGnE,UAAK,MAAErE,EAAA,WAAWqE,EAAM,UAAU;K,IACnC3F,EAEsB0B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAYzB,EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBuF,GAAA,SADVtF,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAiG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIf,EAAA;I,IACpBhF,EAEsB0B,GAAA;KADjB,MAAMsD,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAY/E,EAAA,MACtBC,EACI8E,EAAA,QAA+BpF,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAAkE,EAAA,MAAe,SAAM,E"}
1
+ {"version":3,"file":"PkToolShowSources-q9gQIuam.js","names":["_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_unref","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_toDisplayString","PkUrl","$t","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_createTextVNode","_toDisplayString","_Fragment","_renderList","PkDocumentHeader","_createBlock","PkStreamingMarkdown","PkChunkPreview","_Transition","_withCtx","_normalizeClass","__exportAll","PkStreamingMarkdown_default","getTypeIcon","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","VvButtonLocalized","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/PkDocumentHeader.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 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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAII,IAAM4C,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;;;;IAID5C,EAAsE6C,GAAA;KAA9D,MAAK;KAAkB,OAAM;;IACrC5C,EAEO,QAAA;KAFD,OAAM;KAAuC,OAAOwC,EAAA;IACnD,GAAAvC,EAAAC,EAAA+B,CAAA,CAAa,CAACO,EAAA,OAAO,CAAA,GAAA,GAAA7C,CAAA;IAEhB8C,EAAA,SAAiB,O,aAA7B5C,EAAA,GAAAC,EAEO,QAFPF,GAEOK,EADAwC,EAAA,KAAiB,IAAG,MAC3B,CAAA;IACA1C,EAE2C6C,GAAA;KADtC,MAAMJ,EAAA,WAAQ,uBAAA;KACf,OAAM;;;;;;;;;;;;;;;;;;;;;;;G,wB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I;MACJ,OAAM;K,IACN3F,EAEsB0B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAYzB,EAAA,MACtBC,EAAGN,EAAAA,GAAE,kBAAA,CAAA,GAAA,CAAA,C;KAK0C0B,EAAA,cAAsDqE,EAAM,iBAAY,UAD3H9F,EAAA,GAAAC,EAcS,UAAA;;MATL,OAAKa,EAAA,CAAC,gFAA8E,EACtB,WAAA,CAAAgF,EAAM,U;MAGnE,UAAK,MAAErE,EAAA,WAAWqE,EAAM,UAAU;K,IACnC3F,EAEsB0B,GAAA;MADlB,MAAK;MACL,OAAM;K,IAAYzB,EAAA,MACtBC,EAAGN,EAAAA,GAAE,oBAAA,CAAA,GAAA,CAAA,C;;IAWvBuF,GAAA,SADVtF,EAAA,GAAAC,EAcS,UAAA;;KAZL,OAAM;KACL,SAAK,AAAAiG,EAAA,QAAA,MAAE,EAAA,QAAQ,CAAIf,EAAA;I,IACpBhF,EAEsB0B,GAAA;KADjB,MAAMsD,EAAA,QAAQ,uBAAA;KACf,OAAM;I,uBAAY/E,EAAA,MACtBC,EACI8E,EAAA,QAA+BpF,EAAAA,GAAE,iBAAA,IAA0CA,EAAAA,GAAE,mBAAA,EAAuD,OAAAkE,EAAA,MAAe,SAAM,E"}
@@ -804,13 +804,11 @@ var R = {
804
804
  xychart: "Grafico XY"
805
805
  },
806
806
  documentMetadata: {
807
- affectedDocumentsStat: "Documenti coinvolti",
808
807
  analyzedPages: "analizzate {pages} su",
809
808
  chunkSimilarTo: "Simile al {score}% a un contenuto in «{docName}»",
810
809
  compare: "Confronta",
811
810
  compareChunks: "Confronto semantico chunk",
812
- filterOnlyRedundantLabel: "Mostra solo documenti con chunk ridondanti non gestiti",
813
- filterRedundant: "Mostra ridondanti",
811
+ confirmAllRedundant: "Conferma tutti",
814
812
  hasRedundant: "Questo documento contiene informazioni ridondanti con altri file",
815
813
  isRedundant: "Ridondante",
816
814
  openInProvider: "Apri in {provider}",
@@ -822,11 +820,9 @@ var R = {
822
820
  redundancyExplainer: "Questi blocchi ripetono un contenuto che l'agente trova già in un altro documento, o prima in questo, e la sua ricerca li salta. Conferma per lasciarli fuori, oppure ripristinali per rimetterli nella ricerca, in ogni agente.",
823
821
  redundantChunk: "Chunk ridondante (duplicato)",
824
822
  redundantChunks: "nessun chunk ridondante | {n} chunk ridondante ({percent}%) | {n} chunk ridondanti ({percent}%)",
825
- redundantChunksStat: "Chunk ridondanti",
826
- redundantWarningMessage: "Alcuni documenti contengono chunk ridondanti. Saranno esclusi automaticamente per ottimizzare il contesto del chatbot di recupero RAG.",
827
- redundantWarningServerMessage: "Ci sono {chunks} chunk ridondanti non gestiti distribuiti in {docs} documenti di questo agente (su un totale di {totalChunks} chunk e {totalDocs} documenti).",
828
- redundantWarningTitle: "Rilevati contenuti duplicati o ridondanti nella Knowledge Base",
823
+ redundantNotice: "nessun chunk ridondante | {n} chunk ridondante, già escluso dalla ricerca | {n} chunk ridondanti, già esclusi dalla ricerca",
829
824
  redundantWith: "Ridondante con il chunk {chunkId} di {docName} ({score}% similarità semantica)",
825
+ reviewRedundant: "Rivedi",
830
826
  showAll: "Mostra tutti",
831
827
  thisDocument: "Questo documento",
832
828
  viewByChunks: "Visualizza a chunk",
@@ -3225,13 +3221,11 @@ var R = {
3225
3221
  xychart: "XY chart"
3226
3222
  },
3227
3223
  documentMetadata: {
3228
- affectedDocumentsStat: "Affected documents",
3229
3224
  analyzedPages: "analyze {pages} on",
3230
3225
  chunkSimilarTo: "{score}% similar to content in “{docName}”",
3231
3226
  compare: "Compare",
3232
3227
  compareChunks: "Semantic chunk comparison",
3233
- filterOnlyRedundantLabel: "Show only documents with unmanaged redundant chunks",
3234
- filterRedundant: "Show redundant",
3228
+ confirmAllRedundant: "Confirm all",
3235
3229
  hasRedundant: "This document contains redundant information with other files",
3236
3230
  isRedundant: "Redundant",
3237
3231
  openInProvider: "Open in {provider}",
@@ -3243,11 +3237,9 @@ var R = {
3243
3237
  redundancyExplainer: "These blocks repeat content the agent already finds in another document, or earlier in this one, and its search skips them. Confirm to leave them out, or restore them to put them back in search, in every agent.",
3244
3238
  redundantChunk: "Redundant chunk (duplicate)",
3245
3239
  redundantChunks: "no redundant chunks | {n} redundant chunk ({percent}%) | {n} redundant chunks ({percent}%)",
3246
- redundantChunksStat: "Redundant chunks",
3247
- redundantWarningMessage: "Some documents contain duplicate or redundant semantic chunks. They are automatically skipped during query retrieval to clean and optimize RAG context windows.",
3248
- redundantWarningServerMessage: "There are {chunks} unmanaged redundant semantic chunks distributed across {docs} documents for this agent (out of {totalChunks} chunks and {totalDocs} documents).",
3249
- redundantWarningTitle: "Duplicate or redundant content detected inside Knowledge Base",
3240
+ redundantNotice: "no redundant chunks | {n} redundant chunk, already left out of search | {n} redundant chunks, already left out of search",
3250
3241
  redundantWith: "Redundant with chunk {chunkId} of {docName} ({score}% semantic similarity)",
3242
+ reviewRedundant: "Review",
3251
3243
  showAll: "Show all",
3252
3244
  thisDocument: "This document",
3253
3245
  viewByChunks: "View by chunks",