@8wave/ai-elements 0.118.0 → 0.119.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/_chunks/{PkStreamingMarkdown--CcBvs19.js → PkStreamingMarkdown-kpEBZA4d.js} +789 -780
  2. package/dist/_chunks/PkStreamingMarkdown-kpEBZA4d.js.map +1 -0
  3. package/dist/_chunks/{PkToolShowArtifact-BVGN7hV2.js → PkToolShowArtifact-B8TOTS6A.js} +2 -2
  4. package/dist/_chunks/{PkToolShowArtifact-BVGN7hV2.js.map → PkToolShowArtifact-B8TOTS6A.js.map} +1 -1
  5. package/dist/_chunks/{PkToolShowContactForm-Blrwqpl0.js → PkToolShowContactForm-B89p05XM.js} +2 -2
  6. package/dist/_chunks/{PkToolShowContactForm-Blrwqpl0.js.map → PkToolShowContactForm-B89p05XM.js.map} +1 -1
  7. package/dist/_chunks/{PkToolShowForm-BpGHaN6x.js → PkToolShowForm-DTKQtFij.js} +4 -4
  8. package/dist/_chunks/{PkToolShowForm-BpGHaN6x.js.map → PkToolShowForm-DTKQtFij.js.map} +1 -1
  9. package/dist/_chunks/{PkToolShowSources-8c9RvGV1.js → PkToolShowSources-CbwixpOb.js} +2 -2
  10. package/dist/_chunks/{PkToolShowSources-8c9RvGV1.js.map → PkToolShowSources-CbwixpOb.js.map} +1 -1
  11. package/dist/ai-elements.es.js +1888 -1863
  12. package/dist/ai-elements.es.js.map +1 -1
  13. package/dist-vue/PkChatbot.js +1 -1
  14. package/dist-vue/PkChatbotEmptyState.js +1 -1
  15. package/dist-vue/PkChatbotInput.js +1 -1
  16. package/dist-vue/PkChatbotMessages.js +1 -1
  17. package/dist-vue/PkChatbotStepPayload.js +1 -1
  18. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  19. package/dist-vue/PkChatbotSteps.js +1 -1
  20. package/dist-vue/PkChatbotViewChat.js +1 -1
  21. package/dist-vue/PkChatbotViewProfile.js +1 -1
  22. package/dist-vue/_chunks/PkAvatar-BTqu8tn9.js +44 -0
  23. package/dist-vue/_chunks/PkAvatar-BTqu8tn9.js.map +1 -0
  24. package/dist-vue/_chunks/PkChatbot-C_OzxC0s.js +276 -0
  25. package/dist-vue/_chunks/PkChatbot-C_OzxC0s.js.map +1 -0
  26. package/dist-vue/_chunks/{PkChatbotEmptyState-D2dhInfG.js → PkChatbotEmptyState-BEQCnqui.js} +3 -3
  27. package/dist-vue/_chunks/{PkChatbotEmptyState-D2dhInfG.js.map → PkChatbotEmptyState-BEQCnqui.js.map} +1 -1
  28. package/dist-vue/_chunks/{PkChatbotInput-CQdxFbBR.js → PkChatbotInput-KJxWrDIT.js} +2 -2
  29. package/dist-vue/_chunks/{PkChatbotInput-CQdxFbBR.js.map → PkChatbotInput-KJxWrDIT.js.map} +1 -1
  30. package/dist-vue/_chunks/{PkChatbotMessages-coscJcpy.js → PkChatbotMessages-Zhuxom46.js} +283 -283
  31. package/dist-vue/_chunks/{PkChatbotMessages-coscJcpy.js.map → PkChatbotMessages-Zhuxom46.js.map} +1 -1
  32. package/dist-vue/_chunks/{PkChatbotStepPayload-DnqFluQZ.js → PkChatbotStepPayload-Da4N5CKa.js} +2 -2
  33. package/dist-vue/_chunks/{PkChatbotStepPayload-DnqFluQZ.js.map → PkChatbotStepPayload-Da4N5CKa.js.map} +1 -1
  34. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BMslY_BG.js → PkChatbotStepToolDetail-rrtImvq5.js} +3 -3
  35. package/dist-vue/_chunks/{PkChatbotStepToolDetail-BMslY_BG.js.map → PkChatbotStepToolDetail-rrtImvq5.js.map} +1 -1
  36. package/dist-vue/_chunks/{PkChatbotSteps-7FT6Ju6_.js → PkChatbotSteps-LEfOolAc.js} +38 -38
  37. package/dist-vue/_chunks/{PkChatbotSteps-7FT6Ju6_.js.map → PkChatbotSteps-LEfOolAc.js.map} +1 -1
  38. package/dist-vue/_chunks/{PkChatbotViewChat-Cko-Cw6c.js → PkChatbotViewChat-BJ0YHCvA.js} +7 -7
  39. package/dist-vue/_chunks/PkChatbotViewChat-BJ0YHCvA.js.map +1 -0
  40. package/dist-vue/_chunks/{PkChatbotViewProfile-B57VRVaO.js → PkChatbotViewProfile-CyzRxE3D.js} +2 -2
  41. package/dist-vue/_chunks/{PkChatbotViewProfile-B57VRVaO.js.map → PkChatbotViewProfile-CyzRxE3D.js.map} +1 -1
  42. package/dist-vue/_chunks/{PkStreamingMarkdown-BtyWXY2k.js → PkStreamingMarkdown-BWEvuFZm.js} +2 -2
  43. package/dist-vue/_chunks/{PkStreamingMarkdown-BtyWXY2k.js.map → PkStreamingMarkdown-BWEvuFZm.js.map} +1 -1
  44. package/dist-vue/_chunks/{PkToolShowArtifact-Ritx54_X.js → PkToolShowArtifact-tNEG6-r_.js} +2 -2
  45. package/dist-vue/_chunks/{PkToolShowArtifact-Ritx54_X.js.map → PkToolShowArtifact-tNEG6-r_.js.map} +1 -1
  46. package/dist-vue/_chunks/{PkToolShowContactForm-D30IsZGy.js → PkToolShowContactForm-DBC6f9gR.js} +2 -2
  47. package/dist-vue/_chunks/{PkToolShowContactForm-D30IsZGy.js.map → PkToolShowContactForm-DBC6f9gR.js.map} +1 -1
  48. package/dist-vue/_chunks/{PkToolShowDiagram-PEozSAqU.js → PkToolShowDiagram-Bbq0ETt1.js} +2 -2
  49. package/dist-vue/_chunks/{PkToolShowDiagram-PEozSAqU.js.map → PkToolShowDiagram-Bbq0ETt1.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkToolShowForm-ZmdM9J9x.js → PkToolShowForm-BG-8aTHy.js} +5 -5
  51. package/dist-vue/_chunks/{PkToolShowForm-ZmdM9J9x.js.map → PkToolShowForm-BG-8aTHy.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkToolShowImageGallery-Dkjf7Tw_.js → PkToolShowImageGallery-DXn-bxHv.js} +2 -2
  53. package/dist-vue/_chunks/{PkToolShowImageGallery-Dkjf7Tw_.js.map → PkToolShowImageGallery-DXn-bxHv.js.map} +1 -1
  54. package/dist-vue/_chunks/{PkToolShowProductList-CsHYM8vl.js → PkToolShowProductList-BZ_fDRCq.js} +2 -2
  55. package/dist-vue/_chunks/{PkToolShowProductList-CsHYM8vl.js.map → PkToolShowProductList-BZ_fDRCq.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkToolShowSources-CKZkcPLA.js → PkToolShowSources-CUURb0PG.js} +2 -2
  57. package/dist-vue/_chunks/{PkToolShowSources-CKZkcPLA.js.map → PkToolShowSources-CUURb0PG.js.map} +1 -1
  58. package/dist-vue/_chunks/{PkToolShowVideo-CKm1fVQs.js → PkToolShowVideo-FNlPjswi.js} +2 -2
  59. package/dist-vue/_chunks/{PkToolShowVideo-CKm1fVQs.js.map → PkToolShowVideo-FNlPjswi.js.map} +1 -1
  60. package/dist-vue/_chunks/{PkToolShowWebPages-DLEC9cuh.js → PkToolShowWebPages-CWV79tsb.js} +2 -2
  61. package/dist-vue/_chunks/{PkToolShowWebPages-DLEC9cuh.js.map → PkToolShowWebPages-CWV79tsb.js.map} +1 -1
  62. package/dist-vue/_chunks/{utils-fxHiCnzf.js → utils-Dk2jFXR_.js} +40 -31
  63. package/dist-vue/_chunks/utils-Dk2jFXR_.js.map +1 -0
  64. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +1 -4
  65. package/dist-vue/composables.js +132 -113
  66. package/dist-vue/composables.js.map +1 -1
  67. package/dist-vue/index.js +23 -23
  68. package/dist-vue/index.js.map +1 -1
  69. package/dist-vue/packages/components/src/chat/PkAvatar.d.ts +7 -0
  70. package/dist-vue/packages/components/src/chat/utils.d.ts +10 -0
  71. package/dist-vue/style.css +1 -1
  72. package/package.json +1 -1
  73. package/dist/_chunks/PkStreamingMarkdown--CcBvs19.js.map +0 -1
  74. package/dist-vue/_chunks/PkAvatar-ZgCsoO-p.js +0 -42
  75. package/dist-vue/_chunks/PkAvatar-ZgCsoO-p.js.map +0 -1
  76. package/dist-vue/_chunks/PkChatbot-Cm45hwYw.js +0 -275
  77. package/dist-vue/_chunks/PkChatbot-Cm45hwYw.js.map +0 -1
  78. package/dist-vue/_chunks/PkChatbotViewChat-Cko-Cw6c.js.map +0 -1
  79. package/dist-vue/_chunks/utils-fxHiCnzf.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PkChatbotViewProfile-B57VRVaO.js","names":["__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","PkAvatar","_unref","_toDisplayString","_createCommentVNode","_createBlock","_renderSlot","_sfc_main","useChatbotStore","ChatbotProfileContextKey","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","PkChatbotViewProfile_default","defineComponent","props","__props","$t","useI18n","store","agentName","storeToRefs","profile","inject","user","computed","canManage","profileUrl","isExternalAuth","isSigningOut","ref","errorMessage","onSignOut","error","_component_VvAlert","VvAlert","_component_VvIcon","VvIcon","_component_VvButton","VvButton","openBlock","createElementBlock","createElementVNode","createVNode","PkAvatar_default","unref","agentInterface","toDisplayString","createCommentVNode","createBlock","renderSlot","_ctx"],"sources":["../../../../packages/components/src/chat/PkChatbotViewProfile.vue","../../../../packages/components/src/chat/PkChatbotViewProfile.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n :label=\"$t('action.signOut')\"\n @click=\"onSignOut\" />\n </div>\n\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n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A4B,EAAA,IAAA,EAAA,GAGpBxB,EAAA,OAAM,SADhBpC,EAAA,GAAAC,EAIO,QAJPgB,GAIOX,EADA8B,EAAA,MAAK,KAAK,GAAA,CAAA,KAAAwB,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,CAAA;IAMzB1D,EA+BM,OA/BNgB,GA+BM,CA7BQyB,EAAA,SADV3C,EAAA,GAAAQ,EAG8BsC,GAAA;;KAD1B,WAAU;KACT,SAASH,EAAA;IAIJ,GAAA,MAAA,GAAA,CAAA,SAAA,CAAA,KAAAiB,EAAA,IAAA,EAAA,GAAAtB,EAAA,SAAaC,EAAA,SAAU,CAAKC,EAAA,SADtCxC,EAAA,GAAAC,EAuBI,KAAA;;KArBC,MAAMsC,EAAA;KACP,QAAO;KACP,KAAI;KACJ,OAAM;;KACNrC,EAKM,OALNkB,GAKM,CAHFjB,EAEoC6C,GAAA;MADhC,MAAK;MACL,OAAM;;KAEd9C,EAOM,OAPNmB,GAOM,CANFnB,EAEO,QAFPoB,GAEOhB,EADAD,EAAAwB,CAAA,CAAE,CAAA,sBAAA,CAAA,GAAA,CAAA,GAET3B,EAEO,QAFPqB,GAEOjB,EADAD,EAAAwB,CAAA,CAAE,CAAA,gCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;KAGb1B,EAE6C6C,GAAA;MADzC,MAAK;MACL,OAAM;;;IAKNR,EAAA,qBAAZxC,EAAA,GAAAC,EASM,OATNuB,GASM,CARFrB,EAOyB+C,GAAA;KANrB,WAAU;KACV,OAAM;KACN,MAAK;KACJ,SAAST,EAAA;KACT,UAAUA,EAAA;KACV,OAAOpC,EAAAwB,CAAA,CAAE,CAAA,gBAAA;KACT,SAAOe;;;;;;IAGhBnC,EAAQsD,EAAA,QAAA,SAAA"}
