@8wave/ai-elements 0.126.0-beta.21 → 0.126.0-beta.23
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-B4vbUkNp.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-DHcHcy4x.js.map → PkChatbotFilePreview-B4vbUkNp.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js → PkStreamingMarkdown-GRB3Gg_x.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-0lzE-l9f.js.map → PkStreamingMarkdown-GRB3Gg_x.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-x50rORrq.js → PkToolChatFile-DTm5-CE4.js} +2 -2
- package/dist/_chunks/{PkToolChatFile-x50rORrq.js.map → PkToolChatFile-DTm5-CE4.js.map} +1 -1
- package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js → PkToolShareDocument-DYr0Rq4D.js} +2 -2
- package/dist/_chunks/{PkToolShareDocument-Cv7uBr5Z.js.map → PkToolShareDocument-DYr0Rq4D.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js → PkToolShowArtifact-C9_DHr5Y.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-DMIADTQ6.js.map → PkToolShowArtifact-C9_DHr5Y.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js → PkToolShowContactForm-DhyelktO.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-B5DCcFqt.js.map → PkToolShowContactForm-DhyelktO.js.map} +1 -1
- package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js → PkToolShowDiagram-DWVSCu33.js} +2 -2
- package/dist/_chunks/{PkToolShowDiagram-DEFJr7zY.js.map → PkToolShowDiagram-DWVSCu33.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js → PkToolShowForm-Dz2Hnzts.js} +2 -2
- package/dist/_chunks/{PkToolShowForm-BBxcDLyR.js.map → PkToolShowForm-Dz2Hnzts.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js → PkToolShowImageGallery-By-CPFS0.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-BYvCAUFX.js.map → PkToolShowImageGallery-By-CPFS0.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js → PkToolShowSources-YDHIZ6Ly.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-DxZoqWZd.js.map → PkToolShowSources-YDHIZ6Ly.js.map} +1 -1
- package/dist/_chunks/{useLightbox-BlHExsUm.js → useLightbox-Co8iz61W.js} +117 -95
- package/dist/_chunks/useLightbox-Co8iz61W.js.map +1 -0
- package/dist/ai-elements.es.js +12 -12
- 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/_chunks/{PkChatbot-Ck4H-uln.js → PkChatbot-CwHVS4sT.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-Ck4H-uln.js.map → PkChatbot-CwHVS4sT.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js → PkChatbotEmptyState-BF3Odn3v.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-Jxc1HNJ5.js.map → PkChatbotEmptyState-BF3Odn3v.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js → PkChatbotFilePreview-aKJBtw04.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-BDU2vY0F.js.map → PkChatbotFilePreview-aKJBtw04.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js → PkChatbotInput-DNXvFvyG.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotInput-DSdGtBTs.js.map → PkChatbotInput-DNXvFvyG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js → PkChatbotMessages-DOOQRLEc.js} +17 -17
- package/dist-vue/_chunks/{PkChatbotMessages-C7WSS6sd.js.map → PkChatbotMessages-DOOQRLEc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js → PkChatbotSteps-BalLo6DZ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotSteps-BMWrHfC9.js.map → PkChatbotSteps-BalLo6DZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-SQLnQry2.js → PkChatbotViewChat-BWdFuQ4P.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-SQLnQry2.js.map → PkChatbotViewChat-BWdFuQ4P.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-CyA7aA5I.js → PkFilePreview-B4LOpz5I.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreview-CyA7aA5I.js.map → PkFilePreview-B4LOpz5I.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreviewDialog-1Pp-5cpt.js → PkFilePreviewDialog-C_JCOUKx.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-1Pp-5cpt.js.map → PkFilePreviewDialog-C_JCOUKx.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js → PkStreamingMarkdown-CMxiJTMR.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-BFBv_HdF.js.map → PkStreamingMarkdown-CMxiJTMR.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js → PkSvgViewer-PAr87kCa.js} +2 -2
- package/dist-vue/_chunks/{PkSvgViewer-CRNwb6Yn.js.map → PkSvgViewer-PAr87kCa.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js → PkToolChatFile-Bd6Ci7i1.js} +2 -2
- package/dist-vue/_chunks/{PkToolChatFile-BntAINfN.js.map → PkToolChatFile-Bd6Ci7i1.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js → PkToolShareDocument-Bkt9JVqk.js} +2 -2
- package/dist-vue/_chunks/{PkToolShareDocument-Bf7OE8XA.js.map → PkToolShareDocument-Bkt9JVqk.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js → PkToolShowArtifact-rlZ-AGWh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-PTyAPKlR.js.map → PkToolShowArtifact-rlZ-AGWh.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js → PkToolShowContactForm-BVBL7Unx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CGIA743D.js.map → PkToolShowContactForm-BVBL7Unx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js → PkToolShowDiagram-Bs39QQZ3.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CppjE7Vr.js.map → PkToolShowDiagram-Bs39QQZ3.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js → PkToolShowForm-D-RJeA2F.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowForm-DLlcs1c4.js.map → PkToolShowForm-D-RJeA2F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js → PkToolShowImageGallery-8nTrgIRm.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowImageGallery-KP_ptp0w.js.map → PkToolShowImageGallery-8nTrgIRm.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js → PkToolShowLocation-CqqtwH_R.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-Nhh_LwmN.js.map → PkToolShowLocation-CqqtwH_R.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js → PkToolShowProductList-BwfUG41_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-CbI-ncWs.js.map → PkToolShowProductList-BwfUG41_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js → PkToolShowSources-ChGsGtb3.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-E02Gy3vC.js.map → PkToolShowSources-ChGsGtb3.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js → PkToolShowVideo-BK-jDVJd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-DBqMV0U7.js.map → PkToolShowVideo-BK-jDVJd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js → PkToolShowWebPages-K3Jml1f7.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-2023cqa1.js.map → PkToolShowWebPages-K3Jml1f7.js.map} +1 -1
- package/dist-vue/_chunks/{useLightbox-DmtNa8bJ.js → useLightbox-DrEFS3gx.js} +117 -95
- package/dist-vue/_chunks/useLightbox-DrEFS3gx.js.map +1 -0
- package/dist-vue/index.js +22 -22
- package/dist-vue/packages/components/src/composables/useLightbox.d.ts +12 -0
- package/package.json +1 -1
- package/dist/_chunks/useLightbox-BlHExsUm.js.map +0 -1
- package/dist-vue/_chunks/useLightbox-DmtNa8bJ.js.map +0 -1
|
@@ -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;CA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String","$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</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IAAS;KACjC,SAAOM;KACP,SAAOD"}
|
|
@@ -3,18 +3,18 @@ import { t as a } from "./VvButtonLocalized-C-vx25u4.js";
|
|
|
3
3
|
import { A as o, H as s, _ as c, k as l, r as u } from "./Agent-CRwhrv5Z.js";
|
|
4
4
|
import { c as d } from "./Media-0U2B_qCS.js";
|
|
5
5
|
import { A as f, C as p, I as m, L as h, N as g, O as ee, P as _, S as v, U as y, _ as b, b as te, d as ne, f as re, g as ie, i as x, it as S, n as ae, r as oe, rt as se, t as C, x as ce, y as le, z as ue } from "./utils-Bdk5kFfi.js";
|
|
6
|
-
import { t as de } from "./PkStreamingMarkdown-
|
|
6
|
+
import { t as de } from "./PkStreamingMarkdown-CMxiJTMR.js";
|
|
7
7
|
import { t as fe } from "./PkChatbotError-DFZ5S5jd.js";
|
|
8
8
|
import { t as pe } from "./PkChatbotFeedbackForm-DdQQlAr1.js";
|
|
9
9
|
import { c as me, i as he, l as ge, n as _e, o as ve, s as ye, t as be, u as xe } from "./message-DuibQyHy.js";
|
|
10
10
|
import { t as Se } from "./PkChatbotMessageFeedback-DltXugdR.js";
|
|
11
|
-
import { t as Ce } from "./PkChatbotFilePreview-
|
|
11
|
+
import { t as Ce } from "./PkChatbotFilePreview-aKJBtw04.js";
|
|
12
12
|
import { t as we } from "./PkChatbotAudioTranscript-DgmuXalb.js";
|
|
13
13
|
import { t as Te } from "./PkRelativeTime-CZF5CYHv.js";
|
|
14
14
|
import "./src-nb8MU1sh.js";
|
|
15
|
-
import { n as Ee, r as De, t as Oe } from "./PkChatbotSteps-
|
|
15
|
+
import { n as Ee, r as De, t as Oe } from "./PkChatbotSteps-BalLo6DZ.js";
|
|
16
16
|
import { t as ke } from "./PkChatbotOutlineRail-BI-DMvZi.js";
|
|
17
|
-
import { n as Ae } from "./useLightbox-
|
|
17
|
+
import { n as Ae } from "./useLightbox-DrEFS3gx.js";
|
|
18
18
|
import { VvAccordion as je, VvButtonGroup as Me, VvIcon as Ne } from "@volverjs/ui-vue/components";
|
|
19
19
|
import { Fragment as w, Transition as T, computed as E, createBlock as D, createCommentVNode as O, createElementBlock as k, createElementVNode as A, createTextVNode as Pe, createVNode as j, defineAsyncComponent as M, defineComponent as Fe, inject as Ie, mergeProps as Le, nextTick as N, normalizeClass as P, normalizeStyle as Re, onBeforeUnmount as ze, onMounted as Be, openBlock as F, ref as I, renderList as Ve, renderSlot as He, resolveDynamicComponent as Ue, shallowRef as We, toDisplayString as L, unref as R, useSlots as Ge, useTemplateRef as Ke, watch as z, withCtx as B, withModifiers as V } from "vue";
|
|
20
20
|
import { useI18n as qe } from "vue-i18n";
|
|
@@ -57,26 +57,26 @@ var U = (e) => e.state, $e = (e) => e.type.startsWith("tool-") ? e.type.slice(5)
|
|
|
57
57
|
return t;
|
|
58
58
|
}, nt = (e) => e?.role === "assistant" && !et(e) && tt(e), rt = {
|
|
59
59
|
requestOAuthConnection: M(() => import("./PkToolRequestOAuthConnection-CgD-o99C.js")),
|
|
60
|
-
shareDocument: M(() => import("./PkToolShareDocument-
|
|
61
|
-
showArtifact: M(() => import("./PkToolShowArtifact-
|
|
60
|
+
shareDocument: M(() => import("./PkToolShareDocument-Bkt9JVqk.js").then((e) => e.n)),
|
|
61
|
+
showArtifact: M(() => import("./PkToolShowArtifact-rlZ-AGWh.js").then((e) => e.n)),
|
|
62
62
|
showCalendarEvent: M(() => import("./PkToolShowCalendarEvent-CAejFLQI.js").then((e) => e.n)),
|
|
63
63
|
showChart: M(() => import("./PkToolShowChart-B8xJi1yY.js")),
|
|
64
64
|
showComparison: M(() => import("./PkToolShowComparison-BEHyRNXE.js").then((e) => e.n)),
|
|
65
|
-
showContactForm: M(() => import("./PkToolShowContactForm-
|
|
66
|
-
showDiagram: M(() => import("./PkToolShowDiagram-
|
|
65
|
+
showContactForm: M(() => import("./PkToolShowContactForm-BVBL7Unx.js").then((e) => e.n)),
|
|
66
|
+
showDiagram: M(() => import("./PkToolShowDiagram-Bs39QQZ3.js")),
|
|
67
67
|
showEmail: M(() => import("./PkToolShowEmail-BehvoNsz.js").then((e) => e.n)),
|
|
68
|
-
showImageGallery: M(() => import("./PkToolShowImageGallery-
|
|
69
|
-
showLocation: M(() => import("./PkToolShowLocation-
|
|
68
|
+
showImageGallery: M(() => import("./PkToolShowImageGallery-8nTrgIRm.js").then((e) => e.n)),
|
|
69
|
+
showLocation: M(() => import("./PkToolShowLocation-CqqtwH_R.js").then((e) => e.n)),
|
|
70
70
|
showMessage: M(() => import("./PkToolShowMessage-Cca7K7GQ.js").then((e) => e.n)),
|
|
71
|
-
showForm: M(() => import("./PkToolShowForm-
|
|
72
|
-
showMultipleChoice: M(() => import("./PkToolShowForm-
|
|
73
|
-
showProductList: M(() => import("./PkToolShowProductList-
|
|
71
|
+
showForm: M(() => import("./PkToolShowForm-D-RJeA2F.js").then((e) => e.n)),
|
|
72
|
+
showMultipleChoice: M(() => import("./PkToolShowForm-D-RJeA2F.js").then((e) => e.n)),
|
|
73
|
+
showProductList: M(() => import("./PkToolShowProductList-BwfUG41_.js").then((e) => e.n)),
|
|
74
74
|
showQrCode: M(() => import("./PkToolShowQrCode-96KzD1rX.js").then((e) => e.n)),
|
|
75
|
-
showSources: M(() => import("./PkToolShowSources-
|
|
75
|
+
showSources: M(() => import("./PkToolShowSources-ChGsGtb3.js").then((e) => e.n)),
|
|
76
76
|
showSuggestedReply: M(() => import("./PkToolShowSuggestedReply-75Kc8-OQ.js").then((e) => e.n)),
|
|
77
|
-
showVideo: M(() => import("./PkToolShowVideo-
|
|
77
|
+
showVideo: M(() => import("./PkToolShowVideo-BK-jDVJd.js")),
|
|
78
78
|
showWeather: M(() => import("./PkToolShowWeather-DkWGFxNa.js")),
|
|
79
|
-
showWebPages: M(() => import("./PkToolShowWebPages-
|
|
79
|
+
showWebPages: M(() => import("./PkToolShowWebPages-K3Jml1f7.js").then((e) => e.n))
|
|
80
80
|
}, it = {
|
|
81
81
|
key: 0,
|
|
82
82
|
class: "text-12 text-word-3 m-0 mb-xs"
|
|
@@ -1065,4 +1065,4 @@ var _t = ["aria-busy"], vt = {
|
|
|
1065
1065
|
});
|
|
1066
1066
|
export { nn as t };
|
|
1067
1067
|
|
|
1068
|
-
//# sourceMappingURL=PkChatbotMessages-
|
|
1068
|
+
//# sourceMappingURL=PkChatbotMessages-DOOQRLEc.js.map
|