@8wave/ai-elements 0.125.0-beta.42 → 0.125.0-beta.44
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/README.md +9 -4
- package/dist/_chunks/Chart-1vt0m6l_.js +87 -0
- package/dist/_chunks/Chart-1vt0m6l_.js.map +1 -0
- package/dist/_chunks/{PkChart-CbtMRGWc.js → PkChart-CYFx_UDq.js} +741 -623
- package/dist/_chunks/PkChart-CYFx_UDq.js.map +1 -0
- package/dist/_chunks/PkFilePreview-DfYzaj3Y.js +1745 -0
- package/dist/_chunks/PkFilePreview-DfYzaj3Y.js.map +1 -0
- package/dist/_chunks/{PkFilePreviewDialog-bcTkTcYk.js → PkFilePreviewDialog-COkwyLq6.js} +2 -2
- package/dist/_chunks/{PkFilePreviewDialog-bcTkTcYk.js.map → PkFilePreviewDialog-COkwyLq6.js.map} +1 -1
- package/dist/_chunks/{PkImageEditorDialog-FpbyhV3t.js → PkImageEditorDialog-Ceas-HZA.js} +2 -2
- package/dist/_chunks/{PkImageEditorDialog-FpbyhV3t.js.map → PkImageEditorDialog-Ceas-HZA.js.map} +1 -1
- package/dist/_chunks/{PkSelectionActions-BbfVZY0R.js → PkSelectionActions-Dl3cKb7x.js} +2 -2
- package/dist/_chunks/PkSelectionActions-Dl3cKb7x.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-COSOOhCg.js → PkStreamingMarkdown-DZvLHy2l.js} +2 -2
- package/dist/_chunks/{PkStreamingMarkdown-COSOOhCg.js.map → PkStreamingMarkdown-DZvLHy2l.js.map} +1 -1
- package/dist/_chunks/{PkToolChatFile-C_gS0X1j.js → PkToolChatFile-D4ukZ9g6.js} +3 -3
- package/dist/_chunks/{PkToolChatFile-C_gS0X1j.js.map → PkToolChatFile-D4ukZ9g6.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-fpFtKrZo.js → PkToolShowArtifact-wIAxyXrL.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-fpFtKrZo.js.map → PkToolShowArtifact-wIAxyXrL.js.map} +1 -1
- package/dist/_chunks/PkToolShowChart-D3E_xBJv.js +138 -0
- package/dist/_chunks/PkToolShowChart-D3E_xBJv.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-BAM772bm.js → PkToolShowContactForm-BhcM-Z6m.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BAM772bm.js.map → PkToolShowContactForm-BhcM-Z6m.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DJcL0bgw.js → PkToolShowForm-D6k7_QLF.js} +3 -3
- package/dist/_chunks/{PkToolShowForm-DJcL0bgw.js.map → PkToolShowForm-D6k7_QLF.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-GeWAMHYC.js → PkToolShowSources-Cw1ofky2.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-GeWAMHYC.js.map → PkToolShowSources-Cw1ofky2.js.map} +1 -1
- package/dist/_chunks/chartFormat-B1T7y-16.js +27 -0
- package/dist/_chunks/chartFormat-B1T7y-16.js.map +1 -0
- package/dist/_chunks/{excelNumberFormat-BhQjife9.js → excelNumberFormat-CcXF_wJK.js} +101 -88
- package/dist/_chunks/excelNumberFormat-CcXF_wJK.js.map +1 -0
- package/dist/_chunks/{utils-DMvy5QRR.js → utils-C2aFWWye.js} +132 -110
- package/dist/_chunks/utils-C2aFWWye.js.map +1 -0
- package/dist/ai-elements.es.js +2939 -2882
- 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/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.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/_chunks/Chart-DsBNs5rS.js +87 -0
- package/dist-vue/_chunks/Chart-DsBNs5rS.js.map +1 -0
- package/dist-vue/_chunks/{PkChart-D-K7nc0g.js → PkChart-CrZqhEpp.js} +112 -74
- package/dist-vue/_chunks/PkChart-CrZqhEpp.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-DVQ-Bb7n.js → PkChatbot-CBSe9MOB.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-DVQ-Bb7n.js.map → PkChatbot-CBSe9MOB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-OlgewA4_.js → PkChatbotEmptyState-DfyYZXHQ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-OlgewA4_.js.map → PkChatbotEmptyState-DfyYZXHQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-D_I0Gf_u.js → PkChatbotInput-CBalSveL.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotInput-D_I0Gf_u.js.map → PkChatbotInput-CBalSveL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-CAXnEfXK.js → PkChatbotMessages-C2AUTqk4.js} +307 -307
- package/dist-vue/_chunks/{PkChatbotMessages-CAXnEfXK.js.map → PkChatbotMessages-C2AUTqk4.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepPayload-EBri1L10.js → PkChatbotStepPayload-Bb3Y6kuL.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-EBri1L10.js.map → PkChatbotStepPayload-Bb3Y6kuL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DiQEa0UV.js → PkChatbotStepToolDetail-CwOxzYOe.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-DiQEa0UV.js.map → PkChatbotStepToolDetail-CwOxzYOe.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-BgLnv2J1.js → PkChatbotSteps-FduD9X9i.js} +38 -38
- package/dist-vue/_chunks/{PkChatbotSteps-BgLnv2J1.js.map → PkChatbotSteps-FduD9X9i.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CmjD1IXf.js → PkChatbotViewChat-jl3ZbK7H.js} +22 -22
- package/dist-vue/_chunks/{PkChatbotViewChat-CmjD1IXf.js.map → PkChatbotViewChat-jl3ZbK7H.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-CVZH5dXx.js → PkChatbotViewConversations-BtwTWqmM.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-CVZH5dXx.js.map → PkChatbotViewConversations-BtwTWqmM.js.map} +1 -1
- package/dist-vue/_chunks/{PkFilePreview-k5gEl3n8.js → PkFilePreview-CRfDEYYo.js} +701 -624
- package/dist-vue/_chunks/PkFilePreview-CRfDEYYo.js.map +1 -0
- package/dist-vue/_chunks/{PkFilePreviewDialog-DUwZPErE.js → PkFilePreviewDialog-u-0rhuRx.js} +2 -2
- package/dist-vue/_chunks/{PkFilePreviewDialog-DUwZPErE.js.map → PkFilePreviewDialog-u-0rhuRx.js.map} +1 -1
- package/dist-vue/_chunks/{PkImageEditorDialog-DQPXePae.js → PkImageEditorDialog-CjMwpb-a.js} +2 -2
- package/dist-vue/_chunks/{PkImageEditorDialog-DQPXePae.js.map → PkImageEditorDialog-CjMwpb-a.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-ZasabxE0.js → PkStreamingMarkdown-7Kl_VBH-.js} +2 -2
- package/dist-vue/_chunks/{PkStreamingMarkdown-ZasabxE0.js.map → PkStreamingMarkdown-7Kl_VBH-.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolChatFile-CD26Q2xp.js → PkToolChatFile-DcNRCVXy.js} +3 -3
- package/dist-vue/_chunks/{PkToolChatFile-CD26Q2xp.js.map → PkToolChatFile-DcNRCVXy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-BhVd_ZQ8.js → PkToolShowArtifact-C7CxCqVO.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BhVd_ZQ8.js.map → PkToolShowArtifact-C7CxCqVO.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowChart-DULlrMjq.js +133 -0
- package/dist-vue/_chunks/PkToolShowChart-DULlrMjq.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-CackCDGD.js → PkToolShowContactForm-472d-SAE.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-CackCDGD.js.map → PkToolShowContactForm-472d-SAE.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CABPsFi8.js → PkToolShowDiagram-RrqVpOaX.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CABPsFi8.js.map → PkToolShowDiagram-RrqVpOaX.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BStbk4Iu.js → PkToolShowForm-CgyszDEI.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-BStbk4Iu.js.map → PkToolShowForm-CgyszDEI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-BeeHsdTp.js → PkToolShowImageGallery-LBx9JE6p.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-BeeHsdTp.js.map → PkToolShowImageGallery-LBx9JE6p.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BfUiap9U.js → PkToolShowProductList-THiH4EzZ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BfUiap9U.js.map → PkToolShowProductList-THiH4EzZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CgEkcyRg.js → PkToolShowSources-CEqGXOOt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-CgEkcyRg.js.map → PkToolShowSources-CEqGXOOt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CqSRnDNC.js → PkToolShowVideo-8Gi3vOer.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CqSRnDNC.js.map → PkToolShowVideo-8Gi3vOer.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-B-qIS8qY.js → PkToolShowWebPages-xjUPdfOU.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-B-qIS8qY.js.map → PkToolShowWebPages-xjUPdfOU.js.map} +1 -1
- package/dist-vue/_chunks/chartFormat-B1T7y-16.js +27 -0
- package/dist-vue/_chunks/chartFormat-B1T7y-16.js.map +1 -0
- package/dist-vue/_chunks/{excelNumberFormat-C1sCQrOz.js → excelNumberFormat-BxRi0Y3e.js} +101 -88
- package/dist-vue/_chunks/excelNumberFormat-BxRi0Y3e.js.map +1 -0
- package/dist-vue/_chunks/{utils-KBB6SDPn.js → utils-VVbH-Liq.js} +30 -30
- package/dist-vue/_chunks/utils-VVbH-Liq.js.map +1 -0
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -6
- package/dist-vue/apps/web-component/src/composables/useSelectionActions.d.ts +14 -4
- package/dist-vue/composables.js +9 -3
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +42 -42
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +6 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +6 -6
- package/dist-vue/packages/components/src/chat/PkChart.d.ts +8 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +1 -1
- package/dist-vue/packages/components/src/chat/PkFileChart.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/PkSelectionActionIconPicker.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkSelectionAnswerCard.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkWordPreviewRuns.d.ts +4 -1
- package/dist-vue/packages/components/src/chat/selectionActionEdits.d.ts +1 -1
- package/dist-vue/packages/components/src/chat/useChatFilePreview.d.ts +240 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +57 -5
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +18 -18
- package/dist-vue/packages/composable/src/useSettledSelection.d.ts +2 -2
- package/dist-vue/packages/models/src/schema/Agent.d.ts +21 -21
- package/dist-vue/packages/models/src/schema/Chart.d.ts +91 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/SelectionAction.d.ts +11 -11
- package/dist-vue/packages/models/src/schema/SelectionActionPreview.d.ts +3 -3
- package/dist-vue/packages/models/src/schema/SpreadsheetPreview.d.ts +381 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -6
- package/dist-vue/packages/models/src/schema/WordPreview.d.ts +304 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkChart-CbtMRGWc.js.map +0 -1
- package/dist/_chunks/PkFilePreview-DC4iX7Yc.js +0 -1665
- package/dist/_chunks/PkFilePreview-DC4iX7Yc.js.map +0 -1
- package/dist/_chunks/PkSelectionActions-BbfVZY0R.js.map +0 -1
- package/dist/_chunks/PkToolShowChart-DZWu3Yuo.js +0 -224
- package/dist/_chunks/PkToolShowChart-DZWu3Yuo.js.map +0 -1
- package/dist/_chunks/excelNumberFormat-BhQjife9.js.map +0 -1
- package/dist/_chunks/utils-DMvy5QRR.js.map +0 -1
- package/dist-vue/_chunks/PkChart-D-K7nc0g.js.map +0 -1
- package/dist-vue/_chunks/PkFilePreview-k5gEl3n8.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowChart-BQXxaPIO.js +0 -217
- package/dist-vue/_chunks/PkToolShowChart-BQXxaPIO.js.map +0 -1
- package/dist-vue/_chunks/excelNumberFormat-C1sCQrOz.js.map +0 -1
- package/dist-vue/_chunks/utils-KBB6SDPn.js.map +0 -1
package/dist/_chunks/{PkToolShowArtifact-fpFtKrZo.js.map → PkToolShowArtifact-wIAxyXrL.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowArtifact-fpFtKrZo.js","names":["$attrs","_hoisted_1","_openBlock","_createElementBlock","_normalizeClass","_createTextVNode","_createElementVNode","_sfc_main","$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","_unref","_createBlock","PkCode","PkStreamingMarkdown","_normalizeClass","_sfc_main","normalizeClass","watch","createVNode","init_shared_esm_bundler","createBlock","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","defineComponent","unref","createTextVNode","createElementBlock","openBlock","PkStreamingMarkdown_default","useClipboard","VvButtonLocalized","_hoisted_1$1","PkCode_default","props","__props","highlightedHtml","hasCode","highlight","hljs","result","_ctx","_cache","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","PkToolShowArtifact_default","toolPart","artifactTypeLabel","languageLabel","isCodeType","isMarkdownType","codeLanguage","_component_VvButton","copied","copy"],"sources":["../../../../packages/components/src/chat/PkCode.vue","../../../../packages/components/src/chat/PkCode.vue","../../../../packages/components/src/chat/PkToolShowArtifact.vue","../../../../packages/components/src/chat/PkToolShowArtifact.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n\n defineOptions({\n inheritAttrs: false,\n })\n\n const props = defineProps<{\n code: unknown\n language: string\n line?: boolean\n }>()\n\n const highlightedHtml = ref('')\n\n const hasCode = computed(() => {\n if (typeof props.code === 'string') {\n return props.code\n }\n return JSON.stringify(props.code, null, 2)\n })\n\n async function highlight() {\n const hljs = (await import('highlight.js/lib/common')).default\n try {\n const result = props.language\n ? hljs.highlight(hasCode.value, { language: props.language })\n : hljs.highlightAuto(hasCode.value)\n highlightedHtml.value = result.value\n } catch {\n highlightedHtml.value = hasCode.value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n }\n }\n\n watch(hasCode, highlight, { immediate: true })\n</script>\n\n<template>\n <pre\n :class=\"\n $attrs.class\n ? $attrs.class\n : 'font-mono leading-snug text-smaller bg-surface-1'\n \">\n <code :class=\"['hljs', line ? 'whitespace-pre-line' : 'whitespace-pre', language]\" v-html=\"highlightedHtml\"></code>\n </pre>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n\n defineOptions({\n inheritAttrs: false,\n })\n\n const props = defineProps<{\n code: unknown\n language: string\n line?: boolean\n }>()\n\n const highlightedHtml = ref('')\n\n const hasCode = computed(() => {\n if (typeof props.code === 'string') {\n return props.code\n }\n return JSON.stringify(props.code, null, 2)\n })\n\n async function highlight() {\n const hljs = (await import('highlight.js/lib/common')).default\n try {\n const result = props.language\n ? hljs.highlight(hasCode.value, { language: props.language })\n : hljs.highlightAuto(hasCode.value)\n highlightedHtml.value = result.value\n } catch {\n highlightedHtml.value = hasCode.value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n }\n }\n\n watch(hasCode, highlight, { immediate: true })\n</script>\n\n<template>\n <pre\n :class=\"\n $attrs.class\n ? $attrs.class\n : 'font-mono leading-snug text-smaller bg-surface-1'\n \">\n <code :class=\"['hljs', line ? 'whitespace-pre-line' : 'whitespace-pre', language]\" v-html=\"highlightedHtml\"></code>\n </pre>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import PkCode from './PkCode.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { copy, copied } = useClipboard()\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n content: string\n artifactType: string\n language?: string\n }\n }\n return part\n })\n\n const artifactTypeLabel = computed(() => {\n const labels: Record<string, string> = {\n code: 'Code',\n document: 'Document',\n markdown: 'Markdown',\n json: 'JSON',\n xml: 'XML',\n csv: 'CSV',\n html: 'HTML',\n yaml: 'YAML',\n sql: 'SQL',\n text: 'Text',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'Artifact'\n }\n return labels[toolPart.value.input.artifactType] || 'Artifact'\n })\n\n const languageLabel = computed(() => {\n if (!toolPart.value.input?.language) {\n return ''\n }\n return ` (${toolPart.value.input.language})`\n })\n\n const isCodeType = computed(() => {\n return (\n toolPart.value.input?.artifactType === 'code' ||\n toolPart.value.input?.artifactType === 'json' ||\n toolPart.value.input?.artifactType === 'xml' ||\n toolPart.value.input?.artifactType === 'yaml' ||\n toolPart.value.input?.artifactType === 'html' ||\n toolPart.value.input?.artifactType === 'sql'\n )\n })\n\n const isMarkdownType = computed(() => {\n return toolPart.value.input?.artifactType === 'markdown'\n })\n\n const codeLanguage = computed(() => {\n if (toolPart.value.input?.language) {\n return toolPart.value.input.language\n }\n // Map artifact types to highlight.js languages\n const languageMap: Record<string, string> = {\n json: 'json',\n xml: 'xml',\n yaml: 'yaml',\n html: 'html',\n sql: 'sql',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'plaintext'\n }\n return languageMap[toolPart.value.input.artifactType] || 'plaintext'\n })\n</script>\n\n<template>\n <div class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 font-bold bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex justify-between items-center\">\n <div class=\"flex flex-col items-start gap-4\">\n <span>{{ toolPart?.input?.title }}</span>\n <span class=\"text-10 opacity-60 font-normal\">\n {{ artifactTypeLabel }}{{ languageLabel }}\n </span>\n </div>\n <VvButton\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n modifiers=\"action-quiet-small\"\n :title=\"$t('action.copy')\"\n class=\"shrink-0\"\n @click=\"copy(toolPart?.input?.content || '')\" />\n </div>\n <div class=\"px-sm py-10 bg-surface\">\n <PkCode\n v-if=\"isCodeType\"\n :code=\"toolPart?.input?.content\"\n :language=\"codeLanguage\" />\n <PkStreamingMarkdown\n v-else-if=\"isMarkdownType\"\n :markdown=\"toolPart?.input?.content\"\n class=\"wysiwyg text-word-2\" />\n <pre\n v-else\n class=\"text-word-2 whitespace-pre-wrap break-words\"\n :class=\"{\n italic:\n toolPart?.input?.artifactType === 'document' ||\n toolPart?.input?.artifactType === 'text',\n }\"\n >{{ toolPart?.input?.content }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import PkCode from './PkCode.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { copy, copied } = useClipboard()\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n content: string\n artifactType: string\n language?: string\n }\n }\n return part\n })\n\n const artifactTypeLabel = computed(() => {\n const labels: Record<string, string> = {\n code: 'Code',\n document: 'Document',\n markdown: 'Markdown',\n json: 'JSON',\n xml: 'XML',\n csv: 'CSV',\n html: 'HTML',\n yaml: 'YAML',\n sql: 'SQL',\n text: 'Text',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'Artifact'\n }\n return labels[toolPart.value.input.artifactType] || 'Artifact'\n })\n\n const languageLabel = computed(() => {\n if (!toolPart.value.input?.language) {\n return ''\n }\n return ` (${toolPart.value.input.language})`\n })\n\n const isCodeType = computed(() => {\n return (\n toolPart.value.input?.artifactType === 'code' ||\n toolPart.value.input?.artifactType === 'json' ||\n toolPart.value.input?.artifactType === 'xml' ||\n toolPart.value.input?.artifactType === 'yaml' ||\n toolPart.value.input?.artifactType === 'html' ||\n toolPart.value.input?.artifactType === 'sql'\n )\n })\n\n const isMarkdownType = computed(() => {\n return toolPart.value.input?.artifactType === 'markdown'\n })\n\n const codeLanguage = computed(() => {\n if (toolPart.value.input?.language) {\n return toolPart.value.input.language\n }\n // Map artifact types to highlight.js languages\n const languageMap: Record<string, string> = {\n json: 'json',\n xml: 'xml',\n yaml: 'yaml',\n html: 'html',\n sql: 'sql',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'plaintext'\n }\n return languageMap[toolPart.value.input.artifactType] || 'plaintext'\n })\n</script>\n\n<template>\n <div class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 font-bold bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex justify-between items-center\">\n <div class=\"flex flex-col items-start gap-4\">\n <span>{{ toolPart?.input?.title }}</span>\n <span class=\"text-10 opacity-60 font-normal\">\n {{ artifactTypeLabel }}{{ languageLabel }}\n </span>\n </div>\n <VvButton\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n modifiers=\"action-quiet-small\"\n :title=\"$t('action.copy')\"\n class=\"shrink-0\"\n @click=\"copy(toolPart?.input?.content || '')\" />\n </div>\n <div class=\"px-sm py-10 bg-surface\">\n <PkCode\n v-if=\"isCodeType\"\n :code=\"toolPart?.input?.content\"\n :language=\"codeLanguage\" />\n <PkStreamingMarkdown\n v-else-if=\"isMarkdownType\"\n :markdown=\"toolPart?.input?.content\"\n class=\"wysiwyg text-word-2\" />\n <pre\n v-else\n class=\"text-word-2 whitespace-pre-wrap break-words\"\n :class=\"{\n italic:\n toolPart?.input?.artifactType === 'document' ||\n toolPart?.input?.artifactType === 'text',\n }\"\n >{{ toolPart?.input?.content }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAOI,IAAM0C,IAAQC,GAMRC,IAAkBjB,EAAI,EAAE,GAExBkB,IAAUjB,QACR,OAAOc,EAAM,QAAS,WACfA,EAAM,OAEV,KAAK,UAAUA,EAAM,MAAM,MAAM,CAAC,CAC5C;EAED,eAAeI,IAAY;GACvB,IAAMC,KAAQ,MAAM,OAAO,6DAAA,CAA4B;GACvD,IAAI;IACA,IAAMC,IAASN,EAAM,WACfK,EAAK,UAAUF,EAAQ,OAAO,EAAE,UAAUH,EAAM,SAAS,CAAC,IAC1DK,EAAK,cAAcF,EAAQ,KAAK;IACtC,EAAgB,QAAQG,EAAO;GACnC,QAAQ;IACJ,EAAgB,QAAQH,EAAQ,MAC3B,QAAQ,MAAM,OAAO,CAAA,CACrB,QAAQ,MAA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AAM;GACN,MAAM;GACN,KAAK;EAKF,EAAYA,EAAS,MAAM,MAAM,iBAAiB,WAC5D;;;GAID,OAAA/C,EAAA,GAAAC,EAoCM,OApCNwC,GAoCM,CAnCFvC,EAeM,OAfNwC,GAeM,CAbFxC,EAKM,OALNyC,GAKM,CAJFzC,EAAyC,QAAA,MAAAC,EAAhC4C,EAAA,OAAU,OAAO,KAAK,GAAA,CAAA,GAC/B7C,EAEO,QAFP0C,GAEOzC,EADA6C,EAAA,KAAiB,IAAA7C,EAAM8C,EAAA,KAAa,GAAA,CAAA,C,IAG/C7C,EAMoDiD,GAAA;IAL/C,MAAMhD,EAAAiD,CAAA,IAAM,kBAAA;IACZ,OAAOjD,EAAAiD,CAAA,IAASxD,EAAAA,GAAE,eAAA,IAAoBA,EAAAA,GAAE,aAAA;IACzC,WAAU;IACT,OAAOA,EAAAA,GAAE,aAAA;IACV,OAAM;IACL,SAAK,AAAA0C,EAAA,QAAA,MAAEnC,EAAAkD,CAAA,CAAI,CAACR,EAAA,OAAU,OAAO,WAAO,EAAA;;;;;G,MAE7C7C,EAkBM,OAlBN2C,GAkBM,CAhBQK,EAAA,SADVlD,EAAA,GAAAM,EAG+BC,GAAA;;IAD1B,MAAMwC,EAAA,OAAU,OAAO;IACvB,UAAUK,EAAA;G,qCAEAD,EAAA,SADfnD,EAAA,GAAAM,EAGkCE,GAAA;;IAD7B,UAAUuC,EAAA,OAAU,OAAO;IAC5B,OAAM;G,8BACV/C,EAAA,GAAAC,EAQyC,OAAA;;IANrC,OAAKQ,EAAA,CAAC,+CAA6C,E,QACWsC,EAAA,OAAU,OAAO,iBAAY,cAA2CA,EAAA,OAAU,OAAO,iBAAY,O;GAK/J,GAAA5C,EAAA4C,EAAA,OAAU,OAAO,OAAO,GAAA,CAAA,E"}
|
|
1
|
+
{"version":3,"file":"PkToolShowArtifact-wIAxyXrL.js","names":["$attrs","_hoisted_1","_openBlock","_createElementBlock","_normalizeClass","_createTextVNode","_createElementVNode","_sfc_main","$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode","_unref","_createBlock","PkCode","PkStreamingMarkdown","_normalizeClass","_sfc_main","normalizeClass","watch","createVNode","init_shared_esm_bundler","createBlock","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","defineComponent","unref","createTextVNode","createElementBlock","openBlock","PkStreamingMarkdown_default","useClipboard","VvButtonLocalized","_hoisted_1$1","PkCode_default","props","__props","highlightedHtml","hasCode","highlight","hljs","result","_ctx","_cache","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","PkToolShowArtifact_default","toolPart","artifactTypeLabel","languageLabel","isCodeType","isMarkdownType","codeLanguage","_component_VvButton","copied","copy"],"sources":["../../../../packages/components/src/chat/PkCode.vue","../../../../packages/components/src/chat/PkCode.vue","../../../../packages/components/src/chat/PkToolShowArtifact.vue","../../../../packages/components/src/chat/PkToolShowArtifact.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n\n defineOptions({\n inheritAttrs: false,\n })\n\n const props = defineProps<{\n code: unknown\n language: string\n line?: boolean\n }>()\n\n const highlightedHtml = ref('')\n\n const hasCode = computed(() => {\n if (typeof props.code === 'string') {\n return props.code\n }\n return JSON.stringify(props.code, null, 2)\n })\n\n async function highlight() {\n const hljs = (await import('highlight.js/lib/common')).default\n try {\n const result = props.language\n ? hljs.highlight(hasCode.value, { language: props.language })\n : hljs.highlightAuto(hasCode.value)\n highlightedHtml.value = result.value\n } catch {\n highlightedHtml.value = hasCode.value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n }\n }\n\n watch(hasCode, highlight, { immediate: true })\n</script>\n\n<template>\n <pre\n :class=\"\n $attrs.class\n ? $attrs.class\n : 'font-mono leading-snug text-smaller bg-surface-1'\n \">\n <code :class=\"['hljs', line ? 'whitespace-pre-line' : 'whitespace-pre', language]\" v-html=\"highlightedHtml\"></code>\n </pre>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n\n defineOptions({\n inheritAttrs: false,\n })\n\n const props = defineProps<{\n code: unknown\n language: string\n line?: boolean\n }>()\n\n const highlightedHtml = ref('')\n\n const hasCode = computed(() => {\n if (typeof props.code === 'string') {\n return props.code\n }\n return JSON.stringify(props.code, null, 2)\n })\n\n async function highlight() {\n const hljs = (await import('highlight.js/lib/common')).default\n try {\n const result = props.language\n ? hljs.highlight(hasCode.value, { language: props.language })\n : hljs.highlightAuto(hasCode.value)\n highlightedHtml.value = result.value\n } catch {\n highlightedHtml.value = hasCode.value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n }\n }\n\n watch(hasCode, highlight, { immediate: true })\n</script>\n\n<template>\n <pre\n :class=\"\n $attrs.class\n ? $attrs.class\n : 'font-mono leading-snug text-smaller bg-surface-1'\n \">\n <code :class=\"['hljs', line ? 'whitespace-pre-line' : 'whitespace-pre', language]\" v-html=\"highlightedHtml\"></code>\n </pre>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import PkCode from './PkCode.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { copy, copied } = useClipboard()\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n content: string\n artifactType: string\n language?: string\n }\n }\n return part\n })\n\n const artifactTypeLabel = computed(() => {\n const labels: Record<string, string> = {\n code: 'Code',\n document: 'Document',\n markdown: 'Markdown',\n json: 'JSON',\n xml: 'XML',\n csv: 'CSV',\n html: 'HTML',\n yaml: 'YAML',\n sql: 'SQL',\n text: 'Text',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'Artifact'\n }\n return labels[toolPart.value.input.artifactType] || 'Artifact'\n })\n\n const languageLabel = computed(() => {\n if (!toolPart.value.input?.language) {\n return ''\n }\n return ` (${toolPart.value.input.language})`\n })\n\n const isCodeType = computed(() => {\n return (\n toolPart.value.input?.artifactType === 'code' ||\n toolPart.value.input?.artifactType === 'json' ||\n toolPart.value.input?.artifactType === 'xml' ||\n toolPart.value.input?.artifactType === 'yaml' ||\n toolPart.value.input?.artifactType === 'html' ||\n toolPart.value.input?.artifactType === 'sql'\n )\n })\n\n const isMarkdownType = computed(() => {\n return toolPart.value.input?.artifactType === 'markdown'\n })\n\n const codeLanguage = computed(() => {\n if (toolPart.value.input?.language) {\n return toolPart.value.input.language\n }\n // Map artifact types to highlight.js languages\n const languageMap: Record<string, string> = {\n json: 'json',\n xml: 'xml',\n yaml: 'yaml',\n html: 'html',\n sql: 'sql',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'plaintext'\n }\n return languageMap[toolPart.value.input.artifactType] || 'plaintext'\n })\n</script>\n\n<template>\n <div class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 font-bold bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex justify-between items-center\">\n <div class=\"flex flex-col items-start gap-4\">\n <span>{{ toolPart?.input?.title }}</span>\n <span class=\"text-10 opacity-60 font-normal\">\n {{ artifactTypeLabel }}{{ languageLabel }}\n </span>\n </div>\n <VvButton\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n modifiers=\"action-quiet-small\"\n :title=\"$t('action.copy')\"\n class=\"shrink-0\"\n @click=\"copy(toolPart?.input?.content || '')\" />\n </div>\n <div class=\"px-sm py-10 bg-surface\">\n <PkCode\n v-if=\"isCodeType\"\n :code=\"toolPart?.input?.content\"\n :language=\"codeLanguage\" />\n <PkStreamingMarkdown\n v-else-if=\"isMarkdownType\"\n :markdown=\"toolPart?.input?.content\"\n class=\"wysiwyg text-word-2\" />\n <pre\n v-else\n class=\"text-word-2 whitespace-pre-wrap break-words\"\n :class=\"{\n italic:\n toolPart?.input?.artifactType === 'document' ||\n toolPart?.input?.artifactType === 'text',\n }\"\n >{{ toolPart?.input?.content }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import PkCode from './PkCode.vue'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { copy, copied } = useClipboard()\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n title: string\n content: string\n artifactType: string\n language?: string\n }\n }\n return part\n })\n\n const artifactTypeLabel = computed(() => {\n const labels: Record<string, string> = {\n code: 'Code',\n document: 'Document',\n markdown: 'Markdown',\n json: 'JSON',\n xml: 'XML',\n csv: 'CSV',\n html: 'HTML',\n yaml: 'YAML',\n sql: 'SQL',\n text: 'Text',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'Artifact'\n }\n return labels[toolPart.value.input.artifactType] || 'Artifact'\n })\n\n const languageLabel = computed(() => {\n if (!toolPart.value.input?.language) {\n return ''\n }\n return ` (${toolPart.value.input.language})`\n })\n\n const isCodeType = computed(() => {\n return (\n toolPart.value.input?.artifactType === 'code' ||\n toolPart.value.input?.artifactType === 'json' ||\n toolPart.value.input?.artifactType === 'xml' ||\n toolPart.value.input?.artifactType === 'yaml' ||\n toolPart.value.input?.artifactType === 'html' ||\n toolPart.value.input?.artifactType === 'sql'\n )\n })\n\n const isMarkdownType = computed(() => {\n return toolPart.value.input?.artifactType === 'markdown'\n })\n\n const codeLanguage = computed(() => {\n if (toolPart.value.input?.language) {\n return toolPart.value.input.language\n }\n // Map artifact types to highlight.js languages\n const languageMap: Record<string, string> = {\n json: 'json',\n xml: 'xml',\n yaml: 'yaml',\n html: 'html',\n sql: 'sql',\n }\n if (!toolPart.value.input?.artifactType) {\n return 'plaintext'\n }\n return languageMap[toolPart.value.input.artifactType] || 'plaintext'\n })\n</script>\n\n<template>\n <div class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 font-bold bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex justify-between items-center\">\n <div class=\"flex flex-col items-start gap-4\">\n <span>{{ toolPart?.input?.title }}</span>\n <span class=\"text-10 opacity-60 font-normal\">\n {{ artifactTypeLabel }}{{ languageLabel }}\n </span>\n </div>\n <VvButton\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n modifiers=\"action-quiet-small\"\n :title=\"$t('action.copy')\"\n class=\"shrink-0\"\n @click=\"copy(toolPart?.input?.content || '')\" />\n </div>\n <div class=\"px-sm py-10 bg-surface\">\n <PkCode\n v-if=\"isCodeType\"\n :code=\"toolPart?.input?.content\"\n :language=\"codeLanguage\" />\n <PkStreamingMarkdown\n v-else-if=\"isMarkdownType\"\n :markdown=\"toolPart?.input?.content\"\n class=\"wysiwyg text-word-2\" />\n <pre\n v-else\n class=\"text-word-2 whitespace-pre-wrap break-words\"\n :class=\"{\n italic:\n toolPart?.input?.artifactType === 'document' ||\n toolPart?.input?.artifactType === 'text',\n }\"\n >{{ toolPart?.input?.content }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;EAOI,IAAM0C,IAAQC,GAMRC,IAAkBjB,EAAI,EAAE,GAExBkB,IAAUjB,QACR,OAAOc,EAAM,QAAS,WACfA,EAAM,OAEV,KAAK,UAAUA,EAAM,MAAM,MAAM,CAAC,CAC5C;EAED,eAAeI,IAAY;GACvB,IAAMC,KAAQ,MAAM,OAAO,6DAAA,CAA4B;GACvD,IAAI;IACA,IAAMC,IAASN,EAAM,WACfK,EAAK,UAAUF,EAAQ,OAAO,EAAE,UAAUH,EAAM,SAAS,CAAC,IAC1DK,EAAK,cAAcF,EAAQ,KAAK;IACtC,EAAgB,QAAQG,EAAO;GACnC,QAAQ;IACJ,EAAgB,QAAQH,EAAQ,MAC3B,QAAQ,MAAM,OAAO,CAAA,CACrB,QAAQ,MAAM,MAAM,CAAA,CACpB,QAAQ,MAAM,MAAM;GA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AS,MAAM,MAAM,iBAAiB,WAC5D;;;GAID,OAAA/C,EAAA,GAAAC,EAoCM,OApCNwC,GAoCM,CAnCFvC,EAeM,OAfNwC,GAeM,CAbFxC,EAKM,OALNyC,GAKM,CAJFzC,EAAyC,QAAA,MAAAC,EAAhC4C,EAAA,OAAU,OAAO,KAAK,GAAA,CAAA,GAC/B7C,EAEO,QAFP0C,GAEOzC,EADA6C,EAAA,KAAiB,IAAA7C,EAAM8C,EAAA,KAAa,GAAA,CAAA,C,IAG/C7C,EAMoDiD,GAAA;IAL/C,MAAMhD,EAAAiD,CAAA,IAAM,kBAAA;IACZ,OAAOjD,EAAAiD,CAAA,IAASxD,EAAAA,GAAE,eAAA,IAAoBA,EAAAA,GAAE,aAAA;IACzC,WAAU;IACT,OAAOA,EAAAA,GAAE,aAAA;IACV,OAAM;IACL,SAAK,AAAA0C,EAAA,QAAA,MAAEnC,EAAAkD,CAAA,CAAI,CAACR,EAAA,OAAU,OAAO,WAAO,EAAA;;;;;G,MAE7C7C,EAkBM,OAlBN2C,GAkBM,CAhBQK,EAAA,SADVlD,EAAA,GAAAM,EAG+BC,GAAA;;IAD1B,MAAMwC,EAAA,OAAU,OAAO;IACvB,UAAUK,EAAA;G,qCAEAD,EAAA,SADfnD,EAAA,GAAAM,EAGkCE,GAAA;;IAD7B,UAAUuC,EAAA,OAAU,OAAO;IAC5B,OAAM;G,8BACV/C,EAAA,GAAAC,EAQyC,OAAA;;IANrC,OAAKQ,EAAA,CAAC,+CAA6C,E,QACWsC,EAAA,OAAU,OAAO,iBAAY,cAA2CA,EAAA,OAAU,OAAO,iBAAY,O;GAK/J,GAAA5C,EAAA4C,EAAA,OAAU,OAAO,OAAO,GAAA,CAAA,E"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { C as e, S as t, Tt as n, V as r, X as i, _ as a, f as o, g as s, gt as c, h as l, k as u, kt as d, ot as f, tt as p, v as m, w as h, wt as g, y as _, z as v } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
2
|
+
import { r as y } from "./vue-i18n-POtLvOl1.js";
|
|
3
|
+
import { n as b } from "./Chart-1vt0m6l_.js";
|
|
4
|
+
import "./src-JJyCGvqH.js";
|
|
5
|
+
import { r as x } from "./text-5F7L8EHi.js";
|
|
6
|
+
import { i as S } from "./dist-D6oUr4J_.js";
|
|
7
|
+
import { d as C, r as w } from "./index.es-DIHz5I8K.js";
|
|
8
|
+
import { t as T } from "./VvButtonLocalized-C8S7XJGv.js";
|
|
9
|
+
import { t as E } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
10
|
+
import { n as D, t as O } from "./chartFormat-B1T7y-16.js";
|
|
11
|
+
// ../../packages/components/src/chat/PkChartCard.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
u(), f(), n();
|
|
13
|
+
var k = { class: "pk-chart-card border border-surface-3 rounded-xl w-full overflow-hidden" }, A = { class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8" }, j = { class: "font-bold truncate" }, M = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "pk-chart-card__table-wrap"
|
|
16
|
+
}, N = { class: "pk-chart-card__table text-12" }, P = { scope: "col" }, F = { scope: "row" }, I = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "pk-chart-card__stage px-sm py-sm"
|
|
19
|
+
}, L = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "px-sm py-6 bg-surface-1 min-h-40 text-12 border-t border-surface-3 text-word-3"
|
|
22
|
+
}, R = /*#__PURE__*/ E(/* @__PURE__ */ h({
|
|
23
|
+
__name: "PkChartCard",
|
|
24
|
+
props: {
|
|
25
|
+
chart: { type: null },
|
|
26
|
+
caption: { type: String },
|
|
27
|
+
isDark: { type: Boolean }
|
|
28
|
+
},
|
|
29
|
+
setup(n) {
|
|
30
|
+
let u = e(() => import("./PkChart-CYFx_UDq.js")), f = n, { t: h, locale: b } = y({ useScope: "global" }), { copy: E, copied: R } = S(), z = l(() => {
|
|
31
|
+
switch (f.chart.type) {
|
|
32
|
+
case "line": return "ri:line-chart-line";
|
|
33
|
+
case "pie": return "ri:pie-chart-line";
|
|
34
|
+
case "doughnut": return "ri:donut-chart-line";
|
|
35
|
+
default: return f.chart.horizontal ? "ri:bar-chart-horizontal-line" : "ri:bar-chart-2-line";
|
|
36
|
+
}
|
|
37
|
+
}), B = c(!1), V = l(() => D(b.value, f.chart.format)), H = i("chartRef"), U = async () => {
|
|
38
|
+
let e = await H.value?.toBlob();
|
|
39
|
+
if (!e) return;
|
|
40
|
+
let t = URL.createObjectURL(e), n = document.createElement("a");
|
|
41
|
+
n.href = t, n.download = `${x(f.chart.title || "chart")}.png`, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(t);
|
|
42
|
+
};
|
|
43
|
+
return (e, i) => {
|
|
44
|
+
let c = w, l = T, f = C;
|
|
45
|
+
return v(), _("div", k, [
|
|
46
|
+
s("div", A, [
|
|
47
|
+
t(c, {
|
|
48
|
+
name: z.value,
|
|
49
|
+
class: "text-16 shrink-0"
|
|
50
|
+
}, null, 8, ["name"]),
|
|
51
|
+
s("strong", j, d(n.chart.title || g(h)("label.chart")), 1),
|
|
52
|
+
t(f, {
|
|
53
|
+
modifiers: "compact",
|
|
54
|
+
class: "pk-chart-card__actions ml-auto shrink-0"
|
|
55
|
+
}, {
|
|
56
|
+
default: p(() => [
|
|
57
|
+
t(l, {
|
|
58
|
+
modifiers: "action-quiet-small",
|
|
59
|
+
icon: B.value ? z.value : "ri:table-line",
|
|
60
|
+
label: B.value ? g(h)("chart.showChart") : g(h)("chart.showTable"),
|
|
61
|
+
onClick: i[0] ||= (e) => B.value = !B.value
|
|
62
|
+
}, null, 8, ["icon", "label"]),
|
|
63
|
+
t(l, {
|
|
64
|
+
modifiers: "action-quiet-small",
|
|
65
|
+
icon: g(R) ? "ri:check-line" : "ri:file-copy-line",
|
|
66
|
+
label: g(R) ? g(h)("action.copied") : g(h)("chart.copyData"),
|
|
67
|
+
onClick: i[1] ||= (e) => g(E)(g(O)(n.chart, g(b)))
|
|
68
|
+
}, null, 8, ["icon", "label"]),
|
|
69
|
+
B.value ? m("", !0) : (v(), a(l, {
|
|
70
|
+
key: 0,
|
|
71
|
+
modifiers: "action-quiet-small",
|
|
72
|
+
icon: "ri:download-line",
|
|
73
|
+
label: g(h)("action.download"),
|
|
74
|
+
title: g(h)("chart.downloadPng"),
|
|
75
|
+
onClick: U
|
|
76
|
+
}, null, 8, ["label", "title"]))
|
|
77
|
+
]),
|
|
78
|
+
_: 1
|
|
79
|
+
})
|
|
80
|
+
]),
|
|
81
|
+
B.value ? (v(), _("div", M, [s("table", N, [s("thead", null, [s("tr", null, [s("th", P, d(n.chart.categoryLabel ?? ""), 1), (v(!0), _(o, null, r(n.chart.series, (e) => (v(), _("th", {
|
|
82
|
+
key: e.name,
|
|
83
|
+
scope: "col"
|
|
84
|
+
}, d(e.name), 1))), 128))])]), s("tbody", null, [(v(!0), _(o, null, r(n.chart.categories, (e, t) => (v(), _("tr", { key: t }, [s("th", F, d(e), 1), (v(!0), _(o, null, r(n.chart.series, (e) => (v(), _("td", { key: e.name }, d(V.value(e.values[t] ?? null)), 1))), 128))]))), 128))])])])) : (v(), _("div", I, [t(g(u), {
|
|
85
|
+
ref_key: "chartRef",
|
|
86
|
+
ref: H,
|
|
87
|
+
chart: n.chart,
|
|
88
|
+
"is-dark": n.isDark
|
|
89
|
+
}, null, 8, ["chart", "is-dark"])])),
|
|
90
|
+
n.caption ? (v(), _("div", L, d(n.caption), 1)) : m("", !0)
|
|
91
|
+
]);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}), [["styles", [".pk-chart-card{container-type:inline-size}@container (width<30rem){.pk-chart-card__actions .vv-button__label{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}.pk-chart-card__stage{height:320px}.pk-chart-card__table-wrap{max-height:320px;overflow:auto}.pk-chart-card__table{border-collapse:collapse;width:100%}.pk-chart-card__table th,.pk-chart-card__table td{padding:var(--spacing-6) var(--spacing-sm);border-bottom:1px solid var(--color-surface-3);text-align:right;white-space:nowrap}.pk-chart-card__table th:first-child{text-align:left;white-space:normal}.pk-chart-card__table thead th{color:var(--color-word-3);font-weight:600}.pk-chart-card__table tbody th{color:var(--color-word-2);font-weight:400}.pk-chart-card__table td{color:var(--color-word);font-variant-numeric:tabular-nums}.pk-chart-card__table tbody tr:last-child>*{border-bottom:0}"]]]);
|
|
95
|
+
// ../../packages/components/src/chat/PkToolShowChart.vue?vue&type=script&setup=true&lang.ts
|
|
96
|
+
u(), n();
|
|
97
|
+
var z = {
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "flex flex-col gap-sm w-full"
|
|
100
|
+
}, B = {
|
|
101
|
+
key: 1,
|
|
102
|
+
class: "pk-tool-show-chart__loading border border-surface-3 rounded-xl w-full flex justify-center items-center"
|
|
103
|
+
}, V = {
|
|
104
|
+
key: 2,
|
|
105
|
+
class: "border border-surface-3 rounded-xl w-full text-12 text-danger py-8 px-sm"
|
|
106
|
+
}, H = /*#__PURE__*/ E(/* @__PURE__ */ h({
|
|
107
|
+
__name: "PkToolShowChart",
|
|
108
|
+
props: {
|
|
109
|
+
part: { type: null },
|
|
110
|
+
isDark: { type: Boolean }
|
|
111
|
+
},
|
|
112
|
+
setup(e) {
|
|
113
|
+
let n = e, i = l(() => n.part), s = l(() => i.value.state === "input-streaming"), c = l(() => i.value.state === "output-error"), u = l(() => {
|
|
114
|
+
if (s.value) return;
|
|
115
|
+
let e = b.safeParse(i.value.input);
|
|
116
|
+
return e.success ? e.data : void 0;
|
|
117
|
+
});
|
|
118
|
+
return (n, i) => {
|
|
119
|
+
let l = w;
|
|
120
|
+
return u.value ? (v(), _("div", z, [(v(!0), _(o, null, r(u.value.charts, (t, n) => (v(), a(R, {
|
|
121
|
+
key: n,
|
|
122
|
+
chart: t,
|
|
123
|
+
caption: n === u.value.charts.length - 1 ? u.value.caption : void 0,
|
|
124
|
+
"is-dark": e.isDark
|
|
125
|
+
}, null, 8, [
|
|
126
|
+
"chart",
|
|
127
|
+
"caption",
|
|
128
|
+
"is-dark"
|
|
129
|
+
]))), 128))])) : s.value ? (v(), _("div", B, [t(l, {
|
|
130
|
+
name: "loading-loop",
|
|
131
|
+
class: "w-24 h-24 text-word-5"
|
|
132
|
+
})])) : c.value ? m("", !0) : (v(), _("div", V, d(n.$t("message.chartRenderError")), 1));
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
}), [["styles", [".pk-tool-show-chart__loading{height:360px}"]]]);
|
|
136
|
+
export { H as default };
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=PkToolShowChart-D3E_xBJv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowChart-D3E_xBJv.js","names":["_hoisted_1","_hoisted_2","_hoisted_3","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_unref","_withCtx","_createBlock","_createCommentVNode","_Fragment","_renderList","_sfc_main","_style_0","$t","__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","PkChartCard","_createVNode","_toDisplayString","_createCommentVNode","_sfc_main","_style_0","defineAsyncComponent","createVNode","init_shared_esm_bundler","renderList","useTemplateRef","createBlock","Fragment","createBaseVNode","ref","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","withCtx","createCommentVNode","defineComponent","unref","createElementBlock","openBlock","useI18n","ShowChartInputSchema","toSnakeCase","useClipboard","ou","Ee","VvButtonLocalized","_plugin_vue_export_helper_default","chartValueFormatter","chartAsTsv","_hoisted_1$1","_hoisted_2$1","_hoisted_3$1","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","PkChartCard_default","PkChart","props","__props","$t","icon","showTable","format","locale","chartRef","downloadPng","blob","url","anchor","_component_VvIcon","_component_VvButton","_component_VvButtonGroup","_cache","copied","copy","series","i","category","_hoisted_1","_hoisted_2","_hoisted_3","PkToolShowChart_default","toolPart","streaming","refused","input","parsed","_ctx"],"sources":["../../../../packages/components/src/chat/PkChartCard.vue","../../../../packages/components/src/chat/PkChartCard.vue","../../../../packages/components/src/chat/PkChartCard.vue","../../../../packages/components/src/chat/PkToolShowChart.vue","../../../../packages/components/src/chat/PkToolShowChart.vue","../../../../packages/components/src/chat/PkToolShowChart.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, defineAsyncComponent, ref, useTemplateRef } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import type { Chart } from 'models'\n import { toSnakeCase } from 'utils'\n import { chartAsTsv, chartValueFormatter } from './chartFormat'\n\n // Chart.js comes with it: a separate chunk, loaded with the first chart\n const PkChart = defineAsyncComponent(() => import('./PkChart.vue'))\n\n /**\n * One chart of `showChart` (spec `chat-charts.md`) in its card: the chart,\n * the same numbers as a table, \"Copy data\" for a sheet and the chart as a\n * PNG.\n */\n const props = defineProps<{\n chart: Chart\n /** A note below the chart, e.g. the source of the numbers. */\n caption?: string\n isDark?: boolean\n }>()\n\n const { t: $t, locale } = useI18n({ useScope: 'global' })\n const { copy, copied } = useClipboard()\n\n const icon = computed(() => {\n switch (props.chart.type) {\n case 'line':\n return 'ri:line-chart-line'\n case 'pie':\n return 'ri:pie-chart-line'\n case 'doughnut':\n return 'ri:donut-chart-line'\n default:\n return props.chart.horizontal\n ? 'ri:bar-chart-horizontal-line'\n : 'ri:bar-chart-2-line'\n }\n })\n\n const showTable = ref(false)\n const format = computed(() =>\n chartValueFormatter(locale.value, props.chart.format),\n )\n\n const chartRef = useTemplateRef<{ toBlob: () => Promise<Blob | null> }>(\n 'chartRef',\n )\n const downloadPng = async () => {\n const blob = await chartRef.value?.toBlob()\n if (!blob) {\n return\n }\n const url = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = `${toSnakeCase(props.chart.title || 'chart')}.png`\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n URL.revokeObjectURL(url)\n }\n</script>\n\n<template>\n <div\n class=\"pk-chart-card border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon :name=\"icon\" class=\"text-16 shrink-0\" />\n <strong class=\"font-bold truncate\">\n {{ chart.title || $t('label.chart') }}\n </strong>\n <VvButtonGroup\n modifiers=\"compact\"\n class=\"pk-chart-card__actions ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"showTable ? icon : 'ri:table-line'\"\n :label=\"\n showTable\n ? $t('chart.showChart')\n : $t('chart.showTable')\n \"\n @click=\"showTable = !showTable\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('chart.copyData')\"\n @click=\"copy(chartAsTsv(chart, locale))\" />\n <VvButton\n v-if=\"!showTable\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :label=\"$t('action.download')\"\n :title=\"$t('chart.downloadPng')\"\n @click=\"downloadPng\" />\n </VvButtonGroup>\n </div>\n <div v-if=\"showTable\" class=\"pk-chart-card__table-wrap\">\n <table class=\"pk-chart-card__table text-12\">\n <thead>\n <tr>\n <th scope=\"col\">{{ chart.categoryLabel ?? '' }}</th>\n <th\n v-for=\"series in chart.series\"\n :key=\"series.name\"\n scope=\"col\">\n {{ series.name }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(category, i) in chart.categories\" :key=\"i\">\n <th scope=\"row\">{{ category }}</th>\n <td v-for=\"series in chart.series\" :key=\"series.name\">\n {{ format(series.values[i] ?? null) }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div v-else class=\"pk-chart-card__stage px-sm py-sm\">\n <PkChart ref=\"chartRef\" :chart :is-dark />\n </div>\n <div\n v-if=\"caption\"\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-t border-surface-3 text-word-3\">\n {{ caption }}\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chart-card {\n // A container for the narrow card below. It is also the containing\n // block of any `position: fixed` inside it, so a menu added here\n // must open in the top layer (docs/agents/gotchas/frontend.md, \"The\n // chat measures its own width\"): today the card has none.\n container-type: inline-size;\n\n // On a narrow card the actions keep their icon and lose the word on\n // screen, still read by a screen reader: the title keeps the room\n // (at 390px it was cut to \"Fattori di ...\")\n @container (width < 30rem) {\n &__actions .vv-button__label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n }\n\n // A fixed stage, as the diagram's: the chart loads in a chunk of its\n // own, and loader and chart must take the same room or the chat's\n // scroll jumps\n &__stage {\n height: 320px;\n }\n\n &__table-wrap {\n max-height: 320px;\n overflow: auto;\n }\n\n &__table {\n width: 100%;\n border-collapse: collapse;\n\n th,\n td {\n padding: var(--spacing-6) var(--spacing-sm);\n border-bottom: 1px solid var(--color-surface-3);\n text-align: right;\n white-space: nowrap;\n }\n\n th:first-child {\n text-align: left;\n white-space: normal;\n }\n\n thead th {\n color: var(--color-word-3);\n font-weight: 600;\n }\n\n tbody th {\n color: var(--color-word-2);\n font-weight: 400;\n }\n\n td {\n color: var(--color-word);\n font-variant-numeric: tabular-nums;\n }\n\n tbody tr:last-child > * {\n border-bottom: 0;\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed, defineAsyncComponent, ref, useTemplateRef } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import type { Chart } from 'models'\n import { toSnakeCase } from 'utils'\n import { chartAsTsv, chartValueFormatter } from './chartFormat'\n\n // Chart.js comes with it: a separate chunk, loaded with the first chart\n const PkChart = defineAsyncComponent(() => import('./PkChart.vue'))\n\n /**\n * One chart of `showChart` (spec `chat-charts.md`) in its card: the chart,\n * the same numbers as a table, \"Copy data\" for a sheet and the chart as a\n * PNG.\n */\n const props = defineProps<{\n chart: Chart\n /** A note below the chart, e.g. the source of the numbers. */\n caption?: string\n isDark?: boolean\n }>()\n\n const { t: $t, locale } = useI18n({ useScope: 'global' })\n const { copy, copied } = useClipboard()\n\n const icon = computed(() => {\n switch (props.chart.type) {\n case 'line':\n return 'ri:line-chart-line'\n case 'pie':\n return 'ri:pie-chart-line'\n case 'doughnut':\n return 'ri:donut-chart-line'\n default:\n return props.chart.horizontal\n ? 'ri:bar-chart-horizontal-line'\n : 'ri:bar-chart-2-line'\n }\n })\n\n const showTable = ref(false)\n const format = computed(() =>\n chartValueFormatter(locale.value, props.chart.format),\n )\n\n const chartRef = useTemplateRef<{ toBlob: () => Promise<Blob | null> }>(\n 'chartRef',\n )\n const downloadPng = async () => {\n const blob = await chartRef.value?.toBlob()\n if (!blob) {\n return\n }\n const url = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = `${toSnakeCase(props.chart.title || 'chart')}.png`\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n URL.revokeObjectURL(url)\n }\n</script>\n\n<template>\n <div\n class=\"pk-chart-card border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon :name=\"icon\" class=\"text-16 shrink-0\" />\n <strong class=\"font-bold truncate\">\n {{ chart.title || $t('label.chart') }}\n </strong>\n <VvButtonGroup\n modifiers=\"compact\"\n class=\"pk-chart-card__actions ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"showTable ? icon : 'ri:table-line'\"\n :label=\"\n showTable\n ? $t('chart.showChart')\n : $t('chart.showTable')\n \"\n @click=\"showTable = !showTable\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('chart.copyData')\"\n @click=\"copy(chartAsTsv(chart, locale))\" />\n <VvButton\n v-if=\"!showTable\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :label=\"$t('action.download')\"\n :title=\"$t('chart.downloadPng')\"\n @click=\"downloadPng\" />\n </VvButtonGroup>\n </div>\n <div v-if=\"showTable\" class=\"pk-chart-card__table-wrap\">\n <table class=\"pk-chart-card__table text-12\">\n <thead>\n <tr>\n <th scope=\"col\">{{ chart.categoryLabel ?? '' }}</th>\n <th\n v-for=\"series in chart.series\"\n :key=\"series.name\"\n scope=\"col\">\n {{ series.name }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(category, i) in chart.categories\" :key=\"i\">\n <th scope=\"row\">{{ category }}</th>\n <td v-for=\"series in chart.series\" :key=\"series.name\">\n {{ format(series.values[i] ?? null) }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div v-else class=\"pk-chart-card__stage px-sm py-sm\">\n <PkChart ref=\"chartRef\" :chart :is-dark />\n </div>\n <div\n v-if=\"caption\"\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-t border-surface-3 text-word-3\">\n {{ caption }}\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chart-card {\n // A container for the narrow card below. It is also the containing\n // block of any `position: fixed` inside it, so a menu added here\n // must open in the top layer (docs/agents/gotchas/frontend.md, \"The\n // chat measures its own width\"): today the card has none.\n container-type: inline-size;\n\n // On a narrow card the actions keep their icon and lose the word on\n // screen, still read by a screen reader: the title keeps the room\n // (at 390px it was cut to \"Fattori di ...\")\n @container (width < 30rem) {\n &__actions .vv-button__label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n }\n\n // A fixed stage, as the diagram's: the chart loads in a chunk of its\n // own, and loader and chart must take the same room or the chat's\n // scroll jumps\n &__stage {\n height: 320px;\n }\n\n &__table-wrap {\n max-height: 320px;\n overflow: auto;\n }\n\n &__table {\n width: 100%;\n border-collapse: collapse;\n\n th,\n td {\n padding: var(--spacing-6) var(--spacing-sm);\n border-bottom: 1px solid var(--color-surface-3);\n text-align: right;\n white-space: nowrap;\n }\n\n th:first-child {\n text-align: left;\n white-space: normal;\n }\n\n thead th {\n color: var(--color-word-3);\n font-weight: 600;\n }\n\n tbody th {\n color: var(--color-word-2);\n font-weight: 400;\n }\n\n td {\n color: var(--color-word);\n font-variant-numeric: tabular-nums;\n }\n\n tbody tr:last-child > * {\n border-bottom: 0;\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed, defineAsyncComponent, ref, useTemplateRef } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useI18n } from 'vue-i18n'\n import type { Chart } from 'models'\n import { toSnakeCase } from 'utils'\n import { chartAsTsv, chartValueFormatter } from './chartFormat'\n\n // Chart.js comes with it: a separate chunk, loaded with the first chart\n const PkChart = defineAsyncComponent(() => import('./PkChart.vue'))\n\n /**\n * One chart of `showChart` (spec `chat-charts.md`) in its card: the chart,\n * the same numbers as a table, \"Copy data\" for a sheet and the chart as a\n * PNG.\n */\n const props = defineProps<{\n chart: Chart\n /** A note below the chart, e.g. the source of the numbers. */\n caption?: string\n isDark?: boolean\n }>()\n\n const { t: $t, locale } = useI18n({ useScope: 'global' })\n const { copy, copied } = useClipboard()\n\n const icon = computed(() => {\n switch (props.chart.type) {\n case 'line':\n return 'ri:line-chart-line'\n case 'pie':\n return 'ri:pie-chart-line'\n case 'doughnut':\n return 'ri:donut-chart-line'\n default:\n return props.chart.horizontal\n ? 'ri:bar-chart-horizontal-line'\n : 'ri:bar-chart-2-line'\n }\n })\n\n const showTable = ref(false)\n const format = computed(() =>\n chartValueFormatter(locale.value, props.chart.format),\n )\n\n const chartRef = useTemplateRef<{ toBlob: () => Promise<Blob | null> }>(\n 'chartRef',\n )\n const downloadPng = async () => {\n const blob = await chartRef.value?.toBlob()\n if (!blob) {\n return\n }\n const url = URL.createObjectURL(blob)\n const anchor = document.createElement('a')\n anchor.href = url\n anchor.download = `${toSnakeCase(props.chart.title || 'chart')}.png`\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n URL.revokeObjectURL(url)\n }\n</script>\n\n<template>\n <div\n class=\"pk-chart-card border border-surface-3 rounded-xl w-full overflow-hidden\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8\">\n <VvIcon :name=\"icon\" class=\"text-16 shrink-0\" />\n <strong class=\"font-bold truncate\">\n {{ chart.title || $t('label.chart') }}\n </strong>\n <VvButtonGroup\n modifiers=\"compact\"\n class=\"pk-chart-card__actions ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"showTable ? icon : 'ri:table-line'\"\n :label=\"\n showTable\n ? $t('chart.showChart')\n : $t('chart.showTable')\n \"\n @click=\"showTable = !showTable\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('chart.copyData')\"\n @click=\"copy(chartAsTsv(chart, locale))\" />\n <VvButton\n v-if=\"!showTable\"\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :label=\"$t('action.download')\"\n :title=\"$t('chart.downloadPng')\"\n @click=\"downloadPng\" />\n </VvButtonGroup>\n </div>\n <div v-if=\"showTable\" class=\"pk-chart-card__table-wrap\">\n <table class=\"pk-chart-card__table text-12\">\n <thead>\n <tr>\n <th scope=\"col\">{{ chart.categoryLabel ?? '' }}</th>\n <th\n v-for=\"series in chart.series\"\n :key=\"series.name\"\n scope=\"col\">\n {{ series.name }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(category, i) in chart.categories\" :key=\"i\">\n <th scope=\"row\">{{ category }}</th>\n <td v-for=\"series in chart.series\" :key=\"series.name\">\n {{ format(series.values[i] ?? null) }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div v-else class=\"pk-chart-card__stage px-sm py-sm\">\n <PkChart ref=\"chartRef\" :chart :is-dark />\n </div>\n <div\n v-if=\"caption\"\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-t border-surface-3 text-word-3\">\n {{ caption }}\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chart-card {\n // A container for the narrow card below. It is also the containing\n // block of any `position: fixed` inside it, so a menu added here\n // must open in the top layer (docs/agents/gotchas/frontend.md, \"The\n // chat measures its own width\"): today the card has none.\n container-type: inline-size;\n\n // On a narrow card the actions keep their icon and lose the word on\n // screen, still read by a screen reader: the title keeps the room\n // (at 390px it was cut to \"Fattori di ...\")\n @container (width < 30rem) {\n &__actions .vv-button__label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n }\n }\n\n // A fixed stage, as the diagram's: the chart loads in a chunk of its\n // own, and loader and chart must take the same room or the chat's\n // scroll jumps\n &__stage {\n height: 320px;\n }\n\n &__table-wrap {\n max-height: 320px;\n overflow: auto;\n }\n\n &__table {\n width: 100%;\n border-collapse: collapse;\n\n th,\n td {\n padding: var(--spacing-6) var(--spacing-sm);\n border-bottom: 1px solid var(--color-surface-3);\n text-align: right;\n white-space: nowrap;\n }\n\n th:first-child {\n text-align: left;\n white-space: normal;\n }\n\n thead th {\n color: var(--color-word-3);\n font-weight: 600;\n }\n\n tbody th {\n color: var(--color-word-2);\n font-weight: 400;\n }\n\n td {\n color: var(--color-word);\n font-variant-numeric: tabular-nums;\n }\n\n tbody tr:last-child > * {\n border-bottom: 0;\n }\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { ShowChartInputSchema } from 'models'\n import PkChartCard from './PkChartCard.vue'\n\n /**\n * The cards of `showChart` (spec `chat-charts.md`): every chart of the\n * call in its own card, one under the other, the caption under the last.\n */\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n }>()\n\n const toolPart = computed(\n () => props.part as { state?: string; input?: unknown },\n )\n // A half-written input has series shorter than the categories\n const streaming = computed(() => toolPart.value.state === 'input-streaming')\n // A call the tool refused for its input: the model reads why and calls\n // again, and the corrected chart follows it. Nothing to show here.\n const refused = computed(() => toolPart.value.state === 'output-error')\n /** The input as the tool validated it; a stored one that is not stays a message. */\n const input = computed(() => {\n if (streaming.value) {\n return undefined\n }\n const parsed = ShowChartInputSchema.safeParse(toolPart.value.input)\n return parsed.success ? parsed.data : undefined\n })\n</script>\n\n<template>\n <div v-if=\"input\" class=\"flex flex-col gap-sm w-full\">\n <PkChartCard\n v-for=\"(chart, i) in input.charts\"\n :key=\"i\"\n :chart\n :caption=\"i === input.charts.length - 1 ? input.caption : undefined\"\n :is-dark />\n </div>\n <div\n v-else-if=\"streaming\"\n class=\"pk-tool-show-chart__loading border border-surface-3 rounded-xl w-full flex justify-center items-center\">\n <VvIcon name=\"loading-loop\" class=\"w-24 h-24 text-word-5\" />\n </div>\n <div\n v-else-if=\"!refused\"\n class=\"border border-surface-3 rounded-xl w-full text-12 text-danger py-8 px-sm\">\n {{ $t('message.chartRenderError') }}\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-tool-show-chart {\n // The height of a card while the call is written: the card that\n // replaces it takes about as much, and the chat's scroll stays put\n &__loading {\n height: 360px;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { ShowChartInputSchema } from 'models'\n import PkChartCard from './PkChartCard.vue'\n\n /**\n * The cards of `showChart` (spec `chat-charts.md`): every chart of the\n * call in its own card, one under the other, the caption under the last.\n */\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n }>()\n\n const toolPart = computed(\n () => props.part as { state?: string; input?: unknown },\n )\n // A half-written input has series shorter than the categories\n const streaming = computed(() => toolPart.value.state === 'input-streaming')\n // A call the tool refused for its input: the model reads why and calls\n // again, and the corrected chart follows it. Nothing to show here.\n const refused = computed(() => toolPart.value.state === 'output-error')\n /** The input as the tool validated it; a stored one that is not stays a message. */\n const input = computed(() => {\n if (streaming.value) {\n return undefined\n }\n const parsed = ShowChartInputSchema.safeParse(toolPart.value.input)\n return parsed.success ? parsed.data : undefined\n })\n</script>\n\n<template>\n <div v-if=\"input\" class=\"flex flex-col gap-sm w-full\">\n <PkChartCard\n v-for=\"(chart, i) in input.charts\"\n :key=\"i\"\n :chart\n :caption=\"i === input.charts.length - 1 ? input.caption : undefined\"\n :is-dark />\n </div>\n <div\n v-else-if=\"streaming\"\n class=\"pk-tool-show-chart__loading border border-surface-3 rounded-xl w-full flex justify-center items-center\">\n <VvIcon name=\"loading-loop\" class=\"w-24 h-24 text-word-5\" />\n </div>\n <div\n v-else-if=\"!refused\"\n class=\"border border-surface-3 rounded-xl w-full text-12 text-danger py-8 px-sm\">\n {{ $t('message.chartRenderError') }}\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-tool-show-chart {\n // The height of a card while the call is written: the card that\n // replaces it takes about as much, and the chat's scroll stays put\n &__loading {\n height: 360px;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { ShowChartInputSchema } from 'models'\n import PkChartCard from './PkChartCard.vue'\n\n /**\n * The cards of `showChart` (spec `chat-charts.md`): every chart of the\n * call in its own card, one under the other, the caption under the last.\n */\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n }>()\n\n const toolPart = computed(\n () => props.part as { state?: string; input?: unknown },\n )\n // A half-written input has series shorter than the categories\n const streaming = computed(() => toolPart.value.state === 'input-streaming')\n // A call the tool refused for its input: the model reads why and calls\n // again, and the corrected chart follows it. Nothing to show here.\n const refused = computed(() => toolPart.value.state === 'output-error')\n /** The input as the tool validated it; a stored one that is not stays a message. */\n const input = computed(() => {\n if (streaming.value) {\n return undefined\n }\n const parsed = ShowChartInputSchema.safeParse(toolPart.value.input)\n return parsed.success ? parsed.data : undefined\n })\n</script>\n\n<template>\n <div v-if=\"input\" class=\"flex flex-col gap-sm w-full\">\n <PkChartCard\n v-for=\"(chart, i) in input.charts\"\n :key=\"i\"\n :chart\n :caption=\"i === input.charts.length - 1 ? input.caption : undefined\"\n :is-dark />\n </div>\n <div\n v-else-if=\"streaming\"\n class=\"pk-tool-show-chart__loading border border-surface-3 rounded-xl w-full flex justify-center items-center\">\n <VvIcon name=\"loading-loop\" class=\"w-24 h-24 text-word-5\" />\n </div>\n <div\n v-else-if=\"!refused\"\n class=\"border border-surface-3 rounded-xl w-full text-12 text-danger py-8 px-sm\">\n {{ $t('message.chartRenderError') }}\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-tool-show-chart {\n // The height of a card while the call is written: the card that\n // replaces it takes about as much, and the chat's scroll stays put\n &__loading {\n height: 360px;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASI,IAAMuE,IAAUvC,QAA2B,OAAO,wBAAgB,GAO5DwC,IAAQC,GAOR,EAAE,GAAGC,GAAI,cAAWvB,EAAQ,EAAE,UAAU,SAAS,CAAC,GAClD,EAAE,SAAM,cAAWG,EAAa,GAEhCqB,IAAOlC,QAAe;GACxB,QAAQ+B,EAAM,MAAM,MAApB;IACI,KAAK,QACD,OAAO;IACX,KAAK,OACD,OAAO;IACX,KAAK,YACD,OAAO;IACX,SACI,OAAOA,EAAM,MAAM,aACb,iCACA;GACd;EACJ,CAAC,GAEKI,IAAYpC,EAAI,EAAK,GACrBqC,IAASpC,QACXkB,EAAoBmB,EAAO,OAAON,EAAM,MAAM,MAAM,CACxD,GAEMO,IAAW3C,EACb,UACJ,GACM4C,IAAc,YAAY;GAC5B,IAAMC,IAAO,MAAMF,EAAS,OAAO,OAAO;GAC1C,IAAI,CAACE,GACD;GAEJ,IAAMC,IAAM,IAAI,gBAAgBD,CAAI,GAC9BE,IAAS,SAAS,cAAc,GAAG;GAMzC,AALA,EAAO,OAAOD,GACd,EAAO,WAAW,GAAG7B,EAAYmB,EAAM,MAAM,SAAS,OAAO,EAAE,OAC/D,SA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AS,MAAM,UAAU,cAAc,GAEhEG,IAAQ3D,QAAe;GACzB,IAAIyD,EAAU,OACV;GAEJ,IAAMG,IAASjD,EAAqB,UAAU6C,EAAS,MAAM,KAAK;GAClE,OAAOI,EAAO,UAAUA,EAAO,OAAO,KAAA;EAC1C,CAAC;;;GAIU,OAAAD,EAAA,SAAX/E,EAAA,GAAAC,EAOM,OAPNuE,GAOM,EANFxE,EAAA,EAAA,GAAAC,EAKeC,GAAA,MAAAC,EAJU4E,EAAA,MAAM,SAAnB,GAAO,OADnB/E,EAAA,GAAAI,EAKeC,GAAA;IAHV,KAAKiE;IACL;IACA,SAASA,MAAMS,EAAA,MAAM,OAAO,SAAM,IAAOA,EAAA,MAAM,UAAU,KAAA;IACzD,WAAA3B,EAAA;;;;;G,iBAGMyB,EAAA,SADf7E,EAAA,GAAAC,EAIM,OAJNwE,GAIM,CADFnE,EAA4DyD,GAAA;IAApD,MAAK;IAAe,OAAM;G,QAGtBe,EAAA,Q,aADhB9E,EAAA,GAAAC,EAIM,OAJNyE,GAIMnE,EADCT,EAAAA,GAAE,0BAAA,CAAA,GAAA,CAAA"}
|
package/dist/_chunks/{PkToolShowContactForm-BAM772bm.js → PkToolShowContactForm-BhcM-Z6m.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as e, b as t, d as n } from "./zod-Cty6wiWN.js";
|
|
2
2
|
import { Q as r, S as i, Tt as a, V as o, _ as s, f as ee, g as c, h as l, k as u, kt as d, ot as f, r as p, t as m, tt as h, ut as g, v as _, w as v, wt as y, x as b, y as x, z as S } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
3
3
|
import { r as C } from "./vue-i18n-POtLvOl1.js";
|
|
4
|
-
import { t as w } from "./PkStreamingMarkdown-
|
|
4
|
+
import { t as w } from "./PkStreamingMarkdown-DZvLHy2l.js";
|
|
5
5
|
import { t as T } from "./src-JJyCGvqH.js";
|
|
6
6
|
import { a as E, r as D } from "./index.es-DIHz5I8K.js";
|
|
7
7
|
import { t as O } from "./VvButtonLocalized-C8S7XJGv.js";
|
|
@@ -154,4 +154,4 @@ var M = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
154
154
|
});
|
|
155
155
|
export { K as default };
|
|
156
156
|
|
|
157
|
-
//# sourceMappingURL=PkToolShowContactForm-
|
|
157
|
+
//# sourceMappingURL=PkToolShowContactForm-BhcM-Z6m.js.map
|
package/dist/_chunks/{PkToolShowContactForm-BAM772bm.js.map → PkToolShowContactForm-BhcM-Z6m.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowContactForm-BAM772bm.js","names":["z.object","z.string","z.email","useForm","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_unref","_Transition","_withCtx","_Fragment","_renderList","_createCommentVNode","_isRef","_createBlock","_createTextVNode","PkStreamingMarkdown","_sfc_main","object","string","email","watch","createVNode","init_shared_esm_bundler","renderList","createBlock","Fragment","createBaseVNode","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","init_runtime_dom_esm_bundler","Transition","withCtx","isRef","createCommentVNode","defineComponent","unref","createTextVNode","createElementBlock","openBlock","useI18n","PkStreamingMarkdown_default","formatPhoneNumber","ao","Ee","VvButtonLocalized","useLocalizedString","useSafeLocalStorage","Se","_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","PkToolShowContactForm_default","__emit","$t","props","__props","toolPart","input","prefilled","value","field","localSubmitted","LeadFormSchema","emit","newInput","submitted","isSubmitted","submitLead","data","privacyNotice","_component_VvIcon","_component_VvAlert","_component_VvButton","VvForm","formData","_cache","$event","VvFormField"],"sources":["../../../../packages/components/src/chat/PkToolShowContactForm.vue","../../../../packages/components/src/chat/PkToolShowContactForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import { formatPhoneNumber } from 'utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n /**\n * A conversation read back (the chat logs): the card is the record\n * of the form the agent showed, its prefilled values as text. Nothing\n * in the part says whether the visitor sent it, only the contacts do.\n */\n record?: boolean\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const prefilled = computed(() =>\n (\n [\n { name: 'name', label: $t('label.name') },\n { name: 'email', label: $t('label.email') },\n { name: 'phone', label: $t('label.phone') },\n ] as const\n )\n .map((field) => {\n const value = input.value?.[field.name]?.trim()\n return {\n ...field,\n // Written as the contacts page writes it\n value:\n field.name === 'phone' && value\n ? formatPhoneNumber(value) || value\n : value,\n }\n })\n .filter((field) => field.value),\n )\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"record\" class=\"p-sm flex flex-col gap-sm text-14\">\n <p class=\"text-word-2\">\n {{\n prefilled.length\n ? $t('message.contactFormRecordPrefilled')\n : $t('message.contactFormRecord')\n }}\n </p>\n <dl\n v-if=\"prefilled.length\"\n class=\"flex flex-wrap gap-x-lg gap-y-sm\">\n <div\n v-for=\"field in prefilled\"\n :key=\"field.name\"\n class=\"flex flex-col gap-4 min-w-0\">\n <dt class=\"text-12 text-word-3\">{{ field.label }}</dt>\n <dd class=\"text-word-1 break-words\">\n {{ field.value }}\n </dd>\n </div>\n </dl>\n </div>\n <div v-else-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <!-- A send that failed says so: the reason reached the\n card and was never drawn -->\n <VvAlert v-if=\"error\" modifiers=\"danger\" class=\"mb-md\">\n {{ error }}\n </VvAlert>\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import { formatPhoneNumber } from 'utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n /**\n * A conversation read back (the chat logs): the card is the record\n * of the form the agent showed, its prefilled values as text. Nothing\n * in the part says whether the visitor sent it, only the contacts do.\n */\n record?: boolean\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const prefilled = computed(() =>\n (\n [\n { name: 'name', label: $t('label.name') },\n { name: 'email', label: $t('label.email') },\n { name: 'phone', label: $t('label.phone') },\n ] as const\n )\n .map((field) => {\n const value = input.value?.[field.name]?.trim()\n return {\n ...field,\n // Written as the contacts page writes it\n value:\n field.name === 'phone' && value\n ? formatPhoneNumber(value) || value\n : value,\n }\n })\n .filter((field) => field.value),\n )\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"record\" class=\"p-sm flex flex-col gap-sm text-14\">\n <p class=\"text-word-2\">\n {{\n prefilled.length\n ? $t('message.contactFormRecordPrefilled')\n : $t('message.contactFormRecord')\n }}\n </p>\n <dl\n v-if=\"prefilled.length\"\n class=\"flex flex-wrap gap-x-lg gap-y-sm\">\n <div\n v-for=\"field in prefilled\"\n :key=\"field.name\"\n class=\"flex flex-col gap-4 min-w-0\">\n <dt class=\"text-12 text-word-3\">{{ field.label }}</dt>\n <dd class=\"text-word-1 break-words\">\n {{ field.value }}\n </dd>\n </div>\n </dl>\n </div>\n <div v-else-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <!-- A send that failed says so: the reason reached the\n card and was never drawn -->\n <VvAlert v-if=\"error\" modifiers=\"danger\" class=\"mb-md\">\n {{ error }}\n </VvAlert>\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUI,IAAM,EAAE,GAAGyE,MAAO1B,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1C2B,IAAQC,GAeRC,IAAW3C,QACAyC,EAAM,IAWtB,GAEKG,IAAQ5C,QAAe2C,EAAS,MAAM,KAAK,GAE3CE,IAAY7C,QAEV;GACI;IAAE,MAAM;IAAQ,OAAOwC,EAAG,YAAY;GAAE;GACxC;IAAE,MAAM;IAAS,OAAOA,EAAG,aAAa;GAAE;GAC1C;IAAE,MAAM;IAAS,OAAOA,EAAG,aAAa;GAAE;EAC9C,CAAC,CAEA,KAAK,MAA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kToolShowContactForm-BhcM-Z6m.js","names":["z.object","z.string","z.email","useForm","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_unref","_Transition","_withCtx","_Fragment","_renderList","_createCommentVNode","_isRef","_createBlock","_createTextVNode","PkStreamingMarkdown","_sfc_main","object","string","email","watch","createVNode","init_shared_esm_bundler","renderList","createBlock","Fragment","createBaseVNode","computed","init_runtime_core_esm_bundler","toDisplayString","init_reactivity_esm_bundler","init_runtime_dom_esm_bundler","Transition","withCtx","isRef","createCommentVNode","defineComponent","unref","createTextVNode","createElementBlock","openBlock","useI18n","PkStreamingMarkdown_default","formatPhoneNumber","ao","Ee","VvButtonLocalized","useLocalizedString","useSafeLocalStorage","Se","_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","PkToolShowContactForm_default","__emit","$t","props","__props","toolPart","input","prefilled","value","field","localSubmitted","LeadFormSchema","emit","newInput","submitted","isSubmitted","submitLead","data","privacyNotice","_component_VvIcon","_component_VvAlert","_component_VvButton","VvForm","formData","_cache","$event","VvFormField"],"sources":["../../../../packages/components/src/chat/PkToolShowContactForm.vue","../../../../packages/components/src/chat/PkToolShowContactForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import { formatPhoneNumber } from 'utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n /**\n * A conversation read back (the chat logs): the card is the record\n * of the form the agent showed, its prefilled values as text. Nothing\n * in the part says whether the visitor sent it, only the contacts do.\n */\n record?: boolean\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const prefilled = computed(() =>\n (\n [\n { name: 'name', label: $t('label.name') },\n { name: 'email', label: $t('label.email') },\n { name: 'phone', label: $t('label.phone') },\n ] as const\n )\n .map((field) => {\n const value = input.value?.[field.name]?.trim()\n return {\n ...field,\n // Written as the contacts page writes it\n value:\n field.name === 'phone' && value\n ? formatPhoneNumber(value) || value\n : value,\n }\n })\n .filter((field) => field.value),\n )\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"record\" class=\"p-sm flex flex-col gap-sm text-14\">\n <p class=\"text-word-2\">\n {{\n prefilled.length\n ? $t('message.contactFormRecordPrefilled')\n : $t('message.contactFormRecord')\n }}\n </p>\n <dl\n v-if=\"prefilled.length\"\n class=\"flex flex-wrap gap-x-lg gap-y-sm\">\n <div\n v-for=\"field in prefilled\"\n :key=\"field.name\"\n class=\"flex flex-col gap-4 min-w-0\">\n <dt class=\"text-12 text-word-3\">{{ field.label }}</dt>\n <dd class=\"text-word-1 break-words\">\n {{ field.value }}\n </dd>\n </div>\n </dl>\n </div>\n <div v-else-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <!-- A send that failed says so: the reason reached the\n card and was never drawn -->\n <VvAlert v-if=\"error\" modifiers=\"danger\" class=\"mb-md\">\n {{ error }}\n </VvAlert>\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import { useForm } from '@volverjs/form-vue'\n import * as z from 'zod'\n import { useSafeLocalStorage, useLocalizedString } from 'composables'\n import type { LocalizedString } from 'models'\n import { formatPhoneNumber } from 'utils'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const props = defineProps<{\n part: unknown\n submitted?: boolean\n loading?: boolean\n error?: string\n readonly?: boolean\n privacyPolicyNotice?: LocalizedString\n /**\n * A conversation read back (the chat logs): the card is the record\n * of the form the agent showed, its prefilled values as text. Nothing\n * in the part says whether the visitor sent it, only the contacts do.\n */\n record?: boolean\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n type: string\n toolCallId: string\n input?: {\n name: string\n email: string\n phone?: string\n conversationContext?: Record<string, unknown>\n }\n }\n return part\n })\n\n const input = computed(() => toolPart.value.input)\n\n const prefilled = computed(() =>\n (\n [\n { name: 'name', label: $t('label.name') },\n { name: 'email', label: $t('label.email') },\n { name: 'phone', label: $t('label.phone') },\n ] as const\n )\n .map((field) => {\n const value = input.value?.[field.name]?.trim()\n return {\n ...field,\n // Written as the contacts page writes it\n value:\n field.name === 'phone' && value\n ? formatPhoneNumber(value) || value\n : value,\n }\n })\n .filter((field) => field.value),\n )\n\n const localSubmitted = useSafeLocalStorage<boolean>(\n computed(\n () =>\n `${toolPart.value.toolCallId}-${toolPart.value.type}-submitted`,\n ),\n false,\n )\n\n const LeadFormSchema = z.object({\n name: z.string().min(1).max(255).default(''),\n email: z.email().max(255).default(''),\n phone: z\n .string()\n .max(50)\n .regex(/^[+0-9\\s\\-.()]*$/, $t('validation.invalidPhoneNumber'))\n .optional(),\n })\n\n const emit = defineEmits<{\n submit: [data: Record<string, unknown>]\n }>()\n\n const { VvForm, VvFormField, formData } = useForm(LeadFormSchema, {\n lazyLoad: true,\n })\n\n // Pre-populate form with input values\n watch(\n input,\n (newInput) => {\n formData.value = {\n name: newInput?.name || '',\n email: newInput?.email || '',\n phone: newInput?.phone || '',\n }\n },\n { immediate: true },\n )\n\n watch(\n () => props.submitted,\n (submitted) => {\n if (submitted) {\n localSubmitted.value = true\n }\n },\n { immediate: true },\n )\n\n const isSubmitted = computed(() => {\n return props.submitted || localSubmitted.value\n })\n\n const submitLead = async (data: Record<string, unknown>): Promise<void> => {\n emit('submit', { ...data, metadata: input.value?.conversationContext })\n }\n\n const privacyNotice = useLocalizedString(\n () => props.privacyPolicyNotice,\n 'message.defaultPrivacyPolicyNotice',\n )\n</script>\n\n<template>\n <div\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\n <div\n class=\"px-sm py-6 bg-surface-1 min-h-40 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:send-plane-2-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.contactUs') }}</strong>\n </div>\n\n <Transition mode=\"out-in\">\n <div v-if=\"record\" class=\"p-sm flex flex-col gap-sm text-14\">\n <p class=\"text-word-2\">\n {{\n prefilled.length\n ? $t('message.contactFormRecordPrefilled')\n : $t('message.contactFormRecord')\n }}\n </p>\n <dl\n v-if=\"prefilled.length\"\n class=\"flex flex-wrap gap-x-lg gap-y-sm\">\n <div\n v-for=\"field in prefilled\"\n :key=\"field.name\"\n class=\"flex flex-col gap-4 min-w-0\">\n <dt class=\"text-12 text-word-3\">{{ field.label }}</dt>\n <dd class=\"text-word-1 break-words\">\n {{ field.value }}\n </dd>\n </div>\n </dl>\n </div>\n <div v-else-if=\"!isSubmitted\" class=\"p-sm\">\n <VvForm v-model=\"formData\" :readonly @submit=\"submitLead\">\n <VvFormField\n name=\"name\"\n type=\"text\"\n :label=\"$t('label.name')\"\n :placeholder=\"$t('placeholder.name')\"\n icon=\"ri:user-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"email\"\n type=\"email\"\n :label=\"$t('label.email')\"\n :placeholder=\"$t('placeholder.email')\"\n icon=\"ri:mail-line\"\n modifiers=\"compact\"\n class=\"mb-md\" />\n <VvFormField\n name=\"phone\"\n type=\"tel\"\n :label=\"$t('label.phone')\"\n :placeholder=\"$t('placeholder.phone')\"\n icon=\"ri:phone-line\"\n class=\"mb-md\"\n modifiers=\"compact\" />\n\n <!-- A send that failed says so: the reason reached the\n card and was never drawn -->\n <VvAlert v-if=\"error\" modifiers=\"danger\" class=\"mb-md\">\n {{ error }}\n </VvAlert>\n\n <div class=\"flex justify-between items-center gap-16 mt-xs\">\n <div\n class=\"text-smaller text-word-3 flex items-center gap-8\">\n <VvIcon\n name=\"ri:shield-check-line\"\n class=\"text-16 shrink-0\" />\n <PkStreamingMarkdown\n :markdown=\"privacyNotice\"\n class=\"wysiwyg\" />\n </div>\n <!-- The library's default button is the brand, and in\n the chat the brand is the agent's color, as on the\n rest of the card: `primary` drew it neutral dark -->\n <VvButton\n type=\"submit\"\n :loading\n :disabled=\"loading || readonly\"\n icon-position=\"right\"\n class=\"shrink-0\"\n :label=\"$t('action.submit')\" />\n </div>\n </VvForm>\n </div>\n <div v-else class=\"p-sm\">\n <!-- One confirmation row across every tool card: a green\n check, the title in weight, the body quiet. The check is\n the outcome, so it alone carries the colour (DESIGN.md). -->\n <div class=\"flex items-center gap-sm\">\n <VvIcon name=\"ri:check-line\" class=\"text-16 text-success\" />\n <div>\n <strong class=\"font-medium block text-word-1\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedMessage') }}\n </p>\n </div>\n </div>\n </div>\n </Transition>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUI,IAAM,EAAE,GAAGyE,MAAO1B,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1C2B,IAAQC,GAeRC,IAAW3C,QACAyC,EAAM,IAWtB,GAEKG,IAAQ5C,QAAe2C,EAAS,MAAM,KAAK,GAE3CE,IAAY7C,QAEV;GACI;IAAE,MAAM;IAAQ,OAAOwC,EAAG,YAAY;GAAE;GACxC;IAAE,MAAM;IAAS,OAAOA,EAAG,aAAa;GAAE;GAC1C;IAAE,MAAM;IAAS,OAAOA,EAAG,aAAa;GAAE;EAC9C,CAAC,CAEA,KAAK,MAAU;GACZ,IAAMM,IAAQF,EAAM,QAAQG,EAAM,KAAK,EAAE,KAAK;GAC9C,OAAO;IACH,GAAGA;IAEH,OACIA,EAAM,SAAS,WAAWD,KACpB9B,EAAkB8B,CAAK,KAAKA;GAE1C;EACJ,CAAC,CAAA,CACA,QAAQ,MAAUC,EAAM,KAAK,CACtC,GAEMC,IAAiB3B,EACnBrB,QAEQ,GAAG2C,EAAS,MAAM,WAAW,GAAGA,EAAS,MAAM,KAAK,WAC5D,GACA,EACJ,GAEMM,IAAiBlF,EAAS;GAC5B,MAAMC,EAAS,CAAC,CAAC,IAAI,CAAC,CAAC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;OANhB,MAAK;OACL,MAAK;OACJ,OAAOrF,EAAA6D,CAAA,CAAE,CAAA,aAAA;OACT,aAAa7D,EAAA6D,CAAA,CAAE,CAAA,mBAAA;OAChB,MAAK;OACL,WAAU;OACV,OAAM;;MACV/D,EAO0BE,EAAAqF,CAAA,GAAA;OANtB,MAAK;OACL,MAAK;OACJ,OAAOrF,EAAA6D,CAAA,CAAE,CAAA,aAAA;OACT,aAAa7D,EAAA6D,CAAA,CAAE,CAAA,mBAAA;OAChB,MAAK;OACL,OAAM;OACN,WAAU;;MAICE,EAAA,SAAfpE,EAAA,GAAAY,EAEUwE,GAAA;;OAFY,WAAU;OAAS,OAAM;;OAC3C,SAAA7E,QAAW,CAARM,EAAAT,EAAAgE,EAAA,KAAK,GAAA,CAAA,C;;;MAGZlE,EAoBM,OApBNwD,GAoBM,CAnBFxD,EAQM,OARNyD,GAQM,CANFxD,EAE+BgF,GAAA;OAD3B,MAAK;OACL,OAAM;M,IACVhF,EAEsBW,GAAA;OADjB,UAAUT,EAAA6E,EAAA;OACX,OAAM;M,6BAKd/E,EAMmCkF,GAAA;OAL/B,MAAK;OACJ,SAAAjB,EAAA;OACA,UAAUA,EAAA,WAAWA,EAAA;OACtB,iBAAc;OACd,OAAM;OACL,OAAO/D,EAAA6D,CAAA,CAAE,CAAA,eAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Et as e, H as t, J as n, N as r, Ot as i, P as a, Q as o, S as s, Tt as c, V as l, _ as u, b as d, d as f, f as p, g as m, gt as h, h as g, k as _, kt as v, mt as ee, ot as y, q as te, r as b, tt as x, u as ne, v as S, w as C, wt as w, x as T, y as E, z as D } from "./vue.runtime.esm-bundler-C2U5uTqB.js";
|
|
2
2
|
import { r as re } from "./vue-i18n-POtLvOl1.js";
|
|
3
|
-
import { t as ie } from "./PkStreamingMarkdown-
|
|
3
|
+
import { t as ie } from "./PkStreamingMarkdown-DZvLHy2l.js";
|
|
4
4
|
import { S as O } from "./Agent-DMvYDpLa.js";
|
|
5
|
-
import {
|
|
5
|
+
import { h as ae, m as oe } from "./utils-C2aFWWye.js";
|
|
6
6
|
import { c as se, p as k, r as ce, u as A } from "./index.es-DIHz5I8K.js";
|
|
7
7
|
import { t as le } from "./VvButtonLocalized-C8S7XJGv.js";
|
|
8
8
|
import { t as ue } from "./PkEditorRadioButtons-Br4c42KS.js";
|
|
@@ -309,4 +309,4 @@ var fe = {
|
|
|
309
309
|
});
|
|
310
310
|
export { I as default };
|
|
311
311
|
|
|
312
|
-
//# sourceMappingURL=PkToolShowForm-
|
|
312
|
+
//# sourceMappingURL=PkToolShowForm-D6k7_QLF.js.map
|