@8wave/ai-elements 0.98.0 → 0.99.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +24 -5
  2. package/{dist-vue/_chunks/PkStreamingMarkdown-DEhbK-3c.js → dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js} +379 -362
  3. package/dist/_chunks/PkStreamingMarkdown-6Xx9n1ue.js.map +1 -0
  4. package/dist/_chunks/{PkToolRequestGeolocation-BJ9NJZIg.js → PkToolRequestGeolocation-B73evGBg.js} +2 -2
  5. package/dist/_chunks/{PkToolRequestGeolocation-BJ9NJZIg.js.map → PkToolRequestGeolocation-B73evGBg.js.map} +1 -1
  6. package/dist/_chunks/{PkToolRequestOAuthConnection-DdvJ6n1K.js → PkToolRequestOAuthConnection-BWP5dsK_.js} +3 -3
  7. package/dist/_chunks/{PkToolRequestOAuthConnection-DdvJ6n1K.js.map → PkToolRequestOAuthConnection-BWP5dsK_.js.map} +1 -1
  8. package/dist/_chunks/{PkToolShowArtifact-BaGEr7O9.js → PkToolShowArtifact-bYYaMGxq.js} +7 -7
  9. package/dist/_chunks/{PkToolShowArtifact-BaGEr7O9.js.map → PkToolShowArtifact-bYYaMGxq.js.map} +1 -1
  10. package/dist/_chunks/{PkToolShowCalendarEvent-BYnhl2er.js → PkToolShowCalendarEvent-DdEWaTj-.js} +4 -4
  11. package/dist/_chunks/{PkToolShowCalendarEvent-BYnhl2er.js.map → PkToolShowCalendarEvent-DdEWaTj-.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowComparison-DahL5vHr.js → PkToolShowComparison-Dcar7HPW.js} +4 -4
  13. package/dist/_chunks/{PkToolShowComparison-DahL5vHr.js.map → PkToolShowComparison-Dcar7HPW.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-upUNZtId.js → PkToolShowContactForm-DtjVW-n6.js} +13 -13
  15. package/dist/_chunks/{PkToolShowContactForm-upUNZtId.js.map → PkToolShowContactForm-DtjVW-n6.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowDiagram-Jq_4KWiK.js → PkToolShowDiagram-X35nsoIY.js} +8 -8
  17. package/dist/_chunks/{PkToolShowDiagram-Jq_4KWiK.js.map → PkToolShowDiagram-X35nsoIY.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowEmail-CtmpDS1B.js → PkToolShowEmail-jVoK8qEh.js} +4 -4
  19. package/dist/_chunks/{PkToolShowEmail-CtmpDS1B.js.map → PkToolShowEmail-jVoK8qEh.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowForm-BNV4Ja6g.js → PkToolShowForm-BP8asXtz.js} +123 -97
  21. package/dist/_chunks/PkToolShowForm-BP8asXtz.js.map +1 -0
  22. package/dist/_chunks/{PkToolShowImageGallery-mLq2p3aH.js → PkToolShowImageGallery-WQL3T4Hr.js} +2 -2
  23. package/dist/_chunks/{PkToolShowImageGallery-mLq2p3aH.js.map → PkToolShowImageGallery-WQL3T4Hr.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowLocation-SbgTbuGu.js → PkToolShowLocation-w2t7lKpb.js} +4 -4
  25. package/dist/_chunks/{PkToolShowLocation-SbgTbuGu.js.map → PkToolShowLocation-w2t7lKpb.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowMessage-CAVpDTzd.js → PkToolShowMessage-BPo7WPim.js} +4 -4
  27. package/dist/_chunks/{PkToolShowMessage-CAVpDTzd.js.map → PkToolShowMessage-BPo7WPim.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowProductList-puiPFItN.js → PkToolShowProductList-BbY4ni7Y.js} +2 -2
  29. package/dist/_chunks/{PkToolShowProductList-puiPFItN.js.map → PkToolShowProductList-BbY4ni7Y.js.map} +1 -1
  30. package/dist/_chunks/{PkToolShowQrCode-CctXvRyG.js → PkToolShowQrCode-CN0ms27N.js} +4 -4
  31. package/dist/_chunks/{PkToolShowQrCode-CctXvRyG.js.map → PkToolShowQrCode-CN0ms27N.js.map} +1 -1
  32. package/dist/_chunks/{PkToolShowSources-DwB6VXrK.js → PkToolShowSources-D2tBcx7n.js} +18 -18
  33. package/dist/_chunks/{PkToolShowSources-DwB6VXrK.js.map → PkToolShowSources-D2tBcx7n.js.map} +1 -1
  34. package/dist/_chunks/{PkToolShowSuggestedReply-QEcIhSxa.js → PkToolShowSuggestedReply-Cdh_elSh.js} +2 -2
  35. package/dist/_chunks/{PkToolShowSuggestedReply-QEcIhSxa.js.map → PkToolShowSuggestedReply-Cdh_elSh.js.map} +1 -1
  36. package/dist/_chunks/{PkToolShowVideo-DoLoI8_N.js → PkToolShowVideo-D3aU5FMO.js} +2 -2
  37. package/dist/_chunks/{PkToolShowVideo-DoLoI8_N.js.map → PkToolShowVideo-D3aU5FMO.js.map} +1 -1
  38. package/dist/_chunks/{PkToolShowWeather-C2rPCQ_K.js → PkToolShowWeather-CzanXIJp.js} +3 -3
  39. package/dist/_chunks/{PkToolShowWeather-C2rPCQ_K.js.map → PkToolShowWeather-CzanXIJp.js.map} +1 -1
  40. package/dist/_chunks/{PkToolShowWebPages-BBJYzF8V.js → PkToolShowWebPages-DkMJrWmT.js} +2 -2
  41. package/dist/_chunks/{PkToolShowWebPages-BBJYzF8V.js.map → PkToolShowWebPages-DkMJrWmT.js.map} +1 -1
  42. package/dist/_chunks/{VvCheckbox.es-D5d8k9yP.js → VvCheckbox.es-CRhIKQNR.js} +2 -2
  43. package/dist/_chunks/{VvCheckbox.es-D5d8k9yP.js.map → VvCheckbox.es-CRhIKQNR.js.map} +1 -1
  44. package/dist/_chunks/{VvCheckboxGroup.es-DVnsOjX0.js → VvCheckboxGroup.es-gOy2kM1Y.js} +5 -5
  45. package/dist/_chunks/{VvCheckboxGroup.es-DVnsOjX0.js.map → VvCheckboxGroup.es-gOy2kM1Y.js.map} +1 -1
  46. package/dist/_chunks/{VvCombobox.es-CFA-K-cQ.js → VvCombobox.es-BOwH3LmO.js} +9 -9
  47. package/dist/_chunks/VvCombobox.es-BOwH3LmO.js.map +1 -0
  48. package/dist/_chunks/{VvInputText.es-csEQ-bSG.js → VvInputText.es-D8nXroKO.js} +536 -513
  49. package/dist/_chunks/VvInputText.es-D8nXroKO.js.map +1 -0
  50. package/dist/_chunks/{VvRadio.es-BpymhC73.js → VvRadio.es-Djy5J33A.js} +2 -2
  51. package/dist/_chunks/{VvRadio.es-BpymhC73.js.map → VvRadio.es-Djy5J33A.js.map} +1 -1
  52. package/dist/_chunks/{VvRadioGroup.es-CSNzOJKx.js → VvRadioGroup.es-DQq3JYCR.js} +5 -5
  53. package/dist/_chunks/VvRadioGroup.es-DQq3JYCR.js.map +1 -0
  54. package/dist/_chunks/{VvSelect.es-CjKMd0nH.js → VvSelect.es-CE4x1ww0.js} +4 -4
  55. package/dist/_chunks/{VvSelect.es-CjKMd0nH.js.map → VvSelect.es-CE4x1ww0.js.map} +1 -1
  56. package/dist/_chunks/VvTextarea.es-BU2vqdEQ.js +1129 -0
  57. package/dist/_chunks/VvTextarea.es-BU2vqdEQ.js.map +1 -0
  58. package/dist/_chunks/{dist-BNET2z7b.js → dist-CvMCBce7.js} +39 -21
  59. package/dist/_chunks/dist-CvMCBce7.js.map +1 -0
  60. package/dist/_chunks/dot-prop-CObyt75F.js +141 -0
  61. package/dist/_chunks/dot-prop-CObyt75F.js.map +1 -0
  62. package/dist/_chunks/{floating-ui.vue-CIKvCpTA.js → floating-ui.vue-BacoFpVq.js} +278 -305
  63. package/dist/_chunks/floating-ui.vue-BacoFpVq.js.map +1 -0
  64. package/dist/_chunks/{index.es-u1dF1xg2.js → index.es-DpqfagWZ.js} +12 -12
  65. package/dist/_chunks/{index.es-u1dF1xg2.js.map → index.es-DpqfagWZ.js.map} +1 -1
  66. package/dist/_chunks/{index.es-BYny0uhz.js → index.es-_oXVRjHy.js} +2352 -2329
  67. package/dist/_chunks/index.es-_oXVRjHy.js.map +1 -0
  68. package/dist/ai-elements.es.js +4818 -5765
  69. package/dist/ai-elements.es.js.map +1 -1
  70. package/dist-vue/PkChatbot.js +1 -1
  71. package/dist-vue/PkChatbotAuth.js +1 -1
  72. package/dist-vue/PkChatbotEmptyState.js +1 -1
  73. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  74. package/dist-vue/PkChatbotInput.js +1 -1
  75. package/dist-vue/PkChatbotMessages.js +1 -1
  76. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  77. package/dist-vue/PkChatbotSteps.js +1 -1
  78. package/dist-vue/PkChatbotViewChat.js +1 -1
  79. package/dist-vue/PkChatbotViewConversations.js +1 -1
  80. package/dist-vue/PkChatbotViewFiles.js +1 -1
  81. package/dist-vue/PkChatbotViewProfile.js +1 -1
  82. package/dist-vue/_chunks/PkChatbot-Bf5uY3cO.js +236 -0
  83. package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js.map → PkChatbot-Bf5uY3cO.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkChatbotAuth-C_L2xWuD.js → PkChatbotAuth-BGn2MDYD.js} +2 -2
  85. package/dist-vue/_chunks/{PkChatbotAuth-C_L2xWuD.js.map → PkChatbotAuth-BGn2MDYD.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkChatbotEmptyState-BGOC6vxr.js → PkChatbotEmptyState-CPqLqXek.js} +2 -2
  87. package/dist-vue/_chunks/{PkChatbotEmptyState-BGOC6vxr.js.map → PkChatbotEmptyState-CPqLqXek.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkChatbotFeedbackForm-BSe40qlc.js → PkChatbotFeedbackForm-C_y__RH8.js} +2 -2
  89. package/dist-vue/_chunks/{PkChatbotFeedbackForm-BSe40qlc.js.map → PkChatbotFeedbackForm-C_y__RH8.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkChatbotInput-DTazYlPd.js → PkChatbotInput-jvb0vuak.js} +2 -2
  91. package/dist-vue/_chunks/{PkChatbotInput-DTazYlPd.js.map → PkChatbotInput-jvb0vuak.js.map} +1 -1
  92. package/dist-vue/_chunks/PkChatbotMessages-B3G12zah.js +752 -0
  93. package/dist-vue/_chunks/PkChatbotMessages-B3G12zah.js.map +1 -0
  94. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js → PkChatbotStepToolDetail-BVI72gyx.js} +2 -2
  95. package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js.map → PkChatbotStepToolDetail-BVI72gyx.js.map} +1 -1
  96. package/dist-vue/_chunks/PkChatbotSteps-BdU6YC_N.js +172 -0
  97. package/dist-vue/_chunks/{PkChatbotSteps-BpqdFhsG.js.map → PkChatbotSteps-BdU6YC_N.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkChatbotViewChat-C08TsXiL.js → PkChatbotViewChat-c0Ecpzoc.js} +68 -68
  99. package/dist-vue/_chunks/PkChatbotViewChat-c0Ecpzoc.js.map +1 -0
  100. package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js → PkChatbotViewConversations-BfhRCA_1.js} +2 -2
  101. package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js.map → PkChatbotViewConversations-BfhRCA_1.js.map} +1 -1
  102. package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js → PkChatbotViewFiles-BipRoidH.js} +2 -2
  103. package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js.map → PkChatbotViewFiles-BipRoidH.js.map} +1 -1
  104. package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js → PkChatbotViewProfile-DuLwYpGZ.js} +2 -2
  105. package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js.map → PkChatbotViewProfile-DuLwYpGZ.js.map} +1 -1
  106. package/{dist/_chunks/PkStreamingMarkdown-Djw604Ny.js → dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js} +344 -347
  107. package/dist-vue/_chunks/PkStreamingMarkdown-CjBMQ18U.js.map +1 -0
  108. package/dist-vue/_chunks/{PkToolShowArtifact-CTBwt4DN.js → PkToolShowArtifact-COwSXmF4.js} +2 -2
  109. package/dist-vue/_chunks/{PkToolShowArtifact-CTBwt4DN.js.map → PkToolShowArtifact-COwSXmF4.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowContactForm-B6-MsExL.js → PkToolShowContactForm-DRRtCCxB.js} +10 -10
  111. package/dist-vue/_chunks/{PkToolShowContactForm-B6-MsExL.js.map → PkToolShowContactForm-DRRtCCxB.js.map} +1 -1
  112. package/dist-vue/_chunks/{PkToolShowForm-C-mWyeka.js → PkToolShowForm-j7Ha-0X3.js} +128 -102
  113. package/dist-vue/_chunks/PkToolShowForm-j7Ha-0X3.js.map +1 -0
  114. package/dist-vue/_chunks/{PkToolShowSources-CFh-i60o.js → PkToolShowSources-BVLw4W5l.js} +43 -43
  115. package/dist-vue/_chunks/{PkToolShowSources-CFh-i60o.js.map → PkToolShowSources-BVLw4W5l.js.map} +1 -1
  116. package/dist-vue/_chunks/{createChatbotApiClient-BOBdBxmf.js → createChatbotApiClient-IH6wBh4s.js} +148 -160
  117. package/dist-vue/_chunks/createChatbotApiClient-IH6wBh4s.js.map +1 -0
  118. package/dist-vue/_chunks/{index.es-XfWQ82pb.js → index.es-Bk1O0p8N.js} +166 -156
  119. package/dist-vue/_chunks/index.es-Bk1O0p8N.js.map +1 -0
  120. package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js → useChatbotStore-C3uKi2FS.js} +114 -106
  121. package/dist-vue/_chunks/useChatbotStore-C3uKi2FS.js.map +1 -0
  122. package/dist-vue/_chunks/{utils-BMa8jwJS.js → utils-Cru8TJxe.js} +48 -30
  123. package/dist-vue/_chunks/utils-Cru8TJxe.js.map +1 -0
  124. package/dist-vue/api.js +1 -1
  125. package/dist-vue/composables.js +3 -3
  126. package/dist-vue/index.js +3732 -3213
  127. package/dist-vue/index.js.map +1 -1
  128. package/dist-vue/locales.js +43 -7
  129. package/dist-vue/packages/components/src/PkCheckboxField.d.ts +45 -0
  130. package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
  131. package/dist-vue/packages/components/src/{chat/PkToolRequestConfirm.d.ts → PkOfflineScreen.d.ts} +10 -3
  132. package/dist-vue/packages/components/src/PkPwaNotices.d.ts +19 -0
  133. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +18 -3
  134. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +24 -2
  135. package/dist-vue/packages/components/src/chat/PkToolApprovalBadge.d.ts +4 -0
  136. package/dist-vue/packages/components/src/chat/PkToolApprovalCard.d.ts +35 -0
  137. package/dist-vue/packages/components/src/chat/PkToolApprovalPreviewMessage.d.ts +11 -0
  138. package/dist-vue/packages/components/src/chat/index.d.ts +2 -1
  139. package/dist-vue/packages/components/src/chat/toolApprovalPreviews.d.ts +12 -0
  140. package/dist-vue/packages/components/src/chat/toolComponentMap.d.ts +5 -3
  141. package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +6 -0
  142. package/dist-vue/packages/components/src/chat/utils.d.ts +13 -0
  143. package/dist-vue/packages/components/src/index.d.ts +4 -1
  144. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +70 -1
  145. package/dist-vue/packages/composable/src/index.d.ts +1 -0
  146. package/dist-vue/packages/composable/src/useConnectivity.d.ts +28 -0
  147. package/dist-vue/packages/models/src/schema/Agent.d.ts +129 -0
  148. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +30 -0
  149. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +30 -0
  150. package/dist-vue/style.css +1 -1
  151. package/package.json +3 -3
  152. package/dist/_chunks/PkStreamingMarkdown-Djw604Ny.js.map +0 -1
  153. package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js +0 -48
  154. package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js.map +0 -1
  155. package/dist/_chunks/PkToolShowForm-BNV4Ja6g.js.map +0 -1
  156. package/dist/_chunks/VvCombobox.es-CFA-K-cQ.js.map +0 -1
  157. package/dist/_chunks/VvInputText.es-csEQ-bSG.js.map +0 -1
  158. package/dist/_chunks/VvRadioGroup.es-CSNzOJKx.js.map +0 -1
  159. package/dist/_chunks/VvTextarea.es-eEyRRpuT.js +0 -1109
  160. package/dist/_chunks/VvTextarea.es-eEyRRpuT.js.map +0 -1
  161. package/dist/_chunks/dist-BNET2z7b.js.map +0 -1
  162. package/dist/_chunks/dot-prop-BXrC9bAX.js +0 -131
  163. package/dist/_chunks/dot-prop-BXrC9bAX.js.map +0 -1
  164. package/dist/_chunks/floating-ui.vue-CIKvCpTA.js.map +0 -1
  165. package/dist/_chunks/index.es-BYny0uhz.js.map +0 -1
  166. package/dist-vue/_chunks/PkChatbot-DHkhT0Jf.js +0 -236
  167. package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js +0 -630
  168. package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js.map +0 -1
  169. package/dist-vue/_chunks/PkChatbotSteps-BpqdFhsG.js +0 -172
  170. package/dist-vue/_chunks/PkChatbotViewChat-C08TsXiL.js.map +0 -1
  171. package/dist-vue/_chunks/PkStreamingMarkdown-DEhbK-3c.js.map +0 -1
  172. package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js +0 -48
  173. package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js.map +0 -1
  174. package/dist-vue/_chunks/PkToolShowForm-C-mWyeka.js.map +0 -1
  175. package/dist-vue/_chunks/createChatbotApiClient-BOBdBxmf.js.map +0 -1
  176. package/dist-vue/_chunks/index.es-XfWQ82pb.js.map +0 -1
  177. package/dist-vue/_chunks/useChatbotStore-BJ-EDmND.js.map +0 -1
  178. package/dist-vue/_chunks/utils-BMa8jwJS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PkToolShowContactForm-B6-MsExL.js","names":[],"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 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\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 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=\"!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 no-label\"\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 no-label\"\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 no-label\" />\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 <VvButton\n type=\"submit\"\n modifiers=\"primary\"\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 <div class=\"flex items-center gap-sm\">\n <VvIcon\n name=\"ri:mail-check-line\"\n class=\"text-24 text-success\" />\n <div>\n <strong class=\"font-semibold block text-success\">\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 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\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 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=\"!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 no-label\"\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 no-label\"\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 no-label\" />\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 <VvButton\n type=\"submit\"\n modifiers=\"primary\"\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 <div class=\"flex items-center gap-sm\">\n <VvIcon\n name=\"ri:mail-check-line\"\n class=\"text-24 text-success\" />\n <div>\n <strong class=\"font-semibold block text-success\">\n {{ $t('message.leadSubmittedTitle') }}\n </strong>\n <p class=\"text-word-3\">\n {{ $t('message.leadSubmittedM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B,GAAA;OAD3B,MAAK;OACL,OAAM;UACV,EAEsB,GAAA;OADjB,UAAU,EAAA,CAAA;OACX,OAAM;mCAEd,EAOmC,GAAA;OAN/B,MAAK;OACL,WAAU;OACT,SAAA,EAAA;OACA,UAAU,EAAA,WAAW,EAAA;OACtB,iBAAc;OACd,OAAM;OACL,OAAO,EAAA,CAAA,CAAE,CAAA,eAAA;;;;;;;;wCAcL,CAAA"}
