@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
package/dist-vue/_chunks/{PkToolShowImageGallery-CkfXP_lD.js → PkToolShowImageGallery-ooygXk7j.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { r as t } from "./PkStreamingMarkdown-
|
|
3
|
-
import "./src-
|
|
2
|
+
import { r as t } from "./PkStreamingMarkdown-CsHzdW69.js";
|
|
3
|
+
import "./src-DpkuiHam.js";
|
|
4
4
|
import { n } from "./url-validation-9DstIfq2.js";
|
|
5
5
|
import { t as r } from "./useImageFallback-5vQIO0pC.js";
|
|
6
|
-
import { n as i, r as a } from "./PkChatbotFilePreview-
|
|
6
|
+
import { n as i, r as a } from "./PkChatbotFilePreview-D5H-RIk2.js";
|
|
7
7
|
import { t as o } from "./PkHeldImage-BqnlurT_.js";
|
|
8
8
|
import { VvIcon as s } from "@volverjs/ui-vue/components";
|
|
9
9
|
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, onMounted as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, watchEffect as C } from "vue";
|
|
@@ -85,4 +85,4 @@ var w = {
|
|
|
85
85
|
//#endregion
|
|
86
86
|
export { N as n, P as t };
|
|
87
87
|
|
|
88
|
-
//# sourceMappingURL=PkToolShowImageGallery-
|
|
88
|
+
//# sourceMappingURL=PkToolShowImageGallery-ooygXk7j.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowImageGallery-CkfXP_lD.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_normalizeClass","_Fragment","_renderList","_unref","_createBlock","PkHeldImage","_createCommentVNode","_sfc_main","__exportAll","useChatImageGate","useImageFallback","useImageSizes","useLightbox","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowImageGallery_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","galleryRef","ref","images","imageGate","isShown","url","canShowImage","measured","ready","image","gridCols","count","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","normalizeClass","Fragment","renderList","unref","getSize","isSameSite","onImageError","createBlock","createCommentVNode","PkToolShowImageGallery_exports","PkToolShowImageGallery_default"],"sources":["../../../../packages/components/src/chat/PkToolShowImageGallery.vue","../../../../packages/components/src/chat/PkToolShowImageGallery.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\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:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\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:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;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E,sBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,MAhBVE,EAAA,GAAAS,EAI8CC,GAAA;;IAFzC,MAAMF,EAAA2B,CAAA,CAAS,CAAC,OAAOM,EAAM,GAAG;IACjC,MAAA;IACC,YAAO,MAAEjC,EAAA2B,CAAA,CAAS,CAAC,QAAQM,EAAM,GAAG;GAE1BjC,GAAAA,MAAAA,GAAAA,CAAAA,QAAAA,WAAAA,CAAAA,EAUL,GAAA,IAAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"PkToolShowImageGallery-ooygXk7j.js","names":["$t","__unplugin_components_0","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_normalizeClass","_Fragment","_renderList","_unref","_createBlock","PkHeldImage","_createCommentVNode","_sfc_main","__exportAll","useChatImageGate","useImageFallback","useImageSizes","useLightbox","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowImageGallery_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","galleryRef","ref","images","imageGate","isShown","url","canShowImage","measured","ready","image","gridCols","count","onMounted","init","_component_VvIcon","VvIcon","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","normalizeClass","Fragment","renderList","unref","getSize","isSameSite","onImageError","createBlock","createCommentVNode","PkToolShowImageGallery_exports","PkToolShowImageGallery_default"],"sources":["../../../../packages/components/src/chat/PkToolShowImageGallery.vue","../../../../packages/components/src/chat/PkToolShowImageGallery.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\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:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, onMounted, watchEffect } from 'vue'\n import { isSameSite } from 'utils'\n import { useImageFallback } from 'composables'\n import { useLightbox, useImageSizes } from '../composables/useLightbox'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n images: Array<{\n url: string\n caption?: string\n alt?: string\n }>\n }\n }\n return part\n })\n\n const galleryRef = ref<HTMLElement>()\n const { preload, getSize } = useImageSizes()\n\n const images = computed(() => toolPart.value.input?.images ?? [])\n\n const { canShowImage, onImageError } = useImageFallback()\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts). Until then it is not measured,\n // linked or handed to the lightbox, which would all fetch it.\n const imageGate = useChatImageGate()\n const isShown = (url: string) => imageGate.canLoad(url) && canShowImage(url)\n\n // Measured once it may load: a held image when it is released, a short\n // link when it resolves to a listed host.\n const measured = new Set<string>()\n watchEffect(() => {\n const ready = images.value.filter(\n (image) => !measured.has(image.url) && imageGate.canLoad(image.url),\n )\n for (const image of ready) {\n measured.add(image.url)\n }\n preload(ready)\n })\n\n const gridCols = computed(() => {\n const count = images.value.length\n if (count === 1) {\n return 'grid-cols-1 justify-items-center'\n }\n if (count === 2) {\n return 'grid-cols-2'\n }\n return 'grid-cols-3'\n })\n\n const { init } = useLightbox({ gallery: galleryRef })\n\n onMounted(async () => {\n await init()\n })\n</script>\n\n<template>\n <div\n v-if=\"images.length\"\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:image-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.gallery', { count: images.length }) }}\n </strong>\n </div>\n <div class=\"p-sm\">\n <div ref=\"galleryRef\" class=\"grid gap-8\" :class=\"gridCols\">\n <a\n v-for=\"image in images\"\n :key=\"image.url\"\n :href=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-src=\"isShown(image.url) ? image.url : undefined\"\n :data-pswp-width=\"getSize(image.url).width\"\n :data-pswp-height=\"getSize(image.url).height\"\n :data-pswp-caption=\"image.caption ?? image.alt ?? ''\"\n :data-cropped=\"true\"\n class=\"relative block aspect-square overflow-hidden rounded-xl group max-h-384\"\n :class=\"[\n { 'w-384 max-w-full': images.length === 1 },\n canShowImage(image.url)\n ? 'cursor-pointer'\n : 'pointer-events-none',\n ]\"\n :title=\"image.caption ?? image.alt ?? ''\"\n :target=\"isSameSite(image.url) ? undefined : '_blank'\"\n :rel=\"\n isSameSite(image.url)\n ? undefined\n : 'noopener noreferrer'\n \">\n <PkHeldImage\n v-if=\"!imageGate.canLoad(image.url)\"\n :host=\"imageGate.hostOf(image.url)\"\n fill\n @release=\"imageGate.release(image.url)\" />\n <img\n v-else-if=\"canShowImage(image.url)\"\n :src=\"image.url\"\n :alt=\"image.alt ?? image.caption ?? ''\"\n class=\"w-full h-full object-cover transition-opacity group-hover:opacity-80\"\n @error=\"onImageError(image.url)\" />\n <div\n v-else\n class=\"w-full h-full flex flex-col items-center justify-center gap-4 bg-surface-1 text-word-3\">\n <VvIcon name=\"ri:camera-off-line\" class=\"text-24\" />\n <span class=\"text-12\">{{\n $t('label.imageLoadError')\n }}</span>\n </div>\n </a>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQI,IAAM8B,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAUtB,GAEKI,IAAaC,EAAiB,GAC9B,EAAE,YAAS,eAAYjB,EAAc,GAErCkB,IAASH,QAAeD,EAAS,MAAM,OAAO,UAAU,CAAC,CAAC,GAE1D,EAAE,iBAAc,oBAAiBf,EAAiB,GAIlDoB,IAAYrB,EAAiB,GAC7BsB,KAAW,MAAgBD,EAAU,QAAQE,CAAG,KAAKC,EAAaD,CAAG,GAIrEE,oBAAW,IAAI,IAAY;EACjC,QAAkB;GACd,IAAMC,IAAQN,EAAO,MAAM,QACtB,MAAU,CAACK,EAAS,IAAIE,EAAM,GAAG,KAAKN,EAAU,QAAQM,EAAM,GAAG,CACtE;GACA,KAAK,IAAMA,KAASD,GAChB,EAAS,IAAIC,EAAM,GAAG;GAE1B,EAAQD,CAAK;EACjB,CAAC;EAED,IAAME,IAAWX,QAAe;GAC5B,IAAMY,IAAQT,EAAO,MAAM;GAO3B,OANIS,MAAU,IACH,qCAEPA,MAAU,IACH,gBAEJ;EACX,CAAC,GAEK,EAAE,YAAS1B,EAAY,EAAE,SAASe,EAAW,CAAC;SAEpDY,EAAU,YAAY;GAClB,MAAMC,EAAK;EACf,CAAC;;GAKS,OAAAX,EAAA,MAAO,UADjBlC,EAAA,GAAAC,EAyDM,OAzDNkB,GAyDM,CAtDFjB,EAMM,OANNkB,GAMM,CAJFjB,EAA+C2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C,EAAA,GAAAC,EAKuC,OAAA;;IAHlC,KAAKwC,EAAM;IACX,KAAKA,EAAM,OAAOA,EAAM,WAAO;IAChC,OAAM;IACL,UAAK,MAAEjC,EAAAoD,CAAA,CAAY,CAACnB,EAAM,GAAG;GAClCzC,GAAAA,MAAAA,IAAAA,CAAAA,MAAAA,EAAA,GAAAC,EAOM,OAPNwB,GAOM,CAJFtB,EAAoD2C,GAAA;IAA5C,MAAK;IAAqB,OAAM;GACxC5C,CAAAA,GAAAA,EAES,QAFTwB,GAEStB,EADLN,EAAAA,GAAE,sBAAA,CAAA,GAAA,CAAA,CAAA,CAAA,MAhBVE,EAAA,GAAAS,EAI8CC,GAAA;;IAFzC,MAAMF,EAAA2B,CAAA,CAAS,CAAC,OAAOM,EAAM,GAAG;IACjC,MAAA;IACC,YAAO,MAAEjC,EAAA2B,CAAA,CAAS,CAAC,QAAQM,EAAM,GAAG;GAE1BjC,GAAAA,MAAAA,GAAAA,CAAAA,QAAAA,WAAAA,CAAAA,EAUL,GAAA,IAAAe,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
2
|
+
import { t } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
3
|
+
import { n, t as r } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
+
import "./src-DpkuiHam.js";
|
|
5
|
+
import { VvButtonGroup as i, VvDropdown as a, VvDropdownAction as o, VvIcon as s } from "@volverjs/ui-vue/components";
|
|
5
6
|
import { computed as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, getCurrentInstance as h, guardReactiveProps as g, normalizeProps as _, onMounted as v, openBlock as y, ref as b, toDisplayString as x, unref as S, watchEffect as C, withCtx as w } from "vue";
|
|
6
7
|
import { useClipboard as T } from "@vueuse/core";
|
|
7
8
|
import { MglGeolocateControl as E, MglMap as D, MglMarker as O, MglNavigationControl as k, MglPopup as A, MglScaleControl as j } from "@indoorequal/vue-maplibre-gl";
|
|
@@ -32,7 +33,7 @@ var M = {
|
|
|
32
33
|
dark: "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
33
34
|
};
|
|
34
35
|
v(() => {
|
|
35
|
-
|
|
36
|
+
n("https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css", r(h()?.proxy?.$el));
|
|
36
37
|
});
|
|
37
38
|
let J = c(() => m.isDark ? q.dark : q.light);
|
|
38
39
|
C(async () => {
|
|
@@ -53,15 +54,15 @@ var M = {
|
|
|
53
54
|
let e = G.value.input;
|
|
54
55
|
e && U(`${e.name}\n${e.address}`);
|
|
55
56
|
};
|
|
56
|
-
return (
|
|
57
|
-
let c = s, m =
|
|
57
|
+
return (n, r) => {
|
|
58
|
+
let c = s, m = t, h = o, v = a, b = i;
|
|
58
59
|
return G.value?.input ? (y(), u("div", M, [
|
|
59
60
|
d("div", N, [
|
|
60
61
|
p(c, {
|
|
61
62
|
name: "ri:map-pin-line",
|
|
62
63
|
class: "text-16"
|
|
63
64
|
}),
|
|
64
|
-
d("strong", P, x(
|
|
65
|
+
d("strong", P, x(n.$t("label.location")), 1),
|
|
65
66
|
p(b, {
|
|
66
67
|
modifiers: "compact",
|
|
67
68
|
class: "ml-auto shrink-0"
|
|
@@ -69,7 +70,7 @@ var M = {
|
|
|
69
70
|
default: w(() => [p(m, {
|
|
70
71
|
modifiers: "action-quiet-small",
|
|
71
72
|
icon: S(W) ? "ri:check-line" : "ri:file-copy-line",
|
|
72
|
-
label: S(W) ?
|
|
73
|
+
label: S(W) ? n.$t("action.copied") : n.$t("action.copy"),
|
|
73
74
|
onClick: te
|
|
74
75
|
}, null, 8, ["icon", "label"]), p(v, _(g({
|
|
75
76
|
placement: "bottom-end",
|
|
@@ -80,22 +81,22 @@ var M = {
|
|
|
80
81
|
})), {
|
|
81
82
|
items: w(() => [
|
|
82
83
|
p(h, { onClick: Q }, {
|
|
83
|
-
default: w(() => [p(c, { name: "ri:map-2-line" }),
|
|
84
|
+
default: w(() => [p(c, { name: "ri:map-2-line" }), r[0] ||= f(" Google Maps ", -1)]),
|
|
84
85
|
_: 1
|
|
85
86
|
}),
|
|
86
87
|
p(h, { onClick: $ }, {
|
|
87
|
-
default: w(() => [p(c, { name: "ri:map-line" }),
|
|
88
|
+
default: w(() => [p(c, { name: "ri:map-line" }), r[1] ||= f(" Apple Maps ", -1)]),
|
|
88
89
|
_: 1
|
|
89
90
|
}),
|
|
90
91
|
p(h, { onClick: ee }, {
|
|
91
|
-
default: w(() => [p(c, { name: "ri:navigation-line" }),
|
|
92
|
+
default: w(() => [p(c, { name: "ri:navigation-line" }), r[2] ||= f(" Waze ", -1)]),
|
|
92
93
|
_: 1
|
|
93
94
|
})
|
|
94
95
|
]),
|
|
95
96
|
default: w(() => [p(m, {
|
|
96
97
|
icon: "ri:direction-line",
|
|
97
98
|
modifiers: "action-quiet-small",
|
|
98
|
-
label:
|
|
99
|
+
label: n.$t("action.getDirections")
|
|
99
100
|
}, null, 8, ["label"])]),
|
|
100
101
|
_: 1
|
|
101
102
|
}, 16)]),
|
|
@@ -141,4 +142,4 @@ var M = {
|
|
|
141
142
|
//#endregion
|
|
142
143
|
export { W as n, G as t };
|
|
143
144
|
|
|
144
|
-
//# sourceMappingURL=PkToolShowLocation-
|
|
145
|
+
//# sourceMappingURL=PkToolShowLocation-DVMpFdRk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowLocation-DVMpFdRk.js","names":["$t","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","_createCommentVNode","_sfc_main","__exportAll","getShadowRoot","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","PkToolShowLocation_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","geocodedCoords","ref","MAP_STYLES","getCurrentInstance","mapStyle","input","result","hasCoords","center","getNavDestination","openGoogleMaps","openAppleMaps","openWaze","copyLocation","copy","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","normalizeProps","guardReactiveProps","_cache","createTextVNode","MglMap","MglNavigationControl","MglGeolocateControl","MglScaleControl","MglMarker","MglPopup","createCommentVNode","PkToolShowLocation_exports","PkToolShowLocation_default"],"sources":["../../../../packages/components/src/chat/PkToolShowLocation.vue","../../../../packages/components/src/chat/PkToolShowLocation.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\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\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\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:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import {\n computed,\n ref,\n watchEffect,\n onMounted,\n getCurrentInstance,\n } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { loadCdnCss, getShadowRoot } from 'utils'\n import {\n MglGeolocateControl,\n MglMap,\n MglMarker,\n MglNavigationControl,\n MglPopup,\n MglScaleControl,\n } from '@indoorequal/vue-maplibre-gl'\n\n const props = defineProps<{\n part: unknown\n isDark?: boolean\n mainColor?: string\n forwardGeocode?: (\n query: string,\n lang?: string,\n ) => Promise<\n | { latitude: number; longitude: number; displayName: string }\n | undefined\n >\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n name: string\n address: string\n latitude?: number\n longitude?: number\n additionalInfo?: string\n }\n }\n return part\n })\n\n const geocodedCoords = ref<[number, number] | null>(null)\n\n const MAP_STYLES = {\n light: 'https://basemaps.cartocdn.com/gl/positron-gl-style/style.json',\n dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',\n } as const\n\n onMounted(() => {\n loadCdnCss(\n 'https://cdn.jsdelivr.net/npm/maplibre-gl@5/dist/maplibre-gl.css',\n getShadowRoot(getCurrentInstance()?.proxy?.$el),\n )\n })\n\n const mapStyle = computed(() =>\n props.isDark ? MAP_STYLES.dark : MAP_STYLES.light,\n )\n\n watchEffect(async () => {\n const input = toolPart.value.input\n if (!input || input.latitude != null || !input.address) {\n return\n }\n if (!props.forwardGeocode) {\n return\n }\n\n try {\n const result = await props.forwardGeocode(input.address)\n if (result) {\n // [lng, lat] — MapLibre coordinate order\n geocodedCoords.value = [result.longitude, result.latitude]\n }\n } catch {\n // Geocoding failed — fallback to text-only card\n }\n })\n\n const hasCoords = computed(\n () =>\n (toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null) ||\n geocodedCoords.value != null,\n )\n\n const center = computed<[number, number]>(() => {\n if (\n toolPart.value.input?.latitude != null &&\n toolPart.value.input?.longitude != null\n ) {\n // [lng, lat] — MapLibre coordinate order\n return [\n toolPart.value.input.longitude,\n toolPart.value.input.latitude,\n ]\n }\n return geocodedCoords.value ?? [0, 0]\n })\n\n // Navigation services expect \"lat,lng\" — center is [lng, lat]\n const getNavDestination = () =>\n hasCoords.value\n ? `${center.value[1]},${center.value[0]}`\n : (toolPart.value.input?.address ?? '')\n\n const openGoogleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openAppleMaps = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n window.open(\n `https://maps.apple.com/?daddr=${encodeURIComponent(getNavDestination())}`,\n '_blank',\n )\n }\n\n const openWaze = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n if (hasCoords.value) {\n window.open(\n `https://waze.com/ul?ll=${center.value[1]},${center.value[0]}&navigate=yes`,\n '_blank',\n )\n } else {\n window.open(\n `https://waze.com/ul?q=${encodeURIComponent(input.address)}&navigate=yes`,\n '_blank',\n )\n }\n }\n\n const copyLocation = () => {\n const input = toolPart.value.input\n if (!input) {\n return\n }\n copy(`${input.name}\\n${input.address}`)\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\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\">\n <VvIcon name=\"ri:map-pin-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.location') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copyLocation\" />\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:direction-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.getDirections')\" />\n <template #items>\n <VvDropdownAction @click=\"openGoogleMaps\">\n <VvIcon name=\"ri:map-2-line\" />\n Google Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openAppleMaps\">\n <VvIcon name=\"ri:map-line\" />\n Apple Maps\n </VvDropdownAction>\n <VvDropdownAction @click=\"openWaze\">\n <VvIcon name=\"ri:navigation-line\" />\n Waze\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div v-if=\"hasCoords\" class=\"h-224 border-b border-surface-3\">\n <MglMap\n :map-style=\"mapStyle\"\n :zoom=\"12\"\n :center=\"center\"\n :scroll-zoom=\"false\"\n :attribution-control=\"false\">\n <MglNavigationControl\n position=\"top-right\"\n :show-compass=\"false\" />\n <MglGeolocateControl position=\"top-right\" />\n <MglScaleControl position=\"bottom-left\" />\n <MglMarker :coordinates=\"center\" :color=\"mainColor\">\n <MglPopup :close-button=\"false\">\n <div class=\"flex flex-col leading-normal text-12 pr-12\">\n <p class=\"font-semibold\">\n {{ toolPart.input.name }}\n </p>\n <p\n v-if=\"toolPart.input.address\"\n class=\"text-word-3\">\n {{ toolPart.input.address }}\n </p>\n </div>\n </MglPopup>\n </MglMarker>\n </MglMap>\n </div>\n <div class=\"p-sm flex flex-col gap-4\">\n <p class=\"font-semibold text-word-1 text-14\">\n {{ toolPart.input.name }}\n </p>\n <p class=\"text-12 text-word-3\">{{ toolPart.input.address }}</p>\n <p v-if=\"toolPart.input.additionalInfo\" class=\"text-12 text-word-4\">\n {{ toolPart.input.additionalInfo }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBI,IAAMgC,IAAQC,GAaR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAUtB,GAEKK,IAAiBC,EAA6B,IAAI,GAElDC,IAAa;GACf,OAAO;GACP,MAAM;EACV;EAEA,QAAgB;GACZ,EACI,mEACApB,EAAcqB,EAAmB,CAAC,EAAE,OAAO,GAAG,CAClD;EACJ,CAAC;EAED,IAAMC,IAAWL,QACbJ,EAAM,SAASO,EAAW,OAAOA,EAAW,KAChD;EAEA,EAAY,YAAY;GACpB,IAAMG,IAAQP,EAAS,MAAM;GAC7B,IAAKO,KAASA,EAAM,YAAY,QAASA,EAAM,WAG1CV,EAAM,gBAIX,IAAI;IACA,IAAMW,IAAS,MAAMX,EAAM,eAAeU,EAAM,OAAO;IACvD,AAAIC,MAEA,EAAe,QAAQ,CAACA,EAAO,WAAWA,EAAO,QAAQ;GAEjE,QAAQ,CAER;EACJ,CAAC;EAED,IAAMC,IAAYR,QAETD,EAAS,MAAM,OAAO,YAAY,QAC/BA,EAAS,MAAM,OAAO,aAAa,QACvCE,EAAe,SAAS,IAChC,GAEMQ,IAAST,QAEPD,EAAS,MAAM,OAAO,YAAY,QAClCA,EAAS,MAAM,OAAO,aAAa,OAG5B,CACHA,EAAS,MAAM,MAAM,WACrBA,EAAS,MAAM,MAAM,QACzB,IAEGE,EAAe,SAAS,CAAC,GAAG,CAAC,CACvC,GAGKS,UACFF,EAAU,QACJ,GAAGC,EAAO,MAAM,GAAG,GAA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E,QASM,CATNH,EASM,OATNgB,GASM,CARFhB,EAEI,KAFJiB,GAEIf,EADGyB,EAAA,MAAS,MAAM,IAAI,GAAA,CAAA,GAGhBA,EAAA,MAAS,MAAM,WADzB7B,EAAA,GAAAC,EAII,KAJJmB,GAIIhB,EADGyB,EAAA,MAAS,MAAM,OAAO,GAAA,CAAA,KAAA8C,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;;;;;;;;IAOjDzE,EAQM,OARNmB,GAQM;KAPFnB,EAEI,KAFJoB,GAEIlB,EADGyB,EAAA,MAAS,MAAM,IAAI,GAAA,CAAA;KAE1B3B,EAA+D,KAA/DqB,GAA+DnB,EAA7ByB,EAAA,MAAS,MAAM,OAAO,GAAA,CAAA;KAC/CA,EAAA,MAAS,MAAM,kBAAxB7B,EAAA,GAAAC,EAEI,KAFJuB,GAEIpB,EADGyB,EAAA,MAAS,MAAM,cAAc,GAAA,CAAA,KAAA8C,EAAA,IAAA,EAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { t } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
3
|
+
import { n } from "./useShortUrlResolver-DI8ycJiO.js";
|
|
4
|
+
import { VvButtonGroup as r, VvDropdown as i, VvDropdownAction as a, VvIcon as o } from "@volverjs/ui-vue/components";
|
|
4
5
|
import { computed as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, guardReactiveProps as p, normalizeProps as m, openBlock as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
5
6
|
import { useClipboard as y } from "@vueuse/core";
|
|
6
7
|
//#region ../../packages/components/src/chat/PkToolShowMessage.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -8,7 +9,7 @@ var b = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
8
9
|
__name: "PkToolShowMessage",
|
|
9
10
|
props: { part: {} },
|
|
10
11
|
setup(e) {
|
|
11
|
-
let f = e, { copy: E, copied: D } = y(), O = s(() => f.part), { resolveText: k } =
|
|
12
|
+
let f = e, { copy: E, copied: D } = y(), O = s(() => f.part), { resolveText: k } = n(), A = k(() => O.value.input?.body), j = () => {
|
|
12
13
|
if (!O.value.input) return;
|
|
13
14
|
let e = `https://wa.me/?text=${encodeURIComponent(A.value)}`;
|
|
14
15
|
window.open(e, "_blank");
|
|
@@ -21,8 +22,8 @@ var b = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
21
22
|
let e = `sms:?body=${encodeURIComponent(A.value)}`;
|
|
22
23
|
window.open(e);
|
|
23
24
|
};
|
|
24
|
-
return (e,
|
|
25
|
-
let s = o, f =
|
|
25
|
+
return (e, n) => {
|
|
26
|
+
let s = o, f = t, y = a, O = i, k = r;
|
|
26
27
|
return h(), c("div", b, [l("div", x, [
|
|
27
28
|
d(s, {
|
|
28
29
|
name: "ri:chat-1-line",
|
|
@@ -37,7 +38,7 @@ var b = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
37
38
|
modifiers: "action-quiet-small",
|
|
38
39
|
icon: _(D) ? "ri:check-line" : "ri:file-copy-line",
|
|
39
40
|
label: _(D) ? e.$t("action.copied") : e.$t("action.copy"),
|
|
40
|
-
onClick:
|
|
41
|
+
onClick: n[0] ||= (e) => _(E)(_(A))
|
|
41
42
|
}, null, 8, ["icon", "label"]), d(O, m(p({
|
|
42
43
|
placement: "bottom-end",
|
|
43
44
|
modifiers: "menu",
|
|
@@ -75,4 +76,4 @@ var b = { class: "border border-surface-3 rounded-xl w-full overflow-hidden bg-s
|
|
|
75
76
|
//#endregion
|
|
76
77
|
export { D as n, O as t };
|
|
77
78
|
|
|
78
|
-
//# sourceMappingURL=PkToolShowMessage-
|
|
79
|
+
//# sourceMappingURL=PkToolShowMessage-ATTN5Hac.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowMessage-ATTN5Hac.js","names":["$t","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","__unplugin_components_3","__unplugin_components_4","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_normalizeProps","_guardReactiveProps","_createTextVNode","_sfc_main","__exportAll","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","PkToolShowMessage_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","useShortUrlResolver","body","resolveText","openInWhatsApp","url","openInTelegram","openInSms","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvDropdownAction","VvDropdownAction","_component_VvDropdown","VvDropdown","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","_cache","copy","normalizeProps","guardReactiveProps","createTextVNode","PkToolShowMessage_exports","PkToolShowMessage_default"],"sources":["../../../../packages/components/src/chat/PkToolShowMessage.vue","../../../../packages/components/src/chat/PkToolShowMessage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\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\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\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:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useClipboard } from '@vueuse/core'\n import { useShortUrlResolver } from 'composables'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n body: string\n }\n }\n return part\n })\n\n // Messages leave the app (WhatsApp/Telegram/SMS/clipboard), so expand short\n // urls to their real target rather than keeping the fragile `/api/r/` link.\n const { resolveText } = useShortUrlResolver()\n const body = resolveText(() => toolPart.value.input?.body)\n\n const openInWhatsApp = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://wa.me/?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInTelegram = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `https://t.me/share/url?text=${encodeURIComponent(body.value)}`\n window.open(url, '_blank')\n }\n\n const openInSms = () => {\n if (!toolPart.value.input) {\n return\n }\n const url = `sms:?body=${encodeURIComponent(body.value)}`\n window.open(url)\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\">\n <VvIcon name=\"ri:chat-1-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.message') }}\n </strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(body)\" />\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:send-plane-line\"\n modifiers=\"action-quiet-small\"\n :label=\"$t('action.send')\" />\n <template #items>\n <VvDropdownAction @click=\"openInWhatsApp\">\n <VvIcon name=\"ri:whatsapp-line\" />\n {{ $t('action.openInWhatsApp') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInTelegram\">\n <VvIcon name=\"ri:telegram-line\" />\n {{ $t('action.openInTelegram') }}\n </VvDropdownAction>\n <VvDropdownAction @click=\"openInSms\">\n <VvIcon name=\"ri:message-2-line\" />\n {{ $t('action.openInSms') }}\n </VvDropdownAction>\n </template>\n </VvDropdown>\n </VvButtonGroup>\n </div>\n <div class=\"p-sm\">\n <div class=\"text-12 text-word-4 mb-4\">\n {{ $t('label.body') }}\n </div>\n <pre class=\"text-word-2 whitespace-pre-wrap break-words\">{{\n body\n }}</pre>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;EAKI,IAAMyB,IAAQC,GAIR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAMtB,GAIK,EAAE,mBAAgBK,EAAoB,GACtCC,IAAOC,QAAkBJ,EAAS,MAAM,OAAO,IAAI,GAEnDK,UAAuB;GACzB,IAAI,CAACL,EAAS,MAAM,OAChB;GAEJ,IAAMM,IAAM,uBAAuB,mBAAmBH,EAAK,KAAK;GAChE,OAAO,KAAKG,GAAK,QAAQ;EAC7B,GAEMC,UAAuB;GACzB,IAAI,CAACP,EAAS,MAAM,OAChB;GAEJ,IAAMM,IAAM,+BAA+B,mBAAmBH,EAAK,KAAK;GACxE,OAAO,KAAKG,GAAK,QAAQ;EAC7B,GAEME,UAAkB;GACpB,IAAI,CAACR,EAAS,MAAM,OAChB;GAEJ,IAAMM,IAAM,aAAa,mBAAmBH,EAAK,KAAK;GACtD,OAAO,KAAKG,CAAG;EACnB;;;GAIA,OAAA5B,EAAA,GAAAC,EAmDM,OAnDNW,GAmDM,CAjDFV,EAwCM,OAxCNW,GAwCM;IAtCFV,EAAgD4B,GAAA;KAAxC,MAAK;KAAiB,OAAM;;IACpC7B,EAES,UAFTY,GAESV,EADFV,EAAAA,GAAE,eAAA,CAAA,GAAA,CAAA;IAETS,EAiCgBoC,GAAA;KAjCD,WAAU;KAAU,OAAM;;KACrC,SAAAlC,QAI0B,CAJ1BF,EAI0B8B,GAAA;MAHtB,WAAU;MACT,MAAM3B,EAAA2C,C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CAAA,CAAA,CAAA,CAAA,CAAA"}
|
package/dist-vue/_chunks/{PkToolShowProductList-De-PtmD-.js → PkToolShowProductList-D-HJ9a_h.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { r as t } from "./PkStreamingMarkdown-
|
|
2
|
+
import { r as t } from "./PkStreamingMarkdown-CsHzdW69.js";
|
|
3
3
|
import { t as n } from "./PkLazyImg-X5BMNU_R.js";
|
|
4
4
|
import { t as r } from "./PkUrl-CN1kkZiH.js";
|
|
5
5
|
import { t as i } from "./PkHeldImage-BqnlurT_.js";
|
|
@@ -69,4 +69,4 @@ var x = {
|
|
|
69
69
|
//#endregion
|
|
70
70
|
export { A as n, j as t };
|
|
71
71
|
|
|
72
|
-
//# sourceMappingURL=PkToolShowProductList-
|
|
72
|
+
//# sourceMappingURL=PkToolShowProductList-D-HJ9a_h.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkToolShowProductList-De-PtmD-.js","names":["__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_unref","PkHeldImage","PkLazyImg","_createCommentVNode","_createElementVNode","_toDisplayString","_createVNode","PkUrl","_sfc_main","__exportAll","useChatImageGate","PkLazyImg_default","PkUrl_default","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowProductList_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","imageGate","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","renderList","index","normalizeClass","product","createBlock","resolveDynamicComponent","withCtx","unref","createCommentVNode","createElementVNode","toDisplayString","createVNode","PkToolShowProductList_exports","PkToolShowProductList_default"],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOI,IAAMgC,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAatB,GAIKI,IAAYjB,EAAiB;;;GAKzB,OAAAe,EAAA,OAAU,OAAO,UAAU,UADrCjC,EAAA,GAAAC,EA6DK,MA7DLqB,GA6DK,EA1DDtB,EAAA,EAAA,GAAAC,EAyDKC,GAAA,MAAAC,EAxD0B8B,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrBjC,EAAA,GAAAC,EAyDK,MAAA;IAvDA,KAAKyC;IACN,OAAKtC,EAAA,CAAC,WAAS,EAAA,kBAAA,CACcwC,EAAQ,IAAG,CAAA,CAAA;GAExC5C,GAAAA,EAAAA,EAAA,GAAAK,EAkDYC,EAjDHsC,EAAQ,MAAG,MAAA,KAAA,GAAA;IACf,MAAMA,EAAQ;IACd,QAAQA,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eADlB5C,EAAA,GAAAC,EAII,KAJJ4B,GAIIhB,EADG+B,EAAQ,WAAW,GAAA,CAAA,KAAAK,EAAA,IAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"PkToolShowProductList-D-HJ9a_h.js","names":["__unplugin_components_0","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createBlock","_resolveDynamicComponent","_withCtx","_unref","PkHeldImage","PkLazyImg","_createCommentVNode","_createElementVNode","_toDisplayString","_createVNode","PkUrl","_sfc_main","__exportAll","useChatImageGate","PkLazyImg_default","PkUrl_default","PkHeldImage_default","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","PkToolShowProductList_vue_vue_type_script_setup_true_lang_default","props","__props","toolPart","computed","imageGate","_component_VvIcon","VvIcon","openBlock","createElementBlock","Fragment","renderList","index","normalizeClass","product","createBlock","resolveDynamicComponent","withCtx","unref","createCommentVNode","createElementVNode","toDisplayString","createVNode","PkToolShowProductList_exports","PkToolShowProductList_default"],"sources":["../../../../packages/components/src/chat/PkToolShowProductList.vue","../../../../packages/components/src/chat/PkToolShowProductList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import PkLazyImg from '../PkLazyImg.vue'\n import { useChatImageGate } from './chatImagePolicy'\n import PkHeldImage from './PkHeldImage.vue'\n import PkUrl from '../PkUrl.vue'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n products: Array<{\n name: string\n url?: string\n image?: string\n price?: string\n availability?: string\n description?: string\n }>\n }\n }\n return part\n })\n\n // The model writes these urls: one from a host the agent does not list\n // waits for a click (chatImagePolicy.ts).\n const imageGate = useChatImageGate()\n</script>\n\n<template>\n <ul\n v-if=\"toolPart?.input?.products?.length\"\n class=\"vv-item-group vv-item-group--framed w-full\">\n <li\n v-for=\"(product, index) in toolPart.input.products\"\n :key=\"index\"\n class=\"vv-item\"\n :class=\"{ 'vv-item--plain': !product.url }\">\n <!-- A product without a link answers no click: no hover, no hand -->\n <component\n :is=\"product.url ? 'a' : 'div'\"\n :href=\"product.url\"\n :target=\"product.url ? '_blank' : undefined\"\n :rel=\"product.url ? 'noopener noreferrer' : undefined\"\n class=\"vv-item__entry\">\n <!-- Merchant images rot over time: a dead one degrades to an icon\n so the row keeps its thumbnail slot -->\n <PkHeldImage\n v-if=\"product.image && !imageGate.canLoad(product.image)\"\n :host=\"imageGate.hostOf(product.image)\"\n class=\"w-48 h-48 rounded-lg shrink-0 border border-surface-3 bg-surface\"\n @release=\"imageGate.release(product.image)\" />\n <PkLazyImg\n v-else-if=\"product.image\"\n :src=\"product.image\"\n :alt=\"product.name\"\n fallback-icon=\"ri:image-off-line\"\n class=\"w-48 h-48 object-contain rounded-lg shrink-0 border border-surface-3 bg-surface\" />\n <div class=\"flex flex-col gap-4 min-w-0 flex-1\">\n <strong class=\"font-bold text-12 text-word-1 truncate\">\n {{ product.name }}\n </strong>\n <span\n v-if=\"product.url\"\n class=\"text-10 text-word-4 truncate flex items-center gap-4\">\n <VvIcon name=\"ri:link\" class=\"shrink-0 text-12\" />\n <PkUrl :url=\"product.url\" />\n </span>\n <div class=\"flex items-center gap-sm flex-wrap text-12\">\n <span\n v-if=\"product.price\"\n class=\"font-semibold text-word-1\">\n {{ product.price }}\n </span>\n <!-- Free text from the merchant: it was colour-coded by\n substring, which only ever matched English and\n Italian. It reads as the note it is. -->\n <span\n v-if=\"product.availability\"\n class=\"text-10 text-word-3\">\n {{ product.availability }}\n </span>\n </div>\n <p\n v-if=\"product.description\"\n class=\"text-12 text-word-3 line-clamp-2\">\n {{ product.description }}\n </p>\n </div>\n </component>\n </li>\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOI,IAAMgC,IAAQC,GAIRC,IAAWC,QACAH,EAAM,IAatB,GAIKI,IAAYjB,EAAiB;;;GAKzB,OAAAe,EAAA,OAAU,OAAO,UAAU,UADrCjC,EAAA,GAAAC,EA6DK,MA7DLqB,GA6DK,EA1DDtB,EAAA,EAAA,GAAAC,EAyDKC,GAAA,MAAAC,EAxD0B8B,EAAA,MAAS,MAAM,WAAlC,GAAS,OADrBjC,EAAA,GAAAC,EAyDK,MAAA;IAvDA,KAAKyC;IACN,OAAKtC,EAAA,CAAC,WAAS,EAAA,kBAAA,CACcwC,EAAQ,IAAG,CAAA,CAAA;GAExC5C,GAAAA,EAAAA,EAAA,GAAAK,EAkDYC,EAjDHsC,EAAQ,MAAG,MAAA,KAAA,GAAA;IACf,MAAMA,EAAQ;IACd,QAAQA,EAAQ,MAAG,WAAc,KAAA;IACjC,KAAKA,EAAQ,MAAG,wBAA2B,KAAA;IAC5C,OAAM;;IAGN,SAAArC,QAIkD,CAHxCqC,EAAQ,SAAK,CAAKpC,EAAA2B,CAAA,CAAS,CAAC,QAAQS,EAAQ,KAAK,KAD3D5C,EAAA,GAAAK,EAIkDI,GAAA;;KAF7C,MAAMD,EAAA2B,CAAA,CAAS,CAAC,OAAOS,EAAQ,KAAK;KACrC,OAAM;KACL,YAAO,MAAEpC,EAAA2B,CAAA,CAAS,CAAC,QAAQS,EAAQ,KAAK;IAE9B,GAAA,MAAA,GAAA,CAAA,QAAA,WAAA,CAAA,KAAAA,EAAQ,SADvB5C,EAAA,GAAAK,EAK8FK,GAAA;;KAHzF,KAAKkC,EAAQ;KACb,KAAKA,EAAQ;KACd,iBAAc;KACd,OAAM;IACVhC,GAAAA,MAAAA,GAAAA,CAAAA,OAAAA,KAAAA,CAAAA,KAAAA,EAAAA,IAAAA,EAAAA,GAAAA,EA8BM,OA9BNW,GA8BM;KA7BFX,EAES,UAFTY,GAESX,EADF+B,EAAQ,IAAI,GAAA,CAAA;KAGTA,EAAQ,OADlB5C,EAAA,GAAAC,EAKO,QALPwB,GAKO,CAFHX,EAAkDsB,GAAA;MAA1C,MAAK;MAAU,OAAM;KAC7BtB,CAAAA,GAAAA,EAA4BC,GAAA,EAApB,KAAK6B,EAAQ,IAAA,GAAA,MAAA,GAAA,CAAA,KAAA,CAAA,CAAA,CAAA,KAAAK,EAAA,IAAA,EAAA;KAEzBrC,EAcM,OAdNc,GAcM,CAZQkB,EAAQ,SADlB5C,EAAA,GAAAC,EAIO,QAJP0B,GAIOd,EADA+B,EAAQ,KAAK,GAAA,CAAA,KAAAK,EAAA,IAAA,EAAA,GAMVL,EAAQ,gBADlB5C,EAAA,GAAAC,EAIO,QAJP2B,GAIOf,EADA+B,EAAQ,YAAY,GAAA,CAAA,KAAAK,EAAA,IAAA,EAAA,CAAA,CAAA;KAIrBL,EAAQ,eADlB5C,EAAA,GAAAC,EAII,KAJJ4B,GAIIhB,EADG+B,EAAQ,WAAW,GAAA,CAAA,KAAAK,EAAA,IAAA,EAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t } from "./VvButtonLocalized-BuzLsXp3.js";
|
|
3
|
+
import { VvButtonGroup as n, VvIcon as r } from "@volverjs/ui-vue/components";
|
|
3
4
|
import { computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, onMounted as u, openBlock as d, ref as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
|
|
4
5
|
import { useClipboard as g } from "@vueuse/core";
|
|
5
6
|
//#region ../../packages/components/src/chat/PkToolShowQrCode.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -69,4 +70,4 @@ var _ = {
|
|
|
69
70
|
//#endregion
|
|
70
71
|
export { w as n, T as t };
|
|
71
72
|
|
|
72
|
-
//# sourceMappingURL=PkToolShowQrCode-
|
|
73
|
+
//# sourceMappingURL=PkToolShowQrCode-D_5VUtEB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowQrCode-D_5VUtEB.js","names":["$t","__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","_toDisplayString","_withCtx","_unref","_createCommentVNode","_sfc_main","__exportAll","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","PkToolShowQrCode_vue_vue_type_script_setup_true_lang_default","props","__props","useClipboard","toolPart","computed","svgContent","ref","qrContainerRef","content","QRCode","downloadQr","svgEl","svgData","svgBlob","svgUrl","canvas","ctx","img","a","_component_VvIcon","VvIcon","_component_VvButton","VvButtonLocalized","_component_VvButtonGroup","VvButtonGroup","openBlock","createElementBlock","createElementVNode","createVNode","toDisplayString","_ctx","withCtx","unref","copied","_cache","copy","createCommentVNode","PkToolShowQrCode_exports","PkToolShowQrCode_default"],"sources":["../../../../packages/components/src/chat/PkToolShowQrCode.vue","../../../../packages/components/src/chat/PkToolShowQrCode.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, onMounted } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n content: string\n label?: string\n }\n }\n return part\n })\n\n const svgContent = ref('')\n const qrContainerRef = ref<HTMLElement>()\n\n onMounted(async () => {\n const content = toolPart.value.input?.content\n if (!content) {\n return\n }\n const { default: QRCode } = await import('qrcode')\n svgContent.value = await QRCode.toString(content, { type: 'svg' })\n })\n\n const downloadQr = async () => {\n const svgEl = qrContainerRef.value?.querySelector('svg')\n if (!svgEl) {\n return\n }\n const svgData = new XMLSerializer().serializeToString(svgEl)\n const svgBlob = new Blob([svgData], {\n type: 'image/svg+xml;charset=utf-8',\n })\n const svgUrl = URL.createObjectURL(svgBlob)\n\n const canvas = document.createElement('canvas')\n canvas.width = 512\n canvas.height = 512\n const ctx = canvas.getContext('2d')\n const img = new Image()\n img.onload = () => {\n ctx?.drawImage(img, 0, 0, 512, 512)\n URL.revokeObjectURL(svgUrl)\n const a = document.createElement('a')\n a.href = canvas.toDataURL('image/png')\n a.download = 'qrcode.png'\n a.click()\n }\n img.src = svgUrl\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\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\">\n <VvIcon name=\"ri:qr-code-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.qrCode') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(toolPart?.input?.content ?? '')\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :label=\"$t('action.download')\"\n @click=\"downloadQr\" />\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex flex-col items-center\">\n <div ref=\"qrContainerRef\" class=\"w-144 h-144\" v-html=\"svgContent\" />\n <p\n v-if=\"toolPart.input.label\"\n class=\"text-12 text-word-3 text-center\">\n {{ toolPart.input.label }}\n </p>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, onMounted } from 'vue'\n import { useClipboard } from '@vueuse/core'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { copy, copied } = useClipboard()\n\n const toolPart = computed(() => {\n const part = props.part as {\n input?: {\n content: string\n label?: string\n }\n }\n return part\n })\n\n const svgContent = ref('')\n const qrContainerRef = ref<HTMLElement>()\n\n onMounted(async () => {\n const content = toolPart.value.input?.content\n if (!content) {\n return\n }\n const { default: QRCode } = await import('qrcode')\n svgContent.value = await QRCode.toString(content, { type: 'svg' })\n })\n\n const downloadQr = async () => {\n const svgEl = qrContainerRef.value?.querySelector('svg')\n if (!svgEl) {\n return\n }\n const svgData = new XMLSerializer().serializeToString(svgEl)\n const svgBlob = new Blob([svgData], {\n type: 'image/svg+xml;charset=utf-8',\n })\n const svgUrl = URL.createObjectURL(svgBlob)\n\n const canvas = document.createElement('canvas')\n canvas.width = 512\n canvas.height = 512\n const ctx = canvas.getContext('2d')\n const img = new Image()\n img.onload = () => {\n ctx?.drawImage(img, 0, 0, 512, 512)\n URL.revokeObjectURL(svgUrl)\n const a = document.createElement('a')\n a.href = canvas.toDataURL('image/png')\n a.download = 'qrcode.png'\n a.click()\n }\n img.src = svgUrl\n }\n</script>\n\n<template>\n <div\n v-if=\"toolPart?.input\"\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\">\n <VvIcon name=\"ri:qr-code-line\" class=\"text-16\" />\n <strong class=\"font-bold\">{{ $t('label.qrCode') }}</strong>\n <VvButtonGroup modifiers=\"compact\" class=\"ml-auto shrink-0\">\n <VvButton\n modifiers=\"action-quiet-small\"\n :icon=\"copied ? 'ri:check-line' : 'ri:file-copy-line'\"\n :label=\"copied ? $t('action.copied') : $t('action.copy')\"\n @click=\"copy(toolPart?.input?.content ?? '')\" />\n <VvButton\n modifiers=\"action-quiet-small\"\n icon=\"ri:download-line\"\n :label=\"$t('action.download')\"\n @click=\"downloadQr\" />\n </VvButtonGroup>\n </div>\n <div class=\"p-sm flex flex-col items-center\">\n <div ref=\"qrContainerRef\" class=\"w-144 h-144\" v-html=\"svgContent\" />\n <p\n v-if=\"toolPart.input.label\"\n class=\"text-12 text-word-3 text-center\">\n {{ toolPart.input.label }}\n </p>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAII,IAAMqB,IAAQC,GAIR,EAAE,SAAM,cAAWC,EAAa,GAEhCC,IAAWC,QACAJ,EAAM,IAOtB,GAEKK,IAAaC,EAAI,EAAE,GACnBC,IAAiBD,EAAiB;EAExC,EAAU,YAAY;GAClB,IAAME,IAAUL,EAAS,MAAM,OAAO;GACtC,IAAI,CAACK,GACD;GAEJ,IAAM,EAAE,SAASC,MAAW,MAAM,OAAO;GACzC,EAAW,QAAQ,MAAMA,EAAO,SAASD,GAAS,EAAE,MAAM,MAAM,CAAC;EACrE,CAAC;EAED,IAAME,IAAa,YAAY;GAC3B,IAAMC,IAAQJ,EAAe,OAAO,cAAc,KAAK;GACvD,IAAI,CAACI,GACD;GAEJ,IAAMC,IAAU,IAAI,cAAc,CAAC,CAAC,kBAAkBD,CAAK,GACrDE,IAAU,IAAI,KAAK,CAACD,CAAO,GAAG,EAChC,MAAM,8BACV,CAAC,GACKE,IAAS,IAAI,gBAAgBD,CAAO,GAEpCE,IAAS,SAAS,cAAc,QAAQ;GAE9C,AADA,EAAO,QAAQ,KACf,EAAO,SAAS;GAChB,IAAMC,IAAMD,EAAO,WAAW,IAAI,GAC5BE,IAAM,IAAI,MAAM;GAStB,AARA,EAAI,eAAe;IAEf,AADAD,GAAK,UAAUC,GAAK,GAAG,GAAG,KAAK,GAAG,GAClC,IAAI,gBAAgBH,CAAM;IAC1B,IAAMI,IAAI,SAAS,cAAc,GAAG;IAGpC,AAFA,EAAE,OAAOH,EAAO,UAAU,WAAW,GACrC,EAAE,WAAW,cACbG,EAAE,MAAM;GACZ,GACA,EAAI,MAAMJ;EACd;;;GAKU,OAAAX,EAAA,OAAU,SADpBpB,EAAA,GAAAC,EA4BM,OA5BNS,GA4BM,CAzBFR,EAgBM,OAhBNS,GA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