@8wave/ai-elements 0.126.0-beta.20 → 0.126.0-beta.22
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.
- package/dist/_chunks/{PkChatbotFilePreview-DHcHcy4x.js → PkChatbotFilePreview-jN3SAlut.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-DHcHcy4x.js.map → PkChatbotFilePreview-jN3SAlut.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js → PkStreamingMarkdown-qoTgaVHP.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js.map → PkStreamingMarkdown-qoTgaVHP.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-x50rORrq.js → PkToolChatFile-uAyCds1k.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-x50rORrq.js.map → PkToolChatFile-uAyCds1k.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js → PkToolShareDocument-NUMXFQ2e.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js.map → PkToolShareDocument-NUMXFQ2e.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js → PkToolShowArtifact-D1p76r2a.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js.map → PkToolShowArtifact-D1p76r2a.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js → PkToolShowContactForm-B4S4qtxp.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js.map → PkToolShowContactForm-B4S4qtxp.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js → PkToolShowDiagram-CauQT97Z.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js.map → PkToolShowDiagram-CauQT97Z.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js → PkToolShowForm-1sJBr8KY.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js.map → PkToolShowForm-1sJBr8KY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js → PkToolShowImageGallery-DFhYCp-v.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js.map → PkToolShowImageGallery-DFhYCp-v.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js → PkToolShowSources-DFHejVc0.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js.map → PkToolShowSources-DFHejVc0.js.map} +1 -1
- package/dist/_chunks/{useLightbox-BlHExsUm.js → useLightbox-CUT_xmuZ.js} +100 -95
- package/dist/_chunks/useLightbox-CUT_xmuZ.js.map +1 -0
- package/dist/ai-elements.es.js +2316 -2153
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CxphD_YU.js → PkChatbot-VJorpNbU.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-CxphD_YU.js.map → PkChatbot-VJorpNbU.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js → PkChatbotEmptyState-B9dYpXZm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js.map → PkChatbotEmptyState-B9dYpXZm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js → PkChatbotFilePreview-5_bih_vc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js.map → PkChatbotFilePreview-5_bih_vc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js → PkChatbotInput-BLKhf3WD.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js.map → PkChatbotInput-BLKhf3WD.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js → PkChatbotMessages-Dx_IIX0J.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js.map → PkChatbotMessages-Dx_IIX0J.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js → PkChatbotSteps-BAQ1LriG.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js.map → PkChatbotSteps-BAQ1LriG.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-1RqLcPl4.js +1336 -0
- package/dist-vue/_chunks/PkChatbotViewChat-1RqLcPl4.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-BbCnRdv4.js → PkChatbotViewConversations-D0vDYTyo.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BbCnRdv4.js.map → PkChatbotViewConversations-D0vDYTyo.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-gwoZqmza.js → PkChatbotViewFiles-Bj5Nkzst.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-gwoZqmza.js.map → PkChatbotViewFiles-Bj5Nkzst.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B7DroVld.js → PkChatbotViewProfile-GW0WuMOy.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B7DroVld.js.map → PkChatbotViewProfile-GW0WuMOy.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-N0kWPuFh.js → PkFilePreview-Dkm34tMI.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreview-N0kWPuFh.js.map → PkFilePreview-Dkm34tMI.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-DqBESOIS.js → PkFilePreviewDialog-CZg7uqHL.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-DqBESOIS.js.map → PkFilePreviewDialog-CZg7uqHL.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js → PkStreamingMarkdown-D6Qxwf47.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js.map → PkStreamingMarkdown-D6Qxwf47.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js → PkSvgViewer-jCi13HSd.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js.map → PkSvgViewer-jCi13HSd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js → PkToolChatFile-uO6r1l6t.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js.map → PkToolChatFile-uO6r1l6t.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js → PkToolShareDocument-B7mMJJfn.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js.map → PkToolShareDocument-B7mMJJfn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js → PkToolShowArtifact-VOfSN9nc.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js.map → PkToolShowArtifact-VOfSN9nc.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js → PkToolShowContactForm-D9J0B3C-.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js.map → PkToolShowContactForm-D9J0B3C-.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js → PkToolShowDiagram-BlV7ktLW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js.map → PkToolShowDiagram-BlV7ktLW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js → PkToolShowForm-BCvqIlt_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js.map → PkToolShowForm-BCvqIlt_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js → PkToolShowImageGallery-D2DrAB9v.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js.map → PkToolShowImageGallery-D2DrAB9v.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js → PkToolShowLocation-BhVcLnkV.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js.map → PkToolShowLocation-BhVcLnkV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js → PkToolShowProductList--MBQ_ztM.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js.map → PkToolShowProductList--MBQ_ztM.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js → PkToolShowSources-D_KfNZ_Q.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js.map → PkToolShowSources-D_KfNZ_Q.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js → PkToolShowVideo-CS6iDwjn.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js.map → PkToolShowVideo-CS6iDwjn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js → PkToolShowWebPages-y3sajjCP.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js.map → PkToolShowWebPages-y3sajjCP.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BACnmIzY.js → createChatbotApiClient-Pb7_cU2s.js} +105 -75
- package/dist-vue/_chunks/createChatbotApiClient-Pb7_cU2s.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-B-WenuyB.js → useChatbotStore-ChrZVIDt.js} +1172 -1141
- package/dist-vue/_chunks/useChatbotStore-ChrZVIDt.js.map +1 -0
- package/dist-vue/_chunks/{useLightbox-DmtNa8bJ.js → useLightbox-BZN3tRGu.js} +100 -95
- package/dist-vue/_chunks/useLightbox-BZN3tRGu.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +76 -2
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +4304 -3590
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +78 -2
- package/dist-vue/packages/components/src/PkSchemaField.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkChatProjectDialog.d.ts +50 -0
- package/dist-vue/packages/components/src/chat/PkChatProjectMoveDialog.d.ts +23 -0
- package/dist-vue/packages/components/src/chat/PkChatSidebar.d.ts +5 -2
- package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +9 -3
- package/dist-vue/packages/components/src/chat/PkChatbotFeedbackForm.d.ts +2 -2
- package/dist-vue/packages/composable/src/chatbot/api/createChatbotApiClient.d.ts +20 -1
- package/dist-vue/packages/composable/src/chatbot/index.d.ts +1 -0
- package/dist-vue/packages/composable/src/chatbot/useChatProjectsStore.d.ts +4005 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +36 -6
- package/dist-vue/packages/models/src/schema/ChatProject.d.ts +10 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/useLightbox-BlHExsUm.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-2J6g9Etg.js +0 -1307
- package/dist-vue/_chunks/PkChatbotViewChat-2J6g9Etg.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BACnmIzY.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-B-WenuyB.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkChatbotFilePreview-BDU2vY0F.js","names":["$t","$emit","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_unref","_withDirectives","_vShow","_createVNode","_withModifiers","_toDisplayString","_createTextVNode","_Fragment","_normalizeStyle","_createBlock","useLightbox","_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","_hoisted_19","_hoisted_20","_hoisted_21","THUMB_CACHE_MAX","PkChatbotFilePreview_default","defineComponent","props","__props","onOpenClick","event","isImage","computed","extension","name","dot","subtype","KINDS","fileKind","haystack","test","kind","typeTag","formattedSize","bytes","units","value","unitIndex","thumbCache","setThumbCache","url","entry","cached","thumbStatus","ref","dimensions","onImageLoad","img","onImageError","pswpSize","DEFAULT_PSWP_SIZE","imageMeta","docMeta","galleryRef","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","createElementVNode","unref","shared","_ctx","withDirectives","vShow","createVNode","_cache","withModifiers","createCommentVNode","toDisplayString","createTextVNode","Fragment","normalizeStyle","createBlock","args"],"sources":["../../../../packages/components/src/chat/PkChatbotFilePreview.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, ref, onMounted } from 'vue'\n import { useLightbox } from '../composables/useLightbox'\n\n const props = defineProps<{\n mediaType: string\n url: string\n filename?: string\n /** Size in bytes, when known (e.g. local uploads). */\n size?: number\n loading?: boolean\n error?: string\n removable?: boolean\n /**\n * Shows the \"Edit\" button on an image of the composer (`compact`),\n * opposite the remove one: the host opens the image editor on `edit`.\n */\n editable?: boolean\n /**\n * The upload failed (`error`) and can be tried again: the failure\n * mark becomes a \"Retry\" button, and the host uploads again on `retry`.\n */\n retryable?: boolean\n /**\n * Dense layout for the composer: a small square thumbnail / slim row,\n * without the metadata caption. The full card is reserved for the\n * message log where the details matter.\n */\n compact?: boolean\n /**\n * Keeps the download button visible instead of revealing it on hover:\n * for a file the agent wrote, which the user is there to download.\n */\n showDownload?: boolean\n /**\n * Replaces the download link of a document with a call, for a file\n * whose download URL is minted on demand (a knowledge base document\n * shared in the chat). `url` stays the link's `href`.\n */\n onDownload?: () => void | Promise<void>\n /**\n * Draws an image as a file row, with its download button, instead of\n * a thumbnail: for an image whose `url` stops working while its\n * download keeps going (a shared document after its link expires).\n */\n asFile?: boolean\n /**\n * Opens the file in the chat's viewer: a Word document or a\n * spreadsheet the chat stores, with a button beside the download.\n */\n onPreview?: () => void\n /**\n * Asks for this earlier version of the file back as the newest one,\n * with a button before the others.\n */\n onRestore?: () => void\n }>()\n\n defineEmits<{\n remove: []\n edit: []\n retry: []\n }>()\n\n const onOpenClick = (event: MouseEvent) => {\n if (!props.onDownload) {\n return\n }\n event.preventDefault()\n void props.onDownload()\n }\n\n const isImage = computed(\n () => !props.asFile && props.mediaType.startsWith('image/'),\n )\n\n // --- File-type identity (icon + accent + human kind label) ---\n\n const extension = computed(() => {\n const name = props.filename ?? ''\n const dot = name.lastIndexOf('.')\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : ''\n })\n\n // mediaType subtype, e.g. \"pdf\" from \"application/pdf\"\n const subtype = computed(\n () => props.mediaType.split('/')[1]?.split(';')[0] ?? '',\n )\n\n type FileKind = {\n icon: string\n // CSS color driving the icon glyph + tile tint\n accent: string\n label: string\n }\n\n const KINDS: Array<{ test: RegExp; kind: FileKind }> = [\n {\n test: /pdf/,\n kind: {\n icon: 'ri:file-pdf-2-line',\n accent: '#e2483d',\n label: 'PDF',\n },\n },\n {\n // Match Word specifically: the generic `document` substring also\n // appears in the XLSX/PPTX OOXML mime types (…officedocument…), so\n // matching it here would mis-label spreadsheets/decks as Word.\n test: /msword|wordprocessingml/,\n kind: {\n icon: 'ri:file-word-2-line',\n accent: '#2b7de9',\n label: 'Word',\n },\n },\n {\n test: /sheet|excel|csv/,\n kind: {\n icon: 'ri:file-excel-2-line',\n accent: '#1f9d57',\n label: 'Spreadsheet',\n },\n },\n {\n test: /presentation|powerpoint/,\n kind: {\n icon: 'ri:file-ppt-2-line',\n accent: '#d98324',\n label: 'Presentation',\n },\n },\n {\n test: /zip|compressed|x-7z|x-rar|x-tar|gzip/,\n kind: {\n icon: 'ri:file-zip-line',\n accent: '#c08a1e',\n label: 'Archive',\n },\n },\n {\n // Reached only by an image drawn as a file (`asFile`).\n test: /^image\\//,\n kind: {\n icon: 'ri:image-2-line',\n accent: '#0ea5e9',\n label: 'Image',\n },\n },\n {\n test: /^audio\\//,\n kind: {\n icon: 'ri:file-music-line',\n accent: '#8b5cf6',\n label: 'Audio',\n },\n },\n {\n test: /^video\\//,\n kind: {\n icon: 'ri:film-line',\n accent: '#6366f1',\n label: 'Video',\n },\n },\n {\n // The code an agent can take (`SUPPORTED_CODE_TYPES`).\n test: /json|javascript|typescript|xml|html|css|yaml|toml|sql|x-(?:sh|python|java|kotlin|c|csharp|go|rust|ruby|php|swift|vue)\\b/,\n kind: {\n icon: 'ri:file-code-line',\n accent: '#0d9488',\n label: 'Code',\n },\n },\n {\n test: /^text\\//,\n kind: {\n icon: 'ri:file-text-line',\n accent: '#64748b',\n label: 'Text',\n },\n },\n ]\n\n const fileKind = computed<FileKind>(() => {\n const haystack = `${props.mediaType} ${extension.value}`\n for (const { test, kind } of KINDS) {\n if (test.test(haystack)) {\n return kind\n }\n }\n return {\n icon: 'ri:file-line',\n accent: '#64748b',\n label: 'File',\n }\n })\n\n // Short type tag shown in the meta line: prefer the real extension, fall\n // back to the mime subtype, then the generic kind label.\n const typeTag = computed(() =>\n (\n extension.value ||\n subtype.value ||\n fileKind.value.label\n ).toUpperCase(),\n )\n\n // --- Size & dimensions ---\n\n const formattedSize = computed(() => {\n const bytes = props.size\n if (bytes === undefined || bytes < 0) {\n return undefined\n }\n if (bytes < 1024) {\n return `${bytes} B`\n }\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let unitIndex = 0\n while (value >= 1024 && unitIndex < units.length - 1) {\n value /= 1024\n unitIndex += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unitIndex]}`\n })\n\n // Thumbnail load lifecycle. Driving the spinner and the error fallback\n // off the real <img> events (not a second background fetch) means the\n // image is requested exactly once and reuses the browser cache on any\n // later re-render, instead of re-downloading every time the message list\n // repaints.\n // Not `useImageFallback`: this tile also needs `loading` vs `loaded` and the\n // decoded dimensions, cached across remounts, so the error flag is one field\n // of a richer per-url entry rather than a standalone broken-url set.\n type ThumbStatus = 'loading' | 'loaded' | 'error'\n\n // Module-level, keyed by URL: survives component recreation. In polled\n // views (e.g. admin chat-logs, refreshed every few seconds) the whole\n // message array is replaced on each poll, so this component can be torn\n // down and rebuilt. Seeding from the cache means a URL that already\n // decoded starts in `loaded` (no spinner flash, no re-decode) instead of\n // flickering back through `loading`. This is a client-side, per-session\n // cache (no server/Redis involved); bounded to a max size so a long-lived\n // session browsing many images can't grow it without limit — the oldest\n // entry is evicted first (Map preserves insertion order).\n type ThumbEntry = {\n status: ThumbStatus\n dimensions?: { width: number; height: number }\n }\n const THUMB_CACHE_MAX = 300\n const thumbCache = new Map<string, ThumbEntry>()\n const setThumbCache = (url: string, entry: ThumbEntry) => {\n // Re-insert to mark as most-recently used, then trim from the front.\n thumbCache.delete(url)\n thumbCache.set(url, entry)\n if (thumbCache.size > THUMB_CACHE_MAX) {\n thumbCache.delete(thumbCache.keys().next().value as string)\n }\n }\n\n const cached = thumbCache.get(props.url)\n const thumbStatus = ref<ThumbStatus>(cached?.status ?? 'loading')\n\n // Natural pixel dimensions, captured once the thumbnail decodes. Doubles\n // as the size hint PhotoSwipe needs for its slide (falls back until known).\n const dimensions = ref<{ width: number; height: number } | undefined>(\n cached?.dimensions,\n )\n const onImageLoad = (event: Event) => {\n const img = event.target as HTMLImageElement\n if (img.naturalWidth && img.naturalHeight) {\n dimensions.value = {\n width: img.naturalWidth,\n height: img.naturalHeight,\n }\n }\n thumbStatus.value = 'loaded'\n setThumbCache(props.url, {\n status: 'loaded',\n dimensions: dimensions.value,\n })\n }\n const onImageError = () => {\n thumbStatus.value = 'error'\n setThumbCache(props.url, { status: 'error' })\n }\n\n const pswpSize = computed(() => dimensions.value ?? DEFAULT_PSWP_SIZE)\n\n // Meta fragments joined with \" · \" for the caption / doc subtitle.\n const imageMeta = computed(() =>\n [\n dimensions.value &&\n `${dimensions.value.width}×${dimensions.value.height}`,\n formattedSize.value,\n ].filter(Boolean),\n )\n const docMeta = computed(() =>\n [typeTag.value, formattedSize.value].filter(Boolean),\n )\n\n // --- Lightbox ---\n\n // Slide size PhotoSwipe assumes before the real dimensions are known.\n const DEFAULT_PSWP_SIZE = { width: 1200, height: 800 }\n\n // In a conversation the image opens in its lightbox, with the others\n const galleryRef = ref<HTMLElement>()\n const { init, shared } = useLightbox({\n gallery: galleryRef,\n loop: false,\n shared: true,\n })\n\n onMounted(async () => {\n if (!isImage.value) {\n return\n }\n await init()\n })\n</script>\n\n<template>\n <!-- Image attachment: a thumbnail tile with a metadata caption -->\n <figure\n v-if=\"isImage\"\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--image\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n }\">\n <div ref=\"galleryRef\" class=\"pk-chatbot-file-preview__thumb-wrap\">\n <a\n :href=\"url\"\n :data-pswp-src=\"url\"\n :data-pswp-width=\"pswpSize.width\"\n :data-pswp-height=\"pswpSize.height\"\n :data-pswp-caption=\"filename ?? ''\"\n :data-pswp-shared=\"shared || undefined\"\n class=\"pk-chatbot-file-preview__thumb-link\"\n :aria-label=\"filename ?? $t('label.file')\">\n <img\n v-show=\"thumbStatus === 'loaded'\"\n :src=\"url\"\n :alt=\"filename\"\n decoding=\"async\"\n class=\"pk-chatbot-file-preview__thumb\"\n @load=\"onImageLoad\"\n @error=\"onImageError\" />\n </a>\n <!-- Spinner until the thumbnail decodes (or while an upload is in\n flight); a fixed box keeps this from shifting the layout. -->\n <span\n v-if=\"loading || thumbStatus === 'loading'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay\">\n <VvIcon name=\"loading-loop\" />\n </span>\n <!-- The upload failed: the image would not be sent. The mark says\n so on the thumbnail, where the composer hides the caption, and\n is the retry when the host offers one. -->\n <button\n v-else-if=\"error && retryable\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--failed\"\n :title=\"error\"\n :aria-label=\"$t('action.retry')\"\n @click.prevent=\"$emit('retry')\">\n <VvIcon name=\"ri:refresh-line\" />\n </button>\n <span\n v-else-if=\"error\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--failed\"\n role=\"img\"\n :title=\"error\"\n :aria-label=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n </span>\n <!-- Failed to load: a quiet icon instead of the browser's broken\n image glyph. -->\n <span\n v-else-if=\"thumbStatus === 'error'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--error\">\n <VvIcon name=\"ri:image-2-line\" />\n </span>\n </div>\n <figcaption v-if=\"!compact\" class=\"pk-chatbot-file-preview__caption\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ imageMeta.join(' · ') }}</template>\n </span>\n </figcaption>\n <button\n v-if=\"editable && compact && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__edit\"\n :title=\"$t('imageEditor.edit')\"\n :aria-label=\"$t('imageEditor.edit')\"\n @click.prevent=\"$emit('edit')\">\n <VvIcon name=\"ri:edit-line\" />\n </button>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click.prevent=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </figure>\n\n <!-- Document attachment: an icon tile + name + type · size -->\n <div\n v-else\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--doc\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n 'pk-chatbot-file-preview--show-download': showDownload,\n }\">\n <!-- A failed upload the host can try again: the tile is the retry -->\n <button\n v-if=\"error && retryable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__icon-tile pk-chatbot-file-preview__retry u-touch-target\"\n :title=\"error\"\n :aria-label=\"$t('action.retry')\"\n @click=\"$emit('retry')\">\n <VvIcon\n name=\"ri:refresh-line\"\n class=\"pk-chatbot-file-preview__icon\" />\n </button>\n <span\n v-else\n class=\"pk-chatbot-file-preview__icon-tile\"\n :style=\"{ '--file-accent': fileKind.accent }\">\n <VvIcon\n v-if=\"loading\"\n name=\"loading-loop\"\n class=\"pk-chatbot-file-preview__icon\" />\n <VvIcon\n v-else\n :name=\"fileKind.icon\"\n class=\"pk-chatbot-file-preview__icon\" />\n </span>\n <span class=\"pk-chatbot-file-preview__body\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ docMeta.join(' · ') }}</template>\n </span>\n </span>\n <!-- The actions of a file the chat's viewer opens: a small bar of\n their own, apart from the name and the size -->\n <span\n v-if=\"!loading && !error && !compact\"\n class=\"pk-chatbot-file-preview__actions\"\n :class=\"{\n 'pk-chatbot-file-preview__actions--bar': onPreview || onRestore,\n }\">\n <button\n v-if=\"onRestore\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('chatFilePreview.restore')\"\n :aria-label=\"`${$t('chatFilePreview.restore')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onRestore\">\n <VvIcon name=\"ri:arrow-go-back-line\" />\n </button>\n <button\n v-if=\"onPreview\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('chatFilePreview.open')\"\n :aria-label=\"`${$t('chatFilePreview.open')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onPreview\">\n <VvIcon name=\"ri:eye-line\" />\n </button>\n <a\n :href=\"url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('action.download')\"\n :aria-label=\"`${$t('action.download')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onOpenClick\">\n <VvIcon name=\"ri:download-2-line\" />\n </a>\n </span>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :class=\"{ 'pk-chatbot-file-preview__remove--inline': !compact }\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-file-preview {\n // Concentric radii: outer card and inner tiles share an 8px step.\n --file-radius: var(--rounded-lg, 12px);\n\n position: relative;\n max-width: 280px;\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--file-radius);\n color: var(--color-word-2);\n font-size: var(--text-12);\n\n &--error {\n border-color: var(--color-danger);\n }\n\n // --- Document card ---\n &--doc {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n min-width: 0;\n transition:\n border-color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out),\n box-shadow 0.18s var(--ease-out);\n\n &:hover {\n border-color: var(--color-surface-4);\n background-color: var(--color-surface-2);\n box-shadow: var(--shadow-sm);\n }\n }\n\n &__icon-tile {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-36);\n height: var(--spacing-36);\n\n // One step down from the card radius keeps the nested tile concentric.\n border-radius: var(--rounded-md, 6px);\n\n // Tint derived from the file-type accent; glyph sits at full accent.\n background-color: color-mix(\n in srgb,\n var(--file-accent) 14%,\n transparent\n );\n color: var(--file-accent);\n }\n\n &__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n }\n\n &__actions {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n margin-inline-start: var(--spacing-4);\n }\n\n // Restore, open and download of a file the viewer opens: one small\n // bar, its hairline setting it apart from the name and the size, the\n // icons 8px apart so they read as a group\n &__actions--bar {\n margin-inline-start: var(--spacing-8);\n padding: var(--spacing-2);\n border: var(--border) solid var(--color-surface-3);\n border-radius: var(--rounded);\n }\n\n // 28px to aim at with a mouse, 24 in the bar; 40px under a finger\n // (u-touch-target)\n &__open {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: 0;\n border-radius: var(--rounded);\n background: none;\n color: var(--color-word-3);\n text-decoration: none;\n cursor: pointer;\n opacity: 0;\n transition:\n opacity 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n\n .vv-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n }\n\n &__actions--bar &__open {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &--doc:hover &__open,\n &--doc:focus-within &__open,\n &--show-download &__open {\n opacity: 1;\n }\n\n // Touch devices have no hover: keep the open affordance visible.\n @media (hover: none) {\n &--doc &__open {\n opacity: 1;\n }\n }\n\n // --- Image card ---\n &--image {\n display: inline-flex;\n flex-direction: column;\n margin: 0;\n }\n\n &__thumb-wrap {\n position: relative;\n display: flex;\n\n // Fixed box: the card claims its final footprint before the\n // image decodes, so the message log never shifts on load.\n width: 280px;\n max-width: 100%;\n height: 200px;\n background-color: var(--color-surface);\n border-radius: var(--file-radius);\n overflow: hidden;\n }\n\n &__thumb-link {\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n }\n\n &__thumb {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__caption {\n display: flex;\n flex-direction: column;\n gap: 1px;\n padding: var(--spacing-8);\n min-width: 0;\n }\n\n &__name {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: var(--font-medium, 500);\n color: var(--color-word-1);\n }\n\n &__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--text-10);\n line-height: var(--leading-normal);\n\n // Reserve the line even while empty: image dimensions arrive\n // only after decode and must not grow the caption.\n min-height: 1.4em;\n color: var(--color-word-4);\n\n // Stable column for the dimensions/size figures.\n font-variant-numeric: tabular-nums;\n }\n\n &__error {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-4);\n color: var(--u-danger-text, var(--color-danger));\n\n .vv-icon {\n flex-shrink: 0;\n }\n }\n\n &__status {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .vv-icon {\n width: var(--spacing-32);\n height: var(--spacing-32);\n }\n\n &--overlay {\n position: absolute;\n inset: 0;\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 70%,\n transparent\n );\n color: var(--color-word-1);\n }\n\n &--error {\n color: var(--color-word-4);\n }\n\n // An upload that failed, in the danger text of the caption's error\n &--failed {\n padding: 0;\n border: 0;\n color: var(--u-danger-text, var(--color-danger));\n font: inherit;\n\n .vv-icon {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n }\n\n &--failed:is(button) {\n cursor: pointer;\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n }\n }\n }\n\n // The tile of a document whose upload failed, as a retry\n &__retry {\n --file-accent: var(--u-danger-text, var(--color-danger));\n\n position: relative;\n padding: 0;\n border: 0;\n cursor: pointer;\n }\n\n // --- Remove and edit buttons (input context) ---\n &__remove,\n &__edit {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: flex;\n align-items: center;\n justify-content: center;\n\n // Visible glyph is 18px but the hit area stays a comfortable 28px.\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: none;\n border-radius: var(--rounded-full, 9999px);\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n color: var(--color-word-2);\n cursor: pointer;\n line-height: 1;\n box-shadow: var(--shadow-sm);\n transition:\n background-color 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n scale 0.12s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n\n &:active {\n scale: 0.96;\n }\n\n // Inside the document row the button rides inline, not overlaid\n // (size is inherited from the base).\n &--inline {\n position: static;\n flex-shrink: 0;\n box-shadow: none;\n background-color: transparent;\n color: var(--color-word-4);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n }\n\n // --- Compact (composer) chips ---\n // ChatGPT/Gemini-style: every attachment is the SAME height and carries\n // an always-visible round remove control in the top-right corner — no\n // hover-revealed actions, no size mismatch between image and file chips.\n &--compact {\n // Shared chip height so image and file chips align in the row.\n --chip-size: var(--spacing-56);\n\n max-width: 240px;\n\n &.pk-chatbot-file-preview--image {\n width: var(--chip-size);\n height: var(--chip-size);\n border-radius: var(--rounded-md, 6px);\n }\n\n // Fill the square; the root's `overflow: hidden` rounds the corners.\n .pk-chatbot-file-preview__thumb-wrap,\n .pk-chatbot-file-preview__thumb-link {\n width: 100%;\n height: 100%;\n }\n\n &.pk-chatbot-file-preview--doc {\n height: var(--chip-size);\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n\n // Reserve room so the corner remove button never overlaps the\n // name/meta text.\n padding-inline-end: var(--spacing-28);\n }\n\n // Square icon tile that fills the chip height, so file chips read at\n // the same scale as image thumbnails: the chip less its padding and\n // its two 1px borders. Not `align-self: stretch` with `aspect-ratio`,\n // which Safari sizes from the chip's outer height, so the tile ran\n // past the chip's bottom edge.\n .pk-chatbot-file-preview__icon-tile {\n --chip-tile-size: calc(\n var(--chip-size) - 2 * var(--spacing-8) - 2px\n );\n\n width: var(--chip-tile-size);\n height: var(--chip-tile-size);\n }\n\n .pk-chatbot-file-preview__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n // Always-visible round remove control on the top-right corner: the\n // base transform centres it 4px inside the corner, so half of it rides\n // over the chip's edge (nothing clips it), with an extended hit area\n // for easy tapping. The edit control of an image mirrors it on the\n // top-left corner.\n &--compact &__remove,\n &--compact &__edit {\n top: var(--spacing-4);\n right: var(--spacing-4);\n width: var(--spacing-24);\n height: var(--spacing-24);\n border: 1px solid var(--color-surface-4);\n background-color: var(--color-surface);\n color: var(--color-word-1);\n font-size: var(--text-16);\n box-shadow: var(--shadow-sm);\n\n // Comfortable touch/click target beyond the small visible glyph.\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-4));\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n }\n\n &--compact &__edit {\n right: auto;\n left: var(--spacing-4);\n transform: translate(-50%, -50%);\n }\n\n @media (prefers-reduced-motion: reduce) {\n &--doc,\n &__open,\n &__remove,\n &__edit {\n transition: none;\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;A,gCA2PUsC,IAAkB,K;;;;;;;;;;;;;;;;;;;;;;;;;EAvPxB,IAAMG,IAAQC,GA4DRC,KAAe,MAAsB;GACvC,AAAKF,EAAM,eAGXG,EAAM,eAAe,GACrBH,EAAW,WAAW;EAC1B,GAEMI,IAAUC,QACN,CAACL,EAAM,UAAUA,EAAM,UAAU,WAAW,QAAQ,CAC9D,GAIMM,IAAYD,QAAe;GAC7B,IAAME,IAAOP,EAAM,YAAY,IACzBQ,IAAMD,EAAK,YAAY,GAAG;GAChC,OAAOC,IAAM,IAAID,EAAK,MAAMC,IAAM,CAAC,CAAC,CAAC,YAAY,IAAI;EACzD,CAAC,GAGKC,IAAUJ,QACNL,EAAM,UAAU,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAC1D,GASMU,IAAiD;GACnD;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IAII,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IAEI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IACI,MAAM;IACN,MAAM;KACF,MAAM;KACN,QAAQ;KACR,OAAO;IACX;GACJ;GACA;IAEI,MAAM;IAC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AA,C;KAG9BtC,EAAA,aADVxC,EAAA,GAAAC,EAQS,UAAA;;MANL,MAAK;MACL,OAAM;MACL,OAAOH,EAAAA,GAAE,sBAAA;MACT,cAAU,GAAKA,EAAAA,GAAE,sBAAA,IAA2B0C,EAAA,WAAQ,MAASA,EAAA,aAAQ;MACrE,SAAK,AAAAkD,EAAA,QAAE,GAAAQ,MAAA1D,EAAA,aAAAA,EAAA,UAAA,GAAA0D,CAAA;K,IACR3F,EAA6BuE,GAAA,EAArB,MAAK,cAAa,CAAA,C;KAE9B3E,EASI,KAAA;MARC,MAAMqC,EAAA;MACP,QAAO;MACP,KAAI;MACJ,OAAM;MACL,OAAO1C,EAAAA,GAAE,iBAAA;MACT,cAAU,GAAKA,EAAAA,GAAE,iBAAA,IAAsB0C,EAAA,WAAQ,MAASA,EAAA,aAAQ;MAChE,SAAOC;K,IACRlC,EAAoCuE,GAAA,EAA5B,MAAK,qBAAoB,CAAA,C;;IAI/BtC,EAAA,aAAS,CAAKA,EAAA,WADxBxC,EAAA,GAAAC,EASS,UAAA;;KAPL,MAAK;KACL,OAAKC,EAAA,CAAC,mCAAiC,EAAA,2CAAA,CACesC,EAAA,QAAO,CAAA,CAAA;KAC5D,OAAO1C,EAAAA,GAAE,eAAA;KACT,cAAYA,EAAAA,GAAE,eAAA;KACd,SAAK,AAAA4F,EAAA,QAAA,MAAE3F,EAAAA,MAAK,QAAA;I,IACbQ,EAA+BuE,GAAA,EAAvB,MAAK,gBAAe,CAAA,C"}
|
|
1
|
+
{"version":3,"file":"PkChatbotFilePreview-5_bih_vc.js","names":["$t","$emit","_openBlock","_createElementBlock","_normalizeClass","_createElementVNode","_unref","_withDirectives","_vShow","_createVNode","_withModifiers","_toDisplayString","_createTextVNode","_Fragment","_normalizeStyle","_createBlock","useLightbox","_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","_hoisted_19","_hoisted_20","_hoisted_21","THUMB_CACHE_MAX","PkChatbotFilePreview_default","defineComponent","props","__props","onOpenClick","event","isImage","computed","extension","name","dot","subtype","KINDS","fileKind","haystack","test","kind","typeTag","formattedSize","bytes","units","value","unitIndex","thumbCache","setThumbCache","url","entry","cached","thumbStatus","ref","dimensions","onImageLoad","img","onImageError","pswpSize","DEFAULT_PSWP_SIZE","imageMeta","docMeta","galleryRef","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","createElementVNode","unref","shared","_ctx","withDirectives","vShow","createVNode","_cache","withModifiers","createCommentVNode","toDisplayString","createTextVNode","Fragment","normalizeStyle","createBlock","args"],"sources":["../../../../packages/components/src/chat/PkChatbotFilePreview.vue"],"sourcesContent":["<script lang=\"ts\" setup>\n import { computed, ref, onMounted } from 'vue'\n import { useLightbox } from '../composables/useLightbox'\n\n const props = defineProps<{\n mediaType: string\n url: string\n filename?: string\n /** Size in bytes, when known (e.g. local uploads). */\n size?: number\n loading?: boolean\n error?: string\n removable?: boolean\n /**\n * Shows the \"Edit\" button on an image of the composer (`compact`),\n * opposite the remove one: the host opens the image editor on `edit`.\n */\n editable?: boolean\n /**\n * The upload failed (`error`) and can be tried again: the failure\n * mark becomes a \"Retry\" button, and the host uploads again on `retry`.\n */\n retryable?: boolean\n /**\n * Dense layout for the composer: a small square thumbnail / slim row,\n * without the metadata caption. The full card is reserved for the\n * message log where the details matter.\n */\n compact?: boolean\n /**\n * Keeps the download button visible instead of revealing it on hover:\n * for a file the agent wrote, which the user is there to download.\n */\n showDownload?: boolean\n /**\n * Replaces the download link of a document with a call, for a file\n * whose download URL is minted on demand (a knowledge base document\n * shared in the chat). `url` stays the link's `href`.\n */\n onDownload?: () => void | Promise<void>\n /**\n * Draws an image as a file row, with its download button, instead of\n * a thumbnail: for an image whose `url` stops working while its\n * download keeps going (a shared document after its link expires).\n */\n asFile?: boolean\n /**\n * Opens the file in the chat's viewer: a Word document or a\n * spreadsheet the chat stores, with a button beside the download.\n */\n onPreview?: () => void\n /**\n * Asks for this earlier version of the file back as the newest one,\n * with a button before the others.\n */\n onRestore?: () => void\n }>()\n\n defineEmits<{\n remove: []\n edit: []\n retry: []\n }>()\n\n const onOpenClick = (event: MouseEvent) => {\n if (!props.onDownload) {\n return\n }\n event.preventDefault()\n void props.onDownload()\n }\n\n const isImage = computed(\n () => !props.asFile && props.mediaType.startsWith('image/'),\n )\n\n // --- File-type identity (icon + accent + human kind label) ---\n\n const extension = computed(() => {\n const name = props.filename ?? ''\n const dot = name.lastIndexOf('.')\n return dot > 0 ? name.slice(dot + 1).toLowerCase() : ''\n })\n\n // mediaType subtype, e.g. \"pdf\" from \"application/pdf\"\n const subtype = computed(\n () => props.mediaType.split('/')[1]?.split(';')[0] ?? '',\n )\n\n type FileKind = {\n icon: string\n // CSS color driving the icon glyph + tile tint\n accent: string\n label: string\n }\n\n const KINDS: Array<{ test: RegExp; kind: FileKind }> = [\n {\n test: /pdf/,\n kind: {\n icon: 'ri:file-pdf-2-line',\n accent: '#e2483d',\n label: 'PDF',\n },\n },\n {\n // Match Word specifically: the generic `document` substring also\n // appears in the XLSX/PPTX OOXML mime types (…officedocument…), so\n // matching it here would mis-label spreadsheets/decks as Word.\n test: /msword|wordprocessingml/,\n kind: {\n icon: 'ri:file-word-2-line',\n accent: '#2b7de9',\n label: 'Word',\n },\n },\n {\n test: /sheet|excel|csv/,\n kind: {\n icon: 'ri:file-excel-2-line',\n accent: '#1f9d57',\n label: 'Spreadsheet',\n },\n },\n {\n test: /presentation|powerpoint/,\n kind: {\n icon: 'ri:file-ppt-2-line',\n accent: '#d98324',\n label: 'Presentation',\n },\n },\n {\n test: /zip|compressed|x-7z|x-rar|x-tar|gzip/,\n kind: {\n icon: 'ri:file-zip-line',\n accent: '#c08a1e',\n label: 'Archive',\n },\n },\n {\n // Reached only by an image drawn as a file (`asFile`).\n test: /^image\\//,\n kind: {\n icon: 'ri:image-2-line',\n accent: '#0ea5e9',\n label: 'Image',\n },\n },\n {\n test: /^audio\\//,\n kind: {\n icon: 'ri:file-music-line',\n accent: '#8b5cf6',\n label: 'Audio',\n },\n },\n {\n test: /^video\\//,\n kind: {\n icon: 'ri:film-line',\n accent: '#6366f1',\n label: 'Video',\n },\n },\n {\n // The code an agent can take (`SUPPORTED_CODE_TYPES`).\n test: /json|javascript|typescript|xml|html|css|yaml|toml|sql|x-(?:sh|python|java|kotlin|c|csharp|go|rust|ruby|php|swift|vue)\\b/,\n kind: {\n icon: 'ri:file-code-line',\n accent: '#0d9488',\n label: 'Code',\n },\n },\n {\n test: /^text\\//,\n kind: {\n icon: 'ri:file-text-line',\n accent: '#64748b',\n label: 'Text',\n },\n },\n ]\n\n const fileKind = computed<FileKind>(() => {\n const haystack = `${props.mediaType} ${extension.value}`\n for (const { test, kind } of KINDS) {\n if (test.test(haystack)) {\n return kind\n }\n }\n return {\n icon: 'ri:file-line',\n accent: '#64748b',\n label: 'File',\n }\n })\n\n // Short type tag shown in the meta line: prefer the real extension, fall\n // back to the mime subtype, then the generic kind label.\n const typeTag = computed(() =>\n (\n extension.value ||\n subtype.value ||\n fileKind.value.label\n ).toUpperCase(),\n )\n\n // --- Size & dimensions ---\n\n const formattedSize = computed(() => {\n const bytes = props.size\n if (bytes === undefined || bytes < 0) {\n return undefined\n }\n if (bytes < 1024) {\n return `${bytes} B`\n }\n const units = ['KB', 'MB', 'GB', 'TB']\n let value = bytes / 1024\n let unitIndex = 0\n while (value >= 1024 && unitIndex < units.length - 1) {\n value /= 1024\n unitIndex += 1\n }\n return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unitIndex]}`\n })\n\n // Thumbnail load lifecycle. Driving the spinner and the error fallback\n // off the real <img> events (not a second background fetch) means the\n // image is requested exactly once and reuses the browser cache on any\n // later re-render, instead of re-downloading every time the message list\n // repaints.\n // Not `useImageFallback`: this tile also needs `loading` vs `loaded` and the\n // decoded dimensions, cached across remounts, so the error flag is one field\n // of a richer per-url entry rather than a standalone broken-url set.\n type ThumbStatus = 'loading' | 'loaded' | 'error'\n\n // Module-level, keyed by URL: survives component recreation. In polled\n // views (e.g. admin chat-logs, refreshed every few seconds) the whole\n // message array is replaced on each poll, so this component can be torn\n // down and rebuilt. Seeding from the cache means a URL that already\n // decoded starts in `loaded` (no spinner flash, no re-decode) instead of\n // flickering back through `loading`. This is a client-side, per-session\n // cache (no server/Redis involved); bounded to a max size so a long-lived\n // session browsing many images can't grow it without limit — the oldest\n // entry is evicted first (Map preserves insertion order).\n type ThumbEntry = {\n status: ThumbStatus\n dimensions?: { width: number; height: number }\n }\n const THUMB_CACHE_MAX = 300\n const thumbCache = new Map<string, ThumbEntry>()\n const setThumbCache = (url: string, entry: ThumbEntry) => {\n // Re-insert to mark as most-recently used, then trim from the front.\n thumbCache.delete(url)\n thumbCache.set(url, entry)\n if (thumbCache.size > THUMB_CACHE_MAX) {\n thumbCache.delete(thumbCache.keys().next().value as string)\n }\n }\n\n const cached = thumbCache.get(props.url)\n const thumbStatus = ref<ThumbStatus>(cached?.status ?? 'loading')\n\n // Natural pixel dimensions, captured once the thumbnail decodes. Doubles\n // as the size hint PhotoSwipe needs for its slide (falls back until known).\n const dimensions = ref<{ width: number; height: number } | undefined>(\n cached?.dimensions,\n )\n const onImageLoad = (event: Event) => {\n const img = event.target as HTMLImageElement\n if (img.naturalWidth && img.naturalHeight) {\n dimensions.value = {\n width: img.naturalWidth,\n height: img.naturalHeight,\n }\n }\n thumbStatus.value = 'loaded'\n setThumbCache(props.url, {\n status: 'loaded',\n dimensions: dimensions.value,\n })\n }\n const onImageError = () => {\n thumbStatus.value = 'error'\n setThumbCache(props.url, { status: 'error' })\n }\n\n const pswpSize = computed(() => dimensions.value ?? DEFAULT_PSWP_SIZE)\n\n // Meta fragments joined with \" · \" for the caption / doc subtitle.\n const imageMeta = computed(() =>\n [\n dimensions.value &&\n `${dimensions.value.width}×${dimensions.value.height}`,\n formattedSize.value,\n ].filter(Boolean),\n )\n const docMeta = computed(() =>\n [typeTag.value, formattedSize.value].filter(Boolean),\n )\n\n // --- Lightbox ---\n\n // Slide size PhotoSwipe assumes before the real dimensions are known.\n const DEFAULT_PSWP_SIZE = { width: 1200, height: 800 }\n\n // In a conversation the image opens in its lightbox, with the others\n const galleryRef = ref<HTMLElement>()\n const { init, shared } = useLightbox({\n gallery: galleryRef,\n loop: false,\n shared: true,\n })\n\n onMounted(async () => {\n if (!isImage.value) {\n return\n }\n await init()\n })\n</script>\n\n<template>\n <!-- Image attachment: a thumbnail tile with a metadata caption -->\n <figure\n v-if=\"isImage\"\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--image\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n }\">\n <div ref=\"galleryRef\" class=\"pk-chatbot-file-preview__thumb-wrap\">\n <a\n :href=\"url\"\n :data-pswp-src=\"url\"\n :data-pswp-width=\"pswpSize.width\"\n :data-pswp-height=\"pswpSize.height\"\n :data-pswp-caption=\"filename ?? ''\"\n :data-pswp-shared=\"shared || undefined\"\n class=\"pk-chatbot-file-preview__thumb-link\"\n :aria-label=\"filename ?? $t('label.file')\">\n <img\n v-show=\"thumbStatus === 'loaded'\"\n :src=\"url\"\n :alt=\"filename\"\n decoding=\"async\"\n class=\"pk-chatbot-file-preview__thumb\"\n @load=\"onImageLoad\"\n @error=\"onImageError\" />\n </a>\n <!-- Spinner until the thumbnail decodes (or while an upload is in\n flight); a fixed box keeps this from shifting the layout. -->\n <span\n v-if=\"loading || thumbStatus === 'loading'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay\">\n <VvIcon name=\"loading-loop\" />\n </span>\n <!-- The upload failed: the image would not be sent. The mark says\n so on the thumbnail, where the composer hides the caption, and\n is the retry when the host offers one. -->\n <button\n v-else-if=\"error && retryable\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--failed\"\n :title=\"error\"\n :aria-label=\"$t('action.retry')\"\n @click.prevent=\"$emit('retry')\">\n <VvIcon name=\"ri:refresh-line\" />\n </button>\n <span\n v-else-if=\"error\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--failed\"\n role=\"img\"\n :title=\"error\"\n :aria-label=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n </span>\n <!-- Failed to load: a quiet icon instead of the browser's broken\n image glyph. -->\n <span\n v-else-if=\"thumbStatus === 'error'\"\n class=\"pk-chatbot-file-preview__status pk-chatbot-file-preview__status--overlay pk-chatbot-file-preview__status--error\">\n <VvIcon name=\"ri:image-2-line\" />\n </span>\n </div>\n <figcaption v-if=\"!compact\" class=\"pk-chatbot-file-preview__caption\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ imageMeta.join(' · ') }}</template>\n </span>\n </figcaption>\n <button\n v-if=\"editable && compact && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__edit\"\n :title=\"$t('imageEditor.edit')\"\n :aria-label=\"$t('imageEditor.edit')\"\n @click.prevent=\"$emit('edit')\">\n <VvIcon name=\"ri:edit-line\" />\n </button>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click.prevent=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </figure>\n\n <!-- Document attachment: an icon tile + name + type · size -->\n <div\n v-else\n class=\"pk-chatbot-file-preview pk-chatbot-file-preview--doc\"\n :class=\"{\n 'pk-chatbot-file-preview--error': error,\n 'pk-chatbot-file-preview--compact': compact,\n 'pk-chatbot-file-preview--show-download': showDownload,\n }\">\n <!-- A failed upload the host can try again: the tile is the retry -->\n <button\n v-if=\"error && retryable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__icon-tile pk-chatbot-file-preview__retry u-touch-target\"\n :title=\"error\"\n :aria-label=\"$t('action.retry')\"\n @click=\"$emit('retry')\">\n <VvIcon\n name=\"ri:refresh-line\"\n class=\"pk-chatbot-file-preview__icon\" />\n </button>\n <span\n v-else\n class=\"pk-chatbot-file-preview__icon-tile\"\n :style=\"{ '--file-accent': fileKind.accent }\">\n <VvIcon\n v-if=\"loading\"\n name=\"loading-loop\"\n class=\"pk-chatbot-file-preview__icon\" />\n <VvIcon\n v-else\n :name=\"fileKind.icon\"\n class=\"pk-chatbot-file-preview__icon\" />\n </span>\n <span class=\"pk-chatbot-file-preview__body\">\n <span\n v-if=\"filename\"\n class=\"pk-chatbot-file-preview__name\"\n :title=\"filename\"\n >{{ filename }}</span\n >\n <span class=\"pk-chatbot-file-preview__meta\">\n <span\n v-if=\"error\"\n class=\"pk-chatbot-file-preview__error\"\n :title=\"error\">\n <VvIcon name=\"ri:error-warning-line\" />\n {{ error }}\n </span>\n <template v-else>{{ docMeta.join(' · ') }}</template>\n </span>\n </span>\n <!-- The actions of a file the chat's viewer opens: a small bar of\n their own, apart from the name and the size -->\n <span\n v-if=\"!loading && !error && !compact\"\n class=\"pk-chatbot-file-preview__actions\"\n :class=\"{\n 'pk-chatbot-file-preview__actions--bar': onPreview || onRestore,\n }\">\n <button\n v-if=\"onRestore\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('chatFilePreview.restore')\"\n :aria-label=\"`${$t('chatFilePreview.restore')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onRestore\">\n <VvIcon name=\"ri:arrow-go-back-line\" />\n </button>\n <button\n v-if=\"onPreview\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('chatFilePreview.open')\"\n :aria-label=\"`${$t('chatFilePreview.open')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onPreview\">\n <VvIcon name=\"ri:eye-line\" />\n </button>\n <a\n :href=\"url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"pk-chatbot-file-preview__open u-touch-target\"\n :title=\"$t('action.download')\"\n :aria-label=\"`${$t('action.download')}${filename ? ` — ${filename}` : ''}`\"\n @click=\"onOpenClick\">\n <VvIcon name=\"ri:download-2-line\" />\n </a>\n </span>\n <button\n v-if=\"removable && !loading\"\n type=\"button\"\n class=\"pk-chatbot-file-preview__remove\"\n :class=\"{ 'pk-chatbot-file-preview__remove--inline': !compact }\"\n :title=\"$t('action.remove')\"\n :aria-label=\"$t('action.remove')\"\n @click=\"$emit('remove')\">\n <VvIcon name=\"ri:close-line\" />\n </button>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-file-preview {\n // Concentric radii: outer card and inner tiles share an 8px step.\n --file-radius: var(--rounded-lg, 12px);\n\n position: relative;\n max-width: 280px;\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--file-radius);\n color: var(--color-word-2);\n font-size: var(--text-12);\n\n &--error {\n border-color: var(--color-danger);\n }\n\n // --- Document card ---\n &--doc {\n display: flex;\n align-items: center;\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n min-width: 0;\n transition:\n border-color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out),\n box-shadow 0.18s var(--ease-out);\n\n &:hover {\n border-color: var(--color-surface-4);\n background-color: var(--color-surface-2);\n box-shadow: var(--shadow-sm);\n }\n }\n\n &__icon-tile {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-36);\n height: var(--spacing-36);\n\n // One step down from the card radius keeps the nested tile concentric.\n border-radius: var(--rounded-md, 6px);\n\n // Tint derived from the file-type accent; glyph sits at full accent.\n background-color: color-mix(\n in srgb,\n var(--file-accent) 14%,\n transparent\n );\n color: var(--file-accent);\n }\n\n &__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n\n &__body {\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n }\n\n &__actions {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n margin-inline-start: var(--spacing-4);\n }\n\n // Restore, open and download of a file the viewer opens: one small\n // bar, its hairline setting it apart from the name and the size, the\n // icons 8px apart so they read as a group\n &__actions--bar {\n margin-inline-start: var(--spacing-8);\n padding: var(--spacing-2);\n border: var(--border) solid var(--color-surface-3);\n border-radius: var(--rounded);\n }\n\n // 28px to aim at with a mouse, 24 in the bar; 40px under a finger\n // (u-touch-target)\n &__open {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: 0;\n border-radius: var(--rounded);\n background: none;\n color: var(--color-word-3);\n text-decoration: none;\n cursor: pointer;\n opacity: 0;\n transition:\n opacity 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n background-color 0.18s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n\n .vv-icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n }\n\n &__actions--bar &__open {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n\n &--doc:hover &__open,\n &--doc:focus-within &__open,\n &--show-download &__open {\n opacity: 1;\n }\n\n // Touch devices have no hover: keep the open affordance visible.\n @media (hover: none) {\n &--doc &__open {\n opacity: 1;\n }\n }\n\n // --- Image card ---\n &--image {\n display: inline-flex;\n flex-direction: column;\n margin: 0;\n }\n\n &__thumb-wrap {\n position: relative;\n display: flex;\n\n // Fixed box: the card claims its final footprint before the\n // image decodes, so the message log never shifts on load.\n width: 280px;\n max-width: 100%;\n height: 200px;\n background-color: var(--color-surface);\n border-radius: var(--file-radius);\n overflow: hidden;\n }\n\n &__thumb-link {\n display: flex;\n width: 100%;\n height: 100%;\n cursor: pointer;\n }\n\n &__thumb {\n display: block;\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__caption {\n display: flex;\n flex-direction: column;\n gap: 1px;\n padding: var(--spacing-8);\n min-width: 0;\n }\n\n &__name {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: var(--font-medium, 500);\n color: var(--color-word-1);\n }\n\n &__meta {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--text-10);\n line-height: var(--leading-normal);\n\n // Reserve the line even while empty: image dimensions arrive\n // only after decode and must not grow the caption.\n min-height: 1.4em;\n color: var(--color-word-4);\n\n // Stable column for the dimensions/size figures.\n font-variant-numeric: tabular-nums;\n }\n\n &__error {\n display: inline-flex;\n align-items: center;\n gap: var(--spacing-4);\n color: var(--u-danger-text, var(--color-danger));\n\n .vv-icon {\n flex-shrink: 0;\n }\n }\n\n &__status {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n .vv-icon {\n width: var(--spacing-32);\n height: var(--spacing-32);\n }\n\n &--overlay {\n position: absolute;\n inset: 0;\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 70%,\n transparent\n );\n color: var(--color-word-1);\n }\n\n &--error {\n color: var(--color-word-4);\n }\n\n // An upload that failed, in the danger text of the caption's error\n &--failed {\n padding: 0;\n border: 0;\n color: var(--u-danger-text, var(--color-danger));\n font: inherit;\n\n .vv-icon {\n width: var(--spacing-24);\n height: var(--spacing-24);\n }\n }\n\n &--failed:is(button) {\n cursor: pointer;\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n }\n }\n }\n\n // The tile of a document whose upload failed, as a retry\n &__retry {\n --file-accent: var(--u-danger-text, var(--color-danger));\n\n position: relative;\n padding: 0;\n border: 0;\n cursor: pointer;\n }\n\n // --- Remove and edit buttons (input context) ---\n &__remove,\n &__edit {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n display: flex;\n align-items: center;\n justify-content: center;\n\n // Visible glyph is 18px but the hit area stays a comfortable 28px.\n width: var(--spacing-28);\n height: var(--spacing-28);\n padding: 0;\n border: none;\n border-radius: var(--rounded-full, 9999px);\n background-color: color-mix(\n in srgb,\n var(--color-surface-1) 85%,\n transparent\n );\n color: var(--color-word-2);\n cursor: pointer;\n line-height: 1;\n box-shadow: var(--shadow-sm);\n transition:\n background-color 0.18s var(--ease-out),\n color 0.18s var(--ease-out),\n scale 0.12s var(--ease-out);\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n\n &:active {\n scale: 0.96;\n }\n\n // Inside the document row the button rides inline, not overlaid\n // (size is inherited from the base).\n &--inline {\n position: static;\n flex-shrink: 0;\n box-shadow: none;\n background-color: transparent;\n color: var(--color-word-4);\n\n &:hover {\n background-color: var(--color-surface-3);\n color: var(--color-word-1);\n }\n }\n }\n\n // --- Compact (composer) chips ---\n // ChatGPT/Gemini-style: every attachment is the SAME height and carries\n // an always-visible round remove control in the top-right corner — no\n // hover-revealed actions, no size mismatch between image and file chips.\n &--compact {\n // Shared chip height so image and file chips align in the row.\n --chip-size: var(--spacing-56);\n\n max-width: 240px;\n\n &.pk-chatbot-file-preview--image {\n width: var(--chip-size);\n height: var(--chip-size);\n border-radius: var(--rounded-md, 6px);\n }\n\n // Fill the square; the root's `overflow: hidden` rounds the corners.\n .pk-chatbot-file-preview__thumb-wrap,\n .pk-chatbot-file-preview__thumb-link {\n width: 100%;\n height: 100%;\n }\n\n &.pk-chatbot-file-preview--doc {\n height: var(--chip-size);\n gap: var(--spacing-8);\n padding: var(--spacing-8);\n\n // Reserve room so the corner remove button never overlaps the\n // name/meta text.\n padding-inline-end: var(--spacing-28);\n }\n\n // Square icon tile that fills the chip height, so file chips read at\n // the same scale as image thumbnails: the chip less its padding and\n // its two 1px borders. Not `align-self: stretch` with `aspect-ratio`,\n // which Safari sizes from the chip's outer height, so the tile ran\n // past the chip's bottom edge.\n .pk-chatbot-file-preview__icon-tile {\n --chip-tile-size: calc(\n var(--chip-size) - 2 * var(--spacing-8) - 2px\n );\n\n width: var(--chip-tile-size);\n height: var(--chip-tile-size);\n }\n\n .pk-chatbot-file-preview__icon {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n // Always-visible round remove control on the top-right corner: the\n // base transform centres it 4px inside the corner, so half of it rides\n // over the chip's edge (nothing clips it), with an extended hit area\n // for easy tapping. The edit control of an image mirrors it on the\n // top-left corner.\n &--compact &__remove,\n &--compact &__edit {\n top: var(--spacing-4);\n right: var(--spacing-4);\n width: var(--spacing-24);\n height: var(--spacing-24);\n border: 1px solid var(--color-surface-4);\n background-color: var(--color-surface);\n color: var(--color-word-1);\n font-size: var(--text-16);\n box-shadow: var(--shadow-sm);\n\n // Comfortable touch/click target beyond the small visible glyph.\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-4));\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n color: var(--color-word-1);\n }\n }\n\n &--compact &__edit {\n right: auto;\n left: var(--spacing-4);\n transform: translate(-50%, -50%);\n }\n\n @media (prefers-reduced-motion: reduce) {\n &--doc,\n &__open,\n &__remove,\n &__edit {\n transition: none;\n }\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;A,gCA2PUsC,IAAkB,K;;;;;;;;;;;;;;;;;;;;;;;;;EAvPxB,IAAMG,IAAQC,GA4DRC,KAAe,MAAsB;GACvC,AAAKF,EAAM,eAGXG,EAAM,eAAe,GACrBH,EAAW,WAAW;EAC1B,GAEMI,IAAUC,QACN,CAACL,EAAM,UAAUA,EAAM,UAAU,WAAW,QAAQ,CAC9D,GAIMM,IAAYD,QAAe;GAC7B,IAAME,IAAOP,EAAM,YAAY,IACzBQ,IAAMD,EAAK,YAAY,GAAG;GAChC,OAAOC,IAAM,IAAID,EAAK,MAAMC,IAAM,CAAC,CAAC,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WAAQ,MAASA,EAAA,aAAQ;MAChE,SAAOC;K,IACRlC,EAAoCuE,GAAA,EAA5B,MAAK,qBAAoB,CAAA,C;;IAI/BtC,EAAA,aAAS,CAAKA,EAAA,WADxBxC,EAAA,GAAAC,EASS,UAAA;;KAPL,MAAK;KACL,OAAKC,EAAA,CAAC,mCAAiC,EAAA,2CAAA,CACesC,EAAA,QAAO,CAAA,CAAA;KAC5D,OAAO1C,EAAAA,GAAE,eAAA;KACT,cAAYA,EAAAA,GAAE,eAAA;KACd,SAAK,AAAA4F,EAAA,QAAA,MAAE3F,EAAAA,MAAK,QAAA;I,IACbQ,EAA+BuE,GAAA,EAAvB,MAAK,gBAAe,CAAA,C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./VvButtonLocalized-C-vx25u4.js";
|
|
2
2
|
import { s as t } from "./Media-0U2B_qCS.js";
|
|
3
|
-
import { t as n } from "./PkStreamingMarkdown-
|
|
4
|
-
import { t as r } from "./PkChatbotFilePreview-
|
|
3
|
+
import { t as n } from "./PkStreamingMarkdown-D6Qxwf47.js";
|
|
4
|
+
import { t as r } from "./PkChatbotFilePreview-5_bih_vc.js";
|
|
5
5
|
import { j as i, k as a } from "./utils-Bdk5kFfi.js";
|
|
6
6
|
import { VvDropdown as o, VvDropdownAction as s, VvIcon as c } from "@volverjs/ui-vue/components";
|
|
7
7
|
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineAsyncComponent as _, defineComponent as v, mergeModels as y, mergeProps as ee, nextTick as b, normalizeClass as te, normalizeProps as ne, onBeforeUnmount as re, onMounted as ie, openBlock as x, ref as S, renderList as ae, renderSlot as oe, shallowRef as se, toDisplayString as C, unref as w, useId as ce, useModel as T, useTemplateRef as E, watch as D, withCtx as O, withKeys as le, withModifiers as ue } from "vue";
|
|
@@ -517,4 +517,4 @@ var M = j, N = ["type"], P = {
|
|
|
517
517
|
});
|
|
518
518
|
export { F as n, I as t };
|
|
519
519
|
|
|
520
|
-
//# sourceMappingURL=PkChatbotInput-
|
|
520
|
+
//# sourceMappingURL=PkChatbotInput-BLKhf3WD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkChatbotInput-DSdGtBTs.js","names":["_hoisted_2","_openBlock","_createElementBlock","_normalizeClass","_createVNode","_toDisplayString","$slots","$n","_useModel","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","PkStreamingMarkdown","_toDisplayString","_unref","_createElementVNode","_withModifiers","_createVNode","_createTextVNode","PkChatbotFilePreview","_renderSlot","_normalizeProps","_mergeProps","_withCtx","PkChatButton","_withKeys","_normalizeClass","VvButtonLocalized","codeExtensionsOf","PkStreamingMarkdown_default","PkChatbotFilePreview_default","isImeComposing","isEditableImage","e","t","o","r","n","l","a","i","s","d","c","v","_hoisted_1$1","_hoisted_2$1","PkChatButton_default","defineComponent","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","__props","createVNode","toDisplayString","createCommentVNode","_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","PkChatbotInput_default","\"modelValue\"","\"modelModifiers\"","\"pendingAttachments\"","\"pendingAttachmentsModifiers\"","__expose","__emit","PkImageEditorDialog","defineAsyncComponent","modelValue","useModel","pendingAttachments","emit","props","$t","useI18n","textareaEl","useTemplateRef","fileInputEl","cameraInputEl","formEl","localValue","ref","syncTimer","cancelSync","flushSync","scheduleSync","onTextareaInput","nextTick","isStreaming","computed","isSubmitted","isInputDisabled","counterId","useId","currentLength","isOverLimit","isUploadingAnyFile","hasFailedAttachment","isSubmitEnabled","isQueueing","hasCaptureSupport","acceptMimeTypes","allowed","acceptImageMimeTypes","m","showCameraOption","openFilePicker","openCameraPicker","emitFiles","file","files","onFileChange","input","event","removeAttachment","att","id","editingId","editing","annotating","shallowRef","editorFile","isEditable","closeEditor","onImageEdited","annotated","isDismissableNoticeVisible","closeDismissableNotice","activeNotices","notices","notice","keepKeyboardFocus","stopGeneration","handleSubmit","onTextareaEnter","textareaWidth","useResizeObserver","entry","width","watch","onBeforeUnmount","_component_VvButton","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","Fragment","renderList","createBlock","unref","createElementVNode","withModifiers","_cache","createTextVNode","renderSlot","_ctx","normalizeProps","mergeProps","withCtx","init","aria","toggle","withKeys"],"sources":["../../../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js","../../../../packages/components/src/chat/PkChatButton.vue","../../../../packages/components/src/chat/PkChatbotInput.vue"],"sourcesContent":["var e=new Map;function t(t){var o=e.get(t);o&&o.destroy()}function o(t){var o=e.get(t);o&&o.update()}var r=null;\"undefined\"==typeof window?((r=function(e){return e}).destroy=function(e){return e},r.update=function(e){return e}):((r=function(t,o){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&\"TEXTAREA\"===t.nodeName&&!e.has(t)){var o,r=null,n=window.getComputedStyle(t),i=(o=t.value,function(){a({testForHeightReduction:\"\"===o||!t.value.startsWith(o),restoreTextAlign:null}),o=t.value}),l=function(o){t.removeEventListener(\"autosize:destroy\",l),t.removeEventListener(\"autosize:update\",s),t.removeEventListener(\"input\",i),window.removeEventListener(\"resize\",s),Object.keys(o).forEach(function(e){return t.style[e]=o[e]}),e.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener(\"autosize:destroy\",l),t.addEventListener(\"autosize:update\",s),t.addEventListener(\"input\",i),window.addEventListener(\"resize\",s),t.style.overflowX=\"hidden\",t.style.wordWrap=\"break-word\",e.set(t,{destroy:l,update:s}),s()}function a(e){var o,i,l=e.restoreTextAlign,s=void 0===l?null:l,d=e.testForHeightReduction,u=void 0===d||d,c=n.overflowY;if(0!==t.scrollHeight&&(\"vertical\"===n.resize?t.style.resize=\"none\":\"both\"===n.resize&&(t.style.resize=\"horizontal\"),u&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach(function(e){var t=e[0],o=e[1];t.style.scrollBehavior=\"auto\",t.scrollTop=o,t.style.scrollBehavior=null})}}(t),t.style.height=\"\"),i=\"content-box\"===n.boxSizing?t.scrollHeight-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):t.scrollHeight+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),\"none\"!==n.maxHeight&&i>parseFloat(n.maxHeight)?(\"hidden\"===n.overflowY&&(t.style.overflow=\"scroll\"),i=parseFloat(n.maxHeight)):\"hidden\"!==n.overflowY&&(t.style.overflow=\"hidden\"),t.style.height=i+\"px\",s&&(t.style.textAlign=s),o&&o(),r!==i&&(t.dispatchEvent(new Event(\"autosize:resized\",{bubbles:!0})),r=i),c!==n.overflow&&!s)){var v=n.textAlign;\"hidden\"===n.overflow&&(t.style.textAlign=\"start\"===v?\"end\":\"start\"),a({restoreTextAlign:v,testForHeightReduction:!0})}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(t)}),t}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],t),e},r.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e});var n=r;export default n;\n","<script lang=\"ts\" setup>\n /**\n * The icon button of the chat dock: attach, send and stop in the input,\n * mute and hang up in a live call. One component, because the call bar\n * takes the place of the input and the two must not look like two\n * different pieces of software.\n *\n * Native attributes fall through to the button, so `title`, `disabled` and\n * `aria-pressed` are written by the caller as they would be on a `<button>`.\n */\n withDefaults(\n defineProps<{\n icon: string\n /** Written next to the icon, for an action nobody should have to guess from a glyph. */\n label?: string\n type?: 'button' | 'submit'\n /** `primary` is the filled circle of send and stop, the one action the dock is for. */\n modifiers?: 'danger' | 'primary'\n }>(),\n { label: undefined, type: 'button', modifiers: undefined },\n )\n</script>\n\n<template>\n <button\n class=\"pk-chat-button\"\n :class=\"[\n modifiers ? `pk-chat-button--${modifiers}` : undefined,\n { 'pk-chat-button--labelled': label },\n ]\"\n :type=\"type\">\n <VvIcon :name=\"icon\" class=\"pk-chat-button__icon\" />\n <span v-if=\"label\" class=\"pk-chat-button__label\">{{ label }}</span>\n </button>\n</template>\n\n<style lang=\"scss\">\n .pk-chat-button {\n position: relative;\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n padding: var(--spacing-4);\n border: none;\n border-radius: var(--rounded);\n background-color: transparent;\n color: var(--color-word-1);\n cursor: pointer;\n transition: var(--transition-colors);\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n // The fields' focus ring: a 1px surface-5 line measured 1.3:1 on the\n // surface, under the 3:1 a focus indicator needs\n &:focus-visible {\n outline: var(--spacing-2) solid var(--input-focus-color);\n outline-offset: 0;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n // A finger needs 40px and the button is drawn at 28: on a touch\n // screen it answers 8px around itself, in every layout of the chat\n // (it was the fullscreen one only) and in the call bar, which mounts\n // the same button\n @media (pointer: coarse) {\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-8));\n }\n }\n\n // A toggle has to survive a glance: a crossed-out glyph alone changes\n // too few pixels to notice mid-sentence.\n &[aria-pressed='true'] {\n background-color: var(--color-surface-3);\n color: var(--color-word);\n }\n\n // A wash of the same red rather than a lighter red behind it: the\n // `lighten-5` step lands close enough to the icon to leave it at about\n // 2:1, which is a button that disappears exactly while it is being\n // pointed at. The tint composites over whatever surface is behind, so\n // it holds in the dark theme too.\n &--danger {\n // The project's text shade of danger; the fill where a host app\n // loads only the library and this package's stylesheet\n color: var(--u-danger-text, var(--color-danger));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-danger) 12%,\n transparent\n );\n }\n }\n\n // Same 28px box as the ghost buttons, so the dock keeps its height,\n // with a smaller glyph because a filled shape needs air around it.\n // Its edge is visible, so it sits on the input's padding line just as\n // the text does: a ghost glyph sat 6px further in and made the two\n // sides of the input look unequal. Empty, it turns into a grey pad\n // with the fields' disabled ink: a light arrow on that pad vanished,\n // and with it the circle's edge, which is what squares the sides.\n // The agent's color when the widget has one, like the user's bubble.\n &--primary {\n --pk-chat-button-fill: var(\n --chatbot-main-color,\n var(--color-word-1)\n );\n\n padding: var(--spacing-6);\n border-radius: var(--rounded-full);\n background-color: var(--pk-chat-button-fill);\n color: var(--chatbot-contrast-color, var(--color-surface));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--pk-chat-button-fill) 85%,\n var(--color-surface)\n );\n }\n\n // Off the disc, or a dark ring would sink into a dark fill\n &:focus-visible {\n outline-offset: var(--spacing-2);\n }\n\n &:disabled {\n opacity: 1;\n background-color: var(--color-surface-3);\n color: var(--color-word-3);\n }\n\n .pk-chat-button__icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n }\n\n &--labelled {\n gap: var(--spacing-4);\n padding-inline: var(--spacing-8);\n font-size: var(--text-12);\n }\n\n &__icon {\n display: block;\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n // @ts-expect-error - no types for autosize\n import autosize from 'autosize'\n import {\n computed,\n defineAsyncComponent,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n useId,\n useTemplateRef,\n watch,\n } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useResizeObserver } from '@vueuse/core'\n import { codeExtensionsOf, type AgentFileUpload } from 'models'\n import type { PendingAttachment } from 'composables'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n import PkChatButton from './PkChatButton.vue'\n import { isEditableImage, isImeComposing } from './utils'\n\n // A chunk of its own: the widget downloads the editor on the first \"Edit\"\n const PkImageEditorDialog = defineAsyncComponent(\n () => import('./PkImageEditorDialog.vue'),\n )\n\n // --- Models & Props ---\n\n const modelValue = defineModel<string | undefined>({ default: undefined })\n const pendingAttachments = defineModel<PendingAttachment[]>(\n 'pendingAttachments',\n { default: () => [] },\n )\n\n const emit = defineEmits<{\n submit: []\n 'stop-generation': []\n 'file-select': [file: File]\n /**\n * The user took an attachment back, already out of `pendingAttachments`:\n * the store deletes its upload too.\n */\n 'remove-attachment': [attachment: PendingAttachment]\n /**\n * The user edited an image (`editableImages`): `file` takes the\n * place of `attachment`, which the store uploads and replaces.\n */\n 'replace-attachment': [attachment: PendingAttachment, file: File]\n /** The user retries a failed upload (`retryableAttachments`). */\n 'retry-attachment': [attachment: PendingAttachment]\n 'dismiss-attachment-notice': []\n 'dismiss-page-notice': []\n 'open-answer-notice': [id: string]\n 'dismiss-answer-notice': [id: string]\n 'voice-start': []\n /** Point at the page (spec `page-point-and-choose.md`, P). */\n point: []\n 'remove-pointer': []\n /** The user clicked the \"Automatic\" label: back to manual confirmations. */\n 'manual-confirmations': []\n }>()\n\n const props = defineProps<{\n placeholder?: string\n dismissableNotice?: string\n /**\n * What the agent can do on the page that embeds the chat (spec\n * `page-tools.md`). Its closing is the caller's to remember.\n */\n pageNotice?: string\n status?: 'submitted' | 'streaming' | 'ready' | 'error'\n maxMessageLength?: number\n fileUpload?: AgentFileUpload\n attachmentLimitReached?: boolean\n attachmentNotice?: string\n /** Show the talk button: the agent has voice enabled. */\n voiceEnabled?: boolean\n /**\n * What is written while the agent answers is queued and sent when the\n * answer ends (spec resumable-chat-streams, F2): sending stays open.\n */\n queueEnabled?: boolean\n /** Answers that ended in another conversation, each with its own line and its \"Open\". */\n answerNotices?: { id: string; text: string }[]\n /** The user may point at the page that embeds the chat: the button shows. */\n pointerAvailable?: boolean\n /** The user is pointing at the page now. */\n pointing?: boolean\n /** What the user pointed at for this message: the chip above the field. */\n pointer?: { kind: 'element' | 'text'; label: string }\n /**\n * The user chose automatic confirmations (spec\n * `auto-confirmations.md`): a label above the field says so, and\n * takes them back to manual.\n */\n automaticConfirmations?: boolean\n /**\n * The host replaces an edited image (`replace-attachment`): the\n * images of the composer show \"Edit\" and open the image editor.\n */\n editableImages?: boolean\n /**\n * The host uploads a failed attachment again (`retry-attachment`):\n * its chip shows \"Retry\".\n */\n retryableAttachments?: boolean\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n // --- Template refs ---\n\n const textareaEl = useTemplateRef<HTMLTextAreaElement>('textareaEl')\n const fileInputEl = useTemplateRef<HTMLInputElement>('fileInputEl')\n const cameraInputEl = useTemplateRef<HTMLInputElement>('cameraInputEl')\n const formEl = useTemplateRef<HTMLFormElement>('formEl')\n\n // --- Input buffering (decouples typing from reactive model propagation) ---\n\n const localValue = ref(modelValue.value ?? '')\n let syncTimer: ReturnType<typeof setTimeout> | null = null\n\n const cancelSync = () => {\n if (syncTimer !== null) {\n clearTimeout(syncTimer)\n syncTimer = null\n }\n }\n\n const flushSync = () => {\n cancelSync()\n modelValue.value = localValue.value\n }\n\n const scheduleSync = () => {\n cancelSync()\n syncTimer = setTimeout(() => {\n modelValue.value = localValue.value\n syncTimer = null\n }, 300)\n }\n\n const onTextareaInput = () => {\n localValue.value = textareaEl.value?.value ?? ''\n scheduleSync()\n }\n\n watch(modelValue, (v) => {\n if (v !== localValue.value) {\n localValue.value = v ?? ''\n nextTick(() => {\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n })\n }\n })\n\n // --- Status computeds ---\n\n const isStreaming = computed(() => props.status === 'streaming')\n const isSubmitted = computed(() => props.status === 'submitted')\n const isInputDisabled = computed(\n () => isStreaming.value || isSubmitted.value,\n )\n\n // --- Validation ---\n\n const counterId = useId()\n const currentLength = computed(() => localValue.value.length)\n\n const isOverLimit = computed(\n () =>\n props.maxMessageLength !== undefined &&\n currentLength.value > props.maxMessageLength,\n )\n\n const isUploadingAnyFile = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'uploading'),\n )\n\n // A failed attachment would leave the message without a word: the send\n // stays off until the user retries it or takes it back\n const hasFailedAttachment = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'error'),\n )\n\n const isSubmitEnabled = computed(() => {\n if (\n (isInputDisabled.value && !props.queueEnabled) ||\n isUploadingAnyFile.value ||\n hasFailedAttachment.value ||\n isOverLimit.value\n ) {\n return false\n }\n return localValue.value.trim().length > 0\n })\n\n /** Written during an answer: the send button queues it, next to the stop. */\n const isQueueing = computed(\n () => isInputDisabled.value && isSubmitEnabled.value,\n )\n\n // --- File upload ---\n\n const hasCaptureSupport = 'capture' in document.createElement('input')\n\n // A browser filters the picker by type and knows few code types: their\n // extensions go along.\n const acceptMimeTypes = computed(() => {\n const allowed = props.fileUpload?.allowedMimeTypes ?? []\n return [...allowed, ...codeExtensionsOf(allowed)].join(',')\n })\n\n const acceptImageMimeTypes = computed(() =>\n (props.fileUpload?.allowedMimeTypes ?? [])\n .filter((m) => m.startsWith('image/'))\n .join(','),\n )\n\n const showCameraOption = computed(\n () => hasCaptureSupport && acceptImageMimeTypes.value.length > 0,\n )\n\n const openFilePicker = () => {\n fileInputEl.value?.click()\n }\n\n const openCameraPicker = () => {\n cameraInputEl.value?.click()\n }\n\n // The store owns the attachment limits and drops any overflow; the input\n // just forwards every picked/dropped file.\n const emitFiles = (files: File[]) => {\n for (const file of files) {\n emit('file-select', file)\n }\n }\n\n const onFileChange = (event: Event) => {\n const input = event.target as HTMLInputElement\n emitFiles(Array.from(input.files ?? []))\n input.value = ''\n }\n\n // --- Attachments ---\n\n const removeAttachment = (id: string) => {\n const att = pendingAttachments.value.find((a) => a.id === id)\n if (!att) {\n return\n }\n URL.revokeObjectURL(att.localUrl)\n pendingAttachments.value = pendingAttachments.value.filter(\n (a) => a.id !== id,\n )\n emit('remove-attachment', att)\n }\n\n // The image in the editor: an attachment of the list, which the copy\n // replaces (gone from the list, sent or taken back, the editor closes\n // with it), or an image of the conversation, whose copy joins the list\n // (\"Annota e chiedi\", spec `chat-image-editor.md`, F3)\n const editingId = ref<string>()\n const editing = computed(() =>\n pendingAttachments.value.find((a) => a.id === editingId.value),\n )\n const annotating = shallowRef<Promise<File>>()\n const editorFile = computed(() => editing.value?.file ?? annotating.value)\n\n const isEditable = (att: PendingAttachment) =>\n !!props.editableImages &&\n att.state !== 'uploading' &&\n isEditableImage(att.file.type)\n\n const closeEditor = () => {\n editingId.value = undefined\n annotating.value = undefined\n }\n\n const onImageEdited = async (file: File) => {\n const att = editing.value\n const annotated = !att && !!annotating.value\n closeEditor()\n if (att) {\n emit('replace-attachment', att, file)\n } else if (annotated) {\n emit('file-select', file)\n } else {\n return\n }\n // Once the dialog is gone: its chip is gone too, so the focus it\n // hands back on closing lands nowhere\n await nextTick()\n textareaEl.value?.focus()\n }\n\n // --- Notices (one box above the input) ---\n\n type InputNotice = {\n id: string\n text?: string\n markdown?: string\n icon?: string\n open?: () => void\n dismiss?: () => void\n }\n\n const isDismissableNoticeVisible = ref(true)\n const closeDismissableNotice = () => {\n isDismissableNoticeVisible.value = false\n }\n\n const activeNotices = computed<InputNotice[]>(() => {\n // The alert answers what the user just did, and takes the box alone\n // until it is closed.\n if (props.attachmentNotice) {\n return [\n {\n id: 'limit',\n icon: 'ri:information-line',\n text: props.attachmentNotice,\n dismiss: () => emit('dismiss-attachment-notice'),\n },\n ]\n }\n const notices: InputNotice[] = []\n // Why the send is off: it stays until the attachment is retried or\n // taken back, so it has no close\n if (hasFailedAttachment.value) {\n notices.push({\n id: 'upload-failed',\n icon: 'ri:error-warning-line',\n text: $t('message.attachmentUploadFailed'),\n })\n }\n // An answer that ended where the user is not: news, so it comes\n // first, and it leaves once opened or closed.\n for (const notice of props.answerNotices ?? []) {\n notices.push({\n id: `answer-${notice.id}`,\n icon: 'ri:chat-check-line',\n text: notice.text,\n open: () => emit('open-answer-notice', notice.id),\n dismiss: () => emit('dismiss-answer-notice', notice.id),\n })\n }\n // What the agent does on this page, next: the user should read it\n // before writing. The agent's own notice stays beside it, never\n // behind it: it is where an agent states its terms, a privacy\n // policy among them.\n if (props.pageNotice) {\n notices.push({\n id: 'page',\n icon: 'ri:pages-line',\n text: props.pageNotice,\n dismiss: () => emit('dismiss-page-notice'),\n })\n }\n if (props.dismissableNotice && isDismissableNoticeVisible.value) {\n notices.push({\n id: 'dismissable',\n markdown: props.dismissableNotice,\n dismiss: closeDismissableNotice,\n })\n }\n return notices\n })\n\n // --- Submit ---\n\n /**\n * Send turns disabled and then gives way to stop, stop gives way to send:\n * a keyboard user who pressed one would be left on the page body. Hand\n * the focus to the textarea, but only after a keyboard press: a tap has no\n * focus to keep, and focusing would bring the phone keyboard back up over\n * the answer.\n */\n const keepKeyboardFocus = () => {\n if (formEl.value?.querySelector('button:focus-visible')) {\n textareaEl.value?.focus()\n }\n }\n\n const stopGeneration = () => {\n keepKeyboardFocus()\n emit('stop-generation')\n }\n\n const handleSubmit = () => {\n if (!isSubmitEnabled.value) {\n return\n }\n keepKeyboardFocus()\n flushSync()\n emit('submit')\n localValue.value = ''\n modelValue.value = ''\n nextTick(() => {\n if (textareaEl.value) {\n textareaEl.value.value = ''\n autosize.update(textareaEl.value)\n }\n })\n }\n\n /**\n * Enter sends, Shift+Enter goes to a new line. The Enter that confirms an\n * IME composition belongs to the composition.\n */\n const onTextareaEnter = (event: KeyboardEvent) => {\n if (event.shiftKey || isImeComposing(event)) {\n return\n }\n event.preventDefault()\n handleSubmit()\n }\n\n // --- Lifecycle ---\n\n onMounted(() => {\n if (textareaEl.value) {\n autosize(textareaEl.value)\n }\n })\n\n // autosize measures on input and on a window resize only, and an empty\n // textarea measures its placeholder. The chat settles its layout after\n // mount: measured at a first, narrower width, the placeholder wrapped,\n // and on the chat page of a phone the field stayed 88px tall, four lines\n // with the text at their top, until the user typed. Measured again when\n // its width changes, or its placeholder.\n let textareaWidth = 0\n useResizeObserver(textareaEl, ([entry]) => {\n const width = entry?.contentRect.width ?? 0\n if (textareaEl.value && width !== textareaWidth) {\n textareaWidth = width\n autosize.update(textareaEl.value)\n }\n })\n watch(\n () => props.placeholder,\n async () => {\n await nextTick()\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n },\n )\n\n onBeforeUnmount(() => {\n cancelSync()\n if (textareaEl.value) {\n autosize.destroy(textareaEl.value)\n }\n for (const att of pendingAttachments.value) {\n URL.revokeObjectURL(att.localUrl)\n }\n })\n\n defineExpose({\n /** Move the focus to the message field */\n focus: () => textareaEl.value?.focus(),\n /**\n * Opens the editor on an image of the conversation, whose bytes are\n * on their way; the copy made of it joins the attachments.\n */\n annotateImage: (file: Promise<File>) => {\n editingId.value = undefined\n annotating.value = file\n },\n })\n</script>\n\n<template>\n <div class=\"pk-chatbot-input\">\n <div\n v-if=\"activeNotices.length\"\n class=\"pk-chatbot-input__notice\"\n role=\"status\">\n <div\n v-for=\"notice in activeNotices\"\n :key=\"notice.id\"\n class=\"pk-chatbot-input__notice-item\">\n <VvIcon\n v-if=\"notice.icon\"\n :name=\"notice.icon\"\n class=\"pk-chatbot-input__notice-icon\" />\n <PkStreamingMarkdown\n v-if=\"notice.markdown\"\n :markdown=\"notice.markdown\"\n class=\"wysiwyg pk-chatbot-input__notice-text\" />\n <span v-else class=\"pk-chatbot-input__notice-text\">\n {{ notice.text }}\n </span>\n <VvButton\n v-if=\"notice.open\"\n :label=\"$t('action.open')\"\n modifiers=\"link\"\n class=\"pk-chatbot-input__notice-action\"\n @click=\"notice.open()\" />\n <VvButton\n v-if=\"notice.dismiss\"\n :title=\"$t('action.close')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"notice.dismiss()\" />\n </div>\n </div>\n <form\n ref=\"formEl\"\n class=\"pk-chatbot-input__form\"\n @submit.prevent=\"handleSubmit\">\n <button\n v-if=\"automaticConfirmations\"\n type=\"button\"\n class=\"pk-chatbot-input__mode\"\n :title=\"$t('action.manualConfirmations')\"\n @click=\"emit('manual-confirmations')\">\n <VvIcon\n name=\"ri:flashlight-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n {{ $t('label.automaticConfirmations') }}\n <VvIcon\n name=\"ri:close-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n </button>\n <div v-if=\"pointer\" class=\"pk-chatbot-input__pointer\">\n <VvIcon\n :name=\"\n pointer.kind === 'text'\n ? 'ri:double-quotes-l'\n : 'ri:focus-3-line'\n \"\n class=\"pk-chatbot-input__pointer-icon\" />\n <span class=\"pk-chatbot-input__pointer-label\">\n {{\n pointer.kind === 'text'\n ? `«${pointer.label}»`\n : pointer.label\n }}\n </span>\n <VvButton\n :title=\"$t('pagePointer.remove')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"emit('remove-pointer')\" />\n </div>\n <div\n v-if=\"pendingAttachments.length\"\n class=\"pk-chatbot-input__attachments\">\n <PkChatbotFilePreview\n v-for=\"att in pendingAttachments\"\n :key=\"att.id\"\n :media-type=\"att.mediaSource?.mimeType ?? att.file.type\"\n :url=\"att.localUrl\"\n :filename=\"att.file.name\"\n :size=\"att.file.size\"\n :loading=\"att.state === 'uploading'\"\n :error=\"att.state === 'error' ? att.error : undefined\"\n :removable=\"att.state !== 'uploading'\"\n :editable=\"isEditable(att)\"\n :retryable=\"retryableAttachments && att.state === 'error'\"\n compact\n @remove=\"removeAttachment(att.id)\"\n @edit=\"editingId = att.id\"\n @retry=\"emit('retry-attachment', att)\" />\n </div>\n <div class=\"pk-chatbot-input__fieldset\">\n <slot name=\"prepend\" />\n <VvDropdown\n v-if=\"\n fileUpload &&\n fileUpload.enabled &&\n (showCameraOption || $slots['additional-actions'])\n \"\n v-bind=\"{\n placement: 'top-start',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n }\">\n <template #default=\"{ init, toggle, aria }\">\n <!-- The only one still written by hand: the dropdown\n anchors itself to whatever `init` receives, and that\n has to be the element, not a component instance -->\n <button\n :ref=\"(e: any) => init(e)\"\n v-bind=\"aria\"\n class=\"pk-chat-button\"\n type=\"button\"\n :title=\"$t('action.attachFile')\"\n :disabled=\"isInputDisabled\"\n @click=\"toggle\">\n <VvIcon\n name=\"ri:add-line\"\n class=\"pk-chat-button__icon\" />\n </button>\n </template>\n <template #items>\n <VvDropdownAction\n v-if=\"showCameraOption\"\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openCameraPicker\">\n <VvIcon\n name=\"ri:camera-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.takePhoto') }}\n </VvDropdownAction>\n <VvDropdownAction\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openFilePicker\">\n <VvIcon\n name=\"ri:attachment-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.attachFile') }}\n </VvDropdownAction>\n <slot name=\"additional-actions\" />\n </template>\n </VvDropdown>\n <PkChatButton\n v-else-if=\"fileUpload && fileUpload.enabled\"\n icon=\"ri:add-line\"\n :title=\"$t('action.attachFile')\"\n :disabled=\"isInputDisabled || attachmentLimitReached\"\n @click=\"openFilePicker\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled\"\n ref=\"fileInputEl\"\n type=\"file\"\n hidden\n multiple\n :accept=\"acceptMimeTypes\"\n @change=\"onFileChange\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled && showCameraOption\"\n ref=\"cameraInputEl\"\n type=\"file\"\n capture=\"environment\"\n hidden\n :accept=\"acceptImageMimeTypes\"\n @change=\"onFileChange\" />\n <PkChatButton\n v-if=\"pointerAvailable\"\n icon=\"ri:focus-3-line\"\n :title=\"$t('pagePointer.start')\"\n :aria-pressed=\"pointing\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('point')\" />\n <div class=\"pk-chatbot-input__content\">\n <textarea\n ref=\"textareaEl\"\n :value=\"localValue\"\n class=\"pk-chatbot-input__textarea\"\n name=\"message\"\n rows=\"1\"\n enterkeyhint=\"send\"\n :aria-label=\"$t('label.message')\"\n :aria-describedby=\"\n maxMessageLength ? counterId : undefined\n \"\n :aria-invalid=\"isOverLimit || undefined\"\n :placeholder\n @input=\"onTextareaInput\"\n @keydown.enter=\"onTextareaEnter\"></textarea>\n </div>\n <div\n v-if=\"maxMessageLength\"\n :id=\"counterId\"\n class=\"pk-chatbot-input__counter\"\n :class=\"{ 'pk-chatbot-input__counter--over': isOverLimit }\">\n {{ $n(currentLength, 'integer') }}/<span\n class=\"opacity-60\"\n >{{ $n(maxMessageLength, 'integer') }}</span\n >\n </div>\n <PkChatButton\n v-if=\"voiceEnabled && !isStreaming\"\n icon=\"ri:mic-line\"\n :title=\"$t('action.talk')\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('voice-start')\" />\n <!-- With a message to queue the send button is the filled one,\n and the stop steps back beside it -->\n <PkChatButton\n v-if=\"isStreaming\"\n icon=\"ri:stop-fill\"\n :modifiers=\"isQueueing ? undefined : 'primary'\"\n :title=\"$t('action.stop')\"\n @click=\"stopGeneration\" />\n <PkChatButton\n v-if=\"isQueueing\"\n type=\"submit\"\n modifiers=\"primary\"\n icon=\"ri:arrow-up-line\"\n :title=\"$t('action.queueMessage')\" />\n <PkChatButton\n v-else-if=\"!isStreaming\"\n type=\"submit\"\n modifiers=\"primary\"\n :icon=\"isSubmitted ? 'loading-loop' : 'ri:arrow-up-line'\"\n :title=\"$t('action.submit')\"\n :disabled=\"!isSubmitEnabled\" />\n </div>\n </form>\n <!-- Outside the form: Enter in the editor must not send the message -->\n <PkImageEditorDialog\n v-if=\"editorFile\"\n :key=\"editing?.id ?? 'annotating'\"\n :file=\"editorFile\"\n :initial-tool=\"editing ? undefined : 'arrow'\"\n @apply=\"onImageEdited\"\n @close=\"closeEditor\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-input {\n position: relative;\n display: flex;\n flex-direction: column;\n margin-inline: var(--spacing-sm);\n margin-bottom: var(--spacing-sm);\n\n &__notice {\n position: relative;\n padding: var(--spacing-10) var(--spacing-sm);\n display: flex;\n flex-direction: column;\n gap: var(--spacing-10);\n background-color: var(--color-surface-1);\n border-top-left-radius: var(--rounded-xl);\n border-top-right-radius: var(--rounded-xl);\n transition-property: var(--transition-property-all);\n transition-duration: var(--duration-300);\n transition-timing-function: var(--ease-in-out);\n font-size: var(--text-12);\n color: var(--color-word-4);\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: calc(-1 * var(--spacing-12));\n height: var(--spacing-12);\n background-color: var(--color-surface-1);\n z-index: 1;\n }\n\n // Two notices read as two lines of one box, with a hairline\n // between them\n &-item {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-sm);\n\n & + & {\n padding-top: var(--spacing-10);\n border-top: 1px solid var(--color-surface-3);\n }\n }\n\n &-icon {\n flex-shrink: 0;\n width: var(--spacing-18);\n height: var(--spacing-18);\n }\n\n &-text {\n flex: 1;\n min-width: 0;\n }\n\n // A word of the line's size, on the line: the notice stays one\n // quiet row, not a button bar\n &-action {\n flex-shrink: 0;\n font-size: inherit;\n }\n }\n\n &__form {\n position: relative;\n display: flex;\n z-index: 1;\n flex-direction: column;\n\n // The composer is a field too: same border and focus ring as the\n // form fields, on top of the shadow and the 12px radius that make\n // it the container (12) of its 8px buttons\n border-radius: var(--rounded-xl);\n border: 1px solid var(--input-border-color);\n background-color: var(--color-surface);\n padding: var(--spacing-14);\n box-shadow: var(--shadow-lg);\n font-size: var(\n --text-16\n ); // prevent ios zoom on input focus by using a font size >= 16px\n\n gap: var(--spacing-xs);\n transition: var(--input-transition);\n\n @include media-breakpoint-up('sm', $breakpoints) {\n font-size: var(--text-14);\n padding: var(--spacing-10);\n }\n\n &:has(:focus-within) {\n border-color: var(--input-focus-color);\n box-shadow: var(--shadow-lg), var(--input-focus-ring);\n }\n }\n\n &__fieldset {\n display: flex;\n align-items: center;\n gap: var(--spacing-xs);\n flex: 1;\n\n // The buttons answer 8px around themselves on a touch screen\n // (PkChatButton): 12px apart, neither takes the other's box\n @media (pointer: coarse) {\n gap: var(--spacing-12);\n }\n }\n\n &__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n min-width: 0;\n overflow: hidden;\n }\n\n &__textarea {\n display: block;\n border: none;\n outline: none;\n resize: none;\n width: 100%;\n max-height: 200px;\n color: var(--color-word-1);\n background-color: var(--color-surface);\n\n &::placeholder {\n color: var(--color-word-4);\n }\n }\n\n &__attachments {\n display: flex;\n flex-wrap: wrap;\n\n // Roomy gap so the uniform-height chips breathe in the row.\n gap: var(--spacing-12);\n padding-bottom: var(--spacing-xs);\n border-bottom: 1px solid var(--color-surface-2);\n }\n\n // What the user pointed at on the page: one chip, the element's name\n // or the selected text, on one line\n &__pointer {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n max-width: 100%;\n padding: var(--spacing-4) var(--spacing-4) var(--spacing-4)\n var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font-size: var(--text-12);\n }\n\n &__pointer-icon {\n flex-shrink: 0;\n width: var(--spacing-14);\n height: var(--spacing-14);\n }\n\n // The automatic confirmations, while they hold: the same chip, a\n // button as a whole, since one click takes them back to manual\n &__mode {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n padding: var(--spacing-4) var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font: inherit;\n font-size: var(--text-12);\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-brand);\n outline-offset: 2px;\n }\n }\n\n &__pointer-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__counter {\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-md);\n font-size: var(--text-12);\n color: var(--color-word-3);\n line-height: 1;\n padding-inline: var(--spacing-6);\n padding-block: var(--spacing-4);\n z-index: 1;\n font-variant-numeric: tabular-nums;\n font-family: var(--font-mono);\n font-weight: var(--font-bold);\n\n &--over {\n color: var(--u-danger-text, var(--color-danger));\n border-color: var(--color-danger-lighten-5);\n font-weight: var(--font-bold);\n }\n }\n }\n</style>\n"],"ignoreList":[0],"mappings":";;;;;;;;;;AAAA,IAAImC,oBAAE,IAAI,IAAE;AAAE,SAASC,GAAE,GAAE;CAAC,IAAIC,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,QAAQ;AAAC;AAAC,SAASA,EAAE,GAAE;CAAC,IAAIA,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,OAAO;AAAC;AAAC,IAAIC,IAAE;AAAkB,OAAO,SAApB,OAA4B,CAAC,IAAE,SAAS,GAAE;CAAC,OAAO;AAAC,EAAA,CAAG,UAAQ,SAAS,GAAE;CAAC,OAAO;AAAC,GAAE,EAAE,SAAO,SAAS,GAAE;CAAC,OAAO;AAAC,MAAI,CAAC,IAAE,SAAS,GAAE,GAAE;CAAC,OAAOF,KAAG,MAAM,UAAU,QAAQ,KAAKA,EAAE,SAAOA,IAAE,CAACA,CAAC,GAAE,SAAS,GAAE;EAAC,OAAO,SAAS,GAAE;GAAC,IAAGA,KAAGA,EAAE,YAAuBA,EAAE,aAAf,cAAyB,CAACD,EAAE,IAAIC,CAAC,GAAE;IAAC,IAAIC,GAAEC,IAAE,MAAKC,IAAE,OAAO,iBAAiBH,CAAC,GAAE,KAAG,IAAEA,EAAE,OAAM,WAAU;KAAC,EAAE;MAAC,wBAA4BC,MAAL,MAAQ,CAACD,EAAE,MAAM,WAAWC,CAAC;MAAE,kBAAiB;KAAI,CAAC,GAAE,IAAED,EAAE;IAAK,IAAGI,IAAE,SAAS,GAAE;KAAC,EAAE,oBAAoB,oBAAmBA,CAAC,GAAEJ,EAAE,oBAAoB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AAW,iBAAA;OACjB,OAAO1F,EAAAyE,CAAA,CAAE,CAAA,eAAA;OACT,UAAQ,CAAGyB,EAAA;;;;;;;;IAKduB,EAAA,SADVhI,EAAA,GAAAI,EAM2BG,EAAAkE,EAAA,GAAA;KAJtB,KAAKoD,EAAA,OAAS,MAAE;KAChB,MAAMG,EAAA;KACN,gBAAcH,EAAA,QAAU,KAAA,IAAS;KACjC,SAAOM;KACP,SAAOD"}
|
|
1
|
+
{"version":3,"file":"PkChatbotInput-BLKhf3WD.js","names":["_hoisted_2","_openBlock","_createElementBlock","_normalizeClass","_createVNode","_toDisplayString","$slots","$n","_useModel","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","PkStreamingMarkdown","_toDisplayString","_unref","_createElementVNode","_withModifiers","_createVNode","_createTextVNode","PkChatbotFilePreview","_renderSlot","_normalizeProps","_mergeProps","_withCtx","PkChatButton","_withKeys","_normalizeClass","VvButtonLocalized","codeExtensionsOf","PkStreamingMarkdown_default","PkChatbotFilePreview_default","isImeComposing","isEditableImage","e","t","o","r","n","l","a","i","s","d","c","v","_hoisted_1$1","_hoisted_2$1","PkChatButton_default","defineComponent","_component_VvIcon","VvIcon","openBlock","createElementBlock","normalizeClass","__props","createVNode","toDisplayString","createCommentVNode","_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","PkChatbotInput_default","\"modelValue\"","\"modelModifiers\"","\"pendingAttachments\"","\"pendingAttachmentsModifiers\"","__expose","__emit","PkImageEditorDialog","defineAsyncComponent","modelValue","useModel","pendingAttachments","emit","props","$t","useI18n","textareaEl","useTemplateRef","fileInputEl","cameraInputEl","formEl","localValue","ref","syncTimer","cancelSync","flushSync","scheduleSync","onTextareaInput","nextTick","isStreaming","computed","isSubmitted","isInputDisabled","counterId","useId","currentLength","isOverLimit","isUploadingAnyFile","hasFailedAttachment","isSubmitEnabled","isQueueing","hasCaptureSupport","acceptMimeTypes","allowed","acceptImageMimeTypes","m","showCameraOption","openFilePicker","openCameraPicker","emitFiles","file","files","onFileChange","input","event","removeAttachment","att","id","editingId","editing","annotating","shallowRef","editorFile","isEditable","closeEditor","onImageEdited","annotated","isDismissableNoticeVisible","closeDismissableNotice","activeNotices","notices","notice","keepKeyboardFocus","stopGeneration","handleSubmit","onTextareaEnter","textareaWidth","useResizeObserver","entry","width","watch","onBeforeUnmount","_component_VvButton","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","Fragment","renderList","createBlock","unref","createElementVNode","withModifiers","_cache","createTextVNode","renderSlot","_ctx","normalizeProps","mergeProps","withCtx","init","aria","toggle","withKeys"],"sources":["../../../../node_modules/.pnpm/autosize@6.0.1/node_modules/autosize/dist/autosize.esm.js","../../../../packages/components/src/chat/PkChatButton.vue","../../../../packages/components/src/chat/PkChatbotInput.vue"],"sourcesContent":["var e=new Map;function t(t){var o=e.get(t);o&&o.destroy()}function o(t){var o=e.get(t);o&&o.update()}var r=null;\"undefined\"==typeof window?((r=function(e){return e}).destroy=function(e){return e},r.update=function(e){return e}):((r=function(t,o){return t&&Array.prototype.forEach.call(t.length?t:[t],function(t){return function(t){if(t&&t.nodeName&&\"TEXTAREA\"===t.nodeName&&!e.has(t)){var o,r=null,n=window.getComputedStyle(t),i=(o=t.value,function(){a({testForHeightReduction:\"\"===o||!t.value.startsWith(o),restoreTextAlign:null}),o=t.value}),l=function(o){t.removeEventListener(\"autosize:destroy\",l),t.removeEventListener(\"autosize:update\",s),t.removeEventListener(\"input\",i),window.removeEventListener(\"resize\",s),Object.keys(o).forEach(function(e){return t.style[e]=o[e]}),e.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,textAlign:t.style.textAlign,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener(\"autosize:destroy\",l),t.addEventListener(\"autosize:update\",s),t.addEventListener(\"input\",i),window.addEventListener(\"resize\",s),t.style.overflowX=\"hidden\",t.style.wordWrap=\"break-word\",e.set(t,{destroy:l,update:s}),s()}function a(e){var o,i,l=e.restoreTextAlign,s=void 0===l?null:l,d=e.testForHeightReduction,u=void 0===d||d,c=n.overflowY;if(0!==t.scrollHeight&&(\"vertical\"===n.resize?t.style.resize=\"none\":\"both\"===n.resize&&(t.style.resize=\"horizontal\"),u&&(o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push([e.parentNode,e.parentNode.scrollTop]),e=e.parentNode;return function(){return t.forEach(function(e){var t=e[0],o=e[1];t.style.scrollBehavior=\"auto\",t.scrollTop=o,t.style.scrollBehavior=null})}}(t),t.style.height=\"\"),i=\"content-box\"===n.boxSizing?t.scrollHeight-(parseFloat(n.paddingTop)+parseFloat(n.paddingBottom)):t.scrollHeight+parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),\"none\"!==n.maxHeight&&i>parseFloat(n.maxHeight)?(\"hidden\"===n.overflowY&&(t.style.overflow=\"scroll\"),i=parseFloat(n.maxHeight)):\"hidden\"!==n.overflowY&&(t.style.overflow=\"hidden\"),t.style.height=i+\"px\",s&&(t.style.textAlign=s),o&&o(),r!==i&&(t.dispatchEvent(new Event(\"autosize:resized\",{bubbles:!0})),r=i),c!==n.overflow&&!s)){var v=n.textAlign;\"hidden\"===n.overflow&&(t.style.textAlign=\"start\"===v?\"end\":\"start\"),a({restoreTextAlign:v,testForHeightReduction:!0})}}function s(){a({testForHeightReduction:!0,restoreTextAlign:null})}}(t)}),t}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],t),e},r.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e});var n=r;export default n;\n","<script lang=\"ts\" setup>\n /**\n * The icon button of the chat dock: attach, send and stop in the input,\n * mute and hang up in a live call. One component, because the call bar\n * takes the place of the input and the two must not look like two\n * different pieces of software.\n *\n * Native attributes fall through to the button, so `title`, `disabled` and\n * `aria-pressed` are written by the caller as they would be on a `<button>`.\n */\n withDefaults(\n defineProps<{\n icon: string\n /** Written next to the icon, for an action nobody should have to guess from a glyph. */\n label?: string\n type?: 'button' | 'submit'\n /** `primary` is the filled circle of send and stop, the one action the dock is for. */\n modifiers?: 'danger' | 'primary'\n }>(),\n { label: undefined, type: 'button', modifiers: undefined },\n )\n</script>\n\n<template>\n <button\n class=\"pk-chat-button\"\n :class=\"[\n modifiers ? `pk-chat-button--${modifiers}` : undefined,\n { 'pk-chat-button--labelled': label },\n ]\"\n :type=\"type\">\n <VvIcon :name=\"icon\" class=\"pk-chat-button__icon\" />\n <span v-if=\"label\" class=\"pk-chat-button__label\">{{ label }}</span>\n </button>\n</template>\n\n<style lang=\"scss\">\n .pk-chat-button {\n position: relative;\n display: inline-flex;\n align-items: center;\n flex-shrink: 0;\n padding: var(--spacing-4);\n border: none;\n border-radius: var(--rounded);\n background-color: transparent;\n color: var(--color-word-1);\n cursor: pointer;\n transition: var(--transition-colors);\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n // The fields' focus ring: a 1px surface-5 line measured 1.3:1 on the\n // surface, under the 3:1 a focus indicator needs\n &:focus-visible {\n outline: var(--spacing-2) solid var(--input-focus-color);\n outline-offset: 0;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n // A finger needs 40px and the button is drawn at 28: on a touch\n // screen it answers 8px around itself, in every layout of the chat\n // (it was the fullscreen one only) and in the call bar, which mounts\n // the same button\n @media (pointer: coarse) {\n &::after {\n content: '';\n position: absolute;\n inset: calc(-1 * var(--spacing-8));\n }\n }\n\n // A toggle has to survive a glance: a crossed-out glyph alone changes\n // too few pixels to notice mid-sentence.\n &[aria-pressed='true'] {\n background-color: var(--color-surface-3);\n color: var(--color-word);\n }\n\n // A wash of the same red rather than a lighter red behind it: the\n // `lighten-5` step lands close enough to the icon to leave it at about\n // 2:1, which is a button that disappears exactly while it is being\n // pointed at. The tint composites over whatever surface is behind, so\n // it holds in the dark theme too.\n &--danger {\n // The project's text shade of danger; the fill where a host app\n // loads only the library and this package's stylesheet\n color: var(--u-danger-text, var(--color-danger));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--color-danger) 12%,\n transparent\n );\n }\n }\n\n // Same 28px box as the ghost buttons, so the dock keeps its height,\n // with a smaller glyph because a filled shape needs air around it.\n // Its edge is visible, so it sits on the input's padding line just as\n // the text does: a ghost glyph sat 6px further in and made the two\n // sides of the input look unequal. Empty, it turns into a grey pad\n // with the fields' disabled ink: a light arrow on that pad vanished,\n // and with it the circle's edge, which is what squares the sides.\n // The agent's color when the widget has one, like the user's bubble.\n &--primary {\n --pk-chat-button-fill: var(\n --chatbot-main-color,\n var(--color-word-1)\n );\n\n padding: var(--spacing-6);\n border-radius: var(--rounded-full);\n background-color: var(--pk-chat-button-fill);\n color: var(--chatbot-contrast-color, var(--color-surface));\n\n &:hover {\n background-color: color-mix(\n in srgb,\n var(--pk-chat-button-fill) 85%,\n var(--color-surface)\n );\n }\n\n // Off the disc, or a dark ring would sink into a dark fill\n &:focus-visible {\n outline-offset: var(--spacing-2);\n }\n\n &:disabled {\n opacity: 1;\n background-color: var(--color-surface-3);\n color: var(--color-word-3);\n }\n\n .pk-chat-button__icon {\n width: var(--spacing-16);\n height: var(--spacing-16);\n }\n }\n\n &--labelled {\n gap: var(--spacing-4);\n padding-inline: var(--spacing-8);\n font-size: var(--text-12);\n }\n\n &__icon {\n display: block;\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n // @ts-expect-error - no types for autosize\n import autosize from 'autosize'\n import {\n computed,\n defineAsyncComponent,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n useId,\n useTemplateRef,\n watch,\n } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useResizeObserver } from '@vueuse/core'\n import { codeExtensionsOf, type AgentFileUpload } from 'models'\n import type { PendingAttachment } from 'composables'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkChatbotFilePreview from './PkChatbotFilePreview.vue'\n import PkChatButton from './PkChatButton.vue'\n import { isEditableImage, isImeComposing } from './utils'\n\n // A chunk of its own: the widget downloads the editor on the first \"Edit\"\n const PkImageEditorDialog = defineAsyncComponent(\n () => import('./PkImageEditorDialog.vue'),\n )\n\n // --- Models & Props ---\n\n const modelValue = defineModel<string | undefined>({ default: undefined })\n const pendingAttachments = defineModel<PendingAttachment[]>(\n 'pendingAttachments',\n { default: () => [] },\n )\n\n const emit = defineEmits<{\n submit: []\n 'stop-generation': []\n 'file-select': [file: File]\n /**\n * The user took an attachment back, already out of `pendingAttachments`:\n * the store deletes its upload too.\n */\n 'remove-attachment': [attachment: PendingAttachment]\n /**\n * The user edited an image (`editableImages`): `file` takes the\n * place of `attachment`, which the store uploads and replaces.\n */\n 'replace-attachment': [attachment: PendingAttachment, file: File]\n /** The user retries a failed upload (`retryableAttachments`). */\n 'retry-attachment': [attachment: PendingAttachment]\n 'dismiss-attachment-notice': []\n 'dismiss-page-notice': []\n 'open-answer-notice': [id: string]\n 'dismiss-answer-notice': [id: string]\n 'voice-start': []\n /** Point at the page (spec `page-point-and-choose.md`, P). */\n point: []\n 'remove-pointer': []\n /** The user clicked the \"Automatic\" label: back to manual confirmations. */\n 'manual-confirmations': []\n }>()\n\n const props = defineProps<{\n placeholder?: string\n dismissableNotice?: string\n /**\n * What the agent can do on the page that embeds the chat (spec\n * `page-tools.md`). Its closing is the caller's to remember.\n */\n pageNotice?: string\n status?: 'submitted' | 'streaming' | 'ready' | 'error'\n maxMessageLength?: number\n fileUpload?: AgentFileUpload\n attachmentLimitReached?: boolean\n attachmentNotice?: string\n /** Show the talk button: the agent has voice enabled. */\n voiceEnabled?: boolean\n /**\n * What is written while the agent answers is queued and sent when the\n * answer ends (spec resumable-chat-streams, F2): sending stays open.\n */\n queueEnabled?: boolean\n /** Answers that ended in another conversation, each with its own line and its \"Open\". */\n answerNotices?: { id: string; text: string }[]\n /** The user may point at the page that embeds the chat: the button shows. */\n pointerAvailable?: boolean\n /** The user is pointing at the page now. */\n pointing?: boolean\n /** What the user pointed at for this message: the chip above the field. */\n pointer?: { kind: 'element' | 'text'; label: string }\n /**\n * The user chose automatic confirmations (spec\n * `auto-confirmations.md`): a label above the field says so, and\n * takes them back to manual.\n */\n automaticConfirmations?: boolean\n /**\n * The host replaces an edited image (`replace-attachment`): the\n * images of the composer show \"Edit\" and open the image editor.\n */\n editableImages?: boolean\n /**\n * The host uploads a failed attachment again (`retry-attachment`):\n * its chip shows \"Retry\".\n */\n retryableAttachments?: boolean\n }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n // --- Template refs ---\n\n const textareaEl = useTemplateRef<HTMLTextAreaElement>('textareaEl')\n const fileInputEl = useTemplateRef<HTMLInputElement>('fileInputEl')\n const cameraInputEl = useTemplateRef<HTMLInputElement>('cameraInputEl')\n const formEl = useTemplateRef<HTMLFormElement>('formEl')\n\n // --- Input buffering (decouples typing from reactive model propagation) ---\n\n const localValue = ref(modelValue.value ?? '')\n let syncTimer: ReturnType<typeof setTimeout> | null = null\n\n const cancelSync = () => {\n if (syncTimer !== null) {\n clearTimeout(syncTimer)\n syncTimer = null\n }\n }\n\n const flushSync = () => {\n cancelSync()\n modelValue.value = localValue.value\n }\n\n const scheduleSync = () => {\n cancelSync()\n syncTimer = setTimeout(() => {\n modelValue.value = localValue.value\n syncTimer = null\n }, 300)\n }\n\n const onTextareaInput = () => {\n localValue.value = textareaEl.value?.value ?? ''\n scheduleSync()\n }\n\n watch(modelValue, (v) => {\n if (v !== localValue.value) {\n localValue.value = v ?? ''\n nextTick(() => {\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n })\n }\n })\n\n // --- Status computeds ---\n\n const isStreaming = computed(() => props.status === 'streaming')\n const isSubmitted = computed(() => props.status === 'submitted')\n const isInputDisabled = computed(\n () => isStreaming.value || isSubmitted.value,\n )\n\n // --- Validation ---\n\n const counterId = useId()\n const currentLength = computed(() => localValue.value.length)\n\n const isOverLimit = computed(\n () =>\n props.maxMessageLength !== undefined &&\n currentLength.value > props.maxMessageLength,\n )\n\n const isUploadingAnyFile = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'uploading'),\n )\n\n // A failed attachment would leave the message without a word: the send\n // stays off until the user retries it or takes it back\n const hasFailedAttachment = computed(() =>\n pendingAttachments.value.some((a) => a.state === 'error'),\n )\n\n const isSubmitEnabled = computed(() => {\n if (\n (isInputDisabled.value && !props.queueEnabled) ||\n isUploadingAnyFile.value ||\n hasFailedAttachment.value ||\n isOverLimit.value\n ) {\n return false\n }\n return localValue.value.trim().length > 0\n })\n\n /** Written during an answer: the send button queues it, next to the stop. */\n const isQueueing = computed(\n () => isInputDisabled.value && isSubmitEnabled.value,\n )\n\n // --- File upload ---\n\n const hasCaptureSupport = 'capture' in document.createElement('input')\n\n // A browser filters the picker by type and knows few code types: their\n // extensions go along.\n const acceptMimeTypes = computed(() => {\n const allowed = props.fileUpload?.allowedMimeTypes ?? []\n return [...allowed, ...codeExtensionsOf(allowed)].join(',')\n })\n\n const acceptImageMimeTypes = computed(() =>\n (props.fileUpload?.allowedMimeTypes ?? [])\n .filter((m) => m.startsWith('image/'))\n .join(','),\n )\n\n const showCameraOption = computed(\n () => hasCaptureSupport && acceptImageMimeTypes.value.length > 0,\n )\n\n const openFilePicker = () => {\n fileInputEl.value?.click()\n }\n\n const openCameraPicker = () => {\n cameraInputEl.value?.click()\n }\n\n // The store owns the attachment limits and drops any overflow; the input\n // just forwards every picked/dropped file.\n const emitFiles = (files: File[]) => {\n for (const file of files) {\n emit('file-select', file)\n }\n }\n\n const onFileChange = (event: Event) => {\n const input = event.target as HTMLInputElement\n emitFiles(Array.from(input.files ?? []))\n input.value = ''\n }\n\n // --- Attachments ---\n\n const removeAttachment = (id: string) => {\n const att = pendingAttachments.value.find((a) => a.id === id)\n if (!att) {\n return\n }\n URL.revokeObjectURL(att.localUrl)\n pendingAttachments.value = pendingAttachments.value.filter(\n (a) => a.id !== id,\n )\n emit('remove-attachment', att)\n }\n\n // The image in the editor: an attachment of the list, which the copy\n // replaces (gone from the list, sent or taken back, the editor closes\n // with it), or an image of the conversation, whose copy joins the list\n // (\"Annota e chiedi\", spec `chat-image-editor.md`, F3)\n const editingId = ref<string>()\n const editing = computed(() =>\n pendingAttachments.value.find((a) => a.id === editingId.value),\n )\n const annotating = shallowRef<Promise<File>>()\n const editorFile = computed(() => editing.value?.file ?? annotating.value)\n\n const isEditable = (att: PendingAttachment) =>\n !!props.editableImages &&\n att.state !== 'uploading' &&\n isEditableImage(att.file.type)\n\n const closeEditor = () => {\n editingId.value = undefined\n annotating.value = undefined\n }\n\n const onImageEdited = async (file: File) => {\n const att = editing.value\n const annotated = !att && !!annotating.value\n closeEditor()\n if (att) {\n emit('replace-attachment', att, file)\n } else if (annotated) {\n emit('file-select', file)\n } else {\n return\n }\n // Once the dialog is gone: its chip is gone too, so the focus it\n // hands back on closing lands nowhere\n await nextTick()\n textareaEl.value?.focus()\n }\n\n // --- Notices (one box above the input) ---\n\n type InputNotice = {\n id: string\n text?: string\n markdown?: string\n icon?: string\n open?: () => void\n dismiss?: () => void\n }\n\n const isDismissableNoticeVisible = ref(true)\n const closeDismissableNotice = () => {\n isDismissableNoticeVisible.value = false\n }\n\n const activeNotices = computed<InputNotice[]>(() => {\n // The alert answers what the user just did, and takes the box alone\n // until it is closed.\n if (props.attachmentNotice) {\n return [\n {\n id: 'limit',\n icon: 'ri:information-line',\n text: props.attachmentNotice,\n dismiss: () => emit('dismiss-attachment-notice'),\n },\n ]\n }\n const notices: InputNotice[] = []\n // Why the send is off: it stays until the attachment is retried or\n // taken back, so it has no close\n if (hasFailedAttachment.value) {\n notices.push({\n id: 'upload-failed',\n icon: 'ri:error-warning-line',\n text: $t('message.attachmentUploadFailed'),\n })\n }\n // An answer that ended where the user is not: news, so it comes\n // first, and it leaves once opened or closed.\n for (const notice of props.answerNotices ?? []) {\n notices.push({\n id: `answer-${notice.id}`,\n icon: 'ri:chat-check-line',\n text: notice.text,\n open: () => emit('open-answer-notice', notice.id),\n dismiss: () => emit('dismiss-answer-notice', notice.id),\n })\n }\n // What the agent does on this page, next: the user should read it\n // before writing. The agent's own notice stays beside it, never\n // behind it: it is where an agent states its terms, a privacy\n // policy among them.\n if (props.pageNotice) {\n notices.push({\n id: 'page',\n icon: 'ri:pages-line',\n text: props.pageNotice,\n dismiss: () => emit('dismiss-page-notice'),\n })\n }\n if (props.dismissableNotice && isDismissableNoticeVisible.value) {\n notices.push({\n id: 'dismissable',\n markdown: props.dismissableNotice,\n dismiss: closeDismissableNotice,\n })\n }\n return notices\n })\n\n // --- Submit ---\n\n /**\n * Send turns disabled and then gives way to stop, stop gives way to send:\n * a keyboard user who pressed one would be left on the page body. Hand\n * the focus to the textarea, but only after a keyboard press: a tap has no\n * focus to keep, and focusing would bring the phone keyboard back up over\n * the answer.\n */\n const keepKeyboardFocus = () => {\n if (formEl.value?.querySelector('button:focus-visible')) {\n textareaEl.value?.focus()\n }\n }\n\n const stopGeneration = () => {\n keepKeyboardFocus()\n emit('stop-generation')\n }\n\n const handleSubmit = () => {\n if (!isSubmitEnabled.value) {\n return\n }\n keepKeyboardFocus()\n flushSync()\n emit('submit')\n localValue.value = ''\n modelValue.value = ''\n nextTick(() => {\n if (textareaEl.value) {\n textareaEl.value.value = ''\n autosize.update(textareaEl.value)\n }\n })\n }\n\n /**\n * Enter sends, Shift+Enter goes to a new line. The Enter that confirms an\n * IME composition belongs to the composition.\n */\n const onTextareaEnter = (event: KeyboardEvent) => {\n if (event.shiftKey || isImeComposing(event)) {\n return\n }\n event.preventDefault()\n handleSubmit()\n }\n\n // --- Lifecycle ---\n\n onMounted(() => {\n if (textareaEl.value) {\n autosize(textareaEl.value)\n }\n })\n\n // autosize measures on input and on a window resize only, and an empty\n // textarea measures its placeholder. The chat settles its layout after\n // mount: measured at a first, narrower width, the placeholder wrapped,\n // and on the chat page of a phone the field stayed 88px tall, four lines\n // with the text at their top, until the user typed. Measured again when\n // its width changes, or its placeholder.\n let textareaWidth = 0\n useResizeObserver(textareaEl, ([entry]) => {\n const width = entry?.contentRect.width ?? 0\n if (textareaEl.value && width !== textareaWidth) {\n textareaWidth = width\n autosize.update(textareaEl.value)\n }\n })\n watch(\n () => props.placeholder,\n async () => {\n await nextTick()\n if (textareaEl.value) {\n autosize.update(textareaEl.value)\n }\n },\n )\n\n onBeforeUnmount(() => {\n cancelSync()\n if (textareaEl.value) {\n autosize.destroy(textareaEl.value)\n }\n for (const att of pendingAttachments.value) {\n URL.revokeObjectURL(att.localUrl)\n }\n })\n\n defineExpose({\n /** Move the focus to the message field */\n focus: () => textareaEl.value?.focus(),\n /**\n * Opens the editor on an image of the conversation, whose bytes are\n * on their way; the copy made of it joins the attachments.\n */\n annotateImage: (file: Promise<File>) => {\n editingId.value = undefined\n annotating.value = file\n },\n })\n</script>\n\n<template>\n <div class=\"pk-chatbot-input\">\n <div\n v-if=\"activeNotices.length\"\n class=\"pk-chatbot-input__notice\"\n role=\"status\">\n <div\n v-for=\"notice in activeNotices\"\n :key=\"notice.id\"\n class=\"pk-chatbot-input__notice-item\">\n <VvIcon\n v-if=\"notice.icon\"\n :name=\"notice.icon\"\n class=\"pk-chatbot-input__notice-icon\" />\n <PkStreamingMarkdown\n v-if=\"notice.markdown\"\n :markdown=\"notice.markdown\"\n class=\"wysiwyg pk-chatbot-input__notice-text\" />\n <span v-else class=\"pk-chatbot-input__notice-text\">\n {{ notice.text }}\n </span>\n <VvButton\n v-if=\"notice.open\"\n :label=\"$t('action.open')\"\n modifiers=\"link\"\n class=\"pk-chatbot-input__notice-action\"\n @click=\"notice.open()\" />\n <VvButton\n v-if=\"notice.dismiss\"\n :title=\"$t('action.close')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"notice.dismiss()\" />\n </div>\n </div>\n <form\n ref=\"formEl\"\n class=\"pk-chatbot-input__form\"\n @submit.prevent=\"handleSubmit\">\n <button\n v-if=\"automaticConfirmations\"\n type=\"button\"\n class=\"pk-chatbot-input__mode\"\n :title=\"$t('action.manualConfirmations')\"\n @click=\"emit('manual-confirmations')\">\n <VvIcon\n name=\"ri:flashlight-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n {{ $t('label.automaticConfirmations') }}\n <VvIcon\n name=\"ri:close-line\"\n class=\"pk-chatbot-input__pointer-icon\" />\n </button>\n <div v-if=\"pointer\" class=\"pk-chatbot-input__pointer\">\n <VvIcon\n :name=\"\n pointer.kind === 'text'\n ? 'ri:double-quotes-l'\n : 'ri:focus-3-line'\n \"\n class=\"pk-chatbot-input__pointer-icon\" />\n <span class=\"pk-chatbot-input__pointer-label\">\n {{\n pointer.kind === 'text'\n ? `«${pointer.label}»`\n : pointer.label\n }}\n </span>\n <VvButton\n :title=\"$t('pagePointer.remove')\"\n modifiers=\"action-quiet\"\n icon=\"ri:close-line\"\n class=\"w-18 h-18\"\n @click=\"emit('remove-pointer')\" />\n </div>\n <div\n v-if=\"pendingAttachments.length\"\n class=\"pk-chatbot-input__attachments\">\n <PkChatbotFilePreview\n v-for=\"att in pendingAttachments\"\n :key=\"att.id\"\n :media-type=\"att.mediaSource?.mimeType ?? att.file.type\"\n :url=\"att.localUrl\"\n :filename=\"att.file.name\"\n :size=\"att.file.size\"\n :loading=\"att.state === 'uploading'\"\n :error=\"att.state === 'error' ? att.error : undefined\"\n :removable=\"att.state !== 'uploading'\"\n :editable=\"isEditable(att)\"\n :retryable=\"retryableAttachments && att.state === 'error'\"\n compact\n @remove=\"removeAttachment(att.id)\"\n @edit=\"editingId = att.id\"\n @retry=\"emit('retry-attachment', att)\" />\n </div>\n <div class=\"pk-chatbot-input__fieldset\">\n <slot name=\"prepend\" />\n <VvDropdown\n v-if=\"\n fileUpload &&\n fileUpload.enabled &&\n (showCameraOption || $slots['additional-actions'])\n \"\n v-bind=\"{\n placement: 'top-start',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n }\">\n <template #default=\"{ init, toggle, aria }\">\n <!-- The only one still written by hand: the dropdown\n anchors itself to whatever `init` receives, and that\n has to be the element, not a component instance -->\n <button\n :ref=\"(e: any) => init(e)\"\n v-bind=\"aria\"\n class=\"pk-chat-button\"\n type=\"button\"\n :title=\"$t('action.attachFile')\"\n :disabled=\"isInputDisabled\"\n @click=\"toggle\">\n <VvIcon\n name=\"ri:add-line\"\n class=\"pk-chat-button__icon\" />\n </button>\n </template>\n <template #items>\n <VvDropdownAction\n v-if=\"showCameraOption\"\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openCameraPicker\">\n <VvIcon\n name=\"ri:camera-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.takePhoto') }}\n </VvDropdownAction>\n <VvDropdownAction\n :disabled=\"\n isInputDisabled || attachmentLimitReached\n \"\n @click=\"openFilePicker\">\n <VvIcon\n name=\"ri:attachment-line\"\n class=\"pk-chatbot-input__dropdown-icon\" />\n {{ $t('action.attachFile') }}\n </VvDropdownAction>\n <slot name=\"additional-actions\" />\n </template>\n </VvDropdown>\n <PkChatButton\n v-else-if=\"fileUpload && fileUpload.enabled\"\n icon=\"ri:add-line\"\n :title=\"$t('action.attachFile')\"\n :disabled=\"isInputDisabled || attachmentLimitReached\"\n @click=\"openFilePicker\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled\"\n ref=\"fileInputEl\"\n type=\"file\"\n hidden\n multiple\n :accept=\"acceptMimeTypes\"\n @change=\"onFileChange\" />\n <input\n v-if=\"fileUpload && fileUpload.enabled && showCameraOption\"\n ref=\"cameraInputEl\"\n type=\"file\"\n capture=\"environment\"\n hidden\n :accept=\"acceptImageMimeTypes\"\n @change=\"onFileChange\" />\n <PkChatButton\n v-if=\"pointerAvailable\"\n icon=\"ri:focus-3-line\"\n :title=\"$t('pagePointer.start')\"\n :aria-pressed=\"pointing\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('point')\" />\n <div class=\"pk-chatbot-input__content\">\n <textarea\n ref=\"textareaEl\"\n :value=\"localValue\"\n class=\"pk-chatbot-input__textarea\"\n name=\"message\"\n rows=\"1\"\n enterkeyhint=\"send\"\n :aria-label=\"$t('label.message')\"\n :aria-describedby=\"\n maxMessageLength ? counterId : undefined\n \"\n :aria-invalid=\"isOverLimit || undefined\"\n :placeholder\n @input=\"onTextareaInput\"\n @keydown.enter=\"onTextareaEnter\"></textarea>\n </div>\n <div\n v-if=\"maxMessageLength\"\n :id=\"counterId\"\n class=\"pk-chatbot-input__counter\"\n :class=\"{ 'pk-chatbot-input__counter--over': isOverLimit }\">\n {{ $n(currentLength, 'integer') }}/<span\n class=\"opacity-60\"\n >{{ $n(maxMessageLength, 'integer') }}</span\n >\n </div>\n <PkChatButton\n v-if=\"voiceEnabled && !isStreaming\"\n icon=\"ri:mic-line\"\n :title=\"$t('action.talk')\"\n :disabled=\"isInputDisabled\"\n @click=\"emit('voice-start')\" />\n <!-- With a message to queue the send button is the filled one,\n and the stop steps back beside it -->\n <PkChatButton\n v-if=\"isStreaming\"\n icon=\"ri:stop-fill\"\n :modifiers=\"isQueueing ? undefined : 'primary'\"\n :title=\"$t('action.stop')\"\n @click=\"stopGeneration\" />\n <PkChatButton\n v-if=\"isQueueing\"\n type=\"submit\"\n modifiers=\"primary\"\n icon=\"ri:arrow-up-line\"\n :title=\"$t('action.queueMessage')\" />\n <PkChatButton\n v-else-if=\"!isStreaming\"\n type=\"submit\"\n modifiers=\"primary\"\n :icon=\"isSubmitted ? 'loading-loop' : 'ri:arrow-up-line'\"\n :title=\"$t('action.submit')\"\n :disabled=\"!isSubmitEnabled\" />\n </div>\n </form>\n <!-- Outside the form: Enter in the editor must not send the message -->\n <PkImageEditorDialog\n v-if=\"editorFile\"\n :key=\"editing?.id ?? 'annotating'\"\n :file=\"editorFile\"\n :initial-tool=\"editing ? undefined : 'arrow'\"\n @apply=\"onImageEdited\"\n @close=\"closeEditor\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-input {\n position: relative;\n display: flex;\n flex-direction: column;\n margin-inline: var(--spacing-sm);\n margin-bottom: var(--spacing-sm);\n\n &__notice {\n position: relative;\n padding: var(--spacing-10) var(--spacing-sm);\n display: flex;\n flex-direction: column;\n gap: var(--spacing-10);\n background-color: var(--color-surface-1);\n border-top-left-radius: var(--rounded-xl);\n border-top-right-radius: var(--rounded-xl);\n transition-property: var(--transition-property-all);\n transition-duration: var(--duration-300);\n transition-timing-function: var(--ease-in-out);\n font-size: var(--text-12);\n color: var(--color-word-4);\n\n &::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n bottom: calc(-1 * var(--spacing-12));\n height: var(--spacing-12);\n background-color: var(--color-surface-1);\n z-index: 1;\n }\n\n // Two notices read as two lines of one box, with a hairline\n // between them\n &-item {\n display: flex;\n align-items: flex-start;\n gap: var(--spacing-sm);\n\n & + & {\n padding-top: var(--spacing-10);\n border-top: 1px solid var(--color-surface-3);\n }\n }\n\n &-icon {\n flex-shrink: 0;\n width: var(--spacing-18);\n height: var(--spacing-18);\n }\n\n &-text {\n flex: 1;\n min-width: 0;\n }\n\n // A word of the line's size, on the line: the notice stays one\n // quiet row, not a button bar\n &-action {\n flex-shrink: 0;\n font-size: inherit;\n }\n }\n\n &__form {\n position: relative;\n display: flex;\n z-index: 1;\n flex-direction: column;\n\n // The composer is a field too: same border and focus ring as the\n // form fields, on top of the shadow and the 12px radius that make\n // it the container (12) of its 8px buttons\n border-radius: var(--rounded-xl);\n border: 1px solid var(--input-border-color);\n background-color: var(--color-surface);\n padding: var(--spacing-14);\n box-shadow: var(--shadow-lg);\n font-size: var(\n --text-16\n ); // prevent ios zoom on input focus by using a font size >= 16px\n\n gap: var(--spacing-xs);\n transition: var(--input-transition);\n\n @include media-breakpoint-up('sm', $breakpoints) {\n font-size: var(--text-14);\n padding: var(--spacing-10);\n }\n\n &:has(:focus-within) {\n border-color: var(--input-focus-color);\n box-shadow: var(--shadow-lg), var(--input-focus-ring);\n }\n }\n\n &__fieldset {\n display: flex;\n align-items: center;\n gap: var(--spacing-xs);\n flex: 1;\n\n // The buttons answer 8px around themselves on a touch screen\n // (PkChatButton): 12px apart, neither takes the other's box\n @media (pointer: coarse) {\n gap: var(--spacing-12);\n }\n }\n\n &__content {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: var(--spacing-4);\n min-width: 0;\n overflow: hidden;\n }\n\n &__textarea {\n display: block;\n border: none;\n outline: none;\n resize: none;\n width: 100%;\n max-height: 200px;\n color: var(--color-word-1);\n background-color: var(--color-surface);\n\n &::placeholder {\n color: var(--color-word-4);\n }\n }\n\n &__attachments {\n display: flex;\n flex-wrap: wrap;\n\n // Roomy gap so the uniform-height chips breathe in the row.\n gap: var(--spacing-12);\n padding-bottom: var(--spacing-xs);\n border-bottom: 1px solid var(--color-surface-2);\n }\n\n // What the user pointed at on the page: one chip, the element's name\n // or the selected text, on one line\n &__pointer {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n max-width: 100%;\n padding: var(--spacing-4) var(--spacing-4) var(--spacing-4)\n var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font-size: var(--text-12);\n }\n\n &__pointer-icon {\n flex-shrink: 0;\n width: var(--spacing-14);\n height: var(--spacing-14);\n }\n\n // The automatic confirmations, while they hold: the same chip, a\n // button as a whole, since one click takes them back to manual\n &__mode {\n display: flex;\n align-items: center;\n gap: var(--spacing-6);\n align-self: flex-start;\n padding: var(--spacing-4) var(--spacing-8);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-full);\n margin-bottom: var(--spacing-8);\n background-color: var(--color-surface-1);\n color: var(--color-word-2);\n font: inherit;\n font-size: var(--text-12);\n cursor: pointer;\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n\n &:focus-visible {\n outline: 2px solid var(--color-brand);\n outline-offset: 2px;\n }\n }\n\n &__pointer-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &__counter {\n background-color: var(--color-surface-1);\n border: 1px solid var(--color-surface-3);\n border-radius: var(--rounded-md);\n font-size: var(--text-12);\n color: var(--color-word-3);\n line-height: 1;\n padding-inline: var(--spacing-6);\n padding-block: var(--spacing-4);\n z-index: 1;\n font-variant-numeric: tabular-nums;\n font-family: var(--font-mono);\n font-weight: var(--font-bold);\n\n &--over {\n color: var(--u-danger-text, var(--color-danger));\n border-color: var(--color-danger-lighten-5);\n font-weight: var(--font-bold);\n }\n }\n }\n</style>\n"],"ignoreList":[0],"mappings":";;;;;;;;;;AAAA,IAAImC,oBAAE,IAAI,IAAE;AAAE,SAASC,GAAE,GAAE;CAAC,IAAIC,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,QAAQ;AAAC;AAAC,SAASA,EAAE,GAAE;CAAC,IAAIA,IAAEF,EAAE,IAAIC,CAAC;CAAE,KAAGC,EAAE,OAAO;AAAC;AAAC,IAAIC,IAAE;AAAkB,OAAO,SAApB,OAA4B,CAAC,IAAE,SAAS,GAAE;CAAC,OAAO;AAAC,EAAA,CAAG,UAAQ,SAAS,GAAE;CAAC,OAAO;AAAC,GAAE,EAAE,SAAO,SAAS,GAAE;CAAC,OAAO;AAAC,MAAI,CAAC,IAAE,SAAS,GAAE,GAAE;CAAC,OAAOF,KAAG,MAAM,UAAU,QAAQ,KAAKA,EAAE,SAAOA,IAAE,CAACA,CAAC,GAAE,SAAS,GAAE;EAAC,OAAO,SAAS,GAAE;GAAC,IAAGA,KAAGA,EAAE,YAAuBA,EAAE,aAAf,cAAyB,CAACD,EAAE,IAAIC,CAAC,GAAE;IAAC,IAAIC,GAAEC,IAAE,MAAKC,IAAE,OAAO,iBAAiBH,CAAC,GAAE,KAAG,IAAEA,EAAE,OAAM,WAAU;KAAC,EAAE;MAAC,wBAA4BC,MAAL,MAAQ,CAACD,EAAE,MAAM,WAAWC,CAA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