1
+ {"version":3,"file":"PkToolShowContactForm-DRRtCCxB.js","names":[],"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 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\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 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=\"!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 no-label\"\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 no-label\"\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 no-label\" />\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 <VvButton\n type=\"submit\"\n modifiers=\"primary\"\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 <div class=\"flex items-center gap-sm\">\n <VvIcon\n name=\"ri:mail-check-line\"\n class=\"text-24 text-success\" />\n <div>\n <strong class=\"font-semibold block text-success\">\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 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\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 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=\"!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 no-label\"\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 no-label\"\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 no-label\" />\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 <VvButton\n type=\"submit\"\n modifiers=\"primary\"\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 <div class=\"flex items-center gap-sm\">\n <VvIcon\n name=\"ri:mail-check-line\"\n class=\"text-24 text-success\" />\n <div>\n <strong class=\"font-semibold block text-success\">\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EASI,IAAM,EAAE,GAAG,MAAO,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1C,IAAQ,GASR,IAAW,QACA,EAAM,IAWtB,GAEK,IAAQ,QAAe,EAAS,MAAM,KAAK,GAE3C,IAAiB,EACnB,QAEQ,GAAG,EAAS,MAAM,WAAW,GAAG,EAAS,MAAM,KAAK,WAC5D,GACA,EACJ,GAEM,IAAiB,EAAS;GAC5B,MAAM,EAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;GAC3C,OAAO,EAAQ,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE;GACpC,OAAO,EACK,CAAA,CACP,IAAI,EAAE,CAAA,CACN,MAAM,oBAAoB,EAAG,+BAA+B,CAAC,CAAA,CAC7D,SAAS;EAClB,CAAC,GAEK,IAAO,GAIP,EAAE,WAAQ,gBAAa,gBAAa,EAAQ,GAAgB,EAC9D,UAAU,GACd,CAAC;EAeD,AAZA,EACI,IACC,MAAa;GACV,EAAS,QAAQ;IACb,MAAM,GAAU,QAAQ;IACxB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AA;OAChB,MAAK;OACL,WAAU;OACV,OAAM;;MACV,EAOoB,EAAA,CAAA,GAAA;OANhB,MAAK;OACL,MAAK;OACJ,OAAO,EAAA,CAAA,CAAE,CAAA,aAAA;OACT,aAAa,EAAA,CAAA,CAAE,CAAA,mBAAA;OAChB,MAAK;OACL,WAAU;OACV,OAAM;;MACV,EAOmC,EAAA,CAAA,GAAA;OAN/B,MAAK;OACL,MAAK;OACJ,OAAO,EAAA,CAAA,CAAE,CAAA,aAAA;OACT,aAAa,EAAA,CAAA,CAAE,CAAA,mBAAA;OAChB,MAAK;OACL,OAAM;OACN,WAAU;;MAEd,EAkBM,OAlBN,GAkBM,CAjBF,EAQM,OARN,GAQM,CANF,EAE+B,GAAA;OAD3B,MAAK;OACL,OAAM;UACV,EAEsB,GAAA;OADjB,UAAU,EAAA,CAAA;OACX,OAAM;mCAEd,EAOmC,GAAA;OAN/B,MAAK;OACL,WAAU;OACT,SAAA,EAAA;OACA,UAAU,EAAA,WAAW,EAAA;OACtB,iBAAc;OACd,OAAM;OACL,OAAO,EAAA,CAAA,CAAE,CAAA,eAAA;;;;;;;;wCAcL,CAAA"}
@@ -1,11 +1,11 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { t } from "./PkStreamingMarkdown-DEhbK-3c.js";
2
+ import { t } from "./PkStreamingMarkdown-CjBMQ18U.js";
3
3
  import { VvButton as n, VvCheckbox as r, VvCheckboxGroup as i, VvIcon as a, VvInputText as o, VvRadio as s, VvRadioGroup as c } from "@volverjs/ui-vue/components";