1
+ {"version":3,"file":"PkChatbotViewProfile-CyzRxE3D.js","names":["__unplugin_components_0","__unplugin_components_1","__unplugin_components_2","_openBlock","_createElementBlock","_createElementVNode","_createVNode","PkAvatar","_unref","_toDisplayString","_createCommentVNode","_createBlock","_renderSlot","_sfc_main","useChatbotStore","ChatbotProfileContextKey","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","PkChatbotViewProfile_default","defineComponent","props","__props","$t","useI18n","store","agentName","storeToRefs","profile","inject","user","computed","canManage","profileUrl","isExternalAuth","isSigningOut","ref","errorMessage","onSignOut","error","_component_VvAlert","VvAlert","_component_VvIcon","VvIcon","_component_VvButton","VvButton","openBlock","createElementBlock","createElementVNode","createVNode","PkAvatar_default","unref","agentInterface","toDisplayString","createCommentVNode","createBlock","renderSlot","_ctx"],"sources":["../../../../packages/components/src/chat/PkChatbotViewProfile.vue","../../../../packages/components/src/chat/PkChatbotViewProfile.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n :label=\"$t('action.signOut')\"\n @click=\"onSignOut\" />\n </div>\n\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, inject, ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { useChatbotStore } from 'composables'\n import PkAvatar from './PkAvatar.vue'\n import { ChatbotProfileContextKey } from './chatbotProfileContext'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n\n const store = useChatbotStore(props.agentId)\n const { name: agentName, agentInterface } = storeToRefs(store)\n\n const profile = inject(ChatbotProfileContextKey, undefined)\n const user = computed(() => profile?.user.value ?? null)\n const canManage = computed(() => profile?.canManageProfile.value ?? false)\n const profileUrl = computed(() => profile?.profileUrl.value)\n // External token mode: the host owns the auth lifecycle, so the widget\n // offers no sign-out nor profile management (the main site is not\n // accessible to externally authenticated users).\n const isExternalAuth = computed(\n () => profile?.isExternalAuth?.value ?? false,\n )\n\n const isSigningOut = ref(false)\n const errorMessage = ref<string>()\n\n async function onSignOut() {\n if (!profile) {\n return\n }\n isSigningOut.value = true\n try {\n await profile.signOut()\n } catch (error) {\n errorMessage.value =\n error instanceof Error ? error.message : $t('message.error')\n } finally {\n isSigningOut.value = false\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 overflow-y-auto\">\n <!-- Hero: user identity -->\n <div\n class=\"flex flex-col items-center gap-sm pt-lg px-lg pb-md bg-surface-1 border-b border-surface-3\">\n <PkAvatar\n modifiers=\"surface ring\"\n class=\"w-64 h-64\"\n :name=\"user?.name ?? agentName\"\n :img-src=\"user?.image ?? agentInterface?.logo\" />\n <div class=\"flex flex-col items-center gap-6 text-center\">\n <strong\n v-if=\"user?.name ?? agentName\"\n class=\"text-16 font-semibold text-word-1 leading-tight\">\n {{ user?.name ?? agentName }}\n </strong>\n <span\n v-if=\"user?.email\"\n class=\"text-12 text-word-3 leading-none\">\n {{ user.email }}\n </span>\n </div>\n </div>\n\n <!-- Actions -->\n <div class=\"flex flex-col gap-sm p-md flex-1\">\n <VvAlert\n v-if=\"errorMessage\"\n modifiers=\"danger\"\n :content=\"errorMessage\" />\n\n <!-- Manage profile link card -->\n <a\n v-if=\"canManage && profileUrl && !isExternalAuth\"\n :href=\"profileUrl\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"flex items-center gap-12 p-12 rounded-lg border border-surface-3 hover:border-surface-5 hover:bg-surface-1 transition-colors cursor-pointer no-underline\">\n <div\n class=\"w-40 h-40 rounded-lg bg-surface-2 border border-surface-3 flex items-center justify-center shrink-0\">\n <VvIcon\n name=\"ri:user-settings-line\"\n class=\"w-20 h-20 text-word-2\" />\n </div>\n <div class=\"flex flex-col flex-1 min-w-0 gap-1\">\n <span class=\"text-14 font-medium text-word-1 leading-tight\">\n {{ $t('action.manageProfile') }}\n </span>\n <span class=\"text-12 text-word-3 leading-tight\">\n {{ $t('label.manageProfileDescription') }}\n </span>\n </div>\n <VvIcon\n name=\"ri:arrow-right-s-line\"\n class=\"w-16 h-16 text-word-4 shrink-0\" />\n </a>\n </div>\n\n <!-- Footer: sign out -->\n <div v-if=\"!isExternalAuth\" class=\"px-md py-sm\">\n <VvButton\n modifiers=\"secondary-danger\"\n class=\"w-full\"\n icon=\"ri:logout-box-line\"\n :loading=\"isSigningOut\"\n :disabled=\"isSigningOut\"\n :label=\"$t('action.signOut')\"\n @click=\"onSignOut\" />\n </div>\n\n <slot />\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAQI,IAAM8B,IAAQC,GAER,EAAE,GAAGC,MAAOC,EAAQ,EAAE,UAAU,SAAS,CAAC,GAE1CC,IAAQpB,EAAgBgB,EAAM,OAAO,GACrC,EAAE,MAAMK,GAAW,sBAAmBC,EAAYF,CAAK,GAEvDG,IAAUC,EAAOvB,GAA0B,KAAA,CAAS,GACpDwB,IA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AAA,SAAA,CAAA,KAAAiB,EAAA,IAAA,EAAA,GAAAtB,EAAA,SAAaC,EAAA,SAAU,CAAKC,EAAA,SADtCxC,EAAA,GAAAC,EAuBI,KAAA;;KArBC,MAAMsC,EAAA;KACP,QAAO;KACP,KAAI;KACJ,OAAM;;KACNrC,EAKM,OALNkB,GAKM,CAHFjB,EAEoC6C,GAAA;MADhC,MAAK;MACL,OAAM;;KAEd9C,EAOM,OAPNmB,GAOM,CANFnB,EAEO,QAFPoB,GAEOhB,EADAD,EAAAwB,CAAA,CAAE,CAAA,sBAAA,CAAA,GAAA,CAAA,GAET3B,EAEO,QAFPqB,GAEOjB,EADAD,EAAAwB,CAAA,CAAE,CAAA,gCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;KAGb1B,EAE6C6C,GAAA;MADzC,MAAK;MACL,OAAM;;;IAKNR,EAAA,qBAAZxC,EAAA,GAAAC,EASM,OATNuB,GASM,CARFrB,EAOyB+C,GAAA;KANrB,WAAU;KACV,OAAM;KACN,MAAK;KACJ,SAAST,EAAA;KACT,UAAUA,EAAA;KACV,OAAOpC,EAAAwB,CAAA,CAAE,CAAA,gBAAA;KACT,SAAOe;;;;;;IAGhBnC,EAAQsD,EAAA,QAAA,SAAA"}
@@ -3,7 +3,7 @@ import { n as t, t as n } from "./cdn-css-JUUNhyQ6.js";
3
3
  import "./src-DCfvejyT.js";
4
4
  import { i as r, n as i } from "./url-validation-9DstIfq2.js";
5
5
  import { n as a } from "./useShortUrlResolver-DI8ycJiO.js";
6
- import { u as o } from "./utils-fxHiCnzf.js";
6
+ import { d as o } from "./utils-Dk2jFXR_.js";
7
7
  import { computed as s, createElementBlock as c, defineComponent as l, inject as u, nextTick as d, onBeforeUnmount as f, onMounted as p, openBlock as ee, provide as m, ref as h, toRef as te, useTemplateRef as ne, watch as g } from "vue";
8
8
  import { useI18n as re } from "vue-i18n";
9
9
  import { refThrottled as ie } from "@vueuse/core";
@@ -3401,4 +3401,4 @@ var ka = ["innerHTML"], Aa = 100, ja = /* @__PURE__ */ l({
3401
3401
  //#endregion
3402
3402
  export { wa as n, Oa as r, ja as t };
3403
3403
 
3404
- //# sourceMappingURL=PkStreamingMarkdown-BtyWXY2k.js.map
3404
+ //# sourceMappingURL=PkStreamingMarkdown-BWEvuFZm.js.map