@8wave/ai-elements 0.119.0-beta.26 → 0.119.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Agent-D8YrsP52.js → Agent-Gdgpd3LA.js} +66 -66
- package/dist/_chunks/Agent-Gdgpd3LA.js.map +1 -0
- package/dist/_chunks/{PkChatbotFilePreview-DAhN8TyL.js → PkChatbotFilePreview-DiuzVVKH.js} +2 -2
- package/dist/_chunks/{PkChatbotFilePreview-DAhN8TyL.js.map → PkChatbotFilePreview-DiuzVVKH.js.map} +1 -1
- package/dist/_chunks/{PkStreamingMarkdown-Bry3y6Ru.js → PkStreamingMarkdown-DKyHYHUN.js} +890 -853
- package/dist/_chunks/{PkStreamingMarkdown-Bry3y6Ru.js.map → PkStreamingMarkdown-DKyHYHUN.js.map} +1 -1
- package/dist/_chunks/{PkToolEditSpreadsheet-5vHzEy4P.js → PkToolEditSpreadsheet-CfJ3BWMe.js} +3 -3
- package/dist/_chunks/{PkToolEditSpreadsheet-5vHzEy4P.js.map → PkToolEditSpreadsheet-CfJ3BWMe.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-Cj8hTfNF.js → PkToolRequestGeolocation-PxhQxMP1.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-Cj8hTfNF.js.map → PkToolRequestGeolocation-PxhQxMP1.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-BWxR1hV4.js → PkToolRequestOAuthConnection-klmrRZWz.js} +6 -5
- package/dist/_chunks/PkToolRequestOAuthConnection-klmrRZWz.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-CfJLe8vD.js → PkToolShowArtifact-ChDm6ZEK.js} +3 -3
- package/dist/_chunks/PkToolShowArtifact-ChDm6ZEK.js.map +1 -0
- package/dist/_chunks/{PkToolShowCalendarEvent-Bp_yv8S7.js → PkToolShowCalendarEvent-CRVtR3oP.js} +5 -4
- package/dist/_chunks/PkToolShowCalendarEvent-CRVtR3oP.js.map +1 -0
- package/dist/_chunks/{PkToolShowComparison-Bvd4f4tJ.js → PkToolShowComparison-DLC22e1W.js} +4 -3
- package/dist/_chunks/PkToolShowComparison-DLC22e1W.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm--9XOVqNB.js → PkToolShowContactForm-CfCy-b8w.js} +6 -6
- package/dist/_chunks/PkToolShowContactForm-CfCy-b8w.js.map +1 -0
- package/dist/_chunks/{PkToolShowDiagram-C-pNbC9n.js → PkToolShowDiagram-JpRMa4Jj.js} +11 -10
- package/dist/_chunks/PkToolShowDiagram-JpRMa4Jj.js.map +1 -0
- package/dist/_chunks/{PkToolShowEmail-BKel_O29.js → PkToolShowEmail-C7mUCqGL.js} +4 -3
- package/dist/_chunks/PkToolShowEmail-C7mUCqGL.js.map +1 -0
- package/dist/_chunks/{PkToolShowForm-CGAc1O6K.js → PkToolShowForm-DnIwTGl4.js} +6 -5
- package/dist/_chunks/PkToolShowForm-DnIwTGl4.js.map +1 -0
- package/dist/_chunks/{PkToolShowImageGallery-CIhIrIcY.js → PkToolShowImageGallery-Ab8fJ9jY.js} +4 -4
- package/dist/_chunks/{PkToolShowImageGallery-CIhIrIcY.js.map → PkToolShowImageGallery-Ab8fJ9jY.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-78C7jFiV.js → PkToolShowLocation-D5d6bbP-.js} +5 -4
- package/dist/_chunks/PkToolShowLocation-D5d6bbP-.js.map +1 -0
- package/dist/_chunks/{PkToolShowMessage-BScy-w4J.js → PkToolShowMessage-vw4XS4TR.js} +4 -3
- package/dist/_chunks/PkToolShowMessage-vw4XS4TR.js.map +1 -0
- package/dist/_chunks/{PkToolShowProductList-BjWKnbyD.js → PkToolShowProductList-DztzZVDd.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-BjWKnbyD.js.map → PkToolShowProductList-DztzZVDd.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-B70jPHDw.js → PkToolShowQrCode-BhcAUXSZ.js} +4 -3
- package/dist/_chunks/PkToolShowQrCode-BhcAUXSZ.js.map +1 -0
- package/dist/_chunks/{PkToolShowSources-BJ-XFrLD.js → PkToolShowSources-Bvg3f3GC.js} +52 -51
- package/dist/_chunks/PkToolShowSources-Bvg3f3GC.js.map +1 -0
- package/dist/_chunks/{PkToolShowSuggestedReply-0KahUIlw.js → PkToolShowSuggestedReply-BISQY1ce.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-0KahUIlw.js.map → PkToolShowSuggestedReply-BISQY1ce.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-_V_d-PDr.js → PkToolShowVideo-DdoYLl7R.js} +3 -3
- package/dist/_chunks/{PkToolShowVideo-_V_d-PDr.js.map → PkToolShowVideo-DdoYLl7R.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-DfLsFayn.js → PkToolShowWeather-CnpPZCLm.js} +2 -2
- package/dist/_chunks/{PkToolShowWeather-DfLsFayn.js.map → PkToolShowWeather-CnpPZCLm.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-D55VEPjK.js → PkToolShowWebPages-BooCEJrs.js} +3 -3
- package/dist/_chunks/{PkToolShowWebPages-D55VEPjK.js.map → PkToolShowWebPages-BooCEJrs.js.map} +1 -1
- package/dist/_chunks/VvButtonLocalized-DV-zbH9b.js +21 -0
- package/dist/_chunks/VvButtonLocalized-DV-zbH9b.js.map +1 -0
- package/dist/_chunks/{chatImagePolicy-DXkhb-N_.js → chatImagePolicy-CfJt8_9Z.js} +3 -3
- package/dist/_chunks/{chatImagePolicy-DXkhb-N_.js.map → chatImagePolicy-CfJt8_9Z.js.map} +1 -1
- package/dist/_chunks/{index.es-BrsciU25.js → index.es-oI6RqNZW.js} +2 -2
- package/dist/_chunks/{index.es-BrsciU25.js.map → index.es-oI6RqNZW.js.map} +1 -1
- package/dist/_chunks/{markdown-DpoAzJSk.js → markdown-BbaLt57-.js} +8 -8
- package/dist/_chunks/{markdown-DpoAzJSk.js.map → markdown-BbaLt57-.js.map} +1 -1
- package/dist/_chunks/{src-Dt4rhhPN.js → src-DL9TKN-Z.js} +2 -2
- package/dist/_chunks/src-DL9TKN-Z.js.map +1 -0
- package/dist/_chunks/text-BHCGblDQ.js +6 -0
- package/dist/_chunks/text-BHCGblDQ.js.map +1 -0
- package/dist/_chunks/{useLightbox-pPBe746W.js → useLightbox-1KKLemEE.js} +2 -2
- package/dist/_chunks/{useLightbox-pPBe746W.js.map → useLightbox-1KKLemEE.js.map} +1 -1
- package/dist/ai-elements.es.js +2792 -2529
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAudioTranscript.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotError.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/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/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/PkChatbotWakeupBar.js +1 -1
- package/dist-vue/_chunks/{Agent-dGF8mkG9.js → Agent-DU1WWaHR.js} +87 -87
- package/dist-vue/_chunks/Agent-DU1WWaHR.js.map +1 -0
- package/dist-vue/_chunks/{Document-CV-RJu_p.js → Document-Cto-Qws0.js} +2 -2
- package/dist-vue/_chunks/{Document-CV-RJu_p.js.map → Document-Cto-Qws0.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-536vsOfp.js → PkChatbot-C18mnGJ9.js} +86 -85
- package/dist-vue/_chunks/PkChatbot-C18mnGJ9.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotAudioTranscript-BUxBHanA.js → PkChatbotAudioTranscript-0rvrhSRQ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotAudioTranscript-BUxBHanA.js.map → PkChatbotAudioTranscript-0rvrhSRQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotAuth-BMLLTSwK.js → PkChatbotAuth-BVZzjbK9.js} +4 -3
- package/dist-vue/_chunks/PkChatbotAuth-BVZzjbK9.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-Toj4CqXV.js → PkChatbotEmptyState-BKiyP0Ga.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-Toj4CqXV.js.map → PkChatbotEmptyState-BKiyP0Ga.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotError-CRGbK09-.js → PkChatbotError-BV5ga7hk.js} +4 -3
- package/dist-vue/_chunks/PkChatbotError-BV5ga7hk.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-CMFXjoKR.js → PkChatbotFeedbackForm-B5cYsWBr.js} +8 -7
- package/dist-vue/_chunks/PkChatbotFeedbackForm-B5cYsWBr.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotFilePreview-DIP8KLkS.js → PkChatbotFilePreview-D5H-RIk2.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-DIP8KLkS.js.map → PkChatbotFilePreview-D5H-RIk2.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BfZqRpQ2.js → PkChatbotInput-GvgsYsUw.js} +8 -7
- package/dist-vue/_chunks/PkChatbotInput-GvgsYsUw.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js +876 -0
- package/dist-vue/_chunks/PkChatbotMessages-CDLsj7qw.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-D0eoPBQ8.js → PkChatbotStepPayload-Dm-HCHcG.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-D0eoPBQ8.js.map → PkChatbotStepPayload-Dm-HCHcG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CMx4cw1D.js → PkChatbotStepToolDetail-Bpd_cZEO.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CMx4cw1D.js.map → PkChatbotStepToolDetail-Bpd_cZEO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotSteps-DeZQhGRU.js → PkChatbotSteps-C4qBM3_t.js} +40 -40
- package/dist-vue/_chunks/{PkChatbotSteps-DeZQhGRU.js.map → PkChatbotSteps-C4qBM3_t.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CVT6OUIv.js → PkChatbotViewChat-By2TY72m.js} +13 -13
- package/dist-vue/_chunks/{PkChatbotViewChat-CVT6OUIv.js.map → PkChatbotViewChat-By2TY72m.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-CU5NfEO4.js +199 -0
- package/dist-vue/_chunks/PkChatbotViewConversations-CU5NfEO4.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewFiles-CA20TBFY.js → PkChatbotViewFiles-CD-UZPT5.js} +18 -17
- package/dist-vue/_chunks/PkChatbotViewFiles-CD-UZPT5.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewProfile-CyzRxE3D.js → PkChatbotViewProfile-DPlb_Wca.js} +11 -10
- package/dist-vue/_chunks/PkChatbotViewProfile-DPlb_Wca.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotWakeupBar-jBti21FQ.js → PkChatbotWakeupBar-Cjgarxnw.js} +3 -2
- package/dist-vue/_chunks/PkChatbotWakeupBar-Cjgarxnw.js.map +1 -0
- package/dist-vue/_chunks/{PkStreamingMarkdown-C55Fi0Pd.js → PkStreamingMarkdown-CsHzdW69.js} +24 -24
- package/dist-vue/_chunks/{PkStreamingMarkdown-C55Fi0Pd.js.map → PkStreamingMarkdown-CsHzdW69.js.map} +1 -1
- package/dist-vue/_chunks/{PkSvgViewer-Ts3gQ1hB.js → PkSvgViewer-D6DJ2jVO.js} +7 -6
- package/dist-vue/_chunks/PkSvgViewer-D6DJ2jVO.js.map +1 -0
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-HAskd6d3.js → PkToolEditSpreadsheet-D8Zp9gzW.js} +3 -3
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-HAskd6d3.js.map → PkToolEditSpreadsheet-D8Zp9gzW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BE22qwxB.js → PkToolRequestGeolocation-JZYgc-2X.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BE22qwxB.js.map → PkToolRequestGeolocation-JZYgc-2X.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-GfSalEJG.js → PkToolRequestOAuthConnection-DosWR9I4.js} +11 -10
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-DosWR9I4.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-z1qTnFkA.js → PkToolShowArtifact-BVofKJ7b.js} +5 -5
- package/dist-vue/_chunks/PkToolShowArtifact-BVofKJ7b.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowCalendarEvent-Dv_rss26.js → PkToolShowCalendarEvent-u9O_Sl3-.js} +8 -7
- package/dist-vue/_chunks/PkToolShowCalendarEvent-u9O_Sl3-.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowComparison-DQs3E6-k.js → PkToolShowComparison-c2e239T4.js} +3 -2
- package/dist-vue/_chunks/PkToolShowComparison-c2e239T4.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-Y0lrHXhr.js → PkToolShowContactForm-BzdIFTnC.js} +13 -13
- package/dist-vue/_chunks/PkToolShowContactForm-BzdIFTnC.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowDiagram-7WxDObZ6.js → PkToolShowDiagram-CaoB4k6y.js} +11 -10
- package/dist-vue/_chunks/PkToolShowDiagram-CaoB4k6y.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowEmail-C591LR5N.js → PkToolShowEmail-CUgZN0J5.js} +8 -7
- package/dist-vue/_chunks/PkToolShowEmail-CUgZN0J5.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowForm-CZFWZub7.js → PkToolShowForm-vYuaPtu0.js} +14 -13
- package/dist-vue/_chunks/PkToolShowForm-vYuaPtu0.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowImageGallery-CkfXP_lD.js → PkToolShowImageGallery-ooygXk7j.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowImageGallery-CkfXP_lD.js.map → PkToolShowImageGallery-ooygXk7j.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-Dyz6h_0n.js → PkToolShowLocation-DVMpFdRk.js} +14 -13
- package/dist-vue/_chunks/PkToolShowLocation-DVMpFdRk.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowMessage-CbXERPHI.js → PkToolShowMessage-ATTN5Hac.js} +8 -7
- package/dist-vue/_chunks/PkToolShowMessage-ATTN5Hac.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowProductList-De-PtmD-.js → PkToolShowProductList-D-HJ9a_h.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-De-PtmD-.js.map → PkToolShowProductList-D-HJ9a_h.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowQrCode-DEAvfLFu.js → PkToolShowQrCode-D_5VUtEB.js} +3 -2
- package/dist-vue/_chunks/PkToolShowQrCode-D_5VUtEB.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-CSN7S0zo.js → PkToolShowSources-DJ35l3Z3.js} +58 -57
- package/dist-vue/_chunks/PkToolShowSources-DJ35l3Z3.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DjutyiEi.js → PkToolShowSuggestedReply-I6FBos-F.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DjutyiEi.js.map → PkToolShowSuggestedReply-I6FBos-F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-B_Q93E2y.js → PkToolShowVideo-xcg1gdIE.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowVideo-B_Q93E2y.js.map → PkToolShowVideo-xcg1gdIE.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWeather-BOuNrvY2.js → PkToolShowWeather-DJxKxVp_.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWeather-BOuNrvY2.js.map → PkToolShowWeather-DJxKxVp_.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-D3CdjJUc.js → PkToolShowWebPages-BuaRjavD.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowWebPages-D3CdjJUc.js.map → PkToolShowWebPages-BuaRjavD.js.map} +1 -1
- package/dist-vue/_chunks/VvButtonLocalized-BuzLsXp3.js +20 -0
- package/dist-vue/_chunks/VvButtonLocalized-BuzLsXp3.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-DSLxswr4.js → createChatbotApiClient-G3Tt1I67.js} +18 -18
- package/dist-vue/_chunks/{createChatbotApiClient-DSLxswr4.js.map → createChatbotApiClient-G3Tt1I67.js.map} +1 -1
- package/dist-vue/_chunks/{mcpOAuthReport-BeZDTl87.js → mcpOAuthReport-3A9v_gW_.js} +2 -2
- package/dist-vue/_chunks/{mcpOAuthReport-BeZDTl87.js.map → mcpOAuthReport-3A9v_gW_.js.map} +1 -1
- package/dist-vue/_chunks/{src-DCfvejyT.js → src-DpkuiHam.js} +2 -2
- package/dist-vue/_chunks/src-DpkuiHam.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-rtl-oKqU.js → useChatbotStore-C1sgxgD1.js} +5 -5
- package/dist-vue/_chunks/{useChatbotStore-rtl-oKqU.js.map → useChatbotStore-C1sgxgD1.js.map} +1 -1
- package/dist-vue/_chunks/{useSafeLocalStorage-OwzVTZud.js → useSafeLocalStorage-DLIc8pkn.js} +2 -2
- package/dist-vue/_chunks/{useSafeLocalStorage-OwzVTZud.js.map → useSafeLocalStorage-DLIc8pkn.js.map} +1 -1
- package/dist-vue/_chunks/{utils-CwIMEuAv.js → utils-DsnEcdW3.js} +143 -79
- package/dist-vue/_chunks/utils-DsnEcdW3.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +279 -27
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3909 -3881
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +42 -6
- package/dist-vue/packages/components/src/PkEditorMarkdown.d.ts +3 -2
- package/dist-vue/packages/components/src/VvButtonLocalized.d.ts +11 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +1 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +30 -0
- package/dist-vue/packages/components/src/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/_chunks/Agent-D8YrsP52.js.map +0 -1
- package/dist/_chunks/PkToolRequestOAuthConnection-BWxR1hV4.js.map +0 -1
- package/dist/_chunks/PkToolShowArtifact-CfJLe8vD.js.map +0 -1
- package/dist/_chunks/PkToolShowCalendarEvent-Bp_yv8S7.js.map +0 -1
- package/dist/_chunks/PkToolShowComparison-Bvd4f4tJ.js.map +0 -1
- package/dist/_chunks/PkToolShowContactForm--9XOVqNB.js.map +0 -1
- package/dist/_chunks/PkToolShowDiagram-C-pNbC9n.js.map +0 -1
- package/dist/_chunks/PkToolShowEmail-BKel_O29.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-CGAc1O6K.js.map +0 -1
- package/dist/_chunks/PkToolShowLocation-78C7jFiV.js.map +0 -1
- package/dist/_chunks/PkToolShowMessage-BScy-w4J.js.map +0 -1
- package/dist/_chunks/PkToolShowQrCode-B70jPHDw.js.map +0 -1
- package/dist/_chunks/PkToolShowSources-BJ-XFrLD.js.map +0 -1
- package/dist/_chunks/src-Dt4rhhPN.js.map +0 -1
- package/dist/_chunks/text-DbSEK8si.js +0 -6
- package/dist/_chunks/text-DbSEK8si.js.map +0 -1
- package/dist-vue/_chunks/Agent-dGF8mkG9.js.map +0 -1
- package/dist-vue/_chunks/PkChatbot-536vsOfp.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotAuth-BMLLTSwK.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotError-CRGbK09-.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotFeedbackForm-CMFXjoKR.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-BfZqRpQ2.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-CnI3e9wF.js +0 -869
- package/dist-vue/_chunks/PkChatbotMessages-CnI3e9wF.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewConversations-DHeFtAfN.js +0 -197
- package/dist-vue/_chunks/PkChatbotViewConversations-DHeFtAfN.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewFiles-CA20TBFY.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewProfile-CyzRxE3D.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotWakeupBar-jBti21FQ.js.map +0 -1
- package/dist-vue/_chunks/PkSvgViewer-Ts3gQ1hB.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestOAuthConnection-GfSalEJG.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowArtifact-z1qTnFkA.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowCalendarEvent-Dv_rss26.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowContactForm-Y0lrHXhr.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowDiagram-7WxDObZ6.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowEmail-C591LR5N.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-CZFWZub7.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowLocation-Dyz6h_0n.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowMessage-CbXERPHI.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowQrCode-DEAvfLFu.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowSources-CSN7S0zo.js.map +0 -1
- package/dist-vue/_chunks/src-DCfvejyT.js.map +0 -1
- package/dist-vue/_chunks/utils-CwIMEuAv.js.map +0 -1
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { t as e } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
2
|
+
import { n as t } from "./useChatbotStore-C1sgxgD1.js";
|
|
3
|
+
import "./src-DpkuiHam.js";
|
|
4
|
+
import { t as n } from "./markdown-CCMpGUA7.js";
|
|
5
|
+
import { r } from "./message-BOiF6Bt5.js";
|
|
6
|
+
import { w as i } from "./utils-DsnEcdW3.js";
|
|
7
|
+
import { t as a } from "./useDialogConfirm-BxhvsnRr.js";
|
|
8
|
+
import { t as o } from "./PkRelativeTime--1cIphlA.js";
|
|
9
|
+
import { t as s } from "./chatbotProfileContext-CgnFhNPn.js";
|
|
10
|
+
import { VvButtonGroup as c, VvDropdown as l, VvDropdownAction as ee, VvIcon as te, VvInputText as ne } from "@volverjs/ui-vue/components";
|
|
11
|
+
import { Fragment as u, computed as d, createBlock as re, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, inject as v, isRef as ie, mergeProps as ae, normalizeClass as y, openBlock as b, ref as x, renderList as S, toDisplayString as C, unref as w, withCtx as T, withModifiers as E } from "vue";
|
|
12
|
+
import { useI18n as oe } from "vue-i18n";
|
|
13
|
+
import { storeToRefs as se } from "pinia";
|
|
14
|
+
//#region ../../packages/composable/src/chatbot/useConversationActions.ts
|
|
15
|
+
function D(e) {
|
|
16
|
+
return n(e.title) || n(r(e.messages?.find((e) => e.role === "user"))) || "";
|
|
17
|
+
}
|
|
18
|
+
function O(e) {
|
|
19
|
+
let t = x(null), r = x(""), i = (e, i = "") => {
|
|
20
|
+
t.value = e.id, r.value = n(e.title) || i;
|
|
21
|
+
}, o = async (n) => {
|
|
22
|
+
let i = r.value.trim();
|
|
23
|
+
if (t.value = null, i && i.length <= 255) try {
|
|
24
|
+
await e.renameChatTitle(n, i);
|
|
25
|
+
} catch {}
|
|
26
|
+
}, s = () => {
|
|
27
|
+
t.value = null;
|
|
28
|
+
}, c = (e, t) => {
|
|
29
|
+
e.key === "Enter" ? (e.preventDefault(), o(t)) : e.key === "Escape" && (e.preventDefault(), s());
|
|
30
|
+
}, { openDialogConfirm: l } = a();
|
|
31
|
+
return {
|
|
32
|
+
editingId: t,
|
|
33
|
+
editingTitle: r,
|
|
34
|
+
startEdit: i,
|
|
35
|
+
confirmEdit: o,
|
|
36
|
+
cancelEdit: s,
|
|
37
|
+
onRenameKeydown: c,
|
|
38
|
+
requestDelete: async (t) => {
|
|
39
|
+
try {
|
|
40
|
+
if (!await l()) return;
|
|
41
|
+
await e.deleteChat(t);
|
|
42
|
+
} catch {}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region ../../packages/components/src/chat/PkChatbotViewConversations.vue?vue&type=script&setup=true&lang.ts
|
|
48
|
+
var ce = { class: "flex flex-col flex-1 min-h-0 relative" }, le = {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: "vv-item-group vv-item-group--fill"
|
|
51
|
+
}, ue = { class: "vv-item-group__list" }, de = { class: "vv-item__entry" }, fe = { class: "flex flex-col gap-6 flex-1 min-w-0" }, pe = {
|
|
52
|
+
key: 1,
|
|
53
|
+
class: "flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center"
|
|
54
|
+
}, k = { class: "w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center" }, A = { class: "flex flex-col gap-4" }, j = { class: "text-16 font-semibold text-word-1" }, M = { class: "text-14 text-word-3 leading-relaxed" }, N = {
|
|
55
|
+
key: 2,
|
|
56
|
+
class: "vv-item-group vv-item-group--fill"
|
|
57
|
+
}, P = { class: "vv-item-group__list overflow-y-auto pb-64 light-scrollbar" }, F = {
|
|
58
|
+
key: 0,
|
|
59
|
+
class: "flex flex-1 items-center gap-8 min-w-0 px-md py-12"
|
|
60
|
+
}, I = ["aria-current", "onClick"], L = { class: "min-w-0 flex-1" }, R = { class: "flex items-center gap-8" }, z = { class: "vv-item__title font-medium flex-1" }, B = { class: "text-12 text-word-4 line-clamp-2" }, me = { class: "vv-item__actions" }, he = {
|
|
61
|
+
key: 3,
|
|
62
|
+
class: "absolute bottom-0 left-0 right-0 flex flex-col items-center gap-4 px-16 pb-16 pt-32 pointer-events-none",
|
|
63
|
+
style: { background: "linear-gradient(to top, var(--color-surface) 55%, transparent)" }
|
|
64
|
+
}, V = /* @__PURE__ */ _({
|
|
65
|
+
__name: "PkChatbotViewConversations",
|
|
66
|
+
props: { agentId: {} },
|
|
67
|
+
setup(_) {
|
|
68
|
+
let D = _, { t: V } = oe({ useScope: "global" }), H = t(D.agentId), { conversations: U, isLoadingConversations: ge, localChatId: W } = se(H), { navigate: _e, startNewChat: G, renameChatTitle: ve, deleteChat: ye } = H, { editingId: K, editingTitle: q, startEdit: be, confirmEdit: xe, cancelEdit: Se, onRenameKeydown: Ce, requestDelete: we } = O({
|
|
69
|
+
renameChatTitle: ve,
|
|
70
|
+
deleteChat: ye
|
|
71
|
+
}), Te = (e) => {
|
|
72
|
+
K.value || (W.value = e, _e("chat"));
|
|
73
|
+
}, J = (e) => W.value === e.id, Y = (e, t) => n(r(e.filter((e) => e.role === t).slice(-1)[0]) || ""), Ee = (e) => {
|
|
74
|
+
be(e, Y(e.messages, "assistant"));
|
|
75
|
+
}, { openDialogConfirm: X } = a(), Z = v(s, void 0), Q = d(() => !!Z?.eraseConversations && !(Z.isExternalAuth?.value ?? !1)), $ = x(!1), De = async () => {
|
|
76
|
+
let e = Z?.eraseConversations;
|
|
77
|
+
if (e && Q.value && await X({
|
|
78
|
+
title: V("confirmTitle.deleteMyConversations"),
|
|
79
|
+
questionLabel: V("message.deleteMyConversationsConfirm")
|
|
80
|
+
})) {
|
|
81
|
+
$.value = !0;
|
|
82
|
+
try {
|
|
83
|
+
await e(), U.value = [], G();
|
|
84
|
+
} catch {
|
|
85
|
+
H.loadConversations(D.agentId);
|
|
86
|
+
} finally {
|
|
87
|
+
$.value = !1;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return (t, r) => {
|
|
92
|
+
let a = te, s = e, d = ne, _ = c, v = ee, x = l;
|
|
93
|
+
return b(), p("div", ce, [w(ge) && w(U).length === 0 ? (b(), p("div", le, [m("div", ue, [(b(), p(u, null, S(5, (e) => m("div", {
|
|
94
|
+
key: e,
|
|
95
|
+
class: "vv-item vv-item--roomy vv-item--plain"
|
|
96
|
+
}, [m("div", de, [m("div", fe, [
|
|
97
|
+
m("div", { class: y(["vv-skeleton h-16 rounded", e % 2 ? "w-192" : "w-128"]) }, [...r[5] ||= [m("div", { class: "vv-skeleton__item" }, null, -1)]], 2),
|
|
98
|
+
r[6] ||= m("div", { class: "vv-skeleton h-12 rounded" }, [m("div", { class: "vv-skeleton__item" })], -1),
|
|
99
|
+
r[7] ||= m("div", { class: "vv-skeleton h-12 rounded w-160" }, [m("div", { class: "vv-skeleton__item" })], -1)
|
|
100
|
+
])])])), 64))])])) : w(U).length === 0 ? (b(), p("div", pe, [
|
|
101
|
+
m("div", k, [g(a, {
|
|
102
|
+
name: "ri:chat-3-line",
|
|
103
|
+
class: "w-28 h-28 text-word-4"
|
|
104
|
+
})]),
|
|
105
|
+
m("div", A, [m("strong", j, C(w(V)("message.noConversations")), 1), m("span", M, C(w(V)("message.noConversationsHint")), 1)]),
|
|
106
|
+
g(s, {
|
|
107
|
+
modifiers: "primary rounded",
|
|
108
|
+
icon: "ri:add-line",
|
|
109
|
+
class: "mt-8",
|
|
110
|
+
label: w(V)("action.startNewChat"),
|
|
111
|
+
onClick: r[0] ||= (e) => w(G)()
|
|
112
|
+
}, null, 8, ["label"])
|
|
113
|
+
])) : (b(), p("div", N, [m("ul", P, [(b(!0), p(u, null, S(w(U), (e) => (b(), p("li", {
|
|
114
|
+
key: e.id,
|
|
115
|
+
class: y(["vv-item vv-item--roomy", { "vv-item--current": J(e) }])
|
|
116
|
+
}, [w(K) === e.id ? (b(), p("div", F, [g(d, {
|
|
117
|
+
modelValue: w(q),
|
|
118
|
+
"onUpdate:modelValue": r[1] ||= (e) => ie(q) ? q.value = e : null,
|
|
119
|
+
class: "flex-1 mb-0",
|
|
120
|
+
modifiers: "compact",
|
|
121
|
+
autofocus: "",
|
|
122
|
+
"select-on-focus": "",
|
|
123
|
+
maxlength: 255,
|
|
124
|
+
"aria-label": w(V)("placeholder.insert"),
|
|
125
|
+
placeholder: w(V)("placeholder.insert"),
|
|
126
|
+
onKeydown: (t) => w(Ce)(t, e.id)
|
|
127
|
+
}, null, 8, [
|
|
128
|
+
"modelValue",
|
|
129
|
+
"aria-label",
|
|
130
|
+
"placeholder",
|
|
131
|
+
"onKeydown"
|
|
132
|
+
]), g(_, { modifiers: "compact" }, {
|
|
133
|
+
default: T(() => [g(s, {
|
|
134
|
+
icon: "ri:save-line",
|
|
135
|
+
title: w(V)("action.save"),
|
|
136
|
+
modifiers: "action-quiet-small",
|
|
137
|
+
onClick: (t) => w(xe)(e.id)
|
|
138
|
+
}, null, 8, ["title", "onClick"]), g(s, {
|
|
139
|
+
icon: "ri:close-line",
|
|
140
|
+
title: w(V)("action.cancel"),
|
|
141
|
+
modifiers: "action-quiet-small",
|
|
142
|
+
onClick: r[2] ||= (e) => w(Se)()
|
|
143
|
+
}, null, 8, ["title"])]),
|
|
144
|
+
_: 2
|
|
145
|
+
}, 1024)])) : (b(), p(u, { key: 1 }, [m("button", {
|
|
146
|
+
type: "button",
|
|
147
|
+
class: "vv-item__entry",
|
|
148
|
+
"aria-current": J(e) ? "true" : void 0,
|
|
149
|
+
onClick: (t) => Te(e.id)
|
|
150
|
+
}, [m("div", L, [m("div", R, [m("strong", z, C(w(n)(e.title) || Y(e.messages, "assistant")), 1), g(o, {
|
|
151
|
+
class: "text-word-4 text-smaller shrink-0",
|
|
152
|
+
date: e.lastMessageAt
|
|
153
|
+
}, null, 8, ["date"])]), m("span", B, C(w(n)(w(i)(e.summary, w(V))) || Y(e.messages, "user")), 1)])], 8, I), m("div", me, [g(x, ae({ ref_for: !0 }, {
|
|
154
|
+
placement: "bottom-end",
|
|
155
|
+
modifiers: "menu",
|
|
156
|
+
flip: !0,
|
|
157
|
+
offset: 3,
|
|
158
|
+
strategy: "fixed"
|
|
159
|
+
}), {
|
|
160
|
+
items: T(() => [g(v, { onClick: (t) => Ee(e) }, {
|
|
161
|
+
default: T(() => [g(a, { name: "ri:pencil-line" }), h(" " + C(w(V)("action.renameChat")), 1)]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["onClick"]), g(v, { onClick: (t) => w(we)(e.id) }, {
|
|
164
|
+
default: T(() => [g(a, { name: "ri:delete-bin-line" }), h(" " + C(w(V)("action.delete")), 1)]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["onClick"])]),
|
|
167
|
+
default: T(() => [g(s, {
|
|
168
|
+
icon: "ri:more-2-fill",
|
|
169
|
+
title: w(V)("action.moreActions"),
|
|
170
|
+
modifiers: "action-quiet-small"
|
|
171
|
+
}, null, 8, ["title"])]),
|
|
172
|
+
_: 2
|
|
173
|
+
}, 1040)])], 64))], 2))), 128))])])), w(U).length > 0 ? (b(), p("div", he, [g(s, {
|
|
174
|
+
class: "text-14 pointer-events-auto",
|
|
175
|
+
modifiers: "primary rounded",
|
|
176
|
+
icon: "ri:add-line",
|
|
177
|
+
label: w(V)("action.startNewChat"),
|
|
178
|
+
onClick: r[3] ||= E((e) => w(G)(), ["stop"])
|
|
179
|
+
}, null, 8, ["label"]), Q.value ? (b(), re(s, {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: "text-12 pointer-events-auto",
|
|
182
|
+
modifiers: "action-quiet-danger",
|
|
183
|
+
icon: "ri:delete-bin-line",
|
|
184
|
+
loading: $.value,
|
|
185
|
+
disabled: $.value,
|
|
186
|
+
label: w(V)("action.deleteMyConversations"),
|
|
187
|
+
onClick: r[4] ||= E((e) => De(), ["stop"])
|
|
188
|
+
}, null, 8, [
|
|
189
|
+
"loading",
|
|
190
|
+
"disabled",
|
|
191
|
+
"label"
|
|
192
|
+
])) : f("", !0)])) : f("", !0)]);
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
//#endregion
|
|
197
|
+
export { D as n, O as r, V as t };
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=PkChatbotViewConversations-CU5NfEO4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotViewConversations-CU5NfEO4.js","names":["__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","__unplugin_components_5","_openBlock","_createElementBlock","_unref","_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString","_isRef","_withCtx","PkRelativeTime","_mergeProps","_createTextVNode","_withModifiers","_createBlock","_createCommentVNode","_sfc_main","VvButtonLocalized","useChatbotStore","stripMarkdown","localizeSummaryLabels","useDialogConfirm","PkRelativeTime_default","ChatbotProfileContextKey","getConversationPreview","conversation","getTextPart","message","useConversationActions","editingId","ref","editingTitle","startEdit","fallbackTitle","confirmEdit","trimmed","actions","id","cancelEdit","onRenameKeydown","event","openDialogConfirm","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","PkChatbotViewConversations_default","defineComponent","props","__props","$t","useI18n","store","storeToRefs","startEditConversation","handleDelete","openConversation","navigate","isCurrentConversation","localChatId","getLastMessage","messages","m","role","profile","inject","canEraseConversations","computed","isErasingConversations","handleEraseAll","eraseConversations","startNewChat","_component_VvIcon","VvIcon","_component_VvButton","_component_VvInputText","VvInputText","_component_VvButtonGroup","VvButtonGroup","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","openBlock","createElementBlock","unref","isLoadingConversations","conversations","createElementVNode","Fragment","renderList","i","normalizeClass","_cache","createVNode","toDisplayString","isRef","$event","withCtx","mergeProps","createTextVNode","withModifiers","createBlock","createCommentVNode"],"sources":["../../../../packages/composable/src/chatbot/useConversationActions.ts","../../../../packages/components/src/chat/PkChatbotViewConversations.vue","../../../../packages/components/src/chat/PkChatbotViewConversations.vue"],"sourcesContent":["import { ref } from 'vue'\nimport type { Chat as Conversation } from 'models'\nimport { getTextPart, stripMarkdown } from 'utils'\nimport { useDialogConfirm } from '../useDialogConfirm'\n\n/**\n * Single-line preview for a conversation: explicit title, otherwise the\n * first user message. Used as list label and as search haystack.\n */\nexport function getConversationPreview(conversation: Conversation): string {\n return (\n stripMarkdown(conversation.title) ||\n stripMarkdown(\n getTextPart(\n // The list endpoint isn't Zod-parsed: don't trust the\n // declared types at runtime\n conversation.messages?.find(\n (message) => message.role === 'user',\n ),\n ),\n ) ||\n ''\n )\n}\n\n/**\n * Inline-rename and delete-with-confirm state shared by the conversation\n * lists (PkChatbotViewConversations, PkChatSidebar). Renames are optimistic:\n * on failure the next conversations load reconciles with the server state.\n */\nexport function useConversationActions(actions: {\n renameChatTitle: (chatId: string, title: string) => Promise<unknown>\n deleteChat: (chatId: string) => Promise<unknown>\n}) {\n const editingId = ref<string | null>(null)\n const editingTitle = ref('')\n\n const startEdit = (conversation: Conversation, fallbackTitle = '') => {\n editingId.value = conversation.id\n editingTitle.value = stripMarkdown(conversation.title) || fallbackTitle\n }\n\n const confirmEdit = async (id: string) => {\n const trimmed = editingTitle.value.trim()\n editingId.value = null\n if (trimmed && trimmed.length <= 255) {\n try {\n await actions.renameChatTitle(id, trimmed)\n } catch {\n // Revert optimistically: reload will pick up server state\n }\n }\n }\n\n const cancelEdit = () => {\n editingId.value = null\n }\n\n const onRenameKeydown = (event: KeyboardEvent, id: string) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n confirmEdit(id)\n } else if (event.key === 'Escape') {\n event.preventDefault()\n cancelEdit()\n }\n }\n\n const { openDialogConfirm } = useDialogConfirm()\n const requestDelete = async (id: string) => {\n try {\n const proceed = await openDialogConfirm()\n if (!proceed) {\n return\n }\n await actions.deleteChat(id)\n } catch {\n // Silently fail: next load will reconcile\n }\n }\n\n return {\n editingId,\n editingTitle,\n startEdit,\n confirmEdit,\n cancelEdit,\n onRenameKeydown,\n requestDelete,\n }\n}\n","<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type { Chat as Conversation, UIChatMessage } from 'models'\n import { stripMarkdown, getTextPart } from 'utils'\n import {\n useChatbotStore,\n useConversationActions,\n useDialogConfirm,\n } from 'composables'\n import PkRelativeTime from '../PkRelativeTime.vue'\n import { localizeSummaryLabels } from './utils'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { conversations, isLoadingConversations, localChatId } =\n storeToRefs(store)\n const { navigate, startNewChat, renameChatTitle, deleteChat } = store\n\n const {\n editingId,\n editingTitle,\n startEdit: startEditConversation,\n confirmEdit,\n cancelEdit,\n onRenameKeydown,\n requestDelete: handleDelete,\n } = useConversationActions({ renameChatTitle, deleteChat })\n\n const openConversation = (id: string) => {\n if (editingId.value) {\n return\n }\n localChatId.value = id\n navigate('chat')\n }\n\n const isCurrentConversation = (conversation: Conversation) => {\n return localChatId.value === conversation.id\n }\n\n const getLastMessage = (\n messages: UIChatMessage[],\n role: 'user' | 'assistant',\n ) => {\n return stripMarkdown(\n getTextPart(messages.filter((m) => m.role === role).slice(-1)[0]) ||\n '',\n )\n }\n\n const startEdit = (conversation: Conversation) => {\n startEditConversation(\n conversation,\n getLastMessage(conversation.messages, 'assistant'),\n )\n }\n\n const { openDialogConfirm } = useDialogConfirm()\n\n // GDPR B.3 — bulk \"delete my conversations\", available to anonymous\n // sessions too (the host wires the endpoint through the profile context).\n // Hidden when the host application owns the session (external token or\n // host-session mode): the endpoint erases ALL conversations of the\n // session's user platform-wide, an account-scoped action that belongs to\n // the host, not to an embedded widget. Same gating as sign-out and\n // manage-profile in PkChatbotViewProfile.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canEraseConversations = computed(\n () =>\n !!profile?.eraseConversations &&\n !(profile.isExternalAuth?.value ?? false),\n )\n const isErasingConversations = ref(false)\n const handleEraseAll = async () => {\n const eraseConversations = profile?.eraseConversations\n if (!eraseConversations || !canEraseConversations.value) {\n return\n }\n const proceed = await openDialogConfirm({\n title: $t('confirmTitle.deleteMyConversations'),\n questionLabel: $t('message.deleteMyConversationsConfirm'),\n })\n if (!proceed) {\n return\n }\n isErasingConversations.value = true\n try {\n await eraseConversations()\n conversations.value = []\n startNewChat()\n } catch {\n // Same policy as single delete: fail silently and reconcile\n // with the server state\n store.loadConversations(props.agentId)\n } finally {\n isErasingConversations.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingConversations && conversations.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 5\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-16 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-160\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"conversations.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon name=\"ri:chat-3-line\" class=\"w-28 h-28 text-word-4\" />\n </div>\n <div class=\"flex flex-col gap-4\">\n <strong class=\"text-16 font-semibold text-word-1\">\n {{ $t('message.noConversations') }}\n </strong>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('message.noConversationsHint') }}\n </span>\n </div>\n <VvButton\n modifiers=\"primary rounded\"\n icon=\"ri:add-line\"\n class=\"mt-8\"\n :label=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n </div>\n\n <!-- Conversation list. The row is a container, not a button: the menu\n and the rename field are siblings of the entry, because a button\n cannot legally contain other controls (Firefox and Safari drop\n them from the accessibility tree). -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"vv-item-group__list overflow-y-auto pb-64 light-scrollbar\">\n <li\n v-for=\"conversation in conversations\"\n :key=\"conversation.id\"\n class=\"vv-item vv-item--roomy\"\n :class=\"{\n 'vv-item--current': isCurrentConversation(conversation),\n }\">\n <div\n v-if=\"editingId === conversation.id\"\n class=\"flex flex-1 items-center gap-8 min-w-0 px-md py-12\">\n <VvInputText\n v-model=\"editingTitle\"\n class=\"flex-1 mb-0\"\n modifiers=\"compact\"\n autofocus\n select-on-focus\n :maxlength=\"255\"\n :aria-label=\"$t('placeholder.insert')\"\n :placeholder=\"$t('placeholder.insert')\"\n @keydown=\"\n onRenameKeydown($event, conversation.id)\n \" />\n <VvButtonGroup modifiers=\"compact\">\n <VvButton\n icon=\"ri:save-line\"\n :title=\"$t('action.save')\"\n modifiers=\"action-quiet-small\"\n @click=\"confirmEdit(conversation.id)\" />\n <VvButton\n icon=\"ri:close-line\"\n :title=\"$t('action.cancel')\"\n modifiers=\"action-quiet-small\"\n @click=\"cancelEdit()\" />\n </VvButtonGroup>\n </div>\n <template v-else>\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :aria-current=\"\n isCurrentConversation(conversation)\n ? 'true'\n : undefined\n \"\n @click=\"openConversation(conversation.id)\">\n <div class=\"min-w-0 flex-1\">\n <div class=\"flex items-center gap-8\">\n <strong\n class=\"vv-item__title font-medium flex-1\">\n {{\n stripMarkdown(conversation.title) ||\n getLastMessage(\n conversation.messages,\n 'assistant',\n )\n }}\n </strong>\n <PkRelativeTime\n class=\"text-word-4 text-smaller shrink-0\"\n :date=\"conversation.lastMessageAt\" />\n </div>\n <span class=\"text-12 text-word-4 line-clamp-2\">\n {{\n stripMarkdown(\n localizeSummaryLabels(\n conversation.summary,\n $t,\n ),\n ) ||\n getLastMessage(\n conversation.messages,\n 'user',\n )\n }}\n </span>\n </div>\n </button>\n <div class=\"vv-item__actions\">\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:more-2-fill\"\n :title=\"$t('action.moreActions')\"\n modifiers=\"action-quiet-small\" />\n <template #items>\n <VvDropdownAction\n @click=\"startEdit(conversation)\">\n <VvIcon name=\"ri:pencil-line\" />\n {{ $t('action.renameChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n @click=\"handleDelete(conversation.id)\">\n <VvIcon name=\"ri:delete-bin-line\" />\n {{ $t('action.delete') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </div>\n </template>\n </li>\n </ul>\n </div>\n\n <!-- Sticky \"new chat\" CTA (hidden on empty state, which has its own CTA) -->\n <div\n v-if=\"conversations.length > 0\"\n class=\"absolute bottom-0 left-0 right-0 flex flex-col items-center gap-4 px-16 pb-16 pt-32 pointer-events-none\"\n :style=\"{\n background:\n 'linear-gradient(to top, var(--color-surface) 55%, transparent)',\n }\">\n <VvButton\n class=\"text-14 pointer-events-auto\"\n modifiers=\"primary rounded\"\n icon=\"ri:add-line\"\n :label=\"$t('action.startNewChat')\"\n @click.stop=\"startNewChat()\" />\n <VvButton\n v-if=\"canEraseConversations\"\n class=\"text-12 pointer-events-auto\"\n modifiers=\"action-quiet-danger\"\n icon=\"ri:delete-bin-line\"\n :loading=\"isErasingConversations\"\n :disabled=\"isErasingConversations\"\n :label=\"$t('action.deleteMyConversations')\"\n @click.stop=\"handleEraseAll()\" />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import type { Chat as Conversation, UIChatMessage } from 'models'\n import { stripMarkdown, getTextPart } from 'utils'\n import {\n useChatbotStore,\n useConversationActions,\n useDialogConfirm,\n } from 'composables'\n import PkRelativeTime from '../PkRelativeTime.vue'\n import { localizeSummaryLabels } from './utils'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { conversations, isLoadingConversations, localChatId } =\n storeToRefs(store)\n const { navigate, startNewChat, renameChatTitle, deleteChat } = store\n\n const {\n editingId,\n editingTitle,\n startEdit: startEditConversation,\n confirmEdit,\n cancelEdit,\n onRenameKeydown,\n requestDelete: handleDelete,\n } = useConversationActions({ renameChatTitle, deleteChat })\n\n const openConversation = (id: string) => {\n if (editingId.value) {\n return\n }\n localChatId.value = id\n navigate('chat')\n }\n\n const isCurrentConversation = (conversation: Conversation) => {\n return localChatId.value === conversation.id\n }\n\n const getLastMessage = (\n messages: UIChatMessage[],\n role: 'user' | 'assistant',\n ) => {\n return stripMarkdown(\n getTextPart(messages.filter((m) => m.role === role).slice(-1)[0]) ||\n '',\n )\n }\n\n const startEdit = (conversation: Conversation) => {\n startEditConversation(\n conversation,\n getLastMessage(conversation.messages, 'assistant'),\n )\n }\n\n const { openDialogConfirm } = useDialogConfirm()\n\n // GDPR B.3 — bulk \"delete my conversations\", available to anonymous\n // sessions too (the host wires the endpoint through the profile context).\n // Hidden when the host application owns the session (external token or\n // host-session mode): the endpoint erases ALL conversations of the\n // session's user platform-wide, an account-scoped action that belongs to\n // the host, not to an embedded widget. Same gating as sign-out and\n // manage-profile in PkChatbotViewProfile.\n const profile = inject(ChatbotProfileContextKey, undefined)\n const canEraseConversations = computed(\n () =>\n !!profile?.eraseConversations &&\n !(profile.isExternalAuth?.value ?? false),\n )\n const isErasingConversations = ref(false)\n const handleEraseAll = async () => {\n const eraseConversations = profile?.eraseConversations\n if (!eraseConversations || !canEraseConversations.value) {\n return\n }\n const proceed = await openDialogConfirm({\n title: $t('confirmTitle.deleteMyConversations'),\n questionLabel: $t('message.deleteMyConversationsConfirm'),\n })\n if (!proceed) {\n return\n }\n isErasingConversations.value = true\n try {\n await eraseConversations()\n conversations.value = []\n startNewChat()\n } catch {\n // Same policy as single delete: fail silently and reconcile\n // with the server state\n store.loadConversations(props.agentId)\n } finally {\n isErasingConversations.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingConversations && conversations.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 5\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-16 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-160\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"conversations.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon name=\"ri:chat-3-line\" class=\"w-28 h-28 text-word-4\" />\n </div>\n <div class=\"flex flex-col gap-4\">\n <strong class=\"text-16 font-semibold text-word-1\">\n {{ $t('message.noConversations') }}\n </strong>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('message.noConversationsHint') }}\n </span>\n </div>\n <VvButton\n modifiers=\"primary rounded\"\n icon=\"ri:add-line\"\n class=\"mt-8\"\n :label=\"$t('action.startNewChat')\"\n @click=\"startNewChat()\" />\n </div>\n\n <!-- Conversation list. The row is a container, not a button: the menu\n and the rename field are siblings of the entry, because a button\n cannot legally contain other controls (Firefox and Safari drop\n them from the accessibility tree). -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"vv-item-group__list overflow-y-auto pb-64 light-scrollbar\">\n <li\n v-for=\"conversation in conversations\"\n :key=\"conversation.id\"\n class=\"vv-item vv-item--roomy\"\n :class=\"{\n 'vv-item--current': isCurrentConversation(conversation),\n }\">\n <div\n v-if=\"editingId === conversation.id\"\n class=\"flex flex-1 items-center gap-8 min-w-0 px-md py-12\">\n <VvInputText\n v-model=\"editingTitle\"\n class=\"flex-1 mb-0\"\n modifiers=\"compact\"\n autofocus\n select-on-focus\n :maxlength=\"255\"\n :aria-label=\"$t('placeholder.insert')\"\n :placeholder=\"$t('placeholder.insert')\"\n @keydown=\"\n onRenameKeydown($event, conversation.id)\n \" />\n <VvButtonGroup modifiers=\"compact\">\n <VvButton\n icon=\"ri:save-line\"\n :title=\"$t('action.save')\"\n modifiers=\"action-quiet-small\"\n @click=\"confirmEdit(conversation.id)\" />\n <VvButton\n icon=\"ri:close-line\"\n :title=\"$t('action.cancel')\"\n modifiers=\"action-quiet-small\"\n @click=\"cancelEdit()\" />\n </VvButtonGroup>\n </div>\n <template v-else>\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :aria-current=\"\n isCurrentConversation(conversation)\n ? 'true'\n : undefined\n \"\n @click=\"openConversation(conversation.id)\">\n <div class=\"min-w-0 flex-1\">\n <div class=\"flex items-center gap-8\">\n <strong\n class=\"vv-item__title font-medium flex-1\">\n {{\n stripMarkdown(conversation.title) ||\n getLastMessage(\n conversation.messages,\n 'assistant',\n )\n }}\n </strong>\n <PkRelativeTime\n class=\"text-word-4 text-smaller shrink-0\"\n :date=\"conversation.lastMessageAt\" />\n </div>\n <span class=\"text-12 text-word-4 line-clamp-2\">\n {{\n stripMarkdown(\n localizeSummaryLabels(\n conversation.summary,\n $t,\n ),\n ) ||\n getLastMessage(\n conversation.messages,\n 'user',\n )\n }}\n </span>\n </div>\n </button>\n <div class=\"vv-item__actions\">\n <VvDropdown\n v-bind=\"{\n placement: 'bottom-end',\n modifiers: 'menu',\n flip: true,\n offset: 3,\n strategy: 'fixed',\n }\">\n <VvButton\n icon=\"ri:more-2-fill\"\n :title=\"$t('action.moreActions')\"\n modifiers=\"action-quiet-small\" />\n <template #items>\n <VvDropdownAction\n @click=\"startEdit(conversation)\">\n <VvIcon name=\"ri:pencil-line\" />\n {{ $t('action.renameChat') }}\n </VvDropdownAction>\n <VvDropdownAction\n @click=\"handleDelete(conversation.id)\">\n <VvIcon name=\"ri:delete-bin-line\" />\n {{ $t('action.delete') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </div>\n </template>\n </li>\n </ul>\n </div>\n\n <!-- Sticky \"new chat\" CTA (hidden on empty state, which has its own CTA) -->\n <div\n v-if=\"conversations.length > 0\"\n class=\"absolute bottom-0 left-0 right-0 flex flex-col items-center gap-4 px-16 pb-16 pt-32 pointer-events-none\"\n :style=\"{\n background:\n 'linear-gradient(to top, var(--color-surface) 55%, transparent)',\n }\">\n <VvButton\n class=\"text-14 pointer-events-auto\"\n modifiers=\"primary rounded\"\n icon=\"ri:add-line\"\n :label=\"$t('action.startNewChat')\"\n @click.stop=\"startNewChat()\" />\n <VvButton\n v-if=\"canEraseConversations\"\n class=\"text-12 pointer-events-auto\"\n modifiers=\"action-quiet-danger\"\n icon=\"ri:delete-bin-line\"\n :loading=\"isErasingConversations\"\n :disabled=\"isErasingConversations\"\n :label=\"$t('action.deleteMyConversations')\"\n @click.stop=\"handleEraseAll()\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;AASA,SAAgB+B,EAAuB,GAAoC;CACvE,OACIL,EAAcM,EAAa,KAAK,KAChCN,EACIO,EAGID,EAAa,UAAU,MAClB,MAAYE,EAAQ,SAAS,MAClC,CACJ,CACJ,KACA;AAER;AAOA,SAAgBC,EAAuB,GAGpC;CACC,IAAMC,IAAYC,EAAmB,IAAI,GACnCC,IAAeD,EAAI,EAAE,GAErBE,KAAa,GAA4B,IAAgB,OAAO;EAElE,AADA,EAAU,QAAQP,EAAa,IAC/B,EAAa,QAAQN,EAAcM,EAAa,KAAK,KAAKQ;CAC9D,GAEMC,IAAc,OAAO,MAAe;EACtC,IAAMC,IAAUJ,EAAa,MAAM,KAAK;EAExC,IADA,EAAU,QAAQ,MACdI,KAAWA,EAAQ,UAAU,KAC7B,IAAI;GACA,MAAMC,EAAQ,gBAAgBC,GAAIF,CAAO;EAC7C,QAAQ,CAER;CAER,GAEMG,UAAmB;EACrB,EAAU,QAAQ;CACtB,GAEMC,KAAmB,GAAsB,MAAe;EAC1D,AAAIC,EAAM,QAAQ,WACdA,EAAM,eAAe,GACrBN,EAAYG,CAAE,KACPG,EAAM,QAAQ,aACrBA,EAAM,eAAe,GACrBF,EAAW;CAEnB,GAEM,EAAE,yBAAsBjB,EAAiB;CAa/C,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA,sBAnByB,MAAe;GACxC,IAAI;IAEA,IAAI,CAAC,MADiBoB,EAAkB,GAEpC;IAEJ,MAAML,EAAQ,WAAWC,CAAE;GAC/B,QAAQ,CAER;EACJ;CAUA;AACJ;;;;;;;;;;;;;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,19 +1,20 @@
|
|
|
1
|
-
import { a as e, n as t, o as n } from "./Document-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as a } from "./
|
|
5
|
-
import {
|
|
1
|
+
import { a as e, n as t, o as n } from "./Document-Cto-Qws0.js";
|
|
2
|
+
import { t as r } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
3
|
+
import { n as i } from "./useChatbotStore-C1sgxgD1.js";
|
|
4
|
+
import { t as a } from "./useDialogConfirm-BxhvsnRr.js";
|
|
5
|
+
import { t as o } from "./useImageFallback-5vQIO0pC.js";
|
|
6
|
+
import { VvIcon as s } from "@volverjs/ui-vue/components";
|
|
6
7
|
import { Fragment as c, createBlock as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, openBlock as h, ref as g, renderList as _, toDisplayString as v, unref as y } from "vue";
|
|
7
8
|
import { useI18n as b } from "vue-i18n";
|
|
8
9
|
import { storeToRefs as x } from "pinia";
|
|
9
10
|
//#region ../../packages/composable/src/useFileRow.ts
|
|
10
11
|
function S(t) {
|
|
11
|
-
let { locale: r } = b({ useScope: "global" }), { canShowImage: i, onImageError:
|
|
12
|
+
let { locale: r } = b({ useScope: "global" }), { canShowImage: i, onImageError: a } = o(), s = (e) => t.preview(e.documentId);
|
|
12
13
|
return {
|
|
13
14
|
showThumb: (t) => e(t.mimeType) && i(s(t)),
|
|
14
15
|
thumbUrl: s,
|
|
15
16
|
onThumbError: (e) => {
|
|
16
|
-
|
|
17
|
+
a(s(e));
|
|
17
18
|
},
|
|
18
19
|
openFile: (e, r = !1) => {
|
|
19
20
|
let i = !r && n(e.mimeType);
|
|
@@ -58,7 +59,7 @@ var w = { class: "flex flex-col flex-1 min-h-0 relative" }, T = {
|
|
|
58
59
|
__name: "PkChatbotViewFiles",
|
|
59
60
|
props: { agentId: {} },
|
|
60
61
|
setup(e) {
|
|
61
|
-
let n = e, { t:
|
|
62
|
+
let n = e, { t: o } = b({ useScope: "global" }), { openDialogConfirm: p } = a(), V = i(n.agentId), { chatFiles: H, isLoadingChatFiles: U } = x(V), { showThumb: W, thumbUrl: G, onThumbError: K, openFile: q, formatDate: J } = S({
|
|
62
63
|
view: V.getChatFileUrl,
|
|
63
64
|
preview: V.getChatFilePreviewUrl
|
|
64
65
|
}), { kindNote: Y, removeLabel: X, removeConfirm: Z } = C(), Q = g(null), $ = async (e) => {
|
|
@@ -72,20 +73,20 @@ var w = { class: "flex flex-col flex-1 min-h-0 relative" }, T = {
|
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
75
|
return (e, n) => {
|
|
75
|
-
let
|
|
76
|
+
let i = s, a = r;
|
|
76
77
|
return h(), u("div", w, [y(U) && y(H).length === 0 ? (h(), u("div", T, [d("div", E, [(h(), u(c, null, _(4, (e) => d("div", {
|
|
77
78
|
key: e,
|
|
78
79
|
class: "vv-item vv-item--roomy vv-item--plain"
|
|
79
|
-
}, [d("div", D, [n[2] ||= d("div", { class: "vv-skeleton w-36 h-36 shrink-0 rounded-md" }, [d("div", { class: "vv-skeleton__item" })], -1), d("div", O, [d("div", { class: m(["vv-skeleton h-14 rounded", e % 2 ? "w-192" : "w-128"]) }, [...n[0] ||= [d("div", { class: "vv-skeleton__item" }, null, -1)]], 2), n[1] ||= d("div", { class: "vv-skeleton h-12 rounded w-96" }, [d("div", { class: "vv-skeleton__item" })], -1)])])])), 64))])])) : y(H).length === 0 ? (h(), u("div", k, [d("div", A, [f(
|
|
80
|
+
}, [d("div", D, [n[2] ||= d("div", { class: "vv-skeleton w-36 h-36 shrink-0 rounded-md" }, [d("div", { class: "vv-skeleton__item" })], -1), d("div", O, [d("div", { class: m(["vv-skeleton h-14 rounded", e % 2 ? "w-192" : "w-128"]) }, [...n[0] ||= [d("div", { class: "vv-skeleton__item" }, null, -1)]], 2), n[1] ||= d("div", { class: "vv-skeleton h-12 rounded w-96" }, [d("div", { class: "vv-skeleton__item" })], -1)])])])), 64))])])) : y(H).length === 0 ? (h(), u("div", k, [d("div", A, [f(i, {
|
|
80
81
|
name: "ri:folder-open-line",
|
|
81
82
|
class: "w-28 h-28 text-word-4"
|
|
82
|
-
})]), d("span", j, v(y(
|
|
83
|
+
})]), d("span", j, v(y(o)("userFiles.chatFilesEmpty")), 1)])) : (h(), u("div", M, [d("ul", N, [(h(!0), u(c, null, _(y(H), (e) => (h(), u("li", {
|
|
83
84
|
key: e.documentId,
|
|
84
85
|
class: "vv-item vv-item--roomy"
|
|
85
86
|
}, [d("button", {
|
|
86
87
|
type: "button",
|
|
87
88
|
class: "vv-item__entry",
|
|
88
|
-
title: y(
|
|
89
|
+
title: y(o)("userFiles.open"),
|
|
89
90
|
onClick: (t) => y(q)(e)
|
|
90
91
|
}, [d("span", F, [y(W)(e) ? (h(), u("img", {
|
|
91
92
|
key: 0,
|
|
@@ -95,15 +96,15 @@ var w = { class: "flex flex-col flex-1 min-h-0 relative" }, T = {
|
|
|
95
96
|
alt: "",
|
|
96
97
|
class: "pk-chatbot-files__thumb",
|
|
97
98
|
onError: (t) => y(K)(e)
|
|
98
|
-
}, null, 40, I)) : (h(), l(
|
|
99
|
+
}, null, 40, I)) : (h(), l(i, {
|
|
99
100
|
key: 1,
|
|
100
101
|
name: y(t)(e.mimeType)
|
|
101
|
-
}, null, 8, ["name"]))]), d("span", L, [d("span", R, v(e.name || y(
|
|
102
|
+
}, null, 8, ["name"]))]), d("span", L, [d("span", R, v(e.name || y(o)("userFiles.untitled")), 1), d("span", z, v([y(J)(e.createdAt), y(Y)(e)].filter(Boolean).join(" · ")), 1)])], 8, P), d("div", B, [f(a, {
|
|
102
103
|
modifiers: "action-quiet-small",
|
|
103
104
|
icon: "ri:download-line",
|
|
104
|
-
title: y(
|
|
105
|
+
title: y(o)("action.download"),
|
|
105
106
|
onClick: (t) => y(q)(e, !0)
|
|
106
|
-
}, null, 8, ["title", "onClick"]), f(
|
|
107
|
+
}, null, 8, ["title", "onClick"]), f(a, {
|
|
107
108
|
modifiers: "action-quiet-small",
|
|
108
109
|
icon: "ri:delete-bin-line",
|
|
109
110
|
title: y(X)(e),
|
|
@@ -122,4 +123,4 @@ var w = { class: "flex flex-col flex-1 min-h-0 relative" }, T = {
|
|
|
122
123
|
//#endregion
|
|
123
124
|
export { V as t };
|
|
124
125
|
|
|
125
|
-
//# sourceMappingURL=PkChatbotViewFiles-
|
|
126
|
+
//# sourceMappingURL=PkChatbotViewFiles-CD-UZPT5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotViewFiles-CD-UZPT5.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_unref","_createElementVNode","_Fragment","_renderList","_normalizeClass","_createVNode","_toDisplayString","_createBlock","_sfc_main","isImageMime","fileIconForMime","isInlineViewable","VvButtonLocalized","useChatbotStore","useDialogConfirm","useImageFallback","useFileRow","useI18n","thumbUrl","urls","file","canShowImage","inline","download","iso","locale","useUserFileKind","isSpreadsheet","t","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","PkChatbotViewFiles_default","defineComponent","props","__props","$t","store","storeToRefs","deletingId","ref","handleExclude","openDialogConfirm","removeConfirm","_component_VvIcon","VvIcon","_component_VvButton","openBlock","createElementBlock","unref","isLoadingChatFiles","chatFiles","createElementVNode","Fragment","renderList","i","_cache","normalizeClass","createVNode","toDisplayString","openFile","showThumb","onThumbError","createBlock","formatDate","kindNote","removeLabel"],"sources":["../../../../packages/composable/src/useFileRow.ts","../../../../packages/components/src/chat/PkChatbotViewFiles.vue","../../../../packages/components/src/chat/PkChatbotViewFiles.vue"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport { isImageMime, isInlineViewable } from 'models'\nimport { useImageFallback } from './useImageFallback'\n\n/** Minimal shape a file-list row needs for the shared display helpers. */\nexport interface FileRowLike {\n documentId: string\n mimeType: string | null\n}\n\n/**\n * Shared display logic for the user-files list rows, used by both the in-app\n * table (PjUserFilesTable) and the embedded widget (PkChatbotViewFiles). The two\n * surfaces differ only in how they build URLs (authenticated store vs widget API\n * client), so the URL builders are injected.\n *\n * - `view(id, inline)` → opens/downloads the original file.\n * - `preview(id)` → small resized blob for the row thumbnail.\n */\nexport function useFileRow(urls: {\n view: (documentId: string, inline: boolean) => string\n preview: (documentId: string) => string\n}) {\n const { locale } = useI18n({ useScope: 'global' })\n\n // Image rows show a thumbnail; if it fails to load (auth/redirect, or the\n // preview isn't generated yet) we fall back to the file-type icon.\n const { canShowImage, onImageError } = useImageFallback()\n const thumbUrl = (file: FileRowLike): string =>\n urls.preview(file.documentId)\n const showThumb = (file: FileRowLike): boolean =>\n isImageMime(file.mimeType) && canShowImage(thumbUrl(file))\n const onThumbError = (file: FileRowLike): void => {\n onImageError(thumbUrl(file))\n }\n\n // Name click previews images/PDF inline; an explicit download forces an\n // attachment (inline=false → download SAS).\n const openFile = (file: FileRowLike, download = false): void => {\n const inline = !download && isInlineViewable(file.mimeType)\n window.open(urls.view(file.documentId, inline), '_blank', 'noopener')\n }\n\n const formatDate = (iso: string): string =>\n new Date(iso).toLocaleDateString(locale.value, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n\n return { showThumb, thumbUrl, onThumbError, openFile, formatDate }\n}\n\n/** What tells a spreadsheet row apart from a KB document. */\nexport interface FileKindLike {\n kind?: 'document' | 'spreadsheet'\n sourceAttachmentId?: string | null\n}\n\n/**\n * The wording that depends on what a \"My files\" row is. A KB document is a\n * copy of the upload: removing it only takes it out of the assistant's reach.\n * A spreadsheet is the chat attachment itself and never enters the KB: its row\n * says so, and removing it deletes it from its chat with every version the\n * assistant wrote of it.\n */\nexport function useUserFileKind() {\n const { t } = useI18n({ useScope: 'global' })\n\n const isSpreadsheet = (file: FileKindLike): boolean =>\n file.kind === 'spreadsheet'\n\n /** A short note for the row; undefined for a KB document. */\n const kindNote = (file: FileKindLike): string | undefined => {\n if (!isSpreadsheet(file)) {\n return undefined\n }\n return file.sourceAttachmentId\n ? t('userFiles.spreadsheetVersion')\n : t('userFiles.spreadsheetInChatOnly')\n }\n\n const removeLabel = (file: FileKindLike): string =>\n isSpreadsheet(file)\n ? t('userFiles.deleteSpreadsheet')\n : t('userFiles.exclude')\n\n /** The options of the confirmation dialog before removing the file. */\n const removeConfirm = (file: FileKindLike) =>\n isSpreadsheet(file)\n ? {\n title: t('confirmTitle.deleteSpreadsheet'),\n questionLabel: t('userFiles.deleteSpreadsheetConfirm'),\n }\n : {\n title: t('confirmTitle.excludeUserFile'),\n questionLabel: t('userFiles.excludeConfirm'),\n }\n\n return { isSpreadsheet, kindNote, removeLabel, removeConfirm }\n}\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__actions {\n gap: var(--spacing-2);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n useUserFileKind,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n const { kindNote, removeLabel, removeConfirm } = useUserFileKind()\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm(removeConfirm(file))\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton, shaped like the rows it replaces -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"vv-item-group vv-item-group--fill\">\n <div class=\"vv-item-group__list\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-item vv-item--roomy vv-item--plain\">\n <div class=\"vv-item__entry\">\n <div class=\"vv-skeleton w-36 h-36 shrink-0 rounded-md\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"flex flex-col gap-6 flex-1 min-w-0\">\n <div\n class=\"vv-skeleton h-14 rounded\"\n :class=\"i % 2 ? 'w-192' : 'w-128'\">\n <div class=\"vv-skeleton__item\" />\n </div>\n <div class=\"vv-skeleton h-12 rounded w-96\">\n <div class=\"vv-skeleton__item\" />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <div v-else class=\"vv-item-group vv-item-group--fill\">\n <ul\n class=\"pk-chatbot-files vv-item-group__list overflow-y-auto light-scrollbar\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"vv-item vv-item--roomy\">\n <button\n type=\"button\"\n class=\"vv-item__entry\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon\n v-else\n :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <span class=\"flex flex-col min-w-0 flex-1\">\n <span class=\"vv-item__title\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"text-12 text-word-3\">\n {{\n [formatDate(file.createdAt), kindNote(file)]\n .filter(Boolean)\n .join(' · ')\n }}\n </span>\n </span>\n </button>\n <div class=\"vv-item__actions pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:delete-bin-line\"\n :title=\"removeLabel(file)\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n </div>\n</template>\n\n<style lang=\"scss\">\n // The list and its rows come from `vv-item-group` and `vv-item`; what is\n // left here is the file tile and the pair of row actions.\n .pk-chatbot-files {\n // The box exists to clip a thumbnail and to keep the labels of rows\n // with and without one on the same left edge: with a file icon in it\n // there is nothing to draw, so it stays transparent.\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n color: var(--color-word-3);\n overflow: hidden;\n\n svg {\n width: var(--spacing-20);\n height: var(--spacing-20);\n }\n }\n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
+
import { t as e } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
2
|
+
import { n as t } from "./useChatbotStore-C1sgxgD1.js";
|
|
3
|
+
import { t as n } from "./PkAvatar-BTqu8tn9.js";
|
|
4
|
+
import { t as r } from "./chatbotProfileContext-CgnFhNPn.js";
|
|
5
|
+
import { VvAlert as i, VvIcon as a } from "@volverjs/ui-vue/components";
|
|
5
6
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, inject as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, unref as v } from "vue";
|
|
6
7
|
import { useI18n as y } from "vue-i18n";
|
|
7
8
|
import { storeToRefs as b } from "pinia";
|
|
@@ -19,7 +20,7 @@ var x = { class: "flex flex-col flex-1 min-h-0 overflow-y-auto" }, S = { class:
|
|
|
19
20
|
__name: "PkChatbotViewProfile",
|
|
20
21
|
props: { agentId: {} },
|
|
21
22
|
setup(f) {
|
|
22
|
-
let N = f, { t: P } = y({ useScope: "global" }), F =
|
|
23
|
+
let N = f, { t: P } = y({ useScope: "global" }), F = t(N.agentId), { name: I, agentInterface: L } = b(F), R = p(r, void 0), z = o(() => R?.user.value ?? null), B = o(() => R?.canManageProfile.value ?? !1), V = o(() => R?.profileUrl.value), H = o(() => R?.isExternalAuth?.value ?? !1), U = h(!1), W = h();
|
|
23
24
|
async function G() {
|
|
24
25
|
if (R) {
|
|
25
26
|
U.value = !0;
|
|
@@ -32,10 +33,10 @@ var x = { class: "flex flex-col flex-1 min-h-0 overflow-y-auto" }, S = { class:
|
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
return (
|
|
36
|
-
let o =
|
|
36
|
+
return (t, r) => {
|
|
37
|
+
let o = i, f = a, p = e;
|
|
37
38
|
return m(), l("div", x, [
|
|
38
|
-
u("div", S, [d(
|
|
39
|
+
u("div", S, [d(n, {
|
|
39
40
|
modifiers: "surface ring",
|
|
40
41
|
class: "w-64 h-64",
|
|
41
42
|
name: z.value?.name ?? v(I),
|
|
@@ -75,7 +76,7 @@ var x = { class: "flex flex-col flex-1 min-h-0 overflow-y-auto" }, S = { class:
|
|
|
75
76
|
"disabled",
|
|
76
77
|
"label"
|
|
77
78
|
])])),
|
|
78
|
-
g(
|
|
79
|
+
g(t.$slots, "default")
|
|
79
80
|
]);
|
|
80
81
|
};
|
|
81
82
|
}
|
|
@@ -83,4 +84,4 @@ var x = { class: "flex flex-col flex-1 min-h-0 overflow-y-auto" }, S = { class:
|
|
|
83
84
|
//#endregion
|
|
84
85
|
export { N as t };
|
|
85
86
|
|
|
86
|
-
//# sourceMappingURL=PkChatbotViewProfile-
|
|
87
|
+
//# sourceMappingURL=PkChatbotViewProfile-DPlb_Wca.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotViewProfile-DPlb_Wca.js","names":["__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","PkAvatar","_unref","_toDisplayString","_createCommentVNode","_createBlock","_renderSlot","_sfc_main","VvButtonLocalized","useChatbotStore","PkAvatar_default","ChatbotProfileContextKey","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","PkChatbotViewProfile_default","defineComponent","props","__props","$t","useI18n","store","agentName","storeToRefs","profile","inject","user","computed","canManage","profileUrl","isExternalAuth","isSigningOut","ref","errorMessage","onSignOut","error","_component_VvAlert","VvAlert","_component_VvIcon","VvIcon","_component_VvButton","openBlock","createElementBlock","createElementVNode","createVNode","unref","agentInterface","toDisplayString","createCommentVNode","createBlock","renderSlot","_ctx"],"sources":["../../../../packages/components/src/chat/PkChatbotViewProfile.vue","../../../../packages/components/src/chat/PkChatbotViewProfile.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n :label=\"$t('action.signOut')\"\n @click=\"onSignOut\" />\n </div>\n\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n :label=\"$t('action.signOut')\"\n @click=\"onSignOut\" />\n </div>\n\n <slot />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAQI,IAAMgC,IAAQC,GAER,EAAE,GAAGC,MAAOC,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CC,IAAQrB,EAAgBiB,EAAM,OAAO,GACrC,EAAE,MAAMK,GAAW,sBAAmBC,EAAYF,CAAK,GAEvDG,IAAUC,EAAOvB,GAA0B,KAAA,CAAS,GACpDwB,IAAOC,QAAeH,GAAS,KAAK,SAAS,IAAI,GACjDI,IAAYD,QAAeH,GAAS,iBAAiB,SAAS,EAAK,GACnEK,IAAaF,QAAeH,GAAS,WAAW,KAAK,GAIrDM,IAAiBH,QACbH,GAAS,gBAAgB,SAAS,EAC5C,GAEMO,IAAeC,EAAI,EAAK,GACxBC,IAAeD,EAAY;EAEjC,eAAeE,IAAY;GACvB,IAAKV,GAGL;MAAa,QAAQ;IACrB,IAAI;KACA,MAAMA,EAAQ,QAAQ;IAC1B,SAASW,GAAO;KACZ,EAAa,QACTA,aAAiB,QAAQA,EAAM,UAAUhB,EAAG,eAAe;IACnE,UAAU;KACN,EAAa,QAAQ;IACzB;GARqB;EASzB;;;GAIA,OAAA/B,EAAA,GAAAC,EAsEM,OAtENc,GAsEM;IApEFb,EAmBM,OAnBNc,GAmBM,CAjBFb,EAIqDC,GAAA;KAHjD,WAAU;KACV,OAAM;KACL,MAAMkC,EA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BiD,GAAA;KANrB,WAAU;KACV,OAAM;KACN,MAAK;KACJ,SAAST,EAAA;KACT,UAAUA,EAAA;KACV,OAAOtC,EAAA0B,CAAA,CAAE,CAAA,gBAAA;KACT,SAAOe;;;;;;IAGhBrC,EAAQsD,EAAA,QAAA,SAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as e } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
2
|
+
import { VvIcon as t } from "@volverjs/ui-vue/components";
|
|
2
3
|
import { createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, openBlock as o, toDisplayString as s, unref as c } from "vue";
|
|
3
4
|
import { useI18n as l } from "vue-i18n";
|
|
4
5
|
//#region ../../packages/components/src/chat/PkChatbotWakeupBar.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -40,4 +41,4 @@ var u = {
|
|
|
40
41
|
//#endregion
|
|
41
42
|
export { p as t };
|
|
42
43
|
|
|
43
|
-
//# sourceMappingURL=PkChatbotWakeupBar-
|
|
44
|
+
//# sourceMappingURL=PkChatbotWakeupBar-Cjgarxnw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkChatbotWakeupBar-Cjgarxnw.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_unref","_sfc_main","VvButtonLocalized","_hoisted_1","_hoisted_2","_hoisted_3","PkChatbotWakeupBar_default","defineComponent","__emit","emit","$t","$d","useI18n","_component_VvIcon","VvIcon","_component_VvButton","openBlock","createElementBlock","createVNode","createElementVNode","toDisplayString","unref","__props","_cache"],"sources":["../../../../packages/components/src/chat/PkChatbotWakeupBar.vue","../../../../packages/components/src/chat/PkChatbotWakeupBar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { useI18n } from 'vue-i18n'\n import type { PendingWakeup } from 'models'\n\n /**\n * The check the agent will run by itself next (spec agent-wakeup): when,\n * why, and the user's way to stop it. Above the input, because it is the\n * one thing in the chat still to happen.\n */\n defineProps<{\n pending: PendingWakeup\n stopping?: boolean\n }>()\n\n const emit = defineEmits<{\n stop: []\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n</script>\n\n<template>\n <div class=\"pk-chatbot-wakeup-bar\" role=\"status\">\n <VvIcon name=\"ri:alarm-line\" class=\"shrink-0\" />\n <span class=\"pk-chatbot-wakeup-bar__text\">\n <strong>\n {{\n $t('label.wakeupNext', {\n time: $d(new Date(pending.dueAt), 'time'),\n })\n }}\n </strong>\n <span class=\"pk-chatbot-wakeup-bar__reason\">\n {{ pending.reason }}\n </span>\n </span>\n <VvButton\n :label=\"$t('action.stop')\"\n modifiers=\"action-quiet\"\n :loading=\"stopping\"\n :disabled=\"stopping\"\n @click=\"emit('stop')\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-wakeup-bar {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-xs) var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n color: var(--color-word-3);\n font-size: var(--text-12);\n\n &__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n &__reason {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { useI18n } from 'vue-i18n'\n import type { PendingWakeup } from 'models'\n\n /**\n * The check the agent will run by itself next (spec agent-wakeup): when,\n * why, and the user's way to stop it. Above the input, because it is the\n * one thing in the chat still to happen.\n */\n defineProps<{\n pending: PendingWakeup\n stopping?: boolean\n }>()\n\n const emit = defineEmits<{\n stop: []\n }>()\n\n const { t: $t, d: $d } = useI18n({ useScope: 'global' })\n</script>\n\n<template>\n <div class=\"pk-chatbot-wakeup-bar\" role=\"status\">\n <VvIcon name=\"ri:alarm-line\" class=\"shrink-0\" />\n <span class=\"pk-chatbot-wakeup-bar__text\">\n <strong>\n {{\n $t('label.wakeupNext', {\n time: $d(new Date(pending.dueAt), 'time'),\n })\n }}\n </strong>\n <span class=\"pk-chatbot-wakeup-bar__reason\">\n {{ pending.reason }}\n </span>\n </span>\n <VvButton\n :label=\"$t('action.stop')\"\n modifiers=\"action-quiet\"\n :loading=\"stopping\"\n :disabled=\"stopping\"\n @click=\"emit('stop')\" />\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-wakeup-bar {\n display: flex;\n align-items: center;\n gap: var(--spacing-sm);\n padding: var(--spacing-xs) var(--spacing-md);\n border-top: 1px solid var(--color-surface-3);\n color: var(--color-word-3);\n font-size: var(--text-12);\n\n &__text {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0;\n }\n\n &__reason {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;EAcI,IAAMgB,IAAOD,GAIP,EAAE,GAAGE,GAAI,GAAGC,MAAOC,EAAQ,EAAE,UAAU,SAAS,CAAC;;;GAIvD,OAAAjB,EAAA,GAAAC,EAoBM,OApBNO,GAoBM;IAnBFN,EAAgDgB,GAAA;KAAxC,MAAK;KAAgB,OAAM;;IACnCf,EAWO,QAXPM,GAWO,CAVHN,EAMS,UAAA,MAAAC,EAJDC,EAAAU,CAAA,CAAE,CAAA,oBAAA,EAAqD,MAAAV,EAAAW,CAAA,CAAE,CAAA,IAAK,KAAKW,EAAA,QAAQ,KAAK,GAAA,MAAA,EAAA,CAAA,CAAA,GAAA,CAAA,GAKxFxB,EAEO,QAFPO,GAEON,EADAuB,EAAA,QAAQ,MAAM,GAAA,CAAA,CAAA,CAAA;IAGzBzB,EAK4BkB,GAAA;KAJvB,OAAOf,EAAAU,CAAA,CAAE,CAAA,aAAA;KACV,WAAU;KACT,SAASY,EAAA;KACT,UAAUA,EAAA;KACV,SAAK,AAAAC,EAAA,QAAA,MAAEd,EAAI,MAAA"}
|