4
4
  import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, defineComponent as v, mergeModels as y, mergeProps as b, normalizeClass as ee, normalizeStyle as te, openBlock as x, reactive as ne, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, useModel as D, watch as O, withCtx as k, withKeys as re, withModifiers as A } from "vue";
5
- import { useI18n as ie } from "vue-i18n";
5
+ import { useI18n as j } from "vue-i18n";
6
6
  //#endregion
7
7
  //#region ../../packages/components/src/PkEditorRadioButtons.vue
8
- var j = /* @__PURE__ */ v({
8
+ var M = /* @__PURE__ */ v({
9
9
  __name: "PkEditorRadioButtons",
10
10
  props: /*@__PURE__*/ y({
11
11
  name: {},
@@ -58,7 +58,7 @@ var j = /* @__PURE__ */ v({
58
58
  }, 8, ["modelValue", "name"]);
59
59
  };
60
60
  }
61
- }), M = /* @__PURE__ */ v({
61
+ }), N = /* @__PURE__ */ v({
62
62
  __name: "PkEditorCheckboxButtons",
63
63
  props: /*@__PURE__*/ y({
64
64
  name: {},
@@ -103,31 +103,31 @@ var j = /* @__PURE__ */ v({
103
103
  }, 8, ["modelValue", "name"]);
104
104
  };
105
105
  }
106
- }), ae = {
106
+ }), ie = {
107
107
  key: 0,
108
108
  class: "border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col transition-all bg-surface"
109
- }, oe = {
109
+ }, ae = {
110
110
  key: 0,
111
111
  class: "text-12 border-b border-surface-3 text-word-3 bg-surface-1"
112
- }, se = {
112
+ }, oe = {
113
113
  key: 1,
114
114
  class: "flex flex-col gap-4 p-sm"
115
- }, ce = { class: "flex justify-between text-10 text-word-3" }, le = { class: "h-4 bg-surface-3 rounded-full overflow-hidden" }, ue = { class: "px-sm py-16 flex flex-col gap-12" }, de = { class: "leading-normal text-12" }, fe = { class: "font-semibold" }, pe = { class: "text-12" }, me = { class: "font-semibold" }, he = {
115
+ }, se = { class: "flex justify-between text-10 text-word-3" }, ce = { class: "h-4 bg-surface-3 rounded-full overflow-hidden" }, le = { class: "px-sm py-16 flex flex-col gap-12" }, ue = { class: "leading-normal text-12" }, de = { class: "font-semibold" }, fe = { class: "text-12" }, pe = { class: "font-semibold" }, me = {
116
116
  key: 0,
117
117
  class: "text-word-3"
118
- }, N = { class: "text-12" }, P = { class: "font-semibold" }, F = {
118
+ }, he = { class: "text-12" }, ge = { class: "font-semibold" }, P = {
119
119
  key: 0,
120
120
  class: "text-word-3"
121
- }, I = {
121
+ }, F = {
122
122
  key: 2,
123
123
  class: "flex flex-col gap-6 w-full"
124
- }, L = {
124
+ }, I = {
125
125
  key: 0,
126
126
  class: "px-sm pb-sm border-t border-surface-3"
127
- }, R = {
127
+ }, L = {
128
128
  key: 1,
129
129
  class: "px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12"
130
- }, ge = { key: 1 }, _e = { class: "px-sm py-12 bg-surface space-y-10" }, ve = { class: "flex flex-col gap-8" }, ye = { class: "text-12 text-word-3" }, z = { class: "text-12 text-word-2 font-semibold" }, be = { class: "px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10" }, xe = { class: "w-20 h-20 rounded-full border border-success text-success flex items-center justify-center" }, Se = { class: "flex flex-col" }, Ce = { class: "font-semibold text-12 text-word-1 leading-tight" }, B = /*@__PURE__*/ v({
130
+ }, _e = { key: 1 }, ve = { class: "px-sm py-12 bg-surface space-y-10" }, ye = { class: "flex flex-col gap-8" }, be = { class: "text-12 text-word-3" }, xe = { class: "text-12 text-word-2 font-semibold" }, Se = { class: "px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10" }, Ce = { class: "w-20 h-20 rounded-full border border-success text-success flex items-center justify-center" }, we = { class: "flex flex-col" }, Te = { class: "font-semibold text-12 text-word-1 leading-tight" }, R = /*@__PURE__*/ v({
131
131
  __name: "PkToolShowForm",
132
132
  props: {
133
133
  part: {},
@@ -135,195 +135,221 @@ var j = /* @__PURE__ */ v({
135
135
  },
136
136
  emits: ["select"],
137
137
  setup(e, { emit: r }) {
138
- let i = e, s = r, { t: c, d: g } = ie({ useScope: "global" }), v = u(() => JSON.parse(JSON.stringify(i.part))), y = u(() => v.value.toolName === "showMultipleChoice" || v.value.type === "tool-showMultipleChoice"), b = u(() => v.value.state === "input-available"), w = u(() => {
139
- let e = H.value;
140
- return e ? B.value.length === 1 && !e.allowFreeformInput && !i.allowCustomAnswer : !1;
141
- }), D = u(() => y.value && B.value.length === 1 && !H.value?.multiSelect), B = u(() => {
138
+ let i = e, s = r, { t: c, d: g } = j({ useScope: "global" }), v = u(() => JSON.parse(JSON.stringify(i.part))), y = u(() => v.value.toolName === "showMultipleChoice" || v.value.type === "tool-showMultipleChoice"), b = u(() => v.value.state === "input-available"), w = u(() => {
139
+ let e = V.value;
140
+ return e ? z.value.length === 1 && !e.allowFreeformInput && !i.allowCustomAnswer : !1;
141
+ }), D = u(() => y.value && z.value.length === 1 && !V.value?.multiSelect), R = u(() => !!V.value?.options && !V.value?.multiSelect && (w.value || D.value)), z = u(() => {
142
142
  let e = v.value.input;
143
143
  return e?.steps?.length ? e.steps : e?.question && e?.options ? [{
144
144
  id: "legacy",
145
145
  question: e.question,
146
146
  options: e.options.map((e) => typeof e == "string" ? { label: e } : e)
147
147
  }] : [];
148
- }), V = S(0), H = u(() => B.value[V.value]), U = u(() => V.value > 0), W = u(() => V.value < B.value.length - 1), G = u(() => B.value.length > 1), K = u(() => G.value ? Math.round((V.value + 1) / B.value.length * 100) : null), q = ne({}), J = S(""), Y = u({
148
+ }), B = S(0), V = u(() => z.value[B.value]), H = u(() => B.value > 0), U = u(() => B.value < z.value.length - 1), Ee = u(() => z.value.length > 1), W = u(() => Ee.value ? Math.round((B.value + 1) / z.value.length * 100) : null), G = ne({}), K = S("");
149
+ O(B, () => {
150
+ K.value = "";
151
+ });
152
+ let q = u({
149
153
  get: () => {
150
- let e = H.value ? q[H.value.id] : void 0;
154
+ let e = V.value ? G[V.value.id] : void 0;
151
155
  if (!(e == null || Array.isArray(e))) return e;
152
156
  },
153
157
  set: (e) => {
154
- H.value && (q[H.value.id] = e ?? null);
158
+ V.value && (G[V.value.id] = e ?? null);
155
159
  }
156
- }), X = u({
160
+ }), J = u({
157
161
  get: () => {
158
- let e = H.value ? q[H.value.id] : void 0;
162
+ let e = V.value ? G[V.value.id] : void 0;
159
163
  return Array.isArray(e) ? e : [];
160
164
  },
161
165
  set: (e) => {
162
- H.value && (q[H.value.id] = e ?? []);
166
+ V.value && (G[V.value.id] = e ?? []);
163
167
  }
164
168
  });
169
+ function Y(e) {
170
+ if (!e || typeof e == "string") return;
171
+ let t = e.answers;
172
+ return Array.isArray(t) ? t : void 0;
173
+ }
165
174
  O(() => v.value.output, (e) => {
166
- if (e) {
167
- if (typeof e == "string") B.value.length === 1 && (q[B.value[0].id] = e);
168
- else if (e.answers) for (let t of e.answers) q[t.id] = t.value;
175
+ if (!e) return;
176
+ if (typeof e == "string") {
177
+ z.value.length === 1 && (G[z.value[0].id] = e);
178
+ return;
179
+ }
180
+ let t = Y(e);
181
+ if (t) {
182
+ for (let e of t) G[e.id] = e.value;
183
+ return;
184
+ }
185
+ let n = e;
186
+ for (let e of z.value) {
187
+ let t = n[e.id];
188
+ t !== void 0 && (G[e.id] = t);
169
189
  }
170
190
  }, { immediate: !0 }), O(u(() => {
171
191
  let e = v.value.output;
172
- if (e) {
173
- if (typeof e == "string") return e;
174
- if (e.answers?.length === 1) {
175
- let t = e.answers[0].value;
176
- return Array.isArray(t) ? t.join(", ") : String(t);
177
- }
192
+ if (!e) return;
193
+ if (typeof e == "string") return e;
194
+ let t = Y(e);
195
+ if (t?.length === 1) {
196
+ let e = t[0].value;
197
+ return Array.isArray(e) ? e.join(", ") : String(e);
178
198
  }
179
199
  }), (e) => {
180
- !e || !H.value || (H.value.options ?? []).map((e) => e.label).includes(e) || (J.value = e);
200
+ !e || !V.value || (V.value.options ?? []).map((e) => e.label).includes(e) || (K.value = e);
181
201
  }, { immediate: !0 });
182
- let Z = u(() => H.value?.options ? H.value.options.map((e) => ({
202
+ let X = u(() => V.value?.options ? V.value.options.map((e) => ({
183
203
  label: e.label,
184
204
  value: e.label,
185
205
  description: e.description
186
206
  })) : []);
187
- function Q() {
188
- W.value ? V.value++ : $();
207
+ function Z() {
208
+ if (K.value.trim()) {
209
+ $();
210
+ return;
211
+ }
212
+ U.value ? B.value++ : Q();
189
213
  }
190
- function we() {
191
- U.value && V.value--;
214
+ function De() {
215
+ H.value && B.value--;
192
216
  }
193
- function $() {
217
+ function Q() {
194
218
  if (!b.value) return;
195
- let e = B.value.map((e) => ({
219
+ let e = z.value.map((e) => ({
196
220
  id: e.id,
197
- value: q[e.id] ?? null
221
+ value: G[e.id] ?? null
198
222
  }));
199
- if (D.value && !H.value?.allowFreeformInput) {
223
+ if (D.value && !V.value?.allowFreeformInput) {
200
224
  let t = e[0].value;
201
225
  s("select", Array.isArray(t) ? t[0] : t);
202
226
  } else s("select", { answers: e });
203
227
  }
204
- function Te() {
205
- let e = J.value.trim();
206
- e && (q[H.value.id] = e, B.value.length === 1 ? $() : Q(), J.value = "");
228
+ function $() {
229
+ let e = K.value.trim();
230
+ e && (G[V.value.id] = e, K.value = "", z.value.length === 1 ? Q() : Z());
207
231
  }
208
- function Ee() {
209
- b.value && (w.value || D.value) && $();
232
+ function Oe() {
233
+ b.value && (w.value || D.value) && Q();
210
234
  }
211
- function De(e) {
212
- let t = q[e.id];
235
+ function ke(e) {
236
+ let t = G[e.id];
213
237
  return t == null ? "—" : Array.isArray(t) ? t.join(", ") : e.type === "date" ? g(new Date(t), "short") : t;
214
238
  }
215
239
  return (e, r) => {
216
240
  let i = o, s = n, u = a;
217
- return B.value.length ? (x(), p("div", ae, [v.value.input?.title || b.value && B.value.length > 1 ? (x(), p("div", oe, [v.value.input?.title ? (x(), p("div", {
241
+ return z.value.length ? (x(), p("div", ie, [v.value.input?.title || b.value && z.value.length > 1 ? (x(), p("div", ae, [v.value.input?.title ? (x(), p("div", {
218
242
  key: 0,
219
- class: ee(["px-sm py-10 font-bold", { "border-b border-surface-3": b.value && B.value.length > 1 }])
220
- }, T(v.value.input?.title), 3)) : f("", !0), b.value && B.value.length > 1 ? (x(), p("div", se, [m("div", ce, [m("span", null, T(E(c)("showForm.step", {
221
- current: V.value + 1,
222
- total: B.value.length
223
- })), 1), m("span", null, T(K.value) + "%", 1)]), m("div", le, [m("div", {
243
+ class: ee(["px-sm py-10 font-bold", { "border-b border-surface-3": b.value && z.value.length > 1 }])
244
+ }, T(v.value.input?.title), 3)) : f("", !0), b.value && z.value.length > 1 ? (x(), p("div", oe, [m("div", se, [m("span", null, T(E(c)("showForm.step", {
245
+ current: B.value + 1,
246
+ total: z.value.length
247
+ })), 1), m("span", null, T(W.value) + "%", 1)]), m("div", ce, [m("div", {
224
248
  class: "h-full bg-word-4 transition-all duration-300",
225
- style: te({ width: `${K.value}%` })
249
+ style: te({ width: `${W.value}%` })
226
250
  }, null, 4)])])) : f("", !0)])) : f("", !0), b.value ? (x(), p(l, { key: 1 }, [
227
- m("div", ue, [m("div", de, [m("strong", fe, T(H.value.question), 1), H.value.message ? (x(), d(t, {
251
+ m("div", le, [m("div", ue, [m("strong", de, T(V.value.question), 1), V.value.message ? (x(), d(t, {
228
252
  key: 0,
229
- markdown: H.value.message,
253
+ markdown: V.value.message,
230
254
  class: "text-word-2 mt-4"
231
- }, null, 8, ["markdown"])) : f("", !0)]), H.value.options && H.value.multiSelect ? (x(), d(M, {
255
+ }, null, 8, ["markdown"])) : f("", !0)]), V.value.options && V.value.multiSelect ? (x(), d(N, {
232
256
  key: 0,
233
- modelValue: X.value,
234
- "onUpdate:modelValue": r[0] ||= (e) => X.value = e,
235
- name: H.value.id,
236
- options: Z.value,
257
+ modelValue: J.value,
258
+ "onUpdate:modelValue": r[0] ||= (e) => J.value = e,
259
+ name: V.value.id,
260
+ options: X.value,
237
261
  readonly: !b.value,
238
262
  class: "mb-0",
239
263
  vertical: ""
240
- }, h({ _: 2 }, [C(Z.value, (e) => ({
264
+ }, h({ _: 2 }, [C(X.value, (e) => ({
241
265
  name: e.value,
242
- fn: k(() => [m("div", pe, [m("div", me, T(e.label), 1), e.description ? (x(), p("div", he, T(e.description), 1)) : f("", !0)])])
266
+ fn: k(() => [m("div", fe, [m("div", pe, T(e.label), 1), e.description ? (x(), p("div", me, T(e.description), 1)) : f("", !0)])])
243
267
  }))]), 1032, [
244
268
  "modelValue",
245
269
  "name",
246
270
  "options",
247
271
  "readonly"
248
- ])) : H.value.options && !H.value.multiSelect ? (x(), d(j, {
272
+ ])) : V.value.options && !V.value.multiSelect ? (x(), d(M, {
249
273
  key: 1,
250
- modelValue: Y.value,
251
- "onUpdate:modelValue": [r[1] ||= (e) => Y.value = e, Ee],
252
- name: H.value.id,
253
- options: Z.value,
274
+ modelValue: q.value,
275
+ "onUpdate:modelValue": [r[1] ||= (e) => q.value = e, Oe],
276
+ name: V.value.id,
277
+ options: X.value,
254
278
  readonly: !b.value,
255
279
  vertical: "",
256
280
  class: "mb-0"
257
- }, h({ _: 2 }, [C(Z.value, (e) => ({
281
+ }, h({ _: 2 }, [C(X.value, (e) => ({
258
282
  name: e.value,
259
- fn: k(() => [m("div", N, [m("div", P, T(e.label), 1), e.description ? (x(), p("div", F, T(e.description), 1)) : f("", !0)])])
283
+ fn: k(() => [m("div", he, [m("div", ge, T(e.label), 1), e.description ? (x(), p("div", P, T(e.description), 1)) : f("", !0)])])
260
284
  }))]), 1032, [
261
285
  "modelValue",
262
286
  "name",
263
287
  "options",
264
288
  "readonly"
265
- ])) : H.value.options ? f("", !0) : (x(), p("div", I, [_(i, {
266
- modelValue: Y.value,
267
- "onUpdate:modelValue": r[2] ||= (e) => Y.value = e,
268
- placeholder: H.value.placeholder || E(c)("placeholder.insert"),
269
- type: H.value.type,
289
+ ])) : V.value.options ? f("", !0) : (x(), p("div", F, [(x(), d(i, {
290
+ key: V.value.id,
291
+ modelValue: q.value,
292
+ "onUpdate:modelValue": r[2] ||= (e) => q.value = e,
293
+ placeholder: V.value.placeholder || E(c)("placeholder.insert"),
294
+ type: V.value.type,
270
295
  class: "w-full",
271
- name: H.value.id,
296
+ name: V.value.id,
272
297
  modifiers: "compact rounded",
273
298
  disabled: !b.value,
274
- onKeyup: re(Q, ["enter"])
299
+ onKeyup: re(Z, ["enter"])
275
300
  }, null, 8, [
276
301
  "modelValue",
277
302
  "placeholder",
278
303
  "type",
279
304
  "name",
280
305
  "disabled"
281
- ])]))]),
282
- H.value.allowFreeformInput && H.value.options ? (x(), p("div", L, [m("form", {
306
+ ]))]))]),
307
+ V.value.allowFreeformInput && V.value.options ? (x(), p("div", I, [m("form", {
283
308
  class: "flex gap-xs pt-sm",
284
- onSubmit: A(Te, ["prevent"])
285
- }, [_(i, {
286
- modelValue: J.value,
287
- "onUpdate:modelValue": r[3] ||= (e) => J.value = e,
309
+ onSubmit: A($, ["prevent"])
310
+ }, [(x(), d(i, {
311
+ key: `${V.value.id}-custom`,
312
+ modelValue: K.value,
313
+ "onUpdate:modelValue": r[3] ||= (e) => K.value = e,
288
314
  class: "flex-1",
289
- name: `${H.value.id}-custom`,
315
+ name: `${V.value.id}-custom`,
290
316
  modifiers: "compact rounded",
291
317
  disabled: !b.value,
292
- placeholder: H.value.placeholder || E(c)("showForm.otherPlaceholder")
318
+ placeholder: V.value.placeholder || E(c)("showForm.otherPlaceholder")
293
319
  }, null, 8, [
294
320
  "modelValue",
295
321
  "name",
296
322
  "disabled",
297
323
  "placeholder"
298
- ])], 32)])) : f("", !0),
299
- G.value || H.value.multiSelect || !H.value.options ? (x(), p("div", R, [U.value ? (x(), d(s, {
324
+ ]))], 32)])) : f("", !0),
325
+ R.value ? f("", !0) : (x(), p("div", L, [H.value ? (x(), d(s, {
300
326
  key: 0,
301
327
  modifiers: "action-quiet",
302
328
  icon: "ri:arrow-left-s-line",
303
329
  label: E(c)("action.back"),
304
- onClick: A(we, ["stop"])
305
- }, null, 8, ["label"])) : (x(), p("div", ge)), _(s, {
306
- modifiers: W.value ? "action-quiet" : "action-primary",
307
- icon: W.value ? "ri:arrow-right-s-line" : "ri:send-plane-2-line",
330
+ onClick: A(De, ["stop"])
331
+ }, null, 8, ["label"])) : (x(), p("div", _e)), _(s, {
332
+ modifiers: U.value ? "action-quiet" : "action-primary",
333
+ icon: U.value ? "ri:arrow-right-s-line" : "ri:send-plane-2-line",
308
334
  "icon-position": "right",
309
- label: W.value ? E(c)("action.next") : E(c)("action.submit"),
310
- onClick: A(Q, ["stop"])
335
+ label: U.value ? E(c)("action.next") : E(c)("action.submit"),
336
+ onClick: A(Z, ["stop"])
311
337
  }, null, 8, [
312
338
  "modifiers",
313
339
  "icon",
314
340
  "label"
315
- ])])) : f("", !0)
316
- ], 64)) : (x(), p(l, { key: 2 }, [m("div", _e, [m("ul", ve, [(x(!0), p(l, null, C(B.value, (e) => (x(), p("li", {
341
+ ])]))
342
+ ], 64)) : (x(), p(l, { key: 2 }, [m("div", ve, [m("ul", ye, [(x(!0), p(l, null, C(z.value, (e) => (x(), p("li", {
317
343
  key: e.id,
318
344
  class: "leading-normal"
319
- }, [m("div", ye, T(e.question), 1), m("span", z, T(De(e)), 1)]))), 128))])]), m("div", be, [m("div", xe, [_(u, {
345
+ }, [m("div", be, T(e.question), 1), m("span", xe, T(ke(e)), 1)]))), 128))])]), m("div", Se, [m("div", Ce, [_(u, {
320
346
  name: "ri:check-line",
321
347
  class: "text-12"
322
- })]), m("div", Se, [m("span", Ce, T(E(c)("showForm.completed")), 1)])])], 64))])) : f("", !0);
348
+ })]), m("div", we, [m("span", Te, T(E(c)("showForm.completed")), 1)])])], 64))])) : f("", !0);
323
349
  };
324
350
  }
325
- }), V = /* @__PURE__ */ e({ default: () => H }), H = B;
351
+ }), z = /* @__PURE__ */ e({ default: () => B }), B = R;
326
352
  //#endregion
327
- export { j as i, V as n, M as r, H as t };
353
+ export { M as i, z as n, N as r, B as t };
328
354
 
329
- //# sourceMappingURL=PkToolShowForm-C-mWyeka.js.map
355
+ //# sourceMappingURL=PkToolShowForm-j7Ha-0X3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkToolShowForm-j7Ha-0X3.js","names":[],"sources":["../../../../packages/components/src/PkEditorRadioButtons.vue","../../../../packages/components/src/PkEditorRadioButtons.vue","../../../../packages/components/src/PkEditorCheckboxButtons.vue","../../../../packages/components/src/PkEditorCheckboxButtons.vue","../../../../packages/components/src/chat/PkToolShowForm.vue","../../../../packages/components/src/chat/PkToolShowForm.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n import { computed } from 'vue'\n\n const props = defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n modifiers?: string | string[]\n }>()\n\n const modelValue = defineModel<\n string | number | boolean | symbol | unknown[] | undefined\n >()\n\n const radioModifiers = computed(() => {\n const toReturn = props.modifiers\n ? Array.isArray(props.modifiers)\n ? props.modifiers\n : [props.modifiers]\n : []\n return [...toReturn, 'button']\n })\n</script>\n\n<template>\n <VvRadioGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvRadio\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n :modifiers=\"radioModifiers\">\n <slot :name=\"option.value\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvRadio>\n </VvRadioGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n import { computed } from 'vue'\n\n const props = defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n modifiers?: string | string[]\n }>()\n\n const modelValue = defineModel<\n string | number | boolean | symbol | unknown[] | undefined\n >()\n\n const radioModifiers = computed(() => {\n const toReturn = props.modifiers\n ? Array.isArray(props.modifiers)\n ? props.modifiers\n : [props.modifiers]\n : []\n return [...toReturn, 'button']\n })\n</script>\n\n<template>\n <VvRadioGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvRadio\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n :modifiers=\"radioModifiers\">\n <slot :name=\"option.value\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvRadio>\n </VvRadioGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n\n defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n }>()\n\n const modelValue = defineModel<unknown[] | undefined>()\n</script>\n\n<template>\n <VvCheckboxGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvCheckbox\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n modifiers=\"button\">\n <slot :name=\"String(option.value)\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvCheckbox>\n </VvCheckboxGroup>\n</template>\n","<script setup lang=\"ts\">\n import type { Option } from '@volverjs/ui-vue'\n\n defineProps<{\n name: string\n required?: boolean\n options: Option[]\n readonly?: boolean\n disabled?: boolean\n }>()\n\n const modelValue = defineModel<unknown[] | undefined>()\n</script>\n\n<template>\n <VvCheckboxGroup v-model=\"modelValue\" :name modifiers=\"buttons\">\n <VvCheckbox\n v-for=\"(option, key) in options\"\n :key\n :name\n :required\n :readonly\n :disabled\n :value=\"option.value\"\n modifiers=\"button\">\n <slot :name=\"String(option.value)\" v-bind=\"{ option }\">\n {{ option.label }}\n </slot>\n </VvCheckbox>\n </VvCheckboxGroup>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkEditorRadioButtons from '../PkEditorRadioButtons.vue'\n import PkEditorCheckboxButtons from '../PkEditorCheckboxButtons.vue'\n\n // --- Types ---\n\n interface FormOption {\n label: string\n description?: string\n }\n\n interface FormStep {\n id: string\n question: string\n message?: string\n type?: 'text' | 'number' | 'date'\n options?: FormOption[]\n multiSelect?: boolean\n allowFreeformInput?: boolean\n placeholder?: string\n }\n\n interface FormAnswer {\n id: string\n value: string | string[] | number | null\n }\n\n interface ToolPartShape {\n state?: 'input-available' | 'output-available'\n toolCallId?: string\n // AI SDK v5 encodes the tool name in `type` (e.g. 'tool-showMultipleChoice').\n // `toolName` is kept for backward compatibility but is normally absent.\n type?: string\n toolName?: string\n input?: {\n title?: string\n steps?: FormStep[]\n // Legacy showMultipleChoice fields\n question?: string\n options?: (string | FormOption)[]\n }\n // The web card submits `{ answers: [...] }`; the platform channels\n // (Teams modal) submit a flat record keyed by step id.\n output?: string | { answers: FormAnswer[] } | Record<string, unknown>\n }\n\n type AnswerValue = string | string[] | number | null\n\n // --- Props & Emits ---\n\n const props = defineProps<{\n part: unknown\n allowCustomAnswer?: boolean\n }>()\n\n const emit = defineEmits<{\n select: [answer: string | { answers: FormAnswer[] }]\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n\n // --- Parsed tool part ---\n\n const toolPart = computed(\n () => JSON.parse(JSON.stringify(props.part)) as ToolPartShape,\n )\n\n const isLegacy = computed(\n () =>\n toolPart.value.toolName === 'showMultipleChoice' ||\n toolPart.value.type === 'tool-showMultipleChoice',\n )\n\n const isInteractive = computed(\n () => toolPart.value.state === 'input-available',\n )\n\n /** Single-step with no custom-answer and no freeform → auto-submit on option pick */\n const isAutoSubmitStep = computed(() => {\n const step = currentStep.value\n if (!step) return false\n return (\n steps.value.length === 1 &&\n !step.allowFreeformInput &&\n !props.allowCustomAnswer\n )\n })\n\n /** Legacy tool should auto-submit on option pick regardless of allowCustomAnswer */\n const isLegacyAutoSubmit = computed(\n () =>\n isLegacy.value &&\n steps.value.length === 1 &&\n !currentStep.value?.multiSelect,\n )\n\n /**\n * True only for the steps that send themselves as soon as an option is\n * picked: the single case where the footer button would be redundant.\n * Every other shape needs it, single-step forms included: with\n * `allowFreeformInput` (or `allowCustomAnswer`) the radio pick no longer\n * auto-submits, so without the footer the user was left with a chosen\n * option and no way to send it.\n */\n const isSelfSubmitting = computed(\n () =>\n Boolean(currentStep.value?.options) &&\n !currentStep.value?.multiSelect &&\n (isAutoSubmitStep.value || isLegacyAutoSubmit.value),\n )\n\n // --- Steps ---\n\n const steps = computed<FormStep[]>(() => {\n const input = toolPart.value.input\n if (input?.steps?.length) {\n return input.steps\n }\n // Legacy showMultipleChoice → normalize into a single step\n if (input?.question && input?.options) {\n return [\n {\n id: 'legacy',\n question: input.question,\n options: input.options.map((o) =>\n typeof o === 'string' ? { label: o } : o,\n ),\n },\n ]\n }\n return []\n })\n\n // --- Navigation state ---\n\n const currentStepIndex = ref(0)\n const currentStep = computed(() => steps.value[currentStepIndex.value])\n const canGoBack = computed(() => currentStepIndex.value > 0)\n const canGoNext = computed(\n () => currentStepIndex.value < steps.value.length - 1,\n )\n const isMultiStep = computed(() => steps.value.length > 1)\n\n const progress = computed(() => {\n if (!isMultiStep.value) return null\n return Math.round(\n ((currentStepIndex.value + 1) / steps.value.length) * 100,\n )\n })\n\n // --- Answers ---\n\n const answers = reactive<Record<string, AnswerValue>>({})\n const customAnswer = ref('')\n\n // The freeform field belongs to the step showing it: text left behind\n // (unsubmitted, or arriving from a late input update) must not follow the\n // user to the next or previous question.\n watch(currentStepIndex, () => {\n customAnswer.value = ''\n })\n\n // Single scalar answer shared by radio buttons and freeform text/number/date inputs.\n const scalarValue = computed<string | number | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStep.value.id]\n : undefined\n if (val == null || Array.isArray(val)) return undefined\n return val\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStep.value.id] = val ?? null\n }\n },\n })\n\n const activeCheckboxValue = computed<unknown[] | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStep.value.id]\n : undefined\n return Array.isArray(val) ? val : []\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStep.value.id] = (val as string[]) ?? []\n }\n },\n })\n\n // --- Initialize answers from existing output ---\n\n /** The `{ answers: [...] }` list, when the output carries one. */\n function outputAnswers(output: ToolPartShape['output']) {\n if (!output || typeof output === 'string') return undefined\n const list = (output as { answers?: unknown }).answers\n return Array.isArray(list) ? (list as FormAnswer[]) : undefined\n }\n\n watch(\n () => toolPart.value.output,\n (output) => {\n if (!output) return\n if (typeof output === 'string') {\n if (steps.value.length === 1) {\n answers[steps.value[0].id] = output\n }\n return\n }\n const list = outputAnswers(output)\n if (list) {\n for (const a of list) {\n answers[a.id] = a.value\n }\n return\n }\n // Forms answered on a platform channel come back as a flat record\n // keyed by step id: without this the read-only summary showed every\n // answer as a placeholder.\n const record = output as Record<string, unknown>\n for (const step of steps.value) {\n const value = record[step.id]\n if (value !== undefined) {\n answers[step.id] = value as AnswerValue\n }\n }\n },\n { immediate: true },\n )\n\n // --- Restore custom answer from output when it doesn't match any option ---\n\n const normalizedOutput = computed(() => {\n const out = toolPart.value.output\n if (!out) return undefined\n if (typeof out === 'string') return out\n const list = outputAnswers(out)\n if (list?.length === 1) {\n const val = list[0].value\n return Array.isArray(val) ? val.join(', ') : String(val)\n }\n return undefined\n })\n\n watch(\n normalizedOutput,\n (value) => {\n if (!value || !currentStep.value) return\n const optionLabels = (currentStep.value.options ?? []).map(\n (o) => o.label,\n )\n if (!optionLabels.includes(value)) {\n customAnswer.value = value\n }\n },\n { immediate: true },\n )\n\n // --- Option mapping for radio/checkbox components ---\n\n const radioOptions = computed(() => {\n if (!currentStep.value?.options) return []\n return currentStep.value.options.map((option) => ({\n label: option.label,\n value: option.label,\n description: option.description,\n }))\n })\n\n // --- Navigation & Submission ---\n\n /** Footer button, and Enter on a pure freeform step. */\n function goNext() {\n // A typed freeform answer wins over the picked option: it is the more\n // recent intent, and the footer button is now the visible way to send\n // it (the freeform field only submits on Enter).\n if (customAnswer.value.trim()) {\n submitCustomAnswer()\n return\n }\n if (canGoNext.value) {\n currentStepIndex.value++\n } else {\n submitForm()\n }\n }\n\n function goBack() {\n if (canGoBack.value) {\n currentStepIndex.value--\n }\n }\n\n function submitForm() {\n if (!isInteractive.value) return\n\n const finalAnswers: FormAnswer[] = steps.value.map((step) => ({\n id: step.id,\n value: answers[step.id] ?? null,\n }))\n\n // Legacy backward compatibility: single-step, single-select → return plain string\n if (\n isLegacyAutoSubmit.value &&\n !currentStep.value?.allowFreeformInput\n ) {\n const val = finalAnswers[0].value\n emit('select', Array.isArray(val) ? val[0] : (val as string))\n } else {\n emit('select', { answers: finalAnswers })\n }\n }\n\n /** Enter inside the freeform field shown alongside the options. */\n function submitCustomAnswer() {\n const value = customAnswer.value.trim()\n if (!value) return\n\n answers[currentStep.value.id] = value\n // Cleared before navigating: `goNext()` reads it back to route a typed\n // answer here, so leaving it set would recurse.\n customAnswer.value = ''\n if (steps.value.length === 1) {\n submitForm()\n } else {\n goNext()\n }\n }\n\n function onRadioChange() {\n if (!isInteractive.value) return\n if (isAutoSubmitStep.value || isLegacyAutoSubmit.value) {\n submitForm()\n }\n }\n\n // --- Summary helpers ---\n\n function getSummaryValue(step: FormStep) {\n const val = answers[step.id]\n if (val == null) return '—'\n if (Array.isArray(val)) return val.join(', ')\n if (step.type === 'date') return $d(new Date(val), 'short')\n return val\n }\n</script>\n\n<template>\n <div\n v-if=\"steps.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col transition-all bg-surface\">\n <!-- Header -->\n <div\n v-if=\"toolPart.input?.title || (isInteractive && steps.length > 1)\"\n class=\"text-12 border-b border-surface-3 text-word-3 bg-surface-1\">\n <div\n v-if=\"toolPart.input?.title\"\n class=\"px-sm py-10 font-bold\"\n :class=\"{\n 'border-b border-surface-3':\n isInteractive && steps.length > 1,\n }\">\n {{ toolPart.input?.title }}\n </div>\n <!-- Progress for multi-step -->\n <div\n v-if=\"isInteractive && steps.length > 1\"\n class=\"flex flex-col gap-4 p-sm\">\n <div class=\"flex justify-between text-10 text-word-3\">\n <span>\n {{\n $t('showForm.step', {\n current: currentStepIndex + 1,\n total: steps.length,\n })\n }}\n </span>\n <span>{{ progress }}%</span>\n </div>\n <div class=\"h-4 bg-surface-3 rounded-full overflow-hidden\">\n <div\n class=\"h-full bg-word-4 transition-all duration-300\"\n :style=\"{ width: `${progress}%` }\"></div>\n </div>\n </div>\n </div>\n\n <!-- Input Available State -->\n <template v-if=\"isInteractive\">\n <!-- Current Step Content -->\n <div class=\"px-sm py-16 flex flex-col gap-12\">\n <div class=\"leading-normal text-12\">\n <strong class=\"font-semibold\">\n {{ currentStep.question }}\n </strong>\n <PkStreamingMarkdown\n v-if=\"currentStep.message\"\n :markdown=\"currentStep.message\"\n class=\"text-word-2 mt-4\" />\n </div>\n\n <!-- Checkbox list for multi-select -->\n <PkEditorCheckboxButtons\n v-if=\"currentStep.options && currentStep.multiSelect\"\n v-model=\"activeCheckboxValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n class=\"mb-0\"\n vertical>\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorCheckboxButtons>\n\n <!-- Radio buttons for single-select -->\n <PkEditorRadioButtons\n v-else-if=\"currentStep.options && !currentStep.multiSelect\"\n v-model=\"scalarValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n vertical\n class=\"mb-0\"\n @update:model-value=\"onRadioChange\">\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorRadioButtons>\n\n <!-- Pure Freeform Input (text, number, date) -->\n <div\n v-else-if=\"!currentStep.options\"\n class=\"flex flex-col gap-6 w-full\">\n <VvInputText\n :key=\"currentStep.id\"\n v-model=\"scalarValue\"\n :placeholder=\"\n currentStep.placeholder || $t('placeholder.insert')\n \"\n :type=\"currentStep.type\"\n class=\"w-full\"\n :name=\"currentStep.id\"\n modifiers=\"compact rounded\"\n :disabled=\"!isInteractive\"\n @keyup.enter=\"goNext\" />\n </div>\n </div>\n\n <!-- Custom footer freeform input (shown alongside options when allowFreeformInput) -->\n <div\n v-if=\"currentStep.allowFreeformInput && currentStep.options\"\n class=\"px-sm pb-sm border-t border-surface-3\">\n <form\n class=\"flex gap-xs pt-sm\"\n @submit.prevent=\"submitCustomAnswer\">\n <VvInputText\n :key=\"`${currentStep.id}-custom`\"\n v-model=\"customAnswer\"\n class=\"flex-1\"\n :name=\"`${currentStep.id}-custom`\"\n modifiers=\"compact rounded\"\n :disabled=\"!isInteractive\"\n :placeholder=\"\n currentStep.placeholder ||\n $t('showForm.otherPlaceholder')\n \" />\n </form>\n </div>\n\n <!-- Footer navigation: shown for every step that does not submit\n itself on option pick (see `isSelfSubmitting`). -->\n <div\n v-if=\"!isSelfSubmitting\"\n class=\"px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12\">\n <VvButton\n v-if=\"canGoBack\"\n modifiers=\"action-quiet\"\n icon=\"ri:arrow-left-s-line\"\n :label=\"$t('action.back')\"\n @click.stop=\"goBack\" />\n <div v-else></div>\n\n <VvButton\n :modifiers=\"canGoNext ? 'action-quiet' : 'action-primary'\"\n :icon=\"\n canGoNext\n ? 'ri:arrow-right-s-line'\n : 'ri:send-plane-2-line'\n \"\n icon-position=\"right\"\n :label=\"canGoNext ? $t('action.next') : $t('action.submit')\"\n @click.stop=\"goNext\" />\n </div>\n </template>\n\n <!-- Output Available State (Multi-step Summary) -->\n <template v-else>\n <div class=\"px-sm py-12 bg-surface space-y-10\">\n <ul class=\"flex flex-col gap-8\">\n <li\n v-for=\"step in steps\"\n :key=\"step.id\"\n class=\"leading-normal\">\n <div class=\"text-12 text-word-3\">\n {{ step.question }}\n </div>\n <span class=\"text-12 text-word-2 font-semibold\">\n {{ getSummaryValue(step) }}\n </span>\n </li>\n </ul>\n </div>\n <div\n class=\"px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10\">\n <div\n class=\"w-20 h-20 rounded-full border border-success text-success flex items-center justify-center\">\n <VvIcon name=\"ri:check-line\" class=\"text-12\" />\n </div>\n <div class=\"flex flex-col\">\n <span\n class=\"font-semibold text-12 text-word-1 leading-tight\">\n {{ $t('showForm.completed') }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, reactive, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n import PkStreamingMarkdown from './PkStreamingMarkdown.vue'\n import PkEditorRadioButtons from '../PkEditorRadioButtons.vue'\n import PkEditorCheckboxButtons from '../PkEditorCheckboxButtons.vue'\n\n // --- Types ---\n\n interface FormOption {\n label: string\n description?: string\n }\n\n interface FormStep {\n id: string\n question: string\n message?: string\n type?: 'text' | 'number' | 'date'\n options?: FormOption[]\n multiSelect?: boolean\n allowFreeformInput?: boolean\n placeholder?: string\n }\n\n interface FormAnswer {\n id: string\n value: string | string[] | number | null\n }\n\n interface ToolPartShape {\n state?: 'input-available' | 'output-available'\n toolCallId?: string\n // AI SDK v5 encodes the tool name in `type` (e.g. 'tool-showMultipleChoice').\n // `toolName` is kept for backward compatibility but is normally absent.\n type?: string\n toolName?: string\n input?: {\n title?: string\n steps?: FormStep[]\n // Legacy showMultipleChoice fields\n question?: string\n options?: (string | FormOption)[]\n }\n // The web card submits `{ answers: [...] }`; the platform channels\n // (Teams modal) submit a flat record keyed by step id.\n output?: string | { answers: FormAnswer[] } | Record<string, unknown>\n }\n\n type AnswerValue = string | string[] | number | null\n\n // --- Props & Emits ---\n\n const props = defineProps<{\n part: unknown\n allowCustomAnswer?: boolean\n }>()\n\n const emit = defineEmits<{\n select: [answer: string | { answers: FormAnswer[] }]\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n\n // --- Parsed tool part ---\n\n const toolPart = computed(\n () => JSON.parse(JSON.stringify(props.part)) as ToolPartShape,\n )\n\n const isLegacy = computed(\n () =>\n toolPart.value.toolName === 'showMultipleChoice' ||\n toolPart.value.type === 'tool-showMultipleChoice',\n )\n\n const isInteractive = computed(\n () => toolPart.value.state === 'input-available',\n )\n\n /** Single-step with no custom-answer and no freeform → auto-submit on option pick */\n const isAutoSubmitStep = computed(() => {\n const step = currentStep.value\n if (!step) return false\n return (\n steps.value.length === 1 &&\n !step.allowFreeformInput &&\n !props.allowCustomAnswer\n )\n })\n\n /** Legacy tool should auto-submit on option pick regardless of allowCustomAnswer */\n const isLegacyAutoSubmit = computed(\n () =>\n isLegacy.value &&\n steps.value.length === 1 &&\n !currentStep.value?.multiSelect,\n )\n\n /**\n * True only for the steps that send themselves as soon as an option is\n * picked: the single case where the footer button would be redundant.\n * Every other shape needs it, single-step forms included: with\n * `allowFreeformInput` (or `allowCustomAnswer`) the radio pick no longer\n * auto-submits, so without the footer the user was left with a chosen\n * option and no way to send it.\n */\n const isSelfSubmitting = computed(\n () =>\n Boolean(currentStep.value?.options) &&\n !currentStep.value?.multiSelect &&\n (isAutoSubmitStep.value || isLegacyAutoSubmit.value),\n )\n\n // --- Steps ---\n\n const steps = computed<FormStep[]>(() => {\n const input = toolPart.value.input\n if (input?.steps?.length) {\n return input.steps\n }\n // Legacy showMultipleChoice → normalize into a single step\n if (input?.question && input?.options) {\n return [\n {\n id: 'legacy',\n question: input.question,\n options: input.options.map((o) =>\n typeof o === 'string' ? { label: o } : o,\n ),\n },\n ]\n }\n return []\n })\n\n // --- Navigation state ---\n\n const currentStepIndex = ref(0)\n const currentStep = computed(() => steps.value[currentStepIndex.value])\n const canGoBack = computed(() => currentStepIndex.value > 0)\n const canGoNext = computed(\n () => currentStepIndex.value < steps.value.length - 1,\n )\n const isMultiStep = computed(() => steps.value.length > 1)\n\n const progress = computed(() => {\n if (!isMultiStep.value) return null\n return Math.round(\n ((currentStepIndex.value + 1) / steps.value.length) * 100,\n )\n })\n\n // --- Answers ---\n\n const answers = reactive<Record<string, AnswerValue>>({})\n const customAnswer = ref('')\n\n // The freeform field belongs to the step showing it: text left behind\n // (unsubmitted, or arriving from a late input update) must not follow the\n // user to the next or previous question.\n watch(currentStepIndex, () => {\n customAnswer.value = ''\n })\n\n // Single scalar answer shared by radio buttons and freeform text/number/date inputs.\n const scalarValue = computed<string | number | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStep.value.id]\n : undefined\n if (val == null || Array.isArray(val)) return undefined\n return val\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStep.value.id] = val ?? null\n }\n },\n })\n\n const activeCheckboxValue = computed<unknown[] | undefined>({\n get: () => {\n const val = currentStep.value\n ? answers[currentStep.value.id]\n : undefined\n return Array.isArray(val) ? val : []\n },\n set: (val) => {\n if (currentStep.value) {\n answers[currentStep.value.id] = (val as string[]) ?? []\n }\n },\n })\n\n // --- Initialize answers from existing output ---\n\n /** The `{ answers: [...] }` list, when the output carries one. */\n function outputAnswers(output: ToolPartShape['output']) {\n if (!output || typeof output === 'string') return undefined\n const list = (output as { answers?: unknown }).answers\n return Array.isArray(list) ? (list as FormAnswer[]) : undefined\n }\n\n watch(\n () => toolPart.value.output,\n (output) => {\n if (!output) return\n if (typeof output === 'string') {\n if (steps.value.length === 1) {\n answers[steps.value[0].id] = output\n }\n return\n }\n const list = outputAnswers(output)\n if (list) {\n for (const a of list) {\n answers[a.id] = a.value\n }\n return\n }\n // Forms answered on a platform channel come back as a flat record\n // keyed by step id: without this the read-only summary showed every\n // answer as a placeholder.\n const record = output as Record<string, unknown>\n for (const step of steps.value) {\n const value = record[step.id]\n if (value !== undefined) {\n answers[step.id] = value as AnswerValue\n }\n }\n },\n { immediate: true },\n )\n\n // --- Restore custom answer from output when it doesn't match any option ---\n\n const normalizedOutput = computed(() => {\n const out = toolPart.value.output\n if (!out) return undefined\n if (typeof out === 'string') return out\n const list = outputAnswers(out)\n if (list?.length === 1) {\n const val = list[0].value\n return Array.isArray(val) ? val.join(', ') : String(val)\n }\n return undefined\n })\n\n watch(\n normalizedOutput,\n (value) => {\n if (!value || !currentStep.value) return\n const optionLabels = (currentStep.value.options ?? []).map(\n (o) => o.label,\n )\n if (!optionLabels.includes(value)) {\n customAnswer.value = value\n }\n },\n { immediate: true },\n )\n\n // --- Option mapping for radio/checkbox components ---\n\n const radioOptions = computed(() => {\n if (!currentStep.value?.options) return []\n return currentStep.value.options.map((option) => ({\n label: option.label,\n value: option.label,\n description: option.description,\n }))\n })\n\n // --- Navigation & Submission ---\n\n /** Footer button, and Enter on a pure freeform step. */\n function goNext() {\n // A typed freeform answer wins over the picked option: it is the more\n // recent intent, and the footer button is now the visible way to send\n // it (the freeform field only submits on Enter).\n if (customAnswer.value.trim()) {\n submitCustomAnswer()\n return\n }\n if (canGoNext.value) {\n currentStepIndex.value++\n } else {\n submitForm()\n }\n }\n\n function goBack() {\n if (canGoBack.value) {\n currentStepIndex.value--\n }\n }\n\n function submitForm() {\n if (!isInteractive.value) return\n\n const finalAnswers: FormAnswer[] = steps.value.map((step) => ({\n id: step.id,\n value: answers[step.id] ?? null,\n }))\n\n // Legacy backward compatibility: single-step, single-select → return plain string\n if (\n isLegacyAutoSubmit.value &&\n !currentStep.value?.allowFreeformInput\n ) {\n const val = finalAnswers[0].value\n emit('select', Array.isArray(val) ? val[0] : (val as string))\n } else {\n emit('select', { answers: finalAnswers })\n }\n }\n\n /** Enter inside the freeform field shown alongside the options. */\n function submitCustomAnswer() {\n const value = customAnswer.value.trim()\n if (!value) return\n\n answers[currentStep.value.id] = value\n // Cleared before navigating: `goNext()` reads it back to route a typed\n // answer here, so leaving it set would recurse.\n customAnswer.value = ''\n if (steps.value.length === 1) {\n submitForm()\n } else {\n goNext()\n }\n }\n\n function onRadioChange() {\n if (!isInteractive.value) return\n if (isAutoSubmitStep.value || isLegacyAutoSubmit.value) {\n submitForm()\n }\n }\n\n // --- Summary helpers ---\n\n function getSummaryValue(step: FormStep) {\n const val = answers[step.id]\n if (val == null) return '—'\n if (Array.isArray(val)) return val.join(', ')\n if (step.type === 'date') return $d(new Date(val), 'short')\n return val\n }\n</script>\n\n<template>\n <div\n v-if=\"steps.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden flex flex-col transition-all bg-surface\">\n <!-- Header -->\n <div\n v-if=\"toolPart.input?.title || (isInteractive && steps.length > 1)\"\n class=\"text-12 border-b border-surface-3 text-word-3 bg-surface-1\">\n <div\n v-if=\"toolPart.input?.title\"\n class=\"px-sm py-10 font-bold\"\n :class=\"{\n 'border-b border-surface-3':\n isInteractive && steps.length > 1,\n }\">\n {{ toolPart.input?.title }}\n </div>\n <!-- Progress for multi-step -->\n <div\n v-if=\"isInteractive && steps.length > 1\"\n class=\"flex flex-col gap-4 p-sm\">\n <div class=\"flex justify-between text-10 text-word-3\">\n <span>\n {{\n $t('showForm.step', {\n current: currentStepIndex + 1,\n total: steps.length,\n })\n }}\n </span>\n <span>{{ progress }}%</span>\n </div>\n <div class=\"h-4 bg-surface-3 rounded-full overflow-hidden\">\n <div\n class=\"h-full bg-word-4 transition-all duration-300\"\n :style=\"{ width: `${progress}%` }\"></div>\n </div>\n </div>\n </div>\n\n <!-- Input Available State -->\n <template v-if=\"isInteractive\">\n <!-- Current Step Content -->\n <div class=\"px-sm py-16 flex flex-col gap-12\">\n <div class=\"leading-normal text-12\">\n <strong class=\"font-semibold\">\n {{ currentStep.question }}\n </strong>\n <PkStreamingMarkdown\n v-if=\"currentStep.message\"\n :markdown=\"currentStep.message\"\n class=\"text-word-2 mt-4\" />\n </div>\n\n <!-- Checkbox list for multi-select -->\n <PkEditorCheckboxButtons\n v-if=\"currentStep.options && currentStep.multiSelect\"\n v-model=\"activeCheckboxValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n class=\"mb-0\"\n vertical>\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorCheckboxButtons>\n\n <!-- Radio buttons for single-select -->\n <PkEditorRadioButtons\n v-else-if=\"currentStep.options && !currentStep.multiSelect\"\n v-model=\"scalarValue\"\n :name=\"currentStep.id\"\n :options=\"radioOptions\"\n :readonly=\"!isInteractive\"\n vertical\n class=\"mb-0\"\n @update:model-value=\"onRadioChange\">\n <template\n v-for=\"option in radioOptions\"\n :key=\"option.value\"\n #[option.value]>\n <!-- Shared option layout: label + optional description -->\n <div class=\"text-12\">\n <div class=\"font-semibold\">{{ option.label }}</div>\n <div v-if=\"option.description\" class=\"text-word-3\">\n {{ option.description }}\n </div>\n </div>\n </template>\n </PkEditorRadioButtons>\n\n <!-- Pure Freeform Input (text, number, date) -->\n <div\n v-else-if=\"!currentStep.options\"\n class=\"flex flex-col gap-6 w-full\">\n <VvInputText\n :key=\"currentStep.id\"\n v-model=\"scalarValue\"\n :placeholder=\"\n currentStep.placeholder || $t('placeholder.insert')\n \"\n :type=\"currentStep.type\"\n class=\"w-full\"\n :name=\"currentStep.id\"\n modifiers=\"compact rounded\"\n :disabled=\"!isInteractive\"\n @keyup.enter=\"goNext\" />\n </div>\n </div>\n\n <!-- Custom footer freeform input (shown alongside options when allowFreeformInput) -->\n <div\n v-if=\"currentStep.allowFreeformInput && currentStep.options\"\n class=\"px-sm pb-sm border-t border-surface-3\">\n <form\n class=\"flex gap-xs pt-sm\"\n @submit.prevent=\"submitCustomAnswer\">\n <VvInputText\n :key=\"`${currentStep.id}-custom`\"\n v-model=\"customAnswer\"\n class=\"flex-1\"\n :name=\"`${currentStep.id}-custom`\"\n modifiers=\"compact rounded\"\n :disabled=\"!isInteractive\"\n :placeholder=\"\n currentStep.placeholder ||\n $t('showForm.otherPlaceholder')\n \" />\n </form>\n </div>\n\n <!-- Footer navigation: shown for every step that does not submit\n itself on option pick (see `isSelfSubmitting`). -->\n <div\n v-if=\"!isSelfSubmitting\"\n class=\"px-sm py-10 bg-surface border-t border-surface-3 flex justify-between gap-12\">\n <VvButton\n v-if=\"canGoBack\"\n modifiers=\"action-quiet\"\n icon=\"ri:arrow-left-s-line\"\n :label=\"$t('action.back')\"\n @click.stop=\"goBack\" />\n <div v-else></div>\n\n <VvButton\n :modifiers=\"canGoNext ? 'action-quiet' : 'action-primary'\"\n :icon=\"\n canGoNext\n ? 'ri:arrow-right-s-line'\n : 'ri:send-plane-2-line'\n \"\n icon-position=\"right\"\n :label=\"canGoNext ? $t('action.next') : $t('action.submit')\"\n @click.stop=\"goNext\" />\n </div>\n </template>\n\n <!-- Output Available State (Multi-step Summary) -->\n <template v-else>\n <div class=\"px-sm py-12 bg-surface space-y-10\">\n <ul class=\"flex flex-col gap-8\">\n <li\n v-for=\"step in steps\"\n :key=\"step.id\"\n class=\"leading-normal\">\n <div class=\"text-12 text-word-3\">\n {{ step.question }}\n </div>\n <span class=\"text-12 text-word-2 font-semibold\">\n {{ getSummaryValue(step) }}\n </span>\n </li>\n </ul>\n </div>\n <div\n class=\"px-sm py-12 bg-surface border-t border-surface-3 flex items-center gap-10\">\n <div\n class=\"w-20 h-20 rounded-full border border-success text-success flex items-center justify-center\">\n <VvIcon name=\"ri:check-line\" class=\"text-12\" />\n </div>\n <div class=\"flex flex-col\">\n <span\n class=\"font-semibold text-12 text-word-1 leading-tight\">\n {{ $t('showForm.completed') }}\n </span>\n </div>\n </div>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAII,IAAM,IAAQ,GASR,IAAa,EAElB,GAAA,YAAC,GAEI,IAAiB,QAMZ,CAAC,GALS,EAAM,YACjB,MAAM,QAAQ,EAAM,SAAS,IACzB,EAAM,YACN,CAAC,EAAM,SAAS,IACpB,CAAC,GACc,QAAQ,CAChC;;;eAID,EAce,GAAA;gBAdQ,EAAA;6CAAU,QAAA;IAAG,MAAA,EAAA;IAAK,WAAU;;qBAEX,EAAA,EAAA,EAAA,GADpC,EAYU,GAAA,MAAA,EAXkB,EAAA,UAAhB,GAAQ,YADpB,EAYU,GAAA;KAVL;KACA,MAAA,EAAA;KACA,UAAA,EAAA;KACA,UAAA,EAAA;KACA,UAAA,EAAA;KACA,OAAO,EAAO;KACd,WAAW,EAAA;;sBAGL,CAFP,EAEO,EAAA,QAFM,EAAO,OAApB,EAEO,EAA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