@8wave/ai-elements 0.126.0-beta.36 → 0.126.0-beta.38

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 (131) hide show
  1. package/dist/_chunks/{PkChatbotFilePreview-Cw3va5vW.js → PkChatbotFilePreview-CLUH7cTq.js} +2 -2
  2. package/dist/_chunks/{PkChatbotFilePreview-Cw3va5vW.js.map → PkChatbotFilePreview-CLUH7cTq.js.map} +1 -1
  3. package/dist/_chunks/{PkEditorRadioButtons-CY0D_EkU.js → PkEditorRadioButtons-YSngp-Wn.js} +2 -2
  4. package/dist/_chunks/{PkEditorRadioButtons-CY0D_EkU.js.map → PkEditorRadioButtons-YSngp-Wn.js.map} +1 -1
  5. package/dist/_chunks/{PkFilePreview-D4TgY0T9.js → PkFilePreview-BHqmp1EW.js} +5 -5
  6. package/dist/_chunks/{PkFilePreview-D4TgY0T9.js.map → PkFilePreview-BHqmp1EW.js.map} +1 -1
  7. package/dist/_chunks/{PkFilePreviewDialog-8H1GeV91.js → PkFilePreviewDialog-BHAgVlKs.js} +3 -3
  8. package/dist/_chunks/{PkFilePreviewDialog-8H1GeV91.js.map → PkFilePreviewDialog-BHAgVlKs.js.map} +1 -1
  9. package/dist/_chunks/{PkHeldImage-B6UYQ8Ox.js → PkHeldImage-WGwFM77v.js} +2 -2
  10. package/dist/_chunks/{PkHeldImage-B6UYQ8Ox.js.map → PkHeldImage-WGwFM77v.js.map} +1 -1
  11. package/dist/_chunks/{PkImageEditorDialog-BqHjVX97.js → PkImageEditorDialog-BDwL39Du.js} +18 -18
  12. package/dist/_chunks/{PkImageEditorDialog-BqHjVX97.js.map → PkImageEditorDialog-BDwL39Du.js.map} +1 -1
  13. package/dist/_chunks/{PkLazyImg-D3XOz-dS.js → PkLazyImg-DL7hxjyy.js} +2 -2
  14. package/dist/_chunks/{PkLazyImg-D3XOz-dS.js.map → PkLazyImg-DL7hxjyy.js.map} +1 -1
  15. package/dist/_chunks/{PkSelectionActions-BxUXWFNK.js → PkSelectionActions-DLsZ8-gW.js} +2 -2
  16. package/dist/_chunks/{PkSelectionActions-BxUXWFNK.js.map → PkSelectionActions-DLsZ8-gW.js.map} +1 -1
  17. package/dist/_chunks/{PkToolChatFile-CSBzfuyE.js → PkToolChatFile-62j1S0Pq.js} +3 -3
  18. package/dist/_chunks/{PkToolChatFile-CSBzfuyE.js.map → PkToolChatFile-62j1S0Pq.js.map} +1 -1
  19. package/dist/_chunks/{PkToolRequestGeolocation-DNzNRszE.js → PkToolRequestGeolocation-B9EM_K6O.js} +2 -2
  20. package/dist/_chunks/{PkToolRequestGeolocation-DNzNRszE.js.map → PkToolRequestGeolocation-B9EM_K6O.js.map} +1 -1
  21. package/dist/_chunks/{PkToolRequestOAuthConnection-BDxYXz4s.js → PkToolRequestOAuthConnection-CfjfqCHX.js} +3 -3
  22. package/dist/_chunks/{PkToolRequestOAuthConnection-BDxYXz4s.js.map → PkToolRequestOAuthConnection-CfjfqCHX.js.map} +1 -1
  23. package/dist/_chunks/{PkToolShareDocument-Kq7SFbw5.js → PkToolShareDocument-CYBU4LPO.js} +3 -3
  24. package/dist/_chunks/{PkToolShareDocument-Kq7SFbw5.js.map → PkToolShareDocument-CYBU4LPO.js.map} +1 -1
  25. package/dist/_chunks/{PkToolShowArtifact-d5tKvM01.js → PkToolShowArtifact-I_QZS7Pf.js} +2 -2
  26. package/dist/_chunks/{PkToolShowArtifact-d5tKvM01.js.map → PkToolShowArtifact-I_QZS7Pf.js.map} +1 -1
  27. package/dist/_chunks/{PkToolShowCalendarEvent-fMI-paCP.js → PkToolShowCalendarEvent-js9lh-cX.js} +3 -3
  28. package/dist/_chunks/{PkToolShowCalendarEvent-fMI-paCP.js.map → PkToolShowCalendarEvent-js9lh-cX.js.map} +1 -1
  29. package/dist/_chunks/{PkToolShowChart-lLXuHRJu.js → PkToolShowChart-BalU3bxm.js} +3 -3
  30. package/dist/_chunks/{PkToolShowChart-lLXuHRJu.js.map → PkToolShowChart-BalU3bxm.js.map} +1 -1
  31. package/dist/_chunks/{PkToolShowComparison-CKSqPgJo.js → PkToolShowComparison-DeO7cMeF.js} +3 -3
  32. package/dist/_chunks/{PkToolShowComparison-CKSqPgJo.js.map → PkToolShowComparison-DeO7cMeF.js.map} +1 -1
  33. package/dist/_chunks/{PkToolShowContactForm-Bni1QzXV.js → PkToolShowContactForm-BeJ5GR6t.js} +5 -5
  34. package/dist/_chunks/{PkToolShowContactForm-Bni1QzXV.js.map → PkToolShowContactForm-BeJ5GR6t.js.map} +1 -1
  35. package/dist/_chunks/{PkToolShowDiagram-DWVSCu33.js → PkToolShowDiagram-j3TTzZ5I.js} +3 -3
  36. package/dist/_chunks/{PkToolShowDiagram-DWVSCu33.js.map → PkToolShowDiagram-j3TTzZ5I.js.map} +1 -1
  37. package/dist/_chunks/{PkToolShowEmail-D6Mw24jB.js → PkToolShowEmail-CQ4uyty9.js} +3 -3
  38. package/dist/_chunks/{PkToolShowEmail-D6Mw24jB.js.map → PkToolShowEmail-CQ4uyty9.js.map} +1 -1
  39. package/dist/_chunks/{PkToolShowForm-CFXtO0j4.js → PkToolShowForm-B9VDoS_W.js} +15 -15
  40. package/dist/_chunks/{PkToolShowForm-CFXtO0j4.js.map → PkToolShowForm-B9VDoS_W.js.map} +1 -1
  41. package/dist/_chunks/{PkToolShowImageGallery-Ci_Kg44s.js → PkToolShowImageGallery-DFuc5IJ1.js} +3 -3
  42. package/dist/_chunks/{PkToolShowImageGallery-Ci_Kg44s.js.map → PkToolShowImageGallery-DFuc5IJ1.js.map} +1 -1
  43. package/dist/_chunks/{PkToolShowLocation-DV0puCbD.js → PkToolShowLocation-PThC5tCV.js} +3 -3
  44. package/dist/_chunks/{PkToolShowLocation-DV0puCbD.js.map → PkToolShowLocation-PThC5tCV.js.map} +1 -1
  45. package/dist/_chunks/{PkToolShowMessage-Bq2dbSy1.js → PkToolShowMessage-9mlI4IQ6.js} +3 -3
  46. package/dist/_chunks/{PkToolShowMessage-Bq2dbSy1.js.map → PkToolShowMessage-9mlI4IQ6.js.map} +1 -1
  47. package/dist/_chunks/{PkToolShowProductList-BWWzkWWA.js → PkToolShowProductList-C2EJKYOV.js} +4 -4
  48. package/dist/_chunks/{PkToolShowProductList-BWWzkWWA.js.map → PkToolShowProductList-C2EJKYOV.js.map} +1 -1
  49. package/dist/_chunks/{PkToolShowQrCode-DZkJIyMF.js → PkToolShowQrCode-DQiVo4Vh.js} +3 -3
  50. package/dist/_chunks/{PkToolShowQrCode-DZkJIyMF.js.map → PkToolShowQrCode-DQiVo4Vh.js.map} +1 -1
  51. package/dist/_chunks/{PkToolShowSources-Dv7hbDyy.js → PkToolShowSources-BL3DnfcN.js} +3 -3
  52. package/dist/_chunks/{PkToolShowSources-Dv7hbDyy.js.map → PkToolShowSources-BL3DnfcN.js.map} +1 -1
  53. package/dist/_chunks/{PkToolShowSuggestedReply-B_dRrZfj.js → PkToolShowSuggestedReply-DLgtjBJ1.js} +2 -2
  54. package/dist/_chunks/{PkToolShowSuggestedReply-B_dRrZfj.js.map → PkToolShowSuggestedReply-DLgtjBJ1.js.map} +1 -1
  55. package/dist/_chunks/{PkToolShowVideo-DLgQjTq_.js → PkToolShowVideo-DcWXDcOZ.js} +3 -3
  56. package/dist/_chunks/{PkToolShowVideo-DLgQjTq_.js.map → PkToolShowVideo-DcWXDcOZ.js.map} +1 -1
  57. package/dist/_chunks/{PkToolShowWeather-HElfkyLV.js → PkToolShowWeather-DLT47oC6.js} +2 -2
  58. package/dist/_chunks/{PkToolShowWeather-HElfkyLV.js.map → PkToolShowWeather-DLT47oC6.js.map} +1 -1
  59. package/dist/_chunks/{PkToolShowWebPages-XxcYBQpr.js → PkToolShowWebPages-CPqMC6qt.js} +4 -4
  60. package/dist/_chunks/{PkToolShowWebPages-XxcYBQpr.js.map → PkToolShowWebPages-CPqMC6qt.js.map} +1 -1
  61. package/dist/_chunks/{VvButtonLocalized-BgY-V26j.js → VvButtonLocalized-D_gumqSJ.js} +2 -2
  62. package/dist/_chunks/{VvButtonLocalized-BgY-V26j.js.map → VvButtonLocalized-D_gumqSJ.js.map} +1 -1
  63. package/dist/_chunks/{VvCheckbox.es-KisDJtH_.js → VvCheckbox.es-D44kGZc-.js} +2 -2
  64. package/dist/_chunks/{VvCheckbox.es-KisDJtH_.js.map → VvCheckbox.es-D44kGZc-.js.map} +1 -1
  65. package/dist/_chunks/{VvCheckboxGroup.es-CIVHYElp.js → VvCheckboxGroup.es-Da5Vuel0.js} +2 -2
  66. package/dist/_chunks/{VvCheckboxGroup.es-CIVHYElp.js.map → VvCheckboxGroup.es-Da5Vuel0.js.map} +1 -1
  67. package/dist/_chunks/{VvCombobox.es-DybZ6U_6.js → VvCombobox.es-BJzmLeTh.js} +467 -403
  68. package/dist/_chunks/VvCombobox.es-BJzmLeTh.js.map +1 -0
  69. package/dist/_chunks/{VvInputText.es-DFSPWDcH.js → VvInputText.es-CHcdm2K-.js} +280 -218
  70. package/dist/_chunks/VvInputText.es-CHcdm2K-.js.map +1 -0
  71. package/dist/_chunks/{VvRadio.es-vrNSXb3X.js → VvRadio.es-B3IskaN4.js} +2 -2
  72. package/dist/_chunks/{VvRadio.es-vrNSXb3X.js.map → VvRadio.es-B3IskaN4.js.map} +1 -1
  73. package/dist/_chunks/{VvRadioGroup.es-DalxMbrj.js → VvRadioGroup.es-CBivcD0v.js} +2 -2
  74. package/dist/_chunks/{VvRadioGroup.es-DalxMbrj.js.map → VvRadioGroup.es-CBivcD0v.js.map} +1 -1
  75. package/dist/_chunks/{VvSelect.es-D55xq4Lw.js → VvSelect.es-CAVvkyxB.js} +2 -2
  76. package/dist/_chunks/{VvSelect.es-D55xq4Lw.js.map → VvSelect.es-CAVvkyxB.js.map} +1 -1
  77. package/dist/_chunks/{VvTextarea.es-BOhkaXfY.js → VvTextarea.es-CgvZOWO4.js} +446 -384
  78. package/dist/_chunks/VvTextarea.es-CgvZOWO4.js.map +1 -0
  79. package/dist/_chunks/{index.es-BYhSukum.js → index.es-CEYwDeKz.js} +126 -66
  80. package/dist/_chunks/index.es-CEYwDeKz.js.map +1 -0
  81. package/dist/_chunks/{index.es-CPvSmI-B.js → index.es-DDdkqLT6.js} +10 -10
  82. package/dist/_chunks/{index.es-CPvSmI-B.js.map → index.es-DDdkqLT6.js.map} +1 -1
  83. package/dist/ai-elements.es.js +377 -376
  84. package/dist/ai-elements.es.js.map +1 -1
  85. package/dist-vue/PkChatbot.js +1 -1
  86. package/dist-vue/PkChatbotAuth.js +1 -1
  87. package/dist-vue/PkChatbotFeedbackForm.js +1 -1
  88. package/dist-vue/PkChatbotMessages.js +1 -1
  89. package/dist-vue/PkChatbotViewChat.js +1 -1
  90. package/dist-vue/PkChatbotViewConversations.js +1 -1
  91. package/dist-vue/PkChatbotViewProfile.js +1 -1
  92. package/dist-vue/_chunks/PkChatbot-aCgj2DMu.js +326 -0
  93. package/dist-vue/_chunks/PkChatbot-aCgj2DMu.js.map +1 -0
  94. package/dist-vue/_chunks/{PkChatbotAuth-449QUBoC.js → PkChatbotAuth-C5agN8ht.js} +2 -2
  95. package/dist-vue/_chunks/{PkChatbotAuth-449QUBoC.js.map → PkChatbotAuth-C5agN8ht.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkChatbotFeedbackForm-DdQQlAr1.js → PkChatbotFeedbackForm-DjsLxYjT.js} +2 -2
  97. package/dist-vue/_chunks/{PkChatbotFeedbackForm-DdQQlAr1.js.map → PkChatbotFeedbackForm-DjsLxYjT.js.map} +1 -1
  98. package/dist-vue/_chunks/{PkChatbotMessages-_-h-egX7.js → PkChatbotMessages-CG3UZYcP.js} +3 -3
  99. package/dist-vue/_chunks/{PkChatbotMessages-_-h-egX7.js.map → PkChatbotMessages-CG3UZYcP.js.map} +1 -1
  100. package/dist-vue/_chunks/{PkChatbotViewChat-Bg-Op2Oe.js → PkChatbotViewChat-IU3HJpxG.js} +3 -3
  101. package/dist-vue/_chunks/{PkChatbotViewChat-Bg-Op2Oe.js.map → PkChatbotViewChat-IU3HJpxG.js.map} +1 -1
  102. package/dist-vue/_chunks/PkChatbotViewConversations-4zGrp7Fo.js +197 -0
  103. package/dist-vue/_chunks/PkChatbotViewConversations-4zGrp7Fo.js.map +1 -0
  104. package/dist-vue/_chunks/PkChatbotViewProfile-BrZ7oiUY.js +85 -0
  105. package/dist-vue/_chunks/PkChatbotViewProfile-BrZ7oiUY.js.map +1 -0
  106. package/dist-vue/_chunks/{PkFilePreview-DydUI1G2.js → PkFilePreview-WqS-s3vk.js} +2 -2
  107. package/dist-vue/_chunks/{PkFilePreview-DydUI1G2.js.map → PkFilePreview-WqS-s3vk.js.map} +1 -1
  108. package/dist-vue/_chunks/{PkFilePreviewDialog-BuG1whsJ.js → PkFilePreviewDialog-BIaTAK05.js} +2 -2
  109. package/dist-vue/_chunks/{PkFilePreviewDialog-BuG1whsJ.js.map → PkFilePreviewDialog-BIaTAK05.js.map} +1 -1
  110. package/dist-vue/_chunks/{PkToolShowContactForm-D0lDC69x.js → PkToolShowContactForm-DFufPNnQ.js} +2 -2
  111. package/dist-vue/_chunks/{PkToolShowContactForm-D0lDC69x.js.map → PkToolShowContactForm-DFufPNnQ.js.map} +1 -1
  112. package/dist-vue/_chunks/{index.es-CwEgvvQD.js → index.es-BmedAjkp.js} +2 -2
  113. package/dist-vue/_chunks/{index.es-CwEgvvQD.js.map → index.es-BmedAjkp.js.map} +1 -1
  114. package/dist-vue/composables.js +8 -6
  115. package/dist-vue/composables.js.map +1 -1
  116. package/dist-vue/index.js +10 -10
  117. package/dist-vue/locales.js +20 -16
  118. package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +7 -7
  119. package/package.json +2 -2
  120. package/dist/_chunks/VvCombobox.es-DybZ6U_6.js.map +0 -1
  121. package/dist/_chunks/VvInputText.es-DFSPWDcH.js.map +0 -1
  122. package/dist/_chunks/VvTextarea.es-BOhkaXfY.js.map +0 -1
  123. package/dist/_chunks/index.es-BYhSukum.js.map +0 -1
  124. package/dist-vue/_chunks/PkChatbot-CFJmT4nN.js +0 -299
  125. package/dist-vue/_chunks/PkChatbot-CFJmT4nN.js.map +0 -1
  126. package/dist-vue/_chunks/PkChatbotViewConversations--smzyxqN.js +0 -226
  127. package/dist-vue/_chunks/PkChatbotViewConversations--smzyxqN.js.map +0 -1
  128. package/dist-vue/_chunks/PkChatbotViewProfile-Cn7IQfnQ.js +0 -86
  129. package/dist-vue/_chunks/PkChatbotViewProfile-Cn7IQfnQ.js.map +0 -1
  130. package/dist-vue/_chunks/chatbotProfileContext-b-nve-mR.js +0 -5
  131. package/dist-vue/_chunks/chatbotProfileContext-b-nve-mR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"composables.js","names":["it","itErrors","en","enErrors","logger","AgentWidgetLayout","AgentWidgetAppearance","createChatbotApiClient","agentThemeStyle","resolveContrastColor","useChatbotStore","useLocalizedString","DEFAULT_COOKIE_NAME","REAUTH_PROOF_COOKIE_SUFFIX","MAX_AGE_ONE_YEAR","setCookie","name","value","maxAge","error","getCookie","prefix","row","entry","setSessionCookie","cookieName","token","getSessionCookie","setAnonymousReauthProofCookie","proof","getAnonymousReauthProofCookie","clearAnonymousReauthProofCookie","resolveSetting","attribute","values","setting","fallback","LAYOUTS","APPEARANCES","resolveWidgetLayout","resolveWidgetAppearance","AUTH_BASE_PATH","DEFAULT_BACKEND_URL","useChatbotAgent","agent","ref","branding","authMethods","deploymentCss","deployment","requiresAuth","notFound","isLoading","load","orgSlug","toValue","options","agentId","apiClient","result","watch","source","computed","contrastColor","mainColor","theme","systemTheme","it_default$1","\"accept\"","\"acceptPageAccessRisk\"","\"acceptRedundancy\"","\"activate\"","\"add\"","\"addExistingDocument\"","\"addField\"","\"addFieldMapping\"","\"addHint\"","\"addIntegration\"","\"addMember\"","\"addNestedField\"","\"addToCalendar\"","\"allDocuments\"","\"analyzeChat\"","\"apply\"","\"ask\"","\"attachFile\"","\"automaticConfirmations\"","\"back\"","\"backToAgent\"","\"backToDocuments\"","\"backToHome\"","\"backToSignIn\"","\"ban\"","\"blockChat\"","\"cancel\"","\"cancelInvitation\"","\"change\"","\"changeAgent\"","\"changeRole\"","\"check\"","\"clear\"","\"clearSearch\"","\"close\"","\"closeChat\"","\"closeSidebar\"","\"collapse\"","\"compare\"","\"connect\"","\"continue\"","\"copied\"","\"copy\"","\"copyLink\"","\"crawl\"","\"create\"","\"createAgent\"","\"createApiKey\"","\"createDocument\"","\"createFolder\"","\"createNew\"","\"createNewChat\"","\"createNotification\"","\"createRevise\"","\"createSubfolder\"","\"deactivate\"","\"decline\"","\"delete\"","\"deleteAllMemories\"","\"deleteAllNotifications\"","\"deleteFolder\"","\"deleteMyConversations\"","\"deleteProfile\"","\"deleteRow\"","\"deselectHint\"","\"disableAutoRefresh\"","\"disablePageAccess\"","\"disconnect\"","\"embeddingBackToPlatform\"","\"embeddingRemove\"","\"embeddingUseEndpoint\"","\"enablePageAccess\"","\"modelEndpointConnect\"","\"dismissRedundancy\"","\"documentRefreshNow\"","\"documentSetRefresh\"","\"documentSourceSettings\"","\"documentSourceSyncNow\"","\"documentSourceUnlink\"","\"download\"","\"downloadIcs\"","\"downloadTeamsApp\"","\"downvote\"","\"dropFile\"","\"dropFilesToImport\"","\"duplicate\"","\"edit\"","\"editAgent\"","\"editDocument\"","\"editRevise\"","\"editSchema\"","\"enableAutoRefresh\"","\"expand\"","\"export\"","\"exportMyData\"","\"feedback\"","\"focusMessage\"","\"foldSidebar\"","\"forgetPassword\"","\"generate\"","\"generateFromJson\"","\"getDirections\"","\"getMoreInfo\"","\"goBack\"","\"hangUp\"","\"impersonate\"","\"import\"","\"importFromCrawler\"","\"integrationCheck\"","\"integrationConnectMicrosoft\"","\"integrationConnectApp\"","\"integrationUseOwnApp\"","\"integrationAdvancedSetup\"","\"integrationDisconnect\"","\"integrationReconnect\"","\"integrationRotateSecret\"","\"invite\"","\"inviteMember\"","\"leave\"","\"link\"","\"linkExisting\"","\"linkFromProvider\"","\"loadDefaults\"","\"manageAgentAccess\"","\"manageAgentMemberAccess\"","\"manageProfile\"","\"markAllAsRead\"","\"markAsRead\"","\"moreActions\"","\"moveDown\"","\"moveHere\"","\"moveToFolder\"","\"moveUp\"","\"mute\"","\"next\"","\"open\"","\"openChat\"","\"openFilters\"","\"openInGmail\"","\"openInMailApp\"","\"openInOutlook\"","\"openInSms\"","\"openInTelegram\"","\"openInWhatsApp\"","\"openInYahooMail\"","\"openSettings\"","\"openSidebar\"","\"pan\"","\"pause\"","\"pin\"","\"playVoicePreview\"","\"prev\"","\"previewAsPage\"","\"previewAsWidget\"","\"previous\"","\"proceed\"","\"profileMenu\"","\"recoverPassword\"","\"refill\"","\"refillHistory\"","\"refresh\"","\"refreshPrices\"","\"reviewPageAccessRisk\"","\"setPrice\"","\"regenerate\"","\"remove\"","\"removeFromQueue\"","\"queueMessage\"","\"removeField\"","\"renameChat\"","\"renameFolder\"","\"reorder\"","\"reprocess\"","\"resendInvitation\"","\"reset\"","\"resetPassword\"","\"resize\"","\"resume\"","\"resumeInPlayground\"","\"retry\"","\"retryNow\"","\"revoke\"","\"revokeAllOtherSessions\"","\"revokeAllSessions\"","\"run\"","\"save\"","\"scrollToBottom\"","\"searchAllFolders\"","\"select\"","\"selectHint\"","\"selected\"","\"send\"","\"sendLink\"","\"share\"","\"shareDocumentWithAgents\"","\"showLess\"","\"showMore\"","\"showShortcuts\"","\"signIn\"","\"signInWithSocialProvider\"","\"signOut\"","\"signUp\"","\"signUpWithSocialProvider\"","\"startNewChat\"","\"stop\"","\"stopImpersonation\"","\"stopVoicePreview\"","\"submit\"","\"switch\"","\"takePhoto\"","\"talk\"","\"testIntegration\"","\"toggleIntegration\"","\"toggleSidebar\"","\"toggleTheme\"","\"unban\"","\"unblockChat\"","\"unfoldSidebar\"","\"unlinkDocument\"","\"unmute\"","\"unpin\"","\"update\"","\"upvote\"","\"useColorsForAgentHeader\"","\"view\"","\"viewAgentTree\"","\"viewAll\"","\"viewChat\"","\"viewDetails\"","\"viewDocument\"","\"viewDocuments\"","\"viewProfile\"","\"viewRecentChats\"","\"welcomePopup\"","\"zoomIn\"","\"zoomOut\"","\"createWebSource\"","\"manualConfirmations\"","\"webSourceConfirmRemoval\"","\"channel\"","\"app\"","\"frontoffice\"","\"widget\"","\"reasoning\"","\"high\"","\"low\"","\"medium\"","\"off\"","\"reasoningSummary\"","\"auto\"","\"concise\"","\"detailed\"","\"searchMode\"","\"balanced\"","\"keyword\"","\"semantic\"","\"status\"","\"active\"","\"draft\"","\"inactive\"","\"tool\"","\"createSpreadsheet\"","\"createWordDocument\"","\"fetchTeamsChannelHistory\"","\"geocode\"","\"getWeather\"","\"querySpreadsheet\"","\"readDocumentFile\"","\"requestGeolocation\"","\"retrieveRevisedAnswers\"","\"runWorker\"","\"scheduleWakeup\"","\"cronTasks\"","\"searchInKnowledgeBase\"","\"searchInUserFiles\"","\"shareDocument\"","\"showArtifact\"","\"showCalendarEvent\"","\"showChart\"","\"showComparison\"","\"showContactForm\"","\"showDiagram\"","\"showEmail\"","\"showForm\"","\"showImageGallery\"","\"showLocation\"","\"showMessage\"","\"showMultipleChoice\"","\"showProductList\"","\"showQrCode\"","\"showSources\"","\"showSuggestedReply\"","\"showVideo\"","\"showWeather\"","\"showWebPages\"","\"spreadsheet\"","\"useAllUserFiles\"","\"useAllUserKb\"","\"userMemory\"","\"wordDocument\"","\"toolWorkingSetMode\"","\"shadow\"","\"visibility\"","\"organization\"","\"private\"","\"public\"","\"restricted\"","\"visibilityHint\"","\"manager\"","\"notLimited\"","\"hintOrganization\"","\"hintRestricted\"","\"readError\"","\"restrictTitle\"","\"restrictMembers\"","\"restrictOutsiders\"","\"restrictUnknown\"","\"restrictDescription\"","\"chat\"","\"navigate\"","\"screen\"","\"genericError\"","\"haveAccount\"","\"noAccount\"","\"popupBlocked\"","\"resetSent\"","\"resetSentTitle\"","\"resetTitle\"","\"resetUnavailable\"","\"signInTitle\"","\"signUpSuccessTitle\"","\"signUpTitle\"","\"verifyEmail\"","\"asset\"","\"emailBanner\"","\"emailLogo\"","\"logoDark\"","\"logoLight\"","\"mark\"","\"assetHint\"","\"bundledImage\"","\"color\"","\"accent\"","\"brand\"","\"info\"","\"colors\"","\"colorsHint\"","\"darkLogo\"","\"images\"","\"imagesHint\"","\"lightLogo\"","\"loadFailed\"","\"markBesideName\"","\"mode\"","\"modeDark\"","\"modeHint\"","\"modeLight\"","\"modeSystem\"","\"neutralMark\"","\"noImage\"","\"notRuntimeContent\"","\"notRuntimeTitle\"","\"palette\"","\"dark\"","\"light\"","\"removeImage\"","\"replaceImage\"","\"saveAndReload\"","\"saveFailed\"","\"saveFailedHint\"","\"savedMeanwhile\"","\"savedMeanwhileHint\"","\"text\"","\"companyName\"","\"description\"","\"productName\"","\"productTagline\"","\"shortName\"","\"textHint\"","\"texts\"","\"unsupportedType\"","\"uploadFailed\"","\"uploadFailedHint\"","\"uploadImage\"","\"useBundledImage\"","\"fetch\"","\"puppeteer\"","\"remote\"","\"teams\"","\"whatsapp\"","\"docs\"","\"intro\"","\"step1\"","\"step2\"","\"step3\"","\"step4\"","\"step5\"","\"step6\"","\"step7\"","\"step8\"","\"step9\"","\"title\"","\"webhookUrlAfterSave\"","\"copyData\"","\"downloadPng\"","\"series\"","\"showTable\"","\"Africa\"","\"America\"","\"Asia\"","\"Australia\"","\"Europe\"","\"Pacific\"","\"abusive\"","\"aggressive\"","\"api\"","\"critical\"","\"data_leak\"","\"degrading\"","\"desktop\"","\"direct\"","\"disengaged\"","\"empty_reply\"","\"endpoint\"","\"excited\"","\"failed_action\"","\"false_success\"","\"frustrated\"","\"goal_met\"","\"goal_not_met\"","\"group\"","\"hallucination\"","\"impatient\"","\"improving\"","\"inappropriate_tone\"","\"mobile\"","\"negative\"","\"neutral\"","\"off_brand\"","\"other\"","\"polite\"","\"positive\"","\"refusal_loop\"","\"repetition\"","\"stable\"","\"stuck_flow\"","\"tablet\"","\"unanalyzed\"","\"unclear\"","\"unknown\"","\"voice\"","\"web\"","\"addMemberLabel\"","\"addMemberPlaceholder\"","\"colleague\"","\"deleteDescription\"","\"deleteQuestion\"","\"empty\"","\"error\"","\"instructions\"","\"instructionsHint\"","\"leaveDescription\"","\"leaveQuestion\"","\"makeOwner\"","\"makeOwnerDescription\"","\"makeOwnerQuestion\"","\"members\"","\"move\"","\"moveDescription\"","\"moveOut\"","\"moveTo\"","\"name\"","\"new\"","\"newChat\"","\"noCandidates\"","\"noProjects\"","\"owner\"","\"readOnly\"","\"removeMember\"","\"removeMemberDescription\"","\"removeMemberQuestion\"","\"settings\"","\"documentRefreshTriggerOff\"","\"embeddingBackToPlatformSameFamily\"","\"endpointOffWithEmbedding\"","\"integrationRemove\"","\"lastModelOff\"","\"modelProviderDelete\"","\"modelRemove\"","\"revokeVoiceApiKey\"","\"deleteAgent\"","\"deleteBulkDocument\"","\"deleteDocument\"","\"deleteSpreadsheet\"","\"deleteWordDocument\"","\"excludeUserFile\"","\"unlinkAgent\"","\"unlinkLastAgentDelete\"","\"unlinkSyncedFolder\"","\"unlinkWebSource\"","\"abuseCategory\"","\"data_extraction\"","\"harassment\"","\"hate_speech\"","\"impersonation\"","\"off_topic_persistent\"","\"prompt_injection\"","\"self_harm\"","\"sexual_content\"","\"spam\"","\"violence\"","\"confidence\"","\"engagement\"","\"label\"","\"abuseDetected\"","\"conversationSentiment\"","\"goalMet\"","\"goalNotMet\"","\"llmIssueDetected\"","\"riskScore\"","\"userEngagement\"","\"userTone\"","\"llmIssue\"","\"sentiment\"","\"sentimentTrend\"","\"tone\"","\"trigger\"","\"agent_request\"","\"manual\"","\"summary_cycle\"","\"depth\"","\"sitemap\"","\"downloadPdf\"","\"classDiagram\"","\"erDiagram\"","\"flowchart\"","\"graph\"","\"sequenceDiagram\"","\"stateDiagram\"","\"xychart\"","\"analyzedPages\"","\"chunkSimilarTo\"","\"compareChunks\"","\"confirmAllRedundant\"","\"hasRedundant\"","\"isRedundant\"","\"openInProvider\"","\"originalChunk\"","\"pageCount\"","\"readingTime\"","\"redundancyAccepted\"","\"redundancyDismissed\"","\"redundancyExplainer\"","\"redundantChunk\"","\"redundantChunks\"","\"redundantNotice\"","\"redundantWith\"","\"reviewRedundant\"","\"showAll\"","\"thisDocument\"","\"viewByChunks\"","\"viewOriginal\"","\"wordCount\"","\"failed\"","\"gone\"","\"shrunk\"","\"unchanged\"","\"updated\"","\"pending\"","\"processing\"","\"success\"","\"indexed\"","\"unavailable\"","\"scanned\"","\"added\"","\"renamedOrMoved\"","\"removed\"","\"skippedUnsupported\"","\"skippedTooLarge\"","\"scannedPages\"","\"capped\"","\"daily\"","\"hourly\"","\"monthly\"","\"weekly\"","\"syncing\"","\"idle\"","\"columnDeletedAt\"","\"columnDeletedBy\"","\"columnPurgedIn\"","\"daysLeft\"","\"emptyConsequence\"","\"emptyQuestion\"","\"emptySuccess\"","\"emptyTitle\"","\"emptyTrash\"","\"introRetention\"","\"openLiveDocument\"","\"purge\"","\"purgeConsequence\"","\"purgeQuestion\"","\"purgeSuccess\"","\"purgeTitle\"","\"refusalAgentGone\"","\"refusalIdentityTaken\"","\"restore\"","\"restoreCredits\"","\"restoreFailed\"","\"restoreIndexing\"","\"restoreQuestion\"","\"restoreSuccess\"","\"restoreSuccessRoot\"","\"restoreTitle\"","\"toggle\"","\"toggleHint\"","\"file\"","\"url\"","\"ACCOUNT_TEMPORARILY_LOCKED\"","\"BANNED_USER\"","\"CREDENTIAL_ACCOUNT_NOT_FOUND\"","\"EMAIL_CODE_NOT_AVAILABLE\"","\"TWO_FACTOR_REQUIRED\"","\"PASSKEY_PASSWORD_REQUIRED\"","\"PASSKEY_RECENT_SIGN_IN_REQUIRED\"","\"PASSKEY_NOT_ALLOWED_FOR_SESSION\"","\"PASSKEY_USER_VERIFICATION_REQUIRED\"","\"PASSKEY_NOT_FOUND\"","\"AUTHENTICATION_FAILED\"","\"FAILED_TO_VERIFY_REGISTRATION\"","\"CHALLENGE_NOT_FOUND\"","\"EMAIL_NOT_VERIFIED\"","\"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION\"","\"FAILED_TO_UNLINK_LAST_ACCOUNT\"","\"INVALID_BACKUP_CODE\"","\"INVALID_CODE\"","\"INVALID_EMAIL_OR_PASSWORD\"","\"INVALID_PASSWORD\"","\"INVALID_TOKEN\"","\"INVALID_TWO_FACTOR_COOKIE\"","\"INVITATION_LIMIT_REACHED\"","\"INVITATION_NOT_FOUND\"","\"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION\"","\"KEY_NOT_FOUND\"","\"MEMBER_NOT_FOUND\"","\"NOT_ALLOWED\"","\"ORGANIZATION_ALREADY_EXISTS\"","\"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED\"","\"ORGANIZATION_NOT_FOUND\"","\"ORGANIZATION_SLUG_ALREADY_TAKEN\"","\"OTP_HAS_EXPIRED\"","\"RATE_LIMIT_EXCEEDED\"","\"SESSION_NOT_FRESH\"","\"SOCIAL_ACCOUNT_ALREADY_LINKED\"","\"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE\"","\"TOO_MANY_REQUESTS\"","\"TOTP_ALREADY_ENABLED\"","\"TOTP_NOT_ENABLED\"","\"TWO_FACTOR_REQUIRED_TO_ENFORCE\"","\"UNAUTHORIZED_SESSION\"","\"USER_ALREADY_EXISTS\"","\"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL\"","\"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION\"","\"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION\"","\"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION\"","\"USER_NOT_FOUND\"","\"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION\"","\"YOU_ARE_NOT_ALLOWED_TO_MANAGE_TWO_FACTOR\"","\"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION\"","\"YOU_CANNOT_BAN_YOURSELF\"","\"YOU_CANNOT_IMPERSONATE_ADMINS\"","\"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER\"","\"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER\"","\"YOU_CANNOT_MANAGE_YOUR_OWN_TWO_FACTOR\"","\"YOU_CANNOT_REMOVE_YOURSELF\"","\"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS\"","\"fileAlreadyImported\"","\"invalidToken\"","\"passwordsDoNotMatch\"","\"privateNetworkRequired\"","\"refreshIntervalUrlOnly\"","\"required\"","\"slugAlreadyExists\"","\"slugFormat\"","\"urlAlreadyImported\"","\"syncSourceUrlOnly\"","\"domain\"","\"github\"","\"google\"","\"microsoft\"","\"agentVisibilityPublic\"","\"agentVisibilityRegistered\"","\"agentVisibilityRestricted\"","\"apiTools\"","\"autoConfirmations\"","\"byok\"","\"chatProjects\"","\"endpoints\"","\"fileUpload\"","\"gateway\"","\"channels\"","\"models\"","\"tools\"","\"hostTools\"","\"hubspot\"","\"leads\"","\"legend\"","\"mcpServers\"","\"openaiApi\"","\"proactiveAutomations\"","\"salesforce\"","\"sharepoint\"","\"subAgents\"","\"anonymousLabel\"","\"chatLabel\"","\"defaultDays\"","\"defaultDisabled\"","\"trashLabel\"","\"unitDays\"","\"aiDescription\"","\"aiDescriptionModel\"","\"aiDescriptionPrompt\"","\"browserEngine\"","\"documentFile\"","\"fetchBrowserEngine\"","\"followExternal\"","\"forceOcr\"","\"pages\"","\"puppeteerBrowserEngine\"","\"remoteBrowserEngine\"","\"useBrowserEngine\"","\"useExtractionStrategy\"","\"webSourceWatch\"","\"webSourceRemoveMissing\"","\"webSourceRemoveMissingExplained\"","\"D\"","\"M\"","\"W\"","\"Y\"","\"accepted\"","\"canceled\"","\"expired\"","\"rejected\"","\"de\"","\"en\"","\"english\"","\"es\"","\"fr\"","\"french\"","\"german\"","\"it\"","\"italian\"","\"nl\"","\"pt\"","\"spanish\"","\"contactReason\"","\"appointment\"","\"callback_request\"","\"complaint\"","\"info_request\"","\"quote_request\"","\"support\"","\"budget\"","\"company\"","\"conversationSummary\"","\"preferredContactMethod\"","\"preferredContactTime\"","\"productInterest\"","\"topics\"","\"urgency\"","\"any\"","\"email\"","\"phone\"","\"afternoon\"","\"evening\"","\"morning\"","\"externalToken\"","\"headers\"","\"oauth\"","\"orphan\"","\"stale\"","\"toolbarTips\"","\"bold\"","\"underline\"","\"italic\"","\"strikeThrough\"","\"sub\"","\"sup\"","\"quote\"","\"unorderedList\"","\"orderedList\"","\"task\"","\"codeRow\"","\"code\"","\"image\"","\"table\"","\"mermaid\"","\"katex\"","\"prettier\"","\"pageFullscreen\"","\"fullscreen\"","\"preview\"","\"previewOnly\"","\"htmlPreview\"","\"catalog\"","\"titleItem\"","\"h1\"","\"h2\"","\"h3\"","\"h4\"","\"h5\"","\"h6\"","\"imgTitleItem\"","\"upload\"","\"clip2upload\"","\"linkModalTips\"","\"linkTitle\"","\"imageTitle\"","\"descLabel\"","\"descLabelPlaceHolder\"","\"urlLabel\"","\"urlLabelPlaceHolder\"","\"buttonOK\"","\"clipModalTips\"","\"buttonUpload\"","\"copyCode\"","\"successTips\"","\"failTips\"","\"flow\"","\"sequence\"","\"gantt\"","\"class\"","\"state\"","\"pie\"","\"relationship\"","\"journey\"","\"inline\"","\"block\"","\"footer\"","\"markdownTotal\"","\"scrollAuto\"","\"agentAccess\"","\"limited\"","\"privateAgents\"","\"hintAll\"","\"hintLimited\"","\"managerHint\"","\"column\"","\"all\"","\"allPlusPrivate\"","\"allPlusPrivateTitle\"","\"count\"","\"none\"","\"allTitle\"","\"managerTitle\"","\"noneTitle\"","\"explicit\"","\"extracted\"","\"revisionsOf\"","\"revisionBy\"","\"chart\"","\"chartNotDrawn\"","\"truncated\"","\"true\"","\"false\"","\"staleFormulas\"","\"missingValue\"","\"moreRows\"","\"moreColumns\"","\"working\"","\"answeredInChat\"","\"showChat\"","\"versions\"","\"previousVersion\"","\"nextVersion\"","\"versionOf\"","\"modes\"","\"modeMarkup\"","\"modeMarkupShort\"","\"modeAccepted\"","\"modeOriginal\"","\"shrink\"","\"cell\"","\"formulaBar\"","\"sheets\"","\"computedFormulas\"","\"average\"","\"sum\"","\"fitWidth\"","\"pageOf\"","\"words\"","\"outline\"","\"changes\"","\"noHeadings\"","\"copyFailed\"","\"openInNewTab\"","\"zoom\"","\"annotate\"","\"crop\"","\"cover\"","\"arrow\"","\"rect\"","\"path\"","\"rotateLeft\"","\"rotateRight\"","\"undo\"","\"redo\"","\"aspect\"","\"aspectFree\"","\"cropHint\"","\"coverStyle\"","\"coverSolid\"","\"coverPixelate\"","\"coverHint\"","\"colorRed\"","\"colorYellow\"","\"colorGreen\"","\"colorBlue\"","\"colorWhite\"","\"colorBlack\"","\"arrowHint\"","\"rectHint\"","\"pathHint\"","\"textLabel\"","\"canvasLabel\"","\"use\"","\"loading\"","\"drawFailed\"","\"exportFailed\"","\"size\"","\"sizeScaledDown\"","\"audioTranscribing\"","\"audioTranscript\"","\"audioTranscriptFailed\"","\"audioTranscriptNoSpeech\"","\"audioTranscriptOff\"","\"disconnectOAuthConnection\"","\"requestAccountLink\"","\"unlinkAccount\"","\"editSpreadsheet\"","\"editSpreadsheetCells\"","\"editWordDocument\"","\"editWordDocumentParagraphs\"","\"editWordDocumentRevisions\"","\"chatFileParagraphChanged\"","\"chatFileParagraphAdded\"","\"chatFileParagraphDeleted\"","\"chatFileTableRowAdded\"","\"chatFileTableRowDeleted\"","\"chatFileVersionSummary\"","\"chatFileMoreChanges\"","\"chatFileSheet\"","\"chatFileRow\"","\"chatFileNewSheet\"","\"chatFileCell\"","\"chatFileBefore\"","\"chatFileAfter\"","\"chatFileRefreshPivots\"","\"chatFileUpdateTableOfContents\"","\"chatFileRevisionAccepted\"","\"chatFileRevisionRejected\"","\"chatFileRestored\"","\"chatFileRestoreRequest\"","\"chatFileRestoreRequestById\"","\"enableTools\"","\"expandChunkContext\"","\"hostToolFailed\"","\"hostToolNoAnswer\"","\"pageControlActive\"","\"pageTool\"","\"click\"","\"fill\"","\"find\"","\"form\"","\"hover\"","\"press\"","\"read\"","\"scroll\"","\"snapshot\"","\"wait\"","\"readChatAttachment\"","\"readEarlierMessages\"","\"readSpreadsheet\"","\"readWordDocument\"","\"recallUserMemory\"","\"requestOAuthConnection\"","\"requestOAuthConnectionButton\"","\"requestOAuthConnectionInfo\"","\"requestOAuthConnectionPrompt\"","\"requestOAuthConnectionSuccess\"","\"revisedAnswers\"","\"runSubagent\"","\"saveUserMemory\"","\"cronCreate\"","\"cronList\"","\"cronDelete\"","\"reportTaskRun\"","\"searchingDocuments\"","\"sendChatFile\"","\"shareDocumentValidUntil\"","\"showProducts\"","\"stepCount\"","\"stepDocument\"","\"stepDropped\"","\"stepError\"","\"stepExcerpts\"","\"stepInput\"","\"stepItems\"","\"stepNoResults\"","\"stepOutput\"","\"stepRepeated\"","\"stepTimedOut\"","\"steps\"","\"streaming\"","\"type\"","\"custom\"","\"data\"","\"sourceDocument\"","\"sourceUrl\"","\"stepStart\"","\"webSearch\"","\"pageStep\"","\"access\"","\"accessOff\"","\"accessOn\"","\"agentAsModel\"","\"agentAsModelDescription\"","\"alertOff\"","\"alertOn\"","\"apiKeySummary\"","\"baseUrl\"","\"baseUrlSummary\"","\"connection\"","\"connectionDescription\"","\"conversations\"","\"conversationsSummary\"","\"examples\"","\"externalContextSummary\"","\"model\"","\"modelSummary\"","\"n8nCredential\"","\"n8nModel\"","\"action\"","\"blocked\"","\"blocker\"","\"deletion_exists\"","\"outside_reference\"","\"unclassified_table\"","\"confirm\"","\"confirmHint\"","\"confirmLabel\"","\"deleted\"","\"deletedNotice\"","\"dialogTitle\"","\"finishedAt\"","\"goes\"","\"detach\"","\"erase\"","\"item\"","\"agents\"","\"attachments\"","\"chats\"","\"chunks\"","\"consumption\"","\"documents\"","\"memories\"","\"others\"","\"points\"","\"pointsUnknown\"","\"people\"","\"progress\"","\"report\"","\"reportText\"","\"copies\"","\"deletedHeading\"","\"files\"","\"heading\"","\"kept\"","\"keptHeading\"","\"outside\"","\"requested\"","\"rows\"","\"shortUrls\"","\"signIns\"","\"verified\"","\"requestedBy\"","\"started\"","\"stays\"","\"completed\"","\"running\"","\"step\"","\"tombstone\"","\"users\"","\"vectors\"","\"membersHint\"","\"membersInvalid\"","\"membersLabel\"","\"hint\"","\"pointed\"","\"start\"","\"askPlaceholder\"","\"translateAsks\"","\"card\"","\"aiNotice\"","\"thinking\"","\"waitsConfirm\"","\"waitsReply\"","\"more\"","\"noAnswer\"","\"builtIn\"","\"explain\"","\"summarize\"","\"rewrite\"","\"shorten\"","\"proofread\"","\"translate\"","\"iconSearch\"","\"icon\"","\"sparkles\"","\"magic\"","\"idea\"","\"star\"","\"heart\"","\"lightning\"","\"fire\"","\"rocket\"","\"pen\"","\"pencil\"","\"paragraph\"","\"list\"","\"checklist\"","\"highlighter\"","\"document\"","\"folder\"","\"book\"","\"bookmark\"","\"clipboard\"","\"contract\"","\"attachment\"","\"archive\"","\"search\"","\"filter\"","\"eye\"","\"questions\"","\"database\"","\"calculator\"","\"percent\"","\"scales\"","\"euro\"","\"dollar\"","\"wallet\"","\"bank\"","\"cart\"","\"bill\"","\"gift\"","\"shop\"","\"truck\"","\"shield\"","\"lock\"","\"key\"","\"gavel\"","\"institution\"","\"passport\"","\"person\"","\"team\"","\"smile\"","\"handshake\"","\"contacts\"","\"mail\"","\"speech\"","\"megaphone\"","\"bell\"","\"globe\"","\"calendar\"","\"event\"","\"clock\"","\"timer\"","\"history\"","\"hourglass\"","\"plane\"","\"car\"","\"train\"","\"ship\"","\"map\"","\"compass\"","\"bed\"","\"suitcase\"","\"home\"","\"building\"","\"flag\"","\"earth\"","\"sun\"","\"umbrella\"","\"heartbeat\"","\"capsule\"","\"restaurant\"","\"cup\"","\"leaf\"","\"plant\"","\"recycle\"","\"school\"","\"graduation\"","\"brain\"","\"puzzle\"","\"award\"","\"trophy\"","\"bug\"","\"robot\"","\"cloud\"","\"flask\"","\"microscope\"","\"cross\"","\"warning\"","\"information\"","\"swap\"","\"target\"","\"music\"","\"video\"","\"microphone\"","\"prompt\"","\"docx\"","\"page\"","\"xlsx\"","\"hintOriginal\"","\"hintParagraphs\"","\"hintCells\"","\"notLatest\"","\"openLatest\"","\"labelParagraphs\"","\"labelCells\"","\"labelCell\"","\"selectedInFile\"","\"allProviders\"","\"apiToolName\"","\"apiToolUrl\"","\"askAnything\"","\"autoDetect\"","\"autoGenerated\"","\"comment\"","\"completeName\"","\"constValue\"","\"customAnswer\"","\"documentContent\"","\"documentName\"","\"documentOriginAll\"","\"documentRefreshAll\"","\"documentSourceSearch\"","\"documentStatusAll\"","\"documentUrl\"","\"endDate\"","\"enterYourQuestion\"","\"insert\"","\"insertOrigin\"","\"insertImageHost\"","\"limit\"","\"mcpServerHealthCheckPath\"","\"mcpServerUrl\"","\"modelEndpointBaseUrl\"","\"noHostToolsAllowed\"","\"noPageAccessExcludeSelectors\"","\"noSelectionActions\"","\"noTrustedOrigins\"","\"noImageHosts\"","\"oauthAuthorizationUrl\"","\"oauthClientId\"","\"oauthClientSecret\"","\"oauthScopes\"","\"oauthTokenUrl\"","\"pasteJsonSample\"","\"request\"","\"secretEdit\"","\"selectAgent\"","\"selectLanguage\"","\"selectPriority\"","\"similarity\"","\"sitemapUrl\"","\"slug\"","\"startDate\"","\"startUrl\"","\"temperature\"","\"uploadFile\"","\"emailAddress\"","\"cardTitle\"","\"summaryAvailable\"","\"summaryReplaces\"","\"summaryLinkedHere\"","\"summaryLinkedElsewhere\"","\"summaryExpired\"","\"summaryInvalid\"","\"summaryLinked\"","\"requestedAt\"","\"doNotConfirm\"","\"confirmOnlyIf\"","\"replace\"","\"linked\"","\"identitiesTitle\"","\"identitiesDescription\"","\"linkedAt\"","\"unlinkQuestion\"","\"unlinkDescription\"","\"unlinked\"","\"conflict\"","\"timeout\"","\"unauthorized\"","\"backToApp\"","\"general\"","\"pictureHint\"","\"notifications\"","\"groups\"","\"alwaysOn\"","\"inApp\"","\"agent_replies\"","\"summary\"","\"integrations\"","\"flagged_conversations\"","\"usage_limits\"","\"security\"","\"passwordSummary\"","\"connectedAccountsNote\"","\"connected\"","\"devices\"","\"deviceOn\"","\"available\"","\"keyExpires\"","\"keyNeverExpires\"","\"keyRequests\"","\"tasks\"","\"changed\"","\"nextRun\"","\"paused\"","\"ended\"","\"missed\"","\"failures\"","\"deleteTitle\"","\"deleteConsequence\"","\"resumed\"","\"tooMany\"","\"schedule\"","\"once\"","\"weekdays\"","\"withTimezone\"","\"organizations\"","\"current\"","\"onlyYou\"","\"memberSince\"","\"asksTwoFactor\"","\"account\"","\"installed\"","\"lead\"","\"writtenInEnglish\"","\"admin\"","\"member\"","\"user\"","\"configure\"","\"monitor\"","\"allAgents\"","\"agentSettings\"","\"agentTry\"","\"searchAgent\"","\"searchChat\"","\"searchOrganization\"","\"allOrganizations\"","\"agentCatalog\"","\"agentEndpoints\"","\"backoffice\"","\"branding\"","\"chatLogs\"","\"copatForYou\"","\"dashboard\"","\"dataProtection\"","\"endpointLogs\"","\"feedbacks\"","\"invitations\"","\"mcpServer\"","\"notFound\"","\"profile\"","\"reasoningLogs\"","\"releaseNotes\"","\"requestPasswordReset\"","\"system\"","\"twoFactor\"","\"twoFactorSetup\"","\"virtualAssistant\"","\"noAnswerRecorded\"","\"otherPlaceholder\"","\"future\"","\"past\"","\"unit\"","\"day\"","\"hour\"","\"minute\"","\"second\"","\"afterColumn\"","\"approvalTools\"","\"approved\"","\"assistantDiscardAgent\"","\"assistantLeaveUnsaved\"","\"assistantSaveAgent\"","\"beforeColumn\"","\"cancelled\"","\"changesCount\"","\"confirmed\"","\"denied\"","\"disabledTools\"","\"fieldChecked\"","\"fieldColumn\"","\"fieldUnchecked\"","\"formFill\"","\"formSubmit\"","\"hostCall\"","\"noChanges\"","\"pageAnswer\"","\"pageBack\"","\"pageClick\"","\"pageElement\"","\"pageFill\"","\"pageFillFields\"","\"pageFocused\"","\"pageHover\"","\"pageNavigate\"","\"pageNavigateUnknown\"","\"pageOpen\"","\"pagePress\"","\"pageSubmit\"","\"promptNamed\"","\"unchangedFields\"","\"communication\"","\"delegation\"","\"knowledgeSearch\"","\"locationWeather\"","\"personalization\"","\"richContent\"","\"cost\"","\"enabled\"","\"exposed\"","\"inputTokens\"","\"kind\"","\"mcp\"","\"subagent\"","\"latency\"","\"leadFailed\"","\"missedActive\"","\"missedShadow\"","\"notCharged\"","\"probability\"","\"seeded\"","\"used\"","\"agentsUsedInfo\"","\"mcpConnectionStatus\"","\"requestsUsedInfo\"","\"question\"","\"asksHuman\"","\"durableFact\"","\"informationGap\"","\"manipulation\"","\"missingInfo\"","\"version\"","\"adminBackupCodes\"","\"adminChanges\"","\"adminChangesEmpty\"","\"adminChangesHint\"","\"adminDevicesForgotten\"","\"adminFailedAttempts\"","\"adminFilterEmpty\"","\"adminForgetDevices\"","\"adminForgetDevicesDescription\"","\"adminForgetDevicesQuestion\"","\"adminLocked\"","\"adminPasskeySynced\"","\"adminRemovePasskeyDescription\"","\"adminRemovePasskeyQuestion\"","\"adminRequiredPending\"","\"adminStateNoneHint\"","\"adminSummaryAll\"","\"adminTrustedDevices\"","\"adminUnlock\"","\"adminUnlockDescription\"","\"adminUnlocked\"","\"adminUnlockQuestion\"","\"adoptionRatio\"","\"adoptionState\"","\"totp\"","\"otp\"","\"passkey\"","\"adoptionTitle\"","\"adoptionTitleUsers\"","\"backupCode\"","\"backupCodesDescription\"","\"backupCodesFileHeader\"","\"backupCodesReplaced\"","\"backupCodesSaved\"","\"badge\"","\"challengeApp\"","\"challengeBackup\"","\"challengeEmailSending\"","\"challengeEmailSent\"","\"challengeTitle\"","\"disabledMessage\"","\"enabledMessage\"","\"manualKey\"","\"memberOff\"","\"memberOn\"","\"memberPasskey\"","\"memberPasskeyHint\"","\"memberPending\"","\"memberPendingHint\"","\"memberSocialOnly\"","\"memberSocialOnlyHint\"","\"methodApp\"","\"methodAppSummary\"","\"methodEmail\"","\"methodEmailSummary\"","\"newBackupCodes\"","\"newBackupCodesDescription\"","\"passkeyAdd\"","\"passkeyAddDescription\"","\"passkeyAdded\"","\"passkeyAddNoPasswordDescription\"","\"passkeyAlreadyRegistered\"","\"passkeyCancelled\"","\"passkeyCreate\"","\"passkeyCreatedAt\"","\"passkeyDeviceBound\"","\"passkeyDeviceRefused\"","\"passkeyFallbackName\"","\"passkeyName\"","\"passkeyNameHint\"","\"passkeyRemove\"","\"passkeyRemoved\"","\"passkeyRemoveDescription\"","\"passkeyRemoveQuestion\"","\"passkeys\"","\"passkeysDescription\"","\"passkeysEmpty\"","\"passkeySynced\"","\"qrLabel\"","\"requireConsequence\"","\"requiredBy\"","\"requiredByPasskeyEnough\"","\"requireHint\"","\"requireLabel\"","\"requireOff\"","\"requireOn\"","\"requireQuestion\"","\"requireTitle\"","\"resetConfirm\"","\"resetDescription\"","\"resetQuestion\"","\"scanDescription\"","\"sendAgain\"","\"setupAddAnotherPasskey\"","\"setupAddPasskey\"","\"setupDescription\"","\"setupSignInWithPasskey\"","\"setupTitle\"","\"signInState\"","\"signInWithPasskey\"","\"stateNoPassword\"","\"stateOff\"","\"stateOnApp\"","\"stateOnEmail\"","\"summaryNoPassword\"","\"summaryOff\"","\"summaryOnApp\"","\"summaryOnEmail\"","\"switchToApp\"","\"trustDevice\"","\"turnOff\"","\"turnOffDescription\"","\"turnOffRequired\"","\"turnOffTitle\"","\"turnOn\"","\"turnOnTitle\"","\"useApp\"","\"useBackupCode\"","\"verify\"","\"chatFileCreated\"","\"chatFileInChatOnly\"","\"chatFilesEmpty\"","\"chatFilesTitle\"","\"chatFileVersion\"","\"deleteChatFile\"","\"deleteChatFileConfirm\"","\"deleteCreatedFileConfirm\"","\"emptyHint\"","\"exclude\"","\"excludeConfirm\"","\"openInChat\"","\"subtitle\"","\"untitled\"","\"uploadedAt\"","\"duplicateHeader\"","\"duplicateSecretParameter\"","\"invalidPhoneNumber\"","\"invalidSlug\"","\"invalidToolName\"","\"passwordMismatch\"","\"eager\"","\"normal\"","\"patient\"","\"airQuality\"","\"aqiFair\"","\"aqiGood\"","\"aqiHazardous\"","\"aqiModerate\"","\"aqiPoor\"","\"aqiVeryPoor\"","\"dailyForecast\"","\"feelsLike\"","\"today\"","\"message\"","\"doneTitle\"","\"doneMessage\"","\"invalidTitle\"","\"invalidMessage\"","\"level\"","\"minimal\"","\"xhigh\"","\"max\"","\"anthropicType\"","\"adaptive\"","\"disabled\"","\"anthropicDisplay\"","\"summarized\"","\"omitted\"","\"SingleTenant\"","\"MultiTenant\"","\"intent\"","\"topicsCovered\"","\"keyFacts\"","\"openQuestions\"","en_default$1","en_default","\"starts_with\"","\"ends_with\"","\"includes\"","\"regex\"","\"default\"","\"number\"","\"exact\"","\"inclusive\"","\"notInclusive\"","\"int\"","\"bigint\"","\"date\"","\"string\"","\"array\"","\"set\"","\"emoji\"","\"uuid\"","\"uuidv4\"","\"uuidv6\"","\"nanoid\"","\"guid\"","\"cuid\"","\"cuid2\"","\"ulid\"","\"xid\"","\"ksuid\"","\"datetime\"","\"time\"","\"duration\"","\"ipv4\"","\"ipv6\"","\"cidrv4\"","\"cidrv6\"","\"base64\"","\"base64url\"","\"json_string\"","\"e164\"","\"jwt\"","\"template_literal\"","it_default","SUPPORTED_LOCALES","detectLocale","browserLang","i18n","createI18n","translateAuthError","body","parsed","response","code","key","anonymousReauthClient","$fetch","data","externalAuthClient","path","EXTERNAL_TOKEN_EXPIRING_LEAD_MS","EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS","externalTokenExpiringDelay","remaining","expiresAt","now","readTokenClaims","payload","jwt","base64","isSameIdentity","left","a","right","b","OAUTH_POPUP_MESSAGE_TYPE","createPopupNonce","bytes","useChatbotAuth","_token","useHostSession","headers","client","createAuthClient","inferAdditionalFields","anonymousClient","newTokenFromHeader","ctx","input","init","session","isAuthenticating","externalToken","isActive","activeExternalToken","isExternalAuth","authChain","runExclusiveAuth","run","task","user","previousUser","reauthProofRequested","holdsReauthProofOf","userId","storeReauthProof","signInAnonymously","tryAnonymousReauth","reauthOrSignInAnonymously","handleExternalTokenFailure","failedExternalToken","trackSessionExternalToken","sessionExternalToken","sessionExternalTokenOwner","expiringTimer","currentSessionExternalToken","delay","getCurrentScope","onScopeDispose","refreshSessionExternalToken","newExternalToken","exchangeExternalToken","tracked","pendingExternalToken","attemptedExternalToken","externalSessionReconciled","signInWithExternalToken","signInAnonymouslyWithFallback","newIsActive","newSession","newToken","previousToken","signOut","onError","twoFactorChallenge","signInWithEmail","challenge","TWO_FACTOR_PATHS","twoFactorRequest","lostChallenge","verifyTwoFactor","kind","sendTwoFactorCode","cancelTwoFactor","signUpWithEmail","params","requestPasswordReset","signInWithSocialPopup","baseUrl","basePath","nonce","startUrl","provider","popup","allowedOrigin","closedPollId","finish","onOAuthMessage","resolve","event","onAuthSuccess","revokedToken","useFocusTrapBypass","shadowRoot","stopFocusPropagation","onMounted","rootNode","getCurrentInstance","onBeforeUnmount"],"sources":["../src/utils/cookie.ts","../src/utils/layout.ts","../src/utils/index.ts","../src/composables/useChatbotAgent.ts","../../../packages/i18n/src/index.ts","../src/composables/useChatbotAuth.ts","../src/composables/useFocusTrapBypass.ts"],"sourcesContent":["import { logger } from 'utils'\n\nconst DEFAULT_COOKIE_NAME = 'eight-wave-ai'\n// The cookie that holds the reauth proof keeps the `-uid` name it had when it\n// held the bare user id: a visitor's old value is overwritten in place, and the\n// name customers list in their cookie notices stays the same.\nconst REAUTH_PROOF_COOKIE_SUFFIX = '-uid'\nconst MAX_AGE_ONE_YEAR = 31536000\n\nfunction setCookie(name: string, value: string, maxAge: number) {\n try {\n // A past `expires` accompanies `max-age=0` on deletion: some cookie\n // implementations (older browsers, happy-dom) only honor the former.\n const expires =\n maxAge > 0 ? '' : '; expires=Thu, 01 Jan 1970 00:00:00 GMT'\n document.cookie = `${name}=${value}; path=/; max-age=${maxAge}${expires}; SameSite=Lax; Secure`\n } catch (error) {\n logger.warn(\n '[cookie] setCookie blocked (cross-origin/tracking protection)',\n error,\n )\n }\n}\n\nfunction getCookie(name: string): string {\n try {\n // Only split on the FIRST \"=\" — session tokens are signed with a\n // base64 signature that can contain \"=\" padding, so splitting on every\n // \"=\" would truncate the value and corrupt the token.\n const prefix = `${name}=`\n const row = document.cookie\n .split('; ')\n .find((entry) => entry.startsWith(prefix))\n return row ? row.slice(prefix.length) : ''\n } catch (error) {\n logger.warn(\n '[cookie] getCookie blocked (cross-origin/tracking protection)',\n error,\n )\n return ''\n }\n}\n\n// create first-party session cookie for authentication with 1 year expiry;\n// an empty token (sign-out) deletes the cookie instead of storing an empty value\nexport function setSessionCookie(\n token: string,\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(cookieName, token, token ? MAX_AGE_ONE_YEAR : 0)\n}\n\n// retrieve first-party session cookie\nexport function getSessionCookie(cookieName: string = DEFAULT_COOKIE_NAME) {\n return getCookie(cookieName)\n}\n\n// persist the anonymous user's reauth proof (`<userId>.<signature>`, signed by\n// the backend) alongside the session token, to come back after session expiry\nexport function setAnonymousReauthProofCookie(\n proof: string,\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(\n `${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`,\n proof,\n MAX_AGE_ONE_YEAR,\n )\n}\n\n// retrieve the persisted reauth proof; a cookie written before the proof\n// existed holds the bare user id instead\nexport function getAnonymousReauthProofCookie(\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n return getCookie(`${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`)\n}\n\n// remove the persisted proof once the anonymous user links a real account\n// (the linked anonymous user is deleted server-side, so it's stale)\nexport function clearAnonymousReauthProofCookie(\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(`${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`, '', 0)\n}\n","import { AgentWidgetAppearance, AgentWidgetLayout } from 'models'\n\n/** An attribute of the element wins over the agent's setting, when it names a value of the enum. */\nfunction resolveSetting<Value extends string>(\n values: readonly string[],\n attribute: string | undefined,\n setting: Value | undefined,\n fallback: Value,\n): Value {\n if (attribute && values.includes(attribute)) {\n return attribute as Value\n }\n return setting ?? fallback\n}\n\nconst LAYOUTS: readonly string[] = Object.values(AgentWidgetLayout)\nconst APPEARANCES: readonly string[] = Object.values(AgentWidgetAppearance)\n\n/**\n * The layout the floating element shows (spec `widget-copilot.md`, D1): its\n * `layout` attribute wins over the agent's setting, and an attribute that\n * names no layout counts as absent.\n */\nexport function resolveWidgetLayout(\n attribute: string | undefined,\n setting: AgentWidgetLayout | undefined,\n): AgentWidgetLayout {\n return resolveSetting(\n LAYOUTS,\n attribute,\n setting,\n AgentWidgetLayout.Floating,\n )\n}\n\n/** How the floating card looks over the site, with the same rule as the layout. */\nexport function resolveWidgetAppearance(\n attribute: string | undefined,\n setting: AgentWidgetAppearance | undefined,\n): AgentWidgetAppearance {\n return resolveSetting(\n APPEARANCES,\n attribute,\n setting,\n AgentWidgetAppearance.Solid,\n )\n}\n","export * from './cookie'\nexport * from './layout'\n\nexport const AUTH_BASE_PATH = 'auth'\n\n/**\n * The backend of the Eight Wave cloud: where a widget with no `base-url`\n * talks, as it always has. A dedicated installation sets `base-url`; nothing\n * else of an installation is built into the bundle (README, \"Dedicated\n * installations\").\n */\nexport const DEFAULT_BACKEND_URL = 'https://ai-api.8wave.it'\n","import type { MaybeRefOrGetter } from 'vue'\nimport { computed, ref, toValue, watch } from 'vue'\nimport type {\n AgentBranding,\n AgentPublic,\n AuthMethods,\n WidgetDeployment,\n} from 'models'\nimport { createChatbotApiClient } from 'composables'\nimport {\n agentThemeStyle,\n resolveContrastColor,\n} from 'components/src/chat/utils'\nimport { DEFAULT_BACKEND_URL } from '~/utils'\n\nexport function useChatbotAgent(options: {\n baseUrl?: string\n basePath?: string\n organizationSlug?: MaybeRefOrGetter<string>\n agentId?: MaybeRefOrGetter<string>\n headers?: MaybeRefOrGetter<Record<string, string> | undefined>\n /**\n * Host-provided color scheme override, applied when the agent theme is\n * `auto`. Mirrors the precedence used by the chatbot store: agent theme,\n * then this override, then the OS `prefers-color-scheme`.\n */\n systemTheme?: MaybeRefOrGetter<'light' | 'dark' | undefined>\n /** Host-provided color scheme that wins over the agent theme too. */\n theme?: MaybeRefOrGetter<'light' | 'dark' | undefined>\n}) {\n const agent = ref<AgentPublic>()\n const branding = ref<AgentBranding>()\n const authMethods = ref<AuthMethods>()\n /** The deployment theme's stylesheet, or undefined while it is the default. */\n const deploymentCss = ref<string>()\n /** What the installation tells the widget: its app, its telemetry. */\n const deployment = ref<WidgetDeployment>()\n const requiresAuth = ref(false)\n const notFound = ref(false)\n const isLoading = ref(false)\n\n async function load() {\n const orgSlug = toValue(options.organizationSlug)\n const agentId = toValue(options.agentId)\n if (!orgSlug || !agentId) {\n return\n }\n const apiClient = createChatbotApiClient({\n baseUrl: options.baseUrl ?? DEFAULT_BACKEND_URL,\n basePath: options.basePath,\n headers: () => toValue(options.headers),\n })\n isLoading.value = true\n try {\n const result = await apiClient.getAgentAccess(orgSlug, agentId)\n authMethods.value = result.authMethods\n deploymentCss.value = result.deploymentBranding?.css\n deployment.value = result.deployment\n if (result.requiresAuth) {\n requiresAuth.value = true\n branding.value = result.branding ?? undefined\n agent.value = undefined\n } else {\n requiresAuth.value = false\n branding.value = undefined\n agent.value = result.agent ?? undefined\n }\n notFound.value = false\n } catch {\n notFound.value = true\n deploymentCss.value = undefined\n agent.value = undefined\n branding.value = undefined\n requiresAuth.value = false\n } finally {\n isLoading.value = false\n }\n }\n\n // Reload when org/agent changes\n watch(\n [\n () => toValue(options.organizationSlug),\n () => toValue(options.agentId),\n ],\n () => {\n load()\n },\n { immediate: true },\n )\n\n // Reload when headers change meaningfully (e.g. after login) and auth is required\n watch(\n () => toValue(options.headers),\n () => {\n if (requiresAuth.value) {\n load()\n }\n },\n )\n\n // Branding-aware theming: fall back to branding when agent is not available\n const source = computed(\n () => agent.value?.interface ?? branding.value?.interface,\n )\n\n const contrastColor = computed(() =>\n resolveContrastColor(source.value?.textColor, source.value?.mainColor),\n )\n const mainColor = computed(() => source.value?.mainColor)\n\n const themeClass = computed(() => {\n const theme = toValue(options.theme) ?? source.value?.theme\n if (theme && theme !== 'auto') {\n return ['theme', `theme--${theme}`]\n }\n const systemTheme = toValue(options.systemTheme)\n if (systemTheme) {\n return ['theme', `theme--${systemTheme}`]\n }\n return ['theme']\n })\n\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n\n return {\n agent,\n branding,\n authMethods,\n deploymentCss,\n deployment,\n requiresAuth,\n notFound,\n isLoading,\n reload: load,\n contrastColor,\n mainColor,\n themeClass,\n themeStyle,\n }\n}\n","import { createI18n } from 'vue-i18n'\nimport it from './it.json'\nimport en from './en.json'\nimport enErrors from '@volverjs/zod-vue-i18n/locales/v4/en.json'\nimport itErrors from '@volverjs/zod-vue-i18n/locales/v4/it.json'\n\nexport const SUPPORTED_LOCALES = ['it', 'en'] as const\nexport type SupportedLocale = (typeof SUPPORTED_LOCALES)[number]\n\nfunction detectLocale(): SupportedLocale {\n const browserLang = navigator.language.split('-')[0]\n return (SUPPORTED_LOCALES as readonly string[]).includes(browserLang)\n ? (browserLang as SupportedLocale)\n : 'en'\n}\n\n/*\n * Setup i18n\n * https://vue-i18n.intlify.dev/\n */\n\nexport const i18n = createI18n<false>({\n locale: detectLocale(),\n legacy: false,\n globalInjection: true,\n fallbackWarn: false,\n messages: {\n it: {\n ...it,\n errors: { ...itErrors, ...it.errors },\n },\n en: {\n ...en,\n errors: { ...enErrors, ...en.errors },\n },\n },\n numberFormats: {\n it: {\n currencyEUR: {\n style: 'currency',\n currency: 'EUR',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n currencyUSD: {\n style: 'currency',\n currency: 'USD',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n EUR: {\n style: 'currency',\n currency: 'EUR',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n USD: {\n style: 'currency',\n currency: 'USD',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n decimal: {\n style: 'decimal',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n integer: {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n useGrouping: true,\n },\n compact: {\n style: 'decimal',\n notation: 'compact',\n compactDisplay: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n useGrouping: true,\n },\n seconds: {\n style: 'unit',\n unit: 'second',\n unitDisplay: 'long',\n maximumFractionDigits: 1,\n },\n },\n en: {\n currencyEUR: {\n style: 'currency',\n currency: 'EUR',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n currencyUSD: {\n style: 'currency',\n currency: 'USD',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n EUR: {\n style: 'currency',\n currency: 'EUR',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n USD: {\n style: 'currency',\n currency: 'USD',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n decimal: {\n style: 'decimal',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n integer: {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n useGrouping: true,\n },\n compact: {\n style: 'decimal',\n notation: 'compact',\n compactDisplay: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n useGrouping: true,\n },\n seconds: {\n style: 'unit',\n unit: 'second',\n unitDisplay: 'long',\n maximumFractionDigits: 1,\n },\n },\n },\n datetimeFormats: {\n it: {\n short: {\n dateStyle: 'short',\n },\n 'month-short': {\n month: 'short',\n },\n 'date-medium': {\n dateStyle: 'medium',\n },\n 'date-time': {\n dateStyle: 'short',\n timeStyle: 'short',\n },\n 'date-time-medium': {\n dateStyle: 'medium',\n timeStyle: 'short',\n },\n time: {\n timeStyle: 'short',\n },\n 'weekday-day': {\n weekday: 'short',\n day: 'numeric',\n },\n },\n en: {\n short: {\n dateStyle: 'short',\n },\n 'month-short': {\n month: 'short',\n },\n 'date-medium': {\n dateStyle: 'medium',\n },\n 'date-time': {\n dateStyle: 'short',\n timeStyle: 'short',\n },\n 'date-time-medium': {\n dateStyle: 'medium',\n timeStyle: 'short',\n },\n time: {\n timeStyle: 'short',\n },\n 'weekday-day': {\n weekday: 'short',\n day: 'numeric',\n },\n },\n },\n})\n\n/**\n * `onResponse` hook for the better-auth clients. better-auth writes its error\n * messages in English only, so the `message` of an error response is replaced\n * by the translation of its code (`errors.<CODE>`), and every `error.message`\n * a page shows arrives in the user's language. A code with no translation\n * keeps better-auth's text, the `YOU_ARE_NOT_ALLOWED_TO_*` codes share one\n * message, a 429 reads as `errors.TOO_MANY_REQUESTS` whatever its body, and a\n * body that is not JSON (a proxy's page) gets the generic error instead of no\n * message. It never throws: a failure leaves the response as it came.\n */\nexport async function translateAuthError({\n response,\n}: {\n response: Response\n}): Promise<Response | undefined> {\n if (response.ok) {\n return\n }\n try {\n let body: Record<string, unknown> | undefined\n try {\n const parsed = await response.clone().json()\n body = parsed && typeof parsed === 'object' ? parsed : {}\n } catch {\n body = undefined\n }\n const code = typeof body?.code === 'string' ? body.code : undefined\n let key = `errors.${code}`\n if (response.status === 429) {\n key = 'errors.TOO_MANY_REQUESTS'\n } else if (code?.startsWith('YOU_ARE_NOT_ALLOWED_TO_')) {\n key = 'errors.NOT_ALLOWED'\n } else if (!body) {\n key = 'auth.genericError'\n }\n if (!i18n.global.te(key)) {\n return\n }\n return new Response(\n JSON.stringify({ ...body, message: i18n.global.t(key) }),\n {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n },\n )\n } catch {\n return\n }\n}\n","import type { MaybeRefOrGetter } from 'vue'\nimport type {\n BetterAuthClientOptions,\n BetterAuthClientPlugin,\n} from 'better-auth/client'\nimport type { AdditionalFieldsOptions } from 'auth/src/additional-fields'\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n ref,\n watch,\n toValue,\n} from 'vue'\nimport { createAuthClient } from 'better-auth/vue'\nimport {\n inferAdditionalFields,\n anonymousClient,\n} from 'better-auth/client/plugins'\nimport { translateAuthError } from 'i18n'\nimport {\n getSessionCookie,\n setSessionCookie,\n getAnonymousReauthProofCookie,\n setAnonymousReauthProofCookie,\n clearAnonymousReauthProofCookie,\n DEFAULT_BACKEND_URL,\n AUTH_BASE_PATH,\n} from '~/utils'\n\nfunction anonymousReauthClient() {\n return {\n id: 'anonymous-reauth' as const,\n getActions: ($fetch) => ({\n signIn: {\n /** A new session for the anonymous user the proof names. */\n anonymousReauth: async (data: { proof: string }) => {\n return $fetch<{\n token: string\n user: Record<string, unknown>\n }>('/sign-in/anonymous-reauth', {\n method: 'POST',\n body: data,\n })\n },\n },\n anonymousReauth: {\n /** The proof that brings the current anonymous user back. */\n proof: async () => {\n return $fetch<{ proof: string }>(\n '/anonymous-reauth/proof',\n {\n method: 'GET',\n },\n )\n },\n },\n }),\n pathMethods: {\n '/sign-in/anonymous-reauth': 'POST' as const,\n },\n } satisfies BetterAuthClientPlugin\n}\n\nfunction externalAuthClient() {\n return {\n id: 'external-auth' as const,\n getActions: ($fetch) => ({\n signIn: {\n externalToken: async (data: { token: string }) => {\n return $fetch<{\n token: string\n user: Record<string, unknown>\n }>('/sign-in/external-token', {\n method: 'POST',\n body: data,\n })\n },\n },\n externalToken: {\n /** Hands the current session a fresh token of its own user. */\n refresh: async (data: { token: string }) => {\n return $fetch<{ expiresAt: string | null }>(\n '/external-token/refresh',\n { method: 'POST', body: data },\n )\n },\n },\n }),\n pathMethods: {\n '/sign-in/external-token': 'POST' as const,\n '/external-token/refresh': 'POST' as const,\n },\n atomListeners: [\n {\n matcher: (path: string) => path === '/sign-in/external-token',\n signal: '$sessionSignal' as const,\n },\n ],\n } satisfies BetterAuthClientPlugin\n}\n\n/**\n * How long before its expiry the host is asked for a fresh external token: a\n * turn that starts after it would reach the MCP servers that take the token\n * without one.\n */\nconst EXTERNAL_TOKEN_EXPIRING_LEAD_MS = 60_000\n\n/** The shortest wait between two requests for a fresh token. */\nconst EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS = 10_000\n\n/**\n * When to ask the host for the next token, in ms from `now`, for a token\n * that expires at `expiresAt` (seconds, the `exp` claim). A minute before\n * the expiry, but never before half of the time left, nor within ten\n * seconds: a token that lives a minute or less, or a browser clock running\n * ahead of the provider's, would otherwise have the host asked again as soon\n * as it answers. Nothing for a token already expired here: asking cannot\n * help it.\n */\nexport function externalTokenExpiringDelay(\n expiresAt: number,\n now: number = Date.now(),\n): number | undefined {\n const remaining = expiresAt * 1000 - now\n if (remaining <= 0) {\n return undefined\n }\n return Math.max(\n remaining - EXTERNAL_TOKEN_EXPIRING_LEAD_MS,\n remaining / 2,\n EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS,\n )\n}\n\n/**\n * The claims of a JWT, read without verifying it: enough to tell whether two\n * tokens name the same person and when one expires. The backend verifies\n * every token it is given.\n */\nfunction readTokenClaims(\n jwt: string,\n): { iss?: string; sub?: string; exp?: number } | undefined {\n const [, payload] = jwt.split('.')\n if (!payload) {\n return undefined\n }\n try {\n const base64 = payload.replace(/-/g, '+').replace(/_/g, '/')\n return JSON.parse(atob(base64))\n } catch {\n return undefined\n }\n}\n\n/** Same issuer and subject: a fresh token of the same person. */\nfunction isSameIdentity(a: string, b: string): boolean {\n const left = readTokenClaims(a)\n const right = readTokenClaims(b)\n return (\n !!left?.iss &&\n !!left.sub &&\n left.iss === right?.iss &&\n left.sub === right?.sub\n )\n}\n\n/**\n * The `type` better-auth's `oauthPopup` completion page posts. Written here\n * rather than imported: `better-auth/plugins` would pull every server plugin\n * into the widget bundle.\n */\nconst OAUTH_POPUP_MESSAGE_TYPE = 'better-auth:oauth-popup'\n\n/**\n * A random nonce tying the popup's answer to the call that opened it.\n * `getRandomValues` rather than `randomUUID`, which only exists on pages\n * served over HTTPS.\n */\nfunction createPopupNonce(): string {\n const bytes = crypto.getRandomValues(new Uint8Array(16))\n return Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')\n}\n\ntype AuthClientOptions = {\n baseURL?: string\n basePath?: string\n plugins: [\n ReturnType<typeof inferAdditionalFields<AdditionalFieldsOptions>>,\n ReturnType<typeof anonymousClient>,\n ReturnType<typeof anonymousReauthClient>,\n ReturnType<typeof externalAuthClient>,\n ]\n}\n\nexport type AuthClient = ReturnType<typeof createAuthClient<AuthClientOptions>>\n\ntype ClientFetchOptions = NonNullable<BetterAuthClientOptions['fetchOptions']>\n\nexport function useChatbotAuth(\n options: {\n baseUrl?: string\n basePath?: string\n externalToken?: MaybeRefOrGetter<string | undefined>\n awaitExternalToken?: boolean\n /**\n * Host-session mode: the widget never signs in on its own and sends\n * no Authorization header; the session comes from the host\n * platform's better-auth cookie (sent thanks to\n * `credentials: 'include'`). The session belongs to the host, so\n * account management is hidden and `signOut` is a no-op. Intended\n * for the widget embedded in the platform itself (Backoffice\n * copilot, spec platform-copilot-session-bridge.md); it only works\n * where the host cookie context works, not on third-party embeds.\n */\n useHostSession?: MaybeRefOrGetter<boolean | undefined>\n isActive?: MaybeRefOrGetter<boolean>\n cookieName?: string\n /** Called when a session is established or the user changes. */\n onSignedIn?: (detail: { userId: string; isAnonymous: boolean }) => void\n /** Called when the session ends without an immediate replacement. */\n onSignedOut?: () => void\n /**\n * Called when an external token sign-in fails (expired token, invalid\n * signature or disabled config): the host should provide a fresh token.\n */\n onExternalAuthExpired?: () => void\n /**\n * Called a minute before the external token of the session expires,\n * while the session goes on: the host should provide a fresh token,\n * which the session takes in place. The MCP servers that receive the\n * user's token need a valid one on every turn.\n */\n onExternalTokenExpiring?: () => void\n } = {},\n) {\n const _token = ref(getSessionCookie(options.cookieName))\n const useHostSession = computed(\n () => toValue(options.useHostSession) ?? false,\n )\n\n const token = computed({\n get: () => _token.value,\n set: (token: string) => {\n setSessionCookie(token, options.cookieName)\n _token.value = token\n },\n })\n\n const headers = computed<Record<string, string>>(() => ({\n // The widget's channel, which the backend reads from the Origin\n // except on the portal: there Agent Studio embeds this widget as its\n // assistant, and the origin alone would make it the App page.\n 'X-Agent-Channel': 'widget',\n ...(!useHostSession.value && token.value\n ? { Authorization: `Bearer ${token.value}` }\n : {}),\n }))\n\n // Both fetch callbacks are typed by hand. createAuthClient is generic over\n // its options and TypeScript defers context-sensitive functions inside a\n // generic argument until inference is done, by which point the inferred\n // options type no longer carries them and their parameters fall to\n // implicit any. Annotating them with the public option type restores the\n // contextual type without touching how the client itself is inferred.\n const onFetchSuccess: NonNullable<ClientFetchOptions['onSuccess']> = (\n ctx,\n ) => {\n if (useHostSession.value) {\n // The host session token must never be persisted as the widget's\n // own Bearer: it would keep impersonating the host after the mode\n // is turned off.\n return\n }\n const newTokenFromHeader = ctx.response.headers.get('set-auth-token')\n if (newTokenFromHeader) {\n token.value = newTokenFromHeader\n }\n }\n\n // Only host-session mode may exchange cookies: with credentials on, an\n // anonymous sign-in's Set-Cookie would REPLACE the user's platform session\n // cookie on the backend origin. better-auth's client asks for them on\n // every call, so the other modes leave them out here: passing its\n // `include` on, the widget's first visit to a site signed the same\n // browser out of Agent Studio (copilot bench, 2026-10-28).\n const customFetchImpl: NonNullable<\n ClientFetchOptions['customFetchImpl']\n > = (input, init) =>\n fetch(input, {\n ...init,\n credentials: useHostSession.value ? 'include' : 'omit',\n })\n\n const client = createAuthClient({\n baseURL: options.baseUrl ?? DEFAULT_BACKEND_URL,\n basePath: options.basePath ?? AUTH_BASE_PATH,\n plugins: [\n inferAdditionalFields<AdditionalFieldsOptions>(),\n anonymousClient(),\n anonymousReauthClient(),\n externalAuthClient(),\n ],\n fetchOptions: {\n onSuccess: onFetchSuccess,\n onResponse: translateAuthError,\n auth: {\n type: 'Bearer',\n // Host-session mode relies on the cookie alone: the widget's\n // stored Bearer (e.g. a previous anonymous session) would\n // shadow it.\n token: () => (useHostSession.value ? '' : token.value),\n },\n customFetchImpl,\n },\n }) as AuthClient\n\n const session = client.useSession()\n const isAuthenticating = ref(false)\n const externalToken = computed(() => toValue(options.externalToken))\n const isActive = computed(() => toValue(options.isActive) ?? true)\n\n /**\n * External token currently authorized for automatic (re-)authentication.\n * Follows the `externalToken` option and imperative sign-in calls; cleared\n * by `signOut`, so the watchers never re-login with a token the host has\n * withdrawn.\n */\n const activeExternalToken = ref(externalToken.value)\n\n // External token / host-session mode: the host application owns the auth\n // lifecycle, so the widget must not offer account management (sign-out,\n // profile).\n const isExternalAuth = computed(\n () =>\n !!externalToken.value ||\n !!options.awaitExternalToken ||\n !!activeExternalToken.value ||\n useHostSession.value,\n )\n\n /**\n * Serializes sign-in operations: a request arriving while another is in\n * flight runs right after it instead of being dropped. Each task re-checks\n * state when it starts, so superseded requests no-op.\n */\n let authChain: Promise<void> = Promise.resolve()\n function runExclusiveAuth(task: () => Promise<void>): Promise<void> {\n const run = authChain.then(task, task)\n authChain = run\n return run\n }\n\n // Notify the host on session transitions, whatever flow caused them\n // (anonymous, external token, email, social).\n watch(\n () => session.value.data?.user,\n (user, previousUser) => {\n if (user && user.id !== previousUser?.id) {\n options.onSignedIn?.({\n userId: user.id,\n isAnonymous: !!user.isAnonymous,\n })\n }\n if (!user && previousUser) {\n options.onSignedOut?.()\n }\n },\n )\n\n /** The users whose proof this page already asked for. */\n const reauthProofRequested = new Set<string>()\n\n /** Whether the stored proof is one of the anonymous user `userId`. */\n function holdsReauthProofOf(userId: string): boolean {\n return getAnonymousReauthProofCookie(options.cookieName).startsWith(\n `${userId}.`,\n )\n }\n\n /**\n * Asks the backend for the proof that brings the current anonymous user\n * back once its session expires, and keeps it. Asked once per user and\n * page, so a refusal does not loop: without a proof the visitor keeps the\n * session and only loses the way back after it.\n */\n async function storeReauthProof(userId: string): Promise<void> {\n if (reauthProofRequested.has(userId)) {\n return\n }\n reauthProofRequested.add(userId)\n try {\n const { data } = await client.anonymousReauth.proof()\n // The session may have changed while the request was in flight.\n if (data?.proof?.startsWith(`${userId}.`)) {\n setAnonymousReauthProofCookie(data.proof, options.cookieName)\n }\n } catch {\n // Best effort, as above.\n }\n }\n\n async function signInAnonymously(): Promise<void> {\n const { data } = await client.signIn.anonymous()\n if (data?.token) {\n token.value = data.token\n if (data.user?.id) {\n await storeReauthProof(data.user.id as string)\n }\n }\n }\n\n /**\n * Attempts to create a new session for an existing anonymous user.\n * Returns true if re-auth succeeded, false otherwise.\n */\n async function tryAnonymousReauth(): Promise<boolean> {\n const proof = getAnonymousReauthProofCookie(options.cookieName)\n if (!proof) {\n return false\n }\n if (!proof.includes('.')) {\n // A bare user id, stored before the proof existed: the backend\n // refuses it, so it is not even sent.\n clearAnonymousReauthProofCookie(options.cookieName)\n return false\n }\n try {\n const { data } = await client.signIn.anonymousReauth({ proof })\n if (data?.token) {\n token.value = data.token\n await session.value.refetch()\n return true\n }\n } catch {\n // The user may have been deleted: fall back to a new one.\n }\n return false\n }\n\n /** Re-authenticates the stored anonymous user, or creates a fresh one. */\n async function reauthOrSignInAnonymously(): Promise<void> {\n const reauthed = await tryAnonymousReauth()\n if (!reauthed) {\n await signInAnonymously()\n }\n }\n\n /**\n * The external token was rejected (expired, invalid or config disabled):\n * notify the host so it can provide a fresh one, then apply the fallback\n * (keep waiting in `awaitExternalToken` mode, anonymous otherwise).\n */\n async function handleExternalTokenFailure(\n failedExternalToken: string,\n ): Promise<void> {\n if (activeExternalToken.value !== failedExternalToken) {\n // Withdrawn (sign-out) or replaced while the request was in flight\n return\n }\n options.onExternalAuthExpired?.()\n if (options.awaitExternalToken) {\n return\n }\n // The anonymous session that takes over carries no external token:\n // nothing to refresh, nobody to ask before it expires.\n trackSessionExternalToken(undefined)\n await reauthOrSignInAnonymously()\n }\n\n /**\n * The external token the current session was opened, or last refreshed,\n * with: the one the backend hands the MCP servers that take it. Unknown\n * for a session restored from the cookie.\n */\n let sessionExternalToken: string | undefined\n /** The session (its Bearer) the token above belongs to. */\n let sessionExternalTokenOwner: string | undefined\n let expiringTimer: ReturnType<typeof setTimeout> | undefined\n\n /**\n * The external token of the session in use, or nothing once another\n * session took its place (another user, an email or social sign-in): what\n * was recorded for the previous one must neither be refreshed nor asked\n * for again.\n */\n function currentSessionExternalToken(): string | undefined {\n return sessionExternalTokenOwner === token.value\n ? sessionExternalToken\n : undefined\n }\n\n /** Records the session's token and asks for the next one before it expires. */\n function trackSessionExternalToken(value: string | undefined): void {\n sessionExternalToken = value\n sessionExternalTokenOwner = value ? token.value : undefined\n clearTimeout(expiringTimer)\n expiringTimer = undefined\n const expiresAt = value ? readTokenClaims(value)?.exp : undefined\n const delay =\n typeof expiresAt === 'number'\n ? externalTokenExpiringDelay(expiresAt)\n : undefined\n if (delay === undefined || !options.onExternalTokenExpiring) {\n return\n }\n expiringTimer = setTimeout(() => {\n if (currentSessionExternalToken() === value) {\n options.onExternalTokenExpiring?.()\n }\n }, delay)\n }\n\n if (getCurrentScope()) {\n onScopeDispose(() => clearTimeout(expiringTimer))\n }\n\n /**\n * Hands the current session a fresh token of its own user, without\n * opening another session. False when the backend refuses it (another\n * person, an invalid token, no session any more): a full sign-in follows.\n */\n async function refreshSessionExternalToken(\n newExternalToken: string,\n ): Promise<boolean> {\n try {\n const { error } = await client.externalToken.refresh({\n token: newExternalToken,\n })\n if (error) {\n return false\n }\n // Withdrawn (sign-out) or replaced while the request was in\n // flight: nothing to track, and nobody to ask for the next one.\n if (activeExternalToken.value === newExternalToken) {\n trackSessionExternalToken(newExternalToken)\n }\n return true\n } catch {\n return false\n }\n }\n\n /** Raw token exchange; must run inside `runExclusiveAuth`. */\n async function exchangeExternalToken(\n newExternalToken: string,\n ): Promise<void> {\n isAuthenticating.value = true\n try {\n // A fresh token of the person already signed in: the session\n // takes it in place, instead of being replaced by another one.\n const tracked = currentSessionExternalToken()\n if (\n session.value.data &&\n tracked &&\n isSameIdentity(tracked, newExternalToken)\n ) {\n if (await refreshSessionExternalToken(newExternalToken)) {\n return\n }\n if (activeExternalToken.value !== newExternalToken) {\n // Withdrawn (sign-out) or replaced while the refresh was\n // in flight: no sign-in with a token nobody wants.\n return\n }\n }\n const { data } = await client.signIn.externalToken({\n token: newExternalToken,\n })\n if (activeExternalToken.value !== newExternalToken) {\n // Withdrawn (sign-out) or replaced while the request was in flight\n return\n }\n if (data?.token) {\n token.value = data.token\n trackSessionExternalToken(newExternalToken)\n await session.value.refetch()\n return\n }\n await handleExternalTokenFailure(newExternalToken)\n } catch {\n await handleExternalTokenFailure(newExternalToken)\n } finally {\n isAuthenticating.value = false\n }\n }\n\n /** External token currently queued or in flight, to drop duplicate requests. */\n let pendingExternalToken: string | undefined\n\n /**\n * Last external token an exchange was attempted with, whatever the\n * trigger. The session watcher consults it so a token that was already\n * tried is never auto-retried: a rejected token must not loop between\n * exchange and fallback. Deliberate retries (prop change, imperative\n * `signIn`, 401 handler) bypass it.\n */\n let attemptedExternalToken: string | undefined\n\n /** The cookie-restored external session was reconciled with the host state. */\n let externalSessionReconciled = false\n\n async function signInWithExternalToken(\n newExternalToken: string,\n ): Promise<void> {\n if (!newExternalToken || pendingExternalToken === newExternalToken) {\n return\n }\n activeExternalToken.value = newExternalToken\n attemptedExternalToken = newExternalToken\n pendingExternalToken = newExternalToken\n try {\n await runExclusiveAuth(async () => {\n if (activeExternalToken.value !== newExternalToken) {\n // Superseded while waiting for the previous operation\n return\n }\n await exchangeExternalToken(newExternalToken)\n })\n } finally {\n pendingExternalToken = undefined\n }\n }\n\n async function signInAnonymouslyWithFallback(): Promise<void> {\n if (isAuthenticating.value) {\n // The `[isActive, session]` watcher retries on the next session change\n return\n }\n await runExclusiveAuth(async () => {\n if (activeExternalToken.value || useHostSession.value) {\n // A host-owned sign-in was requested in the meantime\n return\n }\n isAuthenticating.value = true\n try {\n await reauthOrSignInAnonymously()\n } finally {\n isAuthenticating.value = false\n }\n })\n }\n\n watch(\n [isActive, session],\n ([newIsActive, newSession]) => {\n if (!newIsActive) {\n return\n }\n if (\n !newSession.isPending &&\n !newSession.isRefetching &&\n !isAuthenticating.value &&\n !newSession.data\n ) {\n if (useHostSession.value) {\n // Host-session mode: the session comes from the host\n // cookie, the widget never signs in on its own. No\n // session means the host is not (or no longer) logged in.\n return\n }\n if (activeExternalToken.value) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n if (options.awaitExternalToken) {\n return\n }\n signInAnonymouslyWithFallback()\n return\n }\n\n const user = newSession.data?.user\n\n if (useHostSession.value) {\n // Host-session mode: the session is read from (and owned by)\n // the host cookie, none of the widget-session housekeeping\n // below applies.\n return\n }\n\n // A session created by an external token exchange (the only kind\n // with `hardExpiresAt`) may have been restored from the cookie\n // after a page navigation, where prop changes cannot be observed:\n // reconcile it once with the auth state the host declares now.\n if (\n newSession.data?.session?.hardExpiresAt &&\n !externalSessionReconciled\n ) {\n externalSessionReconciled = true\n if (!activeExternalToken.value) {\n // The host no longer provides a token (it logged out\n // before this page load): drop the stale session. The\n // usual fallback rules apply (keep waiting in\n // `awaitExternalToken` mode, anonymous otherwise).\n signOut()\n return\n }\n if (attemptedExternalToken !== activeExternalToken.value) {\n // Re-exchange the current token, so a token minted for a\n // different user replaces the restored session and an\n // expired one raises `external-auth-expired` right away.\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n }\n\n // A fresh token the host handed while the widget was inactive:\n // the session takes it now, before a turn needs it. The exchange\n // refreshes it in place when it names the same person. Attempted\n // once per token, so a refused one does not loop.\n const tracked = currentSessionExternalToken()\n if (\n user &&\n !user.isAnonymous &&\n tracked &&\n activeExternalToken.value &&\n activeExternalToken.value !== tracked &&\n attemptedExternalToken !== activeExternalToken.value\n ) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n\n // Upgrade an anonymous session restored from the cookie when an\n // external token is available (e.g. the user logged into the host\n // app between page loads). Attempted once per token.\n if (\n user?.isAnonymous &&\n activeExternalToken.value &&\n attemptedExternalToken !== activeExternalToken.value\n ) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n\n // Backfill the proof of an anonymous session that has none, or\n // only the bare user id stored before the proof existed: a live\n // session is what the backend hands a proof to.\n if (\n user?.isAnonymous &&\n user.id &&\n !holdsReauthProofOf(user.id as string)\n ) {\n storeReauthProof(user.id as string)\n }\n },\n { immediate: true },\n )\n\n // Host-session mode toggle: on entry re-read the session from the host\n // cookie (the widget Bearer is already suppressed by the mode); on exit\n // re-read without the cookie, so the `[isActive, session]` watcher\n // re-establishes the widget's own flow (anonymous or external token).\n watch(useHostSession, () => {\n session.value.refetch()\n })\n\n watch(externalToken, (newToken, previousToken) => {\n if (newToken) {\n // Track the intent even when inactive: the `[isActive, session]`\n // watcher signs in with it once the widget becomes active.\n activeExternalToken.value = newToken\n if (isActive.value) {\n signInWithExternalToken(newToken)\n }\n return\n }\n // The host withdrew the token (logged out): sign out without\n // re-authenticating; the fallback rules apply (keep waiting in\n // `awaitExternalToken` mode, anonymous otherwise).\n if (previousToken && activeExternalToken.value === previousToken) {\n signOut()\n }\n })\n\n function onError(error: { type: string; title: string; status: number }) {\n if (error.status !== 401) {\n return\n }\n if (useHostSession.value) {\n // The widget cannot recover a host session on its own (a 401\n // here means the host session expired): re-read it so the UI\n // reflects the signed-out state.\n session.value.refetch()\n return\n }\n if (activeExternalToken.value) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n if (options.awaitExternalToken) {\n return\n }\n signInAnonymouslyWithFallback()\n }\n\n const userId = computed(() => session.value.data?.user?.id)\n\n /**\n * The second step of an email sign-in for an account with two-step\n * verification (docs/specs/released/two-factor-authentication.md, D4). better-auth\n * keeps the challenge in a cookie, which a cross-origin widget never\n * holds: the backend hands its value over in the sign-in answer and takes\n * it back in a header.\n */\n const twoFactorChallenge = ref<{ token: string; methods: string[] }>()\n\n // Auth methods for widget login screen\n async function signInWithEmail(\n email: string,\n password: string,\n rememberMe?: boolean,\n ) {\n const result = await client.signIn.email({\n email,\n password,\n rememberMe,\n })\n const challenge = result.data as {\n twoFactorRedirect?: boolean\n twoFactorToken?: string | null\n twoFactorMethods?: string[]\n } | null\n if (challenge?.twoFactorRedirect) {\n twoFactorChallenge.value = challenge.twoFactorToken\n ? {\n token: challenge.twoFactorToken,\n methods: challenge.twoFactorMethods ?? [],\n }\n : undefined\n // The anonymous user stays until the code is verified (D9 of the\n // two-factor spec): its proof goes in `verifyTwoFactor`, so a\n // challenge left behind keeps the way back to its chats.\n return result\n }\n // Capture the session token from the response body. Relying solely on\n // the `set-auth-token` header is unreliable here, so we mirror the\n // anonymous/social flows and store the token explicitly.\n if (result.data?.token) {\n token.value = result.data.token\n // Signing in from an anonymous session links (and deletes) the\n // anonymous user server-side, so its stored proof no longer brings\n // anyone back: drop it so a later sign-out falls straight back to\n // a fresh anonymous session.\n clearAnonymousReauthProofCookie(options.cookieName)\n }\n return result\n }\n\n const TWO_FACTOR_PATHS = {\n totp: '/two-factor/verify-totp',\n otp: '/two-factor/verify-otp',\n backup: '/two-factor/verify-backup-code',\n } as const\n\n /** Fetch options of a request that answers the challenge in flight. */\n function twoFactorRequest(challenge: { token: string }) {\n return {\n method: 'POST' as const,\n headers: { 'x-two-factor-token': challenge.token },\n // No bearer: the challenge is the identity of this request, and a\n // session token would turn it into a verification of that session.\n auth: { type: 'Bearer' as const, token: '' },\n }\n }\n\n const lostChallenge = {\n data: null,\n error: { code: 'INVALID_TWO_FACTOR_COOKIE', message: undefined },\n }\n\n /** Answers the challenge with a code of the app, the email or a backup code. */\n async function verifyTwoFactor(\n kind: keyof typeof TWO_FACTOR_PATHS,\n code: string,\n ) {\n const challenge = twoFactorChallenge.value\n if (!challenge) {\n return lostChallenge\n }\n const result = await client.$fetch<{ token?: string }>(\n TWO_FACTOR_PATHS[kind],\n { ...twoFactorRequest(challenge), body: { code } },\n )\n if (result.data?.token) {\n token.value = result.data.token\n twoFactorChallenge.value = undefined\n // The verification linked and deleted the anonymous user, as an\n // email sign-in without a second factor does.\n clearAnonymousReauthProofCookie(options.cookieName)\n }\n return result\n }\n\n /** Sends the code by email, for an account whose factor is the email. */\n async function sendTwoFactorCode() {\n const challenge = twoFactorChallenge.value\n if (!challenge) {\n return lostChallenge\n }\n return client.$fetch<{ status: boolean }>(\n '/two-factor/send-otp',\n twoFactorRequest(challenge),\n )\n }\n\n /** Back to the sign-in form: the challenge left behind simply expires. */\n function cancelTwoFactor() {\n twoFactorChallenge.value = undefined\n }\n\n function signUpWithEmail(params: {\n email: string\n password: string\n name: string\n }) {\n return client.signUp.email(params)\n }\n\n function requestPasswordReset(email: string, redirectTo: string) {\n return client.requestPasswordReset({ email, redirectTo })\n }\n\n /**\n * Opens a popup for social OAuth sign-in.\n *\n * The popup navigates top-level to better-auth's `/oauth-popup/start` on\n * the backend origin, so the OAuth `state` cookie is set first-party there\n * and survives the round trip (a cross-origin XHR `signIn.social` would set\n * it as a third-party cookie that browsers drop, causing `state_mismatch`).\n * The server binds the flow to this page's origin and, on the callback,\n * posts the token of the session it just created to that origin only. The\n * message is taken only from the popup this call opened, from the backend\n * origin, carrying the nonce this call generated.\n *\n * better-auth's own `signIn.popup` is not used: it keeps the token to\n * itself, and the widget authenticates with its own stored Bearer.\n */\n async function signInWithSocialPopup(\n provider: 'google' | 'microsoft',\n onAuthSuccess?: () => void,\n ): Promise<{ popupBlocked: boolean }> {\n const baseUrl = options.baseUrl ?? DEFAULT_BACKEND_URL\n const basePath = options.basePath ?? AUTH_BASE_PATH\n const nonce = createPopupNonce()\n const startUrl = new URL(`${baseUrl}/${basePath}/oauth-popup/start`)\n startUrl.searchParams.set('provider', provider)\n startUrl.searchParams.set('popupOrigin', window.location.origin)\n startUrl.searchParams.set('popupNonce', nonce)\n\n const popup = window.open(\n startUrl.toString(),\n 'eightwave-oauth',\n 'width=600,height=700,menubar=no,toolbar=no',\n )\n\n if (!popup) {\n return { popupBlocked: true }\n }\n\n return new Promise((resolve) => {\n const allowedOrigin = new URL(baseUrl).origin\n // Resolve too if the user closes the popup without completing OAuth.\n const closedPollId = setInterval(() => {\n if (popup?.closed) {\n finish()\n }\n }, 500)\n\n function finish() {\n window.removeEventListener('message', onOAuthMessage)\n clearInterval(closedPollId)\n resolve({ popupBlocked: false })\n }\n\n function onOAuthMessage(event: MessageEvent) {\n const isTrustedOAuthMessage =\n event.origin === allowedOrigin &&\n event.source === popup &&\n event.data?.type === OAUTH_POPUP_MESSAGE_TYPE &&\n event.data.nonce === nonce\n if (!isTrustedOAuthMessage) {\n return\n }\n popup?.close()\n // A refusal or a failure at the provider comes back as\n // `error`, with no token: the user simply stays as they were.\n if (typeof event.data.token === 'string' && event.data.token) {\n token.value = event.data.token\n // Unlike the email flow, the anonymous user was not\n // linked: the popup's callback carries neither its bearer\n // nor its cookie (see the auth-and-tenancy gotchas). Its\n // proof stays, so a sign-out leads back to its chats.\n session.value.refetch().then(() => onAuthSuccess?.())\n }\n finish()\n }\n\n window.addEventListener('message', onOAuthMessage)\n })\n }\n\n /**\n * Signs the current user out and clears the locally stored session token.\n * Withdraws the active external token first, so the watchers never\n * re-authenticate with it: in external mode the host signs the widget back\n * in (prop change or `signInWithExternalToken`), while in the other modes\n * the `[isActive, session]` watcher re-establishes an anonymous session\n * (re-using the stored anonymous reauth proof when present).\n */\n async function signOut(): Promise<void> {\n if (useHostSession.value) {\n // The session belongs to the host application (cookie): revoking\n // it from the widget would log the user out of the host too.\n // Leaving host-session mode is the host's move (prop change).\n return\n }\n activeExternalToken.value = undefined\n trackSessionExternalToken(undefined)\n const revokedToken = token.value\n try {\n await client.signOut()\n } finally {\n // A concurrent exchange may have stored a fresh session token\n // while the revoke request was in flight (e.g. a host `signIn`\n // racing the mount-time reconcile): only clear our own token,\n // never the newer one.\n if (token.value === revokedToken) {\n token.value = ''\n }\n await session.value.refetch()\n }\n }\n\n return {\n client,\n session,\n isAuthenticating,\n isExternalAuth,\n token,\n headers,\n onError,\n userId,\n signInWithEmail,\n twoFactorChallenge,\n verifyTwoFactor,\n sendTwoFactorCode,\n cancelTwoFactor,\n signUpWithEmail,\n requestPasswordReset,\n signInSocial: client.signIn.social,\n signInWithSocialPopup,\n signInWithExternalToken,\n signOut,\n }\n}\n","import { getCurrentInstance, onBeforeUnmount, onMounted } from 'vue'\n\n/**\n * Prevents external focus-trapping libraries (e.g. Bootstrap 5 modals) from\n * stealing focus away from elements inside this custom element's shadow root.\n *\n * Bootstrap modals attach a `focusin` listener on `document` that pulls focus\n * back whenever it leaves the modal subtree. Because our custom element lives\n * outside the modal in the DOM, every focus event that escapes the shadow root\n * is treated as a \"focus escape\" and gets redirected back into the modal.\n *\n * Fix: intercept `focusin` at the shadow root boundary in the **bubble phase**\n * and stop its propagation. The event still reaches every internal element\n * normally (capture → target → bubble up through the shadow tree), but is\n * stopped at the shadow root before it can re-target and continue to `document`.\n *\n * Must be called inside a `.ce.vue` root component's `<script setup>`.\n */\nexport function useFocusTrapBypass() {\n let shadowRoot: ShadowRoot | null = null\n\n const stopFocusPropagation = (event: Event) => {\n event.stopPropagation()\n }\n\n onMounted(() => {\n const instance = getCurrentInstance()\n const rootNode = instance?.proxy?.$el?.getRootNode()\n\n if (!(rootNode instanceof ShadowRoot)) {\n return\n }\n\n shadowRoot = rootNode\n shadowRoot.addEventListener('focusin', stopFocusPropagation)\n })\n\n onBeforeUnmount(() => {\n if (!shadowRoot) {\n return\n }\n\n shadowRoot.removeEventListener('focusin', stopFocusPropagation)\n shadowRoot = null\n })\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAMY,IAAsB,iBAItBC,IAA6B,QAC7BC,IAAmB;AAEzB,SAASC,EAAU,GAAc,GAAe,GAAgB;CAC5D,IAAI;EAKA,SAAS,SAAS,GAAGC,EAAK,GAAGC,EAAM,oBAAoBC,IADnDA,IAAS,IAAI,KAAK,0CACkD;CAC5E,SAASC,GAAO;EACZ,EAAO,KACH,iEACAA,CACJ;CACJ;AACJ;AAEA,SAASC,EAAU,GAAsB;CACrC,IAAI;EAIA,IAAMC,IAAS,GAAGL,EAAK,IACjBM,IAAM,SAAS,OAChB,MAAM,IAAI,CAAC,CACX,MAAM,MAAUC,EAAM,WAAWF,CAAM,CAAC;EAC7C,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,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,uBAAuB;GAC3B;EACJ;EACA,IAAI;GACA,aAAa;IACT,OAAO;IACP,UAAU;IACV,cAAc;IACd,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,aAAa;IACT,OAAO;IACP,UAAU;IACV,cAAc;IACd,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,KAAK;IACD,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,KAAK;IACD,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,uBAAuB;GAC3B;EACJ;CACJ;CACA,iBAAiB;EACb,IAAI;GACA,OAAO,EACH,WAAW,QACf;GACA,eAAe,EACX,OAAO,QACX;GACA,eAAe,EACX,WAAW,SACf;GACA,aAAa;IACT,WAAW;IACX,WAAW;GACf;GACA,oBAAoB;IAChB,WAAW;IACX,WAAW;GACf;GACA,MAAM,EACF,WAAW,QACf;GACA,eAAe;IACX,SAAS;IACT,KAAK;GACT;EACJ;EACA,IAAI;GACA,OAAO,EACH,WAAW,QACf;GACA,eAAe,EACX,OAAO,QACX;GACA,eAAe,EACX,WAAW,SACf;GACA,aAAa;IACT,WAAW;IACX,WAAW;GACf;GACA,oBAAoB;I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AAevyD,EAAM;EAC3B,IAAI;GACA,MAAMwtD,EAAO,QAAQ;EACzB,UAAU;GAQN,AAHIxtD,EAAM,UAAUuyD,MAChB,EAAM,QAAQ,KAElB,MAAMvE,EAAQ,MAAM,QAAQ;EAChC;CACJ;CAEA,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAcR,EAAO,OAAO;EAC5B;EACA;EACA;CACJ;AACJ;;AC/gCA,SAAgBgF,IAAqB;CACjC,IAAIC,IAAgC,MAE9BC,KAAwB,MAAiB;EAC3C,EAAM,gBAAgB;CAC1B;CAcA,AAZAC,QAAgB;EAEZ,IAAMC,IADWC,EACA,CAAA,EAAU,OAAO,KAAK,YAAY;EAEnD,AAAMD,aAAoB,eAI1B,IAAaA,GACbH,EAAW,iBAAiB,WAAWC,CAAoB;CAC/D,CAAC,GAEDI,QAAsB;EAClB,AAKAL,OADAA,EAAW,oBAAoB,WAAWC,CAAoB,GACjD;CACjB,CAAC;AACL"}
1
+ {"version":3,"file":"composables.js","names":["it","itErrors","en","enErrors","logger","AgentWidgetLayout","AgentWidgetAppearance","createChatbotApiClient","agentThemeStyle","resolveContrastColor","useChatbotStore","useLocalizedString","DEFAULT_COOKIE_NAME","REAUTH_PROOF_COOKIE_SUFFIX","MAX_AGE_ONE_YEAR","setCookie","name","value","maxAge","error","getCookie","prefix","row","entry","setSessionCookie","cookieName","token","getSessionCookie","setAnonymousReauthProofCookie","proof","getAnonymousReauthProofCookie","clearAnonymousReauthProofCookie","resolveSetting","attribute","values","setting","fallback","LAYOUTS","APPEARANCES","resolveWidgetLayout","resolveWidgetAppearance","AUTH_BASE_PATH","DEFAULT_BACKEND_URL","useChatbotAgent","agent","ref","branding","authMethods","deploymentCss","deployment","requiresAuth","notFound","isLoading","load","orgSlug","toValue","options","agentId","apiClient","result","watch","source","computed","contrastColor","mainColor","theme","systemTheme","it_default$1","\"accept\"","\"acceptPageAccessRisk\"","\"acceptRedundancy\"","\"activate\"","\"add\"","\"addExistingDocument\"","\"addField\"","\"addFieldMapping\"","\"addHint\"","\"addIntegration\"","\"addMember\"","\"addNestedField\"","\"addToCalendar\"","\"allDocuments\"","\"analyzeChat\"","\"apply\"","\"ask\"","\"attachFile\"","\"automaticConfirmations\"","\"back\"","\"backToAgent\"","\"backToDocuments\"","\"backToHome\"","\"backToSignIn\"","\"ban\"","\"blockChat\"","\"cancel\"","\"cancelInvitation\"","\"change\"","\"changeAgent\"","\"changeRole\"","\"check\"","\"clear\"","\"clearSearch\"","\"close\"","\"closeChat\"","\"closeSidebar\"","\"collapse\"","\"compare\"","\"connect\"","\"continue\"","\"copied\"","\"copy\"","\"copyLink\"","\"crawl\"","\"create\"","\"createAgent\"","\"createApiKey\"","\"createDocument\"","\"createFolder\"","\"createNew\"","\"createNewChat\"","\"createNotification\"","\"createRevise\"","\"createSubfolder\"","\"deactivate\"","\"decline\"","\"delete\"","\"deleteAllMemories\"","\"deleteAllNotifications\"","\"deleteFolder\"","\"deleteMyConversations\"","\"deleteMyConversationsConfirm\"","\"deleteProfile\"","\"deleteRow\"","\"deselectHint\"","\"disableAutoRefresh\"","\"disablePageAccess\"","\"disconnect\"","\"embeddingBackToPlatform\"","\"embeddingRemove\"","\"embeddingUseEndpoint\"","\"enablePageAccess\"","\"modelEndpointConnect\"","\"dismissRedundancy\"","\"documentRefreshNow\"","\"documentSetRefresh\"","\"documentSourceSettings\"","\"documentSourceSyncNow\"","\"documentSourceUnlink\"","\"download\"","\"downloadIcs\"","\"downloadTeamsApp\"","\"downvote\"","\"dropFile\"","\"dropFilesToImport\"","\"duplicate\"","\"edit\"","\"editAgent\"","\"editDocument\"","\"editRevise\"","\"editSchema\"","\"enableAutoRefresh\"","\"expand\"","\"export\"","\"exportMyData\"","\"feedback\"","\"focusMessage\"","\"foldSidebar\"","\"forgetPassword\"","\"generate\"","\"generateFromJson\"","\"getDirections\"","\"getMoreInfo\"","\"goBack\"","\"hangUp\"","\"impersonate\"","\"import\"","\"importFromCrawler\"","\"integrationCheck\"","\"integrationConnectMicrosoft\"","\"integrationConnectApp\"","\"integrationUseOwnApp\"","\"integrationAdvancedSetup\"","\"integrationDisconnect\"","\"integrationReconnect\"","\"integrationRotateSecret\"","\"invite\"","\"inviteMember\"","\"leave\"","\"link\"","\"linkExisting\"","\"linkFromProvider\"","\"loadDefaults\"","\"manageAgentAccess\"","\"manageAgentMemberAccess\"","\"manageProfile\"","\"markAllAsRead\"","\"markAsRead\"","\"moreActions\"","\"moveDown\"","\"moveHere\"","\"moveToFolder\"","\"moveUp\"","\"mute\"","\"next\"","\"open\"","\"openChat\"","\"openFilters\"","\"openInGmail\"","\"openInMailApp\"","\"openInOutlook\"","\"openInSms\"","\"openInTelegram\"","\"openInWhatsApp\"","\"openInYahooMail\"","\"openSettings\"","\"openSidebar\"","\"pan\"","\"pause\"","\"pin\"","\"playVoicePreview\"","\"prev\"","\"previewAsPage\"","\"previewAsWidget\"","\"previous\"","\"proceed\"","\"profileMenu\"","\"recoverPassword\"","\"refill\"","\"refillHistory\"","\"refresh\"","\"refreshPrices\"","\"reviewPageAccessRisk\"","\"setPrice\"","\"regenerate\"","\"remove\"","\"removeFromQueue\"","\"queueMessage\"","\"removeField\"","\"renameChat\"","\"renameFolder\"","\"reorder\"","\"reprocess\"","\"resendInvitation\"","\"reset\"","\"resetPassword\"","\"resize\"","\"resume\"","\"resumeInPlayground\"","\"retry\"","\"retryNow\"","\"revoke\"","\"revokeAllOtherSessions\"","\"revokeAllSessions\"","\"run\"","\"save\"","\"scrollToBottom\"","\"searchAllFolders\"","\"select\"","\"selectHint\"","\"selected\"","\"send\"","\"sendLink\"","\"share\"","\"shareDocumentWithAgents\"","\"showLess\"","\"showMore\"","\"showShortcuts\"","\"signIn\"","\"signInWithSocialProvider\"","\"signOut\"","\"signUp\"","\"signUpWithSocialProvider\"","\"startNewChat\"","\"stop\"","\"stopImpersonation\"","\"stopVoicePreview\"","\"submit\"","\"switch\"","\"takePhoto\"","\"talk\"","\"testIntegration\"","\"toggleIntegration\"","\"toggleSidebar\"","\"toggleTheme\"","\"unban\"","\"unblockChat\"","\"unfoldSidebar\"","\"unlinkDocument\"","\"unmute\"","\"unpin\"","\"update\"","\"upvote\"","\"useColorsForAgentHeader\"","\"view\"","\"viewAgentTree\"","\"viewAll\"","\"viewChat\"","\"viewDetails\"","\"viewDocument\"","\"viewDocuments\"","\"viewProfile\"","\"viewRecentChats\"","\"welcomePopup\"","\"zoomIn\"","\"zoomOut\"","\"createWebSource\"","\"manualConfirmations\"","\"webSourceConfirmRemoval\"","\"channel\"","\"app\"","\"frontoffice\"","\"widget\"","\"reasoning\"","\"high\"","\"low\"","\"medium\"","\"off\"","\"reasoningSummary\"","\"auto\"","\"concise\"","\"detailed\"","\"searchMode\"","\"balanced\"","\"keyword\"","\"semantic\"","\"status\"","\"active\"","\"draft\"","\"inactive\"","\"tool\"","\"createSpreadsheet\"","\"createWordDocument\"","\"fetchTeamsChannelHistory\"","\"geocode\"","\"getWeather\"","\"querySpreadsheet\"","\"readDocumentFile\"","\"requestGeolocation\"","\"retrieveRevisedAnswers\"","\"runWorker\"","\"scheduleWakeup\"","\"cronTasks\"","\"searchInKnowledgeBase\"","\"searchInUserFiles\"","\"shareDocument\"","\"showArtifact\"","\"showCalendarEvent\"","\"showChart\"","\"showComparison\"","\"showContactForm\"","\"showDiagram\"","\"showEmail\"","\"showForm\"","\"showImageGallery\"","\"showLocation\"","\"showMessage\"","\"showMultipleChoice\"","\"showProductList\"","\"showQrCode\"","\"showSources\"","\"showSuggestedReply\"","\"showVideo\"","\"showWeather\"","\"showWebPages\"","\"spreadsheet\"","\"useAllUserFiles\"","\"useAllUserKb\"","\"userMemory\"","\"wordDocument\"","\"toolWorkingSetMode\"","\"shadow\"","\"visibility\"","\"organization\"","\"private\"","\"public\"","\"restricted\"","\"visibilityHint\"","\"manager\"","\"notLimited\"","\"hintOrganization\"","\"hintRestricted\"","\"readError\"","\"restrictTitle\"","\"restrictMembers\"","\"restrictOutsiders\"","\"restrictUnknown\"","\"restrictDescription\"","\"chat\"","\"navigate\"","\"screen\"","\"genericError\"","\"haveAccount\"","\"noAccount\"","\"popupBlocked\"","\"resetSent\"","\"resetSentTitle\"","\"resetTitle\"","\"resetUnavailable\"","\"signInTitle\"","\"signUpSuccessTitle\"","\"signUpTitle\"","\"verifyEmail\"","\"asset\"","\"emailBanner\"","\"emailLogo\"","\"logoDark\"","\"logoLight\"","\"mark\"","\"assetHint\"","\"bundledImage\"","\"color\"","\"accent\"","\"brand\"","\"info\"","\"colors\"","\"colorsHint\"","\"darkLogo\"","\"images\"","\"imagesHint\"","\"lightLogo\"","\"loadFailed\"","\"markBesideName\"","\"mode\"","\"modeDark\"","\"modeHint\"","\"modeLight\"","\"modeSystem\"","\"neutralMark\"","\"noImage\"","\"notRuntimeContent\"","\"notRuntimeTitle\"","\"palette\"","\"dark\"","\"light\"","\"removeImage\"","\"replaceImage\"","\"saveAndReload\"","\"saveFailed\"","\"saveFailedHint\"","\"savedMeanwhile\"","\"savedMeanwhileHint\"","\"text\"","\"companyName\"","\"description\"","\"productName\"","\"productTagline\"","\"shortName\"","\"textHint\"","\"texts\"","\"unsupportedType\"","\"uploadFailed\"","\"uploadFailedHint\"","\"uploadImage\"","\"useBundledImage\"","\"fetch\"","\"puppeteer\"","\"remote\"","\"teams\"","\"whatsapp\"","\"docs\"","\"intro\"","\"step1\"","\"step2\"","\"step3\"","\"step4\"","\"step5\"","\"step6\"","\"step7\"","\"step8\"","\"step9\"","\"title\"","\"webhookUrlAfterSave\"","\"copyData\"","\"downloadPng\"","\"series\"","\"showTable\"","\"Africa\"","\"America\"","\"Asia\"","\"Australia\"","\"Europe\"","\"Pacific\"","\"abusive\"","\"aggressive\"","\"api\"","\"critical\"","\"data_leak\"","\"degrading\"","\"desktop\"","\"direct\"","\"disengaged\"","\"empty_reply\"","\"endpoint\"","\"excited\"","\"failed_action\"","\"false_success\"","\"frustrated\"","\"goal_met\"","\"goal_not_met\"","\"group\"","\"hallucination\"","\"impatient\"","\"improving\"","\"inappropriate_tone\"","\"mobile\"","\"negative\"","\"neutral\"","\"off_brand\"","\"other\"","\"polite\"","\"positive\"","\"refusal_loop\"","\"repetition\"","\"stable\"","\"stuck_flow\"","\"tablet\"","\"unanalyzed\"","\"unclear\"","\"unknown\"","\"voice\"","\"web\"","\"addMemberLabel\"","\"addMemberPlaceholder\"","\"colleague\"","\"deleteDescription\"","\"deleteQuestion\"","\"empty\"","\"error\"","\"instructions\"","\"instructionsHint\"","\"leaveDescription\"","\"leaveQuestion\"","\"makeOwner\"","\"makeOwnerDescription\"","\"makeOwnerQuestion\"","\"members\"","\"move\"","\"moveDescription\"","\"moveOut\"","\"moveTo\"","\"name\"","\"new\"","\"newChat\"","\"noCandidates\"","\"noProjects\"","\"owner\"","\"readOnly\"","\"removeMember\"","\"removeMemberDescription\"","\"removeMemberQuestion\"","\"settings\"","\"documentRefreshTriggerOff\"","\"embeddingBackToPlatformSameFamily\"","\"endpointOffWithEmbedding\"","\"integrationRemove\"","\"lastModelOff\"","\"modelProviderDelete\"","\"modelRemove\"","\"revokeVoiceApiKey\"","\"deleteAgent\"","\"deleteBulkDocument\"","\"deleteDocument\"","\"deleteSpreadsheet\"","\"deleteWordDocument\"","\"excludeUserFile\"","\"unlinkAgent\"","\"unlinkLastAgentDelete\"","\"unlinkSyncedFolder\"","\"unlinkWebSource\"","\"abuseCategory\"","\"data_extraction\"","\"harassment\"","\"hate_speech\"","\"impersonation\"","\"off_topic_persistent\"","\"prompt_injection\"","\"self_harm\"","\"sexual_content\"","\"spam\"","\"violence\"","\"confidence\"","\"engagement\"","\"label\"","\"abuseDetected\"","\"conversationSentiment\"","\"goalMet\"","\"goalNotMet\"","\"llmIssueDetected\"","\"riskScore\"","\"userEngagement\"","\"userTone\"","\"llmIssue\"","\"sentiment\"","\"sentimentTrend\"","\"tone\"","\"trigger\"","\"agent_request\"","\"manual\"","\"summary_cycle\"","\"depth\"","\"sitemap\"","\"downloadPdf\"","\"classDiagram\"","\"erDiagram\"","\"flowchart\"","\"graph\"","\"sequenceDiagram\"","\"stateDiagram\"","\"xychart\"","\"analyzedPages\"","\"chunkSimilarTo\"","\"compareChunks\"","\"confirmAllRedundant\"","\"hasRedundant\"","\"isRedundant\"","\"openInProvider\"","\"originalChunk\"","\"pageCount\"","\"readingTime\"","\"redundancyAccepted\"","\"redundancyDismissed\"","\"redundancyExplainer\"","\"redundantChunk\"","\"redundantChunks\"","\"redundantNotice\"","\"redundantWith\"","\"reviewRedundant\"","\"showAll\"","\"thisDocument\"","\"viewByChunks\"","\"viewOriginal\"","\"wordCount\"","\"failed\"","\"gone\"","\"shrunk\"","\"unchanged\"","\"updated\"","\"pending\"","\"processing\"","\"success\"","\"indexed\"","\"unavailable\"","\"scanned\"","\"added\"","\"renamedOrMoved\"","\"removed\"","\"skippedUnsupported\"","\"skippedTooLarge\"","\"scannedPages\"","\"capped\"","\"daily\"","\"hourly\"","\"monthly\"","\"weekly\"","\"syncing\"","\"idle\"","\"columnDeletedAt\"","\"columnDeletedBy\"","\"columnPurgedIn\"","\"daysLeft\"","\"emptyConsequence\"","\"emptyQuestion\"","\"emptySuccess\"","\"emptyTitle\"","\"emptyTrash\"","\"introRetention\"","\"openLiveDocument\"","\"purge\"","\"purgeConsequence\"","\"purgeQuestion\"","\"purgeSuccess\"","\"purgeTitle\"","\"refusalAgentGone\"","\"refusalIdentityTaken\"","\"restore\"","\"restoreCredits\"","\"restoreFailed\"","\"restoreIndexing\"","\"restoreQuestion\"","\"restoreSuccess\"","\"restoreSuccessRoot\"","\"restoreTitle\"","\"toggle\"","\"toggleHint\"","\"file\"","\"url\"","\"ACCOUNT_TEMPORARILY_LOCKED\"","\"BANNED_USER\"","\"CREDENTIAL_ACCOUNT_NOT_FOUND\"","\"EMAIL_CODE_NOT_AVAILABLE\"","\"TWO_FACTOR_REQUIRED\"","\"PASSKEY_PASSWORD_REQUIRED\"","\"PASSKEY_RECENT_SIGN_IN_REQUIRED\"","\"PASSKEY_NOT_ALLOWED_FOR_SESSION\"","\"PASSKEY_USER_VERIFICATION_REQUIRED\"","\"PASSKEY_NOT_FOUND\"","\"AUTHENTICATION_FAILED\"","\"FAILED_TO_VERIFY_REGISTRATION\"","\"CHALLENGE_NOT_FOUND\"","\"EMAIL_NOT_VERIFIED\"","\"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION\"","\"FAILED_TO_UNLINK_LAST_ACCOUNT\"","\"INVALID_BACKUP_CODE\"","\"INVALID_CODE\"","\"INVALID_EMAIL_OR_PASSWORD\"","\"INVALID_PASSWORD\"","\"INVALID_TOKEN\"","\"INVALID_TWO_FACTOR_COOKIE\"","\"INVITATION_LIMIT_REACHED\"","\"INVITATION_NOT_FOUND\"","\"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION\"","\"KEY_NOT_FOUND\"","\"MEMBER_NOT_FOUND\"","\"NOT_ALLOWED\"","\"ORGANIZATION_ALREADY_EXISTS\"","\"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED\"","\"ORGANIZATION_NOT_FOUND\"","\"ORGANIZATION_SLUG_ALREADY_TAKEN\"","\"OTP_HAS_EXPIRED\"","\"RATE_LIMIT_EXCEEDED\"","\"SESSION_NOT_FRESH\"","\"SOCIAL_ACCOUNT_ALREADY_LINKED\"","\"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE\"","\"TOO_MANY_REQUESTS\"","\"TOTP_ALREADY_ENABLED\"","\"TOTP_NOT_ENABLED\"","\"TWO_FACTOR_REQUIRED_TO_ENFORCE\"","\"UNAUTHORIZED_SESSION\"","\"USER_ALREADY_EXISTS\"","\"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL\"","\"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION\"","\"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION\"","\"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION\"","\"USER_NOT_FOUND\"","\"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION\"","\"YOU_ARE_NOT_ALLOWED_TO_MANAGE_TWO_FACTOR\"","\"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION\"","\"YOU_CANNOT_BAN_YOURSELF\"","\"YOU_CANNOT_IMPERSONATE_ADMINS\"","\"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER\"","\"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER\"","\"YOU_CANNOT_MANAGE_YOUR_OWN_TWO_FACTOR\"","\"YOU_CANNOT_REMOVE_YOURSELF\"","\"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS\"","\"fileAlreadyImported\"","\"invalidToken\"","\"passwordsDoNotMatch\"","\"privateNetworkRequired\"","\"refreshIntervalUrlOnly\"","\"required\"","\"slugAlreadyExists\"","\"slugFormat\"","\"urlAlreadyImported\"","\"syncSourceUrlOnly\"","\"domain\"","\"github\"","\"google\"","\"microsoft\"","\"agentVisibilityPublic\"","\"agentVisibilityRegistered\"","\"agentVisibilityRestricted\"","\"apiTools\"","\"autoConfirmations\"","\"byok\"","\"chatProjects\"","\"endpoints\"","\"fileUpload\"","\"gateway\"","\"channels\"","\"models\"","\"tools\"","\"hostTools\"","\"hubspot\"","\"leads\"","\"legend\"","\"mcpServers\"","\"openaiApi\"","\"proactiveAutomations\"","\"salesforce\"","\"sharepoint\"","\"subAgents\"","\"anonymousLabel\"","\"chatLabel\"","\"defaultDays\"","\"defaultDisabled\"","\"trashLabel\"","\"unitDays\"","\"aiDescription\"","\"aiDescriptionModel\"","\"aiDescriptionPrompt\"","\"browserEngine\"","\"documentFile\"","\"fetchBrowserEngine\"","\"followExternal\"","\"forceOcr\"","\"pages\"","\"puppeteerBrowserEngine\"","\"remoteBrowserEngine\"","\"useBrowserEngine\"","\"useExtractionStrategy\"","\"webSourceWatch\"","\"webSourceRemoveMissing\"","\"webSourceRemoveMissingExplained\"","\"D\"","\"M\"","\"W\"","\"Y\"","\"accepted\"","\"canceled\"","\"expired\"","\"rejected\"","\"de\"","\"en\"","\"english\"","\"es\"","\"fr\"","\"french\"","\"german\"","\"it\"","\"italian\"","\"nl\"","\"pt\"","\"spanish\"","\"contactReason\"","\"appointment\"","\"callback_request\"","\"complaint\"","\"info_request\"","\"quote_request\"","\"support\"","\"budget\"","\"company\"","\"conversationSummary\"","\"preferredContactMethod\"","\"preferredContactTime\"","\"productInterest\"","\"topics\"","\"urgency\"","\"any\"","\"email\"","\"phone\"","\"afternoon\"","\"evening\"","\"morning\"","\"externalToken\"","\"headers\"","\"oauth\"","\"orphan\"","\"stale\"","\"toolbarTips\"","\"bold\"","\"underline\"","\"italic\"","\"strikeThrough\"","\"sub\"","\"sup\"","\"quote\"","\"unorderedList\"","\"orderedList\"","\"task\"","\"codeRow\"","\"code\"","\"image\"","\"table\"","\"mermaid\"","\"katex\"","\"prettier\"","\"pageFullscreen\"","\"fullscreen\"","\"preview\"","\"previewOnly\"","\"htmlPreview\"","\"catalog\"","\"titleItem\"","\"h1\"","\"h2\"","\"h3\"","\"h4\"","\"h5\"","\"h6\"","\"imgTitleItem\"","\"upload\"","\"clip2upload\"","\"linkModalTips\"","\"linkTitle\"","\"imageTitle\"","\"descLabel\"","\"descLabelPlaceHolder\"","\"urlLabel\"","\"urlLabelPlaceHolder\"","\"buttonOK\"","\"clipModalTips\"","\"buttonUpload\"","\"copyCode\"","\"successTips\"","\"failTips\"","\"flow\"","\"sequence\"","\"gantt\"","\"class\"","\"state\"","\"pie\"","\"relationship\"","\"journey\"","\"inline\"","\"block\"","\"footer\"","\"markdownTotal\"","\"scrollAuto\"","\"agentAccess\"","\"limited\"","\"privateAgents\"","\"hintAll\"","\"hintLimited\"","\"managerHint\"","\"column\"","\"all\"","\"allPlusPrivate\"","\"allPlusPrivateTitle\"","\"count\"","\"none\"","\"allTitle\"","\"managerTitle\"","\"noneTitle\"","\"explicit\"","\"extracted\"","\"revisionsOf\"","\"revisionBy\"","\"chart\"","\"chartNotDrawn\"","\"truncated\"","\"true\"","\"false\"","\"staleFormulas\"","\"missingValue\"","\"moreRows\"","\"moreColumns\"","\"working\"","\"answeredInChat\"","\"showChat\"","\"versions\"","\"previousVersion\"","\"nextVersion\"","\"versionOf\"","\"modes\"","\"modeMarkup\"","\"modeMarkupShort\"","\"modeAccepted\"","\"modeOriginal\"","\"shrink\"","\"cell\"","\"formulaBar\"","\"sheets\"","\"computedFormulas\"","\"average\"","\"sum\"","\"fitWidth\"","\"pageOf\"","\"words\"","\"outline\"","\"changes\"","\"noHeadings\"","\"copyFailed\"","\"openInNewTab\"","\"zoom\"","\"annotate\"","\"crop\"","\"cover\"","\"arrow\"","\"rect\"","\"path\"","\"rotateLeft\"","\"rotateRight\"","\"undo\"","\"redo\"","\"aspect\"","\"aspectFree\"","\"cropHint\"","\"coverStyle\"","\"coverSolid\"","\"coverPixelate\"","\"coverHint\"","\"colorRed\"","\"colorYellow\"","\"colorGreen\"","\"colorBlue\"","\"colorWhite\"","\"colorBlack\"","\"arrowHint\"","\"rectHint\"","\"pathHint\"","\"textLabel\"","\"canvasLabel\"","\"use\"","\"loading\"","\"drawFailed\"","\"exportFailed\"","\"size\"","\"sizeScaledDown\"","\"audioTranscribing\"","\"audioTranscript\"","\"audioTranscriptFailed\"","\"audioTranscriptNoSpeech\"","\"audioTranscriptOff\"","\"disconnectOAuthConnection\"","\"requestAccountLink\"","\"unlinkAccount\"","\"editSpreadsheet\"","\"editSpreadsheetCells\"","\"editWordDocument\"","\"editWordDocumentParagraphs\"","\"editWordDocumentRevisions\"","\"chatFileParagraphChanged\"","\"chatFileParagraphAdded\"","\"chatFileParagraphDeleted\"","\"chatFileTableRowAdded\"","\"chatFileTableRowDeleted\"","\"chatFileVersionSummary\"","\"chatFileMoreChanges\"","\"chatFileSheet\"","\"chatFileRow\"","\"chatFileNewSheet\"","\"chatFileCell\"","\"chatFileBefore\"","\"chatFileAfter\"","\"chatFileRefreshPivots\"","\"chatFileUpdateTableOfContents\"","\"chatFileRevisionAccepted\"","\"chatFileRevisionRejected\"","\"chatFileRestored\"","\"chatFileRestoreRequest\"","\"chatFileRestoreRequestById\"","\"enableTools\"","\"expandChunkContext\"","\"hostToolFailed\"","\"hostToolNoAnswer\"","\"pageControlActive\"","\"pageTool\"","\"click\"","\"fill\"","\"find\"","\"form\"","\"hover\"","\"press\"","\"read\"","\"scroll\"","\"snapshot\"","\"wait\"","\"readChatAttachment\"","\"readEarlierMessages\"","\"readSpreadsheet\"","\"readWordDocument\"","\"recallUserMemory\"","\"requestOAuthConnection\"","\"requestOAuthConnectionButton\"","\"requestOAuthConnectionInfo\"","\"requestOAuthConnectionPrompt\"","\"requestOAuthConnectionSuccess\"","\"revisedAnswers\"","\"runSubagent\"","\"saveUserMemory\"","\"cronCreate\"","\"cronList\"","\"cronDelete\"","\"reportTaskRun\"","\"searchingDocuments\"","\"sendChatFile\"","\"shareDocumentValidUntil\"","\"showProducts\"","\"stepCount\"","\"stepDocument\"","\"stepDropped\"","\"stepError\"","\"stepExcerpts\"","\"stepInput\"","\"stepItems\"","\"stepNoResults\"","\"stepOutput\"","\"stepRepeated\"","\"stepTimedOut\"","\"steps\"","\"streaming\"","\"type\"","\"custom\"","\"data\"","\"sourceDocument\"","\"sourceUrl\"","\"stepStart\"","\"webSearch\"","\"pageStep\"","\"access\"","\"accessOff\"","\"accessOn\"","\"agentAsModel\"","\"agentAsModelDescription\"","\"alertOff\"","\"alertOn\"","\"apiKeySummary\"","\"baseUrl\"","\"baseUrlSummary\"","\"connection\"","\"connectionDescription\"","\"conversations\"","\"conversationsSummary\"","\"examples\"","\"externalContextSummary\"","\"model\"","\"modelSummary\"","\"n8nCredential\"","\"n8nModel\"","\"action\"","\"blocked\"","\"blocker\"","\"deletion_exists\"","\"outside_reference\"","\"unclassified_table\"","\"confirm\"","\"confirmHint\"","\"confirmLabel\"","\"deleted\"","\"deletedNotice\"","\"dialogTitle\"","\"finishedAt\"","\"goes\"","\"detach\"","\"erase\"","\"item\"","\"agents\"","\"attachments\"","\"chats\"","\"chunks\"","\"consumption\"","\"documents\"","\"memories\"","\"others\"","\"points\"","\"pointsUnknown\"","\"people\"","\"progress\"","\"report\"","\"reportText\"","\"copies\"","\"deletedHeading\"","\"files\"","\"heading\"","\"kept\"","\"keptHeading\"","\"outside\"","\"requested\"","\"rows\"","\"shortUrls\"","\"signIns\"","\"verified\"","\"requestedBy\"","\"started\"","\"stays\"","\"completed\"","\"running\"","\"step\"","\"tombstone\"","\"users\"","\"vectors\"","\"membersHint\"","\"membersInvalid\"","\"membersLabel\"","\"hint\"","\"pointed\"","\"start\"","\"askPlaceholder\"","\"translateAsks\"","\"card\"","\"aiNotice\"","\"thinking\"","\"waitsConfirm\"","\"waitsReply\"","\"more\"","\"noAnswer\"","\"builtIn\"","\"explain\"","\"summarize\"","\"rewrite\"","\"shorten\"","\"proofread\"","\"translate\"","\"iconSearch\"","\"icon\"","\"sparkles\"","\"magic\"","\"idea\"","\"star\"","\"heart\"","\"lightning\"","\"fire\"","\"rocket\"","\"pen\"","\"pencil\"","\"paragraph\"","\"list\"","\"checklist\"","\"highlighter\"","\"document\"","\"folder\"","\"book\"","\"bookmark\"","\"clipboard\"","\"contract\"","\"attachment\"","\"archive\"","\"search\"","\"filter\"","\"eye\"","\"questions\"","\"database\"","\"calculator\"","\"percent\"","\"scales\"","\"euro\"","\"dollar\"","\"wallet\"","\"bank\"","\"cart\"","\"bill\"","\"gift\"","\"shop\"","\"truck\"","\"shield\"","\"lock\"","\"key\"","\"gavel\"","\"institution\"","\"passport\"","\"person\"","\"team\"","\"smile\"","\"handshake\"","\"contacts\"","\"mail\"","\"speech\"","\"megaphone\"","\"bell\"","\"globe\"","\"calendar\"","\"event\"","\"clock\"","\"timer\"","\"history\"","\"hourglass\"","\"plane\"","\"car\"","\"train\"","\"ship\"","\"map\"","\"compass\"","\"bed\"","\"suitcase\"","\"home\"","\"building\"","\"flag\"","\"earth\"","\"sun\"","\"umbrella\"","\"heartbeat\"","\"capsule\"","\"restaurant\"","\"cup\"","\"leaf\"","\"plant\"","\"recycle\"","\"school\"","\"graduation\"","\"brain\"","\"puzzle\"","\"award\"","\"trophy\"","\"bug\"","\"robot\"","\"cloud\"","\"flask\"","\"microscope\"","\"cross\"","\"warning\"","\"information\"","\"swap\"","\"target\"","\"music\"","\"video\"","\"microphone\"","\"prompt\"","\"docx\"","\"page\"","\"xlsx\"","\"hintOriginal\"","\"hintParagraphs\"","\"hintCells\"","\"notLatest\"","\"openLatest\"","\"labelParagraphs\"","\"labelCells\"","\"labelCell\"","\"selectedInFile\"","\"allProviders\"","\"apiToolName\"","\"apiToolUrl\"","\"askAnything\"","\"autoDetect\"","\"autoGenerated\"","\"comment\"","\"completeName\"","\"constValue\"","\"customAnswer\"","\"documentContent\"","\"documentName\"","\"documentOriginAll\"","\"documentRefreshAll\"","\"documentSourceSearch\"","\"documentStatusAll\"","\"documentUrl\"","\"endDate\"","\"enterYourQuestion\"","\"insert\"","\"insertOrigin\"","\"insertImageHost\"","\"limit\"","\"mcpServerHealthCheckPath\"","\"mcpServerUrl\"","\"modelEndpointBaseUrl\"","\"noHostToolsAllowed\"","\"noPageAccessExcludeSelectors\"","\"noSelectionActions\"","\"noTrustedOrigins\"","\"noImageHosts\"","\"oauthAuthorizationUrl\"","\"oauthClientId\"","\"oauthClientSecret\"","\"oauthScopes\"","\"oauthTokenUrl\"","\"pasteJsonSample\"","\"request\"","\"secretEdit\"","\"selectAgent\"","\"selectLanguage\"","\"selectPriority\"","\"similarity\"","\"sitemapUrl\"","\"slug\"","\"startDate\"","\"startUrl\"","\"temperature\"","\"uploadFile\"","\"emailAddress\"","\"cardTitle\"","\"summaryAvailable\"","\"summaryReplaces\"","\"summaryLinkedHere\"","\"summaryLinkedElsewhere\"","\"summaryExpired\"","\"summaryInvalid\"","\"summaryLinked\"","\"requestedAt\"","\"doNotConfirm\"","\"confirmOnlyIf\"","\"replace\"","\"linked\"","\"identitiesTitle\"","\"identitiesDescription\"","\"linkedAt\"","\"unlinkQuestion\"","\"unlinkDescription\"","\"unlinked\"","\"conflict\"","\"timeout\"","\"unauthorized\"","\"backToApp\"","\"general\"","\"pictureHint\"","\"notifications\"","\"groups\"","\"alwaysOn\"","\"inApp\"","\"agent_replies\"","\"summary\"","\"integrations\"","\"flagged_conversations\"","\"usage_limits\"","\"security\"","\"passwordSummary\"","\"connectedAccountsNote\"","\"connected\"","\"devices\"","\"deviceOn\"","\"available\"","\"keyExpires\"","\"keyNeverExpires\"","\"keyRequests\"","\"tasks\"","\"changed\"","\"nextRun\"","\"paused\"","\"ended\"","\"missed\"","\"failures\"","\"deleteTitle\"","\"deleteConsequence\"","\"resumed\"","\"tooMany\"","\"schedule\"","\"once\"","\"weekdays\"","\"withTimezone\"","\"organizations\"","\"current\"","\"onlyYou\"","\"memberSince\"","\"asksTwoFactor\"","\"account\"","\"installed\"","\"lead\"","\"writtenInEnglish\"","\"admin\"","\"member\"","\"user\"","\"configure\"","\"monitor\"","\"allAgents\"","\"agentSettings\"","\"agentTry\"","\"searchAgent\"","\"searchChat\"","\"searchOrganization\"","\"allOrganizations\"","\"agentCatalog\"","\"agentEndpoints\"","\"backoffice\"","\"branding\"","\"chatLogs\"","\"copatForYou\"","\"dashboard\"","\"dataProtection\"","\"endpointLogs\"","\"feedbacks\"","\"invitations\"","\"mcpServer\"","\"notFound\"","\"profile\"","\"reasoningLogs\"","\"releaseNotes\"","\"requestPasswordReset\"","\"system\"","\"twoFactor\"","\"twoFactorSetup\"","\"virtualAssistant\"","\"noAnswerRecorded\"","\"otherPlaceholder\"","\"future\"","\"past\"","\"unit\"","\"day\"","\"hour\"","\"minute\"","\"second\"","\"afterColumn\"","\"approvalTools\"","\"approved\"","\"assistantDiscardAgent\"","\"assistantLeaveUnsaved\"","\"assistantSaveAgent\"","\"beforeColumn\"","\"cancelled\"","\"changesCount\"","\"confirmed\"","\"denied\"","\"disabledTools\"","\"fieldChecked\"","\"fieldColumn\"","\"fieldUnchecked\"","\"formFill\"","\"formSubmit\"","\"hostCall\"","\"noChanges\"","\"pageAnswer\"","\"pageBack\"","\"pageClick\"","\"pageElement\"","\"pageFill\"","\"pageFillFields\"","\"pageFocused\"","\"pageHover\"","\"pageNavigate\"","\"pageNavigateUnknown\"","\"pageOpen\"","\"pagePress\"","\"pageSubmit\"","\"promptNamed\"","\"unchangedFields\"","\"communication\"","\"delegation\"","\"knowledgeSearch\"","\"locationWeather\"","\"personalization\"","\"richContent\"","\"cost\"","\"enabled\"","\"exposed\"","\"inputTokens\"","\"kind\"","\"mcp\"","\"subagent\"","\"latency\"","\"leadFailed\"","\"missedActive\"","\"missedShadow\"","\"notCharged\"","\"probability\"","\"seeded\"","\"used\"","\"agentsUsedInfo\"","\"mcpConnectionStatus\"","\"requestsUsedInfo\"","\"question\"","\"asksHuman\"","\"durableFact\"","\"informationGap\"","\"manipulation\"","\"missingInfo\"","\"version\"","\"adminBackupCodes\"","\"adminChanges\"","\"adminChangesEmpty\"","\"adminChangesHint\"","\"adminDevicesForgotten\"","\"adminFailedAttempts\"","\"adminFilterEmpty\"","\"adminForgetDevices\"","\"adminForgetDevicesDescription\"","\"adminForgetDevicesQuestion\"","\"adminLocked\"","\"adminPasskeySynced\"","\"adminRemovePasskeyDescription\"","\"adminRemovePasskeyQuestion\"","\"adminRequiredPending\"","\"adminStateNoneHint\"","\"adminSummaryAll\"","\"adminTrustedDevices\"","\"adminUnlock\"","\"adminUnlockDescription\"","\"adminUnlocked\"","\"adminUnlockQuestion\"","\"adoptionRatio\"","\"adoptionState\"","\"totp\"","\"otp\"","\"passkey\"","\"adoptionTitle\"","\"adoptionTitleUsers\"","\"backupCode\"","\"backupCodesDescription\"","\"backupCodesFileHeader\"","\"backupCodesReplaced\"","\"backupCodesSaved\"","\"badge\"","\"challengeApp\"","\"challengeBackup\"","\"challengeEmailSending\"","\"challengeEmailSent\"","\"challengeTitle\"","\"disabledMessage\"","\"enabledMessage\"","\"manualKey\"","\"memberOff\"","\"memberOn\"","\"memberPasskey\"","\"memberPasskeyHint\"","\"memberPending\"","\"memberPendingHint\"","\"memberSocialOnly\"","\"memberSocialOnlyHint\"","\"methodApp\"","\"methodAppSummary\"","\"methodEmail\"","\"methodEmailSummary\"","\"newBackupCodes\"","\"newBackupCodesDescription\"","\"passkeyAdd\"","\"passkeyAddDescription\"","\"passkeyAdded\"","\"passkeyAddNoPasswordDescription\"","\"passkeyAlreadyRegistered\"","\"passkeyCancelled\"","\"passkeyCreate\"","\"passkeyCreatedAt\"","\"passkeyDeviceBound\"","\"passkeyDeviceRefused\"","\"passkeyFallbackName\"","\"passkeyName\"","\"passkeyNameHint\"","\"passkeyRemove\"","\"passkeyRemoved\"","\"passkeyRemoveDescription\"","\"passkeyRemoveQuestion\"","\"passkeys\"","\"passkeysDescription\"","\"passkeysEmpty\"","\"passkeySynced\"","\"qrLabel\"","\"requireConsequence\"","\"requiredBy\"","\"requiredByPasskeyEnough\"","\"requireHint\"","\"requireLabel\"","\"requireOff\"","\"requireOn\"","\"requireQuestion\"","\"requireTitle\"","\"resetConfirm\"","\"resetDescription\"","\"resetQuestion\"","\"scanDescription\"","\"sendAgain\"","\"setupAddAnotherPasskey\"","\"setupAddPasskey\"","\"setupDescription\"","\"setupSignInWithPasskey\"","\"setupTitle\"","\"signInState\"","\"signInWithPasskey\"","\"stateNoPassword\"","\"stateOff\"","\"stateOnApp\"","\"stateOnEmail\"","\"summaryNoPassword\"","\"summaryOff\"","\"summaryOnApp\"","\"summaryOnEmail\"","\"switchToApp\"","\"trustDevice\"","\"turnOff\"","\"turnOffDescription\"","\"turnOffRequired\"","\"turnOffTitle\"","\"turnOn\"","\"turnOnTitle\"","\"useApp\"","\"useBackupCode\"","\"verify\"","\"chatFileCreated\"","\"chatFileInChatOnly\"","\"chatFilesEmpty\"","\"chatFilesTitle\"","\"chatFileVersion\"","\"deleteChatFile\"","\"deleteChatFileConfirm\"","\"deleteCreatedFileConfirm\"","\"emptyHint\"","\"exclude\"","\"excludeConfirm\"","\"openInChat\"","\"subtitle\"","\"untitled\"","\"uploadedAt\"","\"duplicateHeader\"","\"duplicateSecretParameter\"","\"invalidPhoneNumber\"","\"invalidSlug\"","\"invalidToolName\"","\"passwordMismatch\"","\"eager\"","\"normal\"","\"patient\"","\"airQuality\"","\"aqiFair\"","\"aqiGood\"","\"aqiHazardous\"","\"aqiModerate\"","\"aqiPoor\"","\"aqiVeryPoor\"","\"dailyForecast\"","\"feelsLike\"","\"today\"","\"message\"","\"doneTitle\"","\"doneMessage\"","\"invalidTitle\"","\"invalidMessage\"","\"level\"","\"minimal\"","\"xhigh\"","\"max\"","\"anthropicType\"","\"adaptive\"","\"disabled\"","\"anthropicDisplay\"","\"summarized\"","\"omitted\"","\"SingleTenant\"","\"MultiTenant\"","\"intent\"","\"topicsCovered\"","\"keyFacts\"","\"openQuestions\"","en_default$1","en_default","\"starts_with\"","\"ends_with\"","\"includes\"","\"regex\"","\"default\"","\"number\"","\"exact\"","\"inclusive\"","\"notInclusive\"","\"int\"","\"bigint\"","\"date\"","\"string\"","\"array\"","\"set\"","\"emoji\"","\"uuid\"","\"uuidv4\"","\"uuidv6\"","\"nanoid\"","\"guid\"","\"cuid\"","\"cuid2\"","\"ulid\"","\"xid\"","\"ksuid\"","\"datetime\"","\"time\"","\"duration\"","\"ipv4\"","\"ipv6\"","\"cidrv4\"","\"cidrv6\"","\"base64\"","\"base64url\"","\"json_string\"","\"e164\"","\"jwt\"","\"template_literal\"","it_default","SUPPORTED_LOCALES","detectLocale","browserLang","i18n","createI18n","translateAuthError","body","parsed","response","code","key","anonymousReauthClient","$fetch","data","externalAuthClient","path","EXTERNAL_TOKEN_EXPIRING_LEAD_MS","EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS","externalTokenExpiringDelay","remaining","expiresAt","now","readTokenClaims","payload","jwt","base64","isSameIdentity","left","a","right","b","OAUTH_POPUP_MESSAGE_TYPE","createPopupNonce","bytes","useChatbotAuth","_token","useHostSession","headers","client","createAuthClient","inferAdditionalFields","anonymousClient","newTokenFromHeader","ctx","input","init","session","isAuthenticating","externalToken","isActive","activeExternalToken","isExternalAuth","authChain","runExclusiveAuth","run","task","user","previousUser","reauthProofRequested","holdsReauthProofOf","userId","storeReauthProof","signInAnonymously","tryAnonymousReauth","reauthOrSignInAnonymously","handleExternalTokenFailure","failedExternalToken","trackSessionExternalToken","sessionExternalToken","sessionExternalTokenOwner","expiringTimer","currentSessionExternalToken","delay","getCurrentScope","onScopeDispose","refreshSessionExternalToken","newExternalToken","exchangeExternalToken","tracked","pendingExternalToken","attemptedExternalToken","externalSessionReconciled","signInWithExternalToken","signInAnonymouslyWithFallback","newIsActive","newSession","newToken","previousToken","signOut","onError","twoFactorChallenge","signInWithEmail","challenge","TWO_FACTOR_PATHS","twoFactorRequest","lostChallenge","verifyTwoFactor","kind","sendTwoFactorCode","cancelTwoFactor","signUpWithEmail","params","requestPasswordReset","signInWithSocialPopup","baseUrl","basePath","nonce","startUrl","provider","popup","allowedOrigin","closedPollId","finish","onOAuthMessage","resolve","event","onAuthSuccess","revokedToken","useFocusTrapBypass","shadowRoot","stopFocusPropagation","onMounted","rootNode","getCurrentInstance","onBeforeUnmount"],"sources":["../src/utils/cookie.ts","../src/utils/layout.ts","../src/utils/index.ts","../src/composables/useChatbotAgent.ts","../../../packages/i18n/src/index.ts","../src/composables/useChatbotAuth.ts","../src/composables/useFocusTrapBypass.ts"],"sourcesContent":["import { logger } from 'utils'\n\nconst DEFAULT_COOKIE_NAME = 'eight-wave-ai'\n// The cookie that holds the reauth proof keeps the `-uid` name it had when it\n// held the bare user id: a visitor's old value is overwritten in place, and the\n// name customers list in their cookie notices stays the same.\nconst REAUTH_PROOF_COOKIE_SUFFIX = '-uid'\nconst MAX_AGE_ONE_YEAR = 31536000\n\nfunction setCookie(name: string, value: string, maxAge: number) {\n try {\n // A past `expires` accompanies `max-age=0` on deletion: some cookie\n // implementations (older browsers, happy-dom) only honor the former.\n const expires =\n maxAge > 0 ? '' : '; expires=Thu, 01 Jan 1970 00:00:00 GMT'\n document.cookie = `${name}=${value}; path=/; max-age=${maxAge}${expires}; SameSite=Lax; Secure`\n } catch (error) {\n logger.warn(\n '[cookie] setCookie blocked (cross-origin/tracking protection)',\n error,\n )\n }\n}\n\nfunction getCookie(name: string): string {\n try {\n // Only split on the FIRST \"=\" — session tokens are signed with a\n // base64 signature that can contain \"=\" padding, so splitting on every\n // \"=\" would truncate the value and corrupt the token.\n const prefix = `${name}=`\n const row = document.cookie\n .split('; ')\n .find((entry) => entry.startsWith(prefix))\n return row ? row.slice(prefix.length) : ''\n } catch (error) {\n logger.warn(\n '[cookie] getCookie blocked (cross-origin/tracking protection)',\n error,\n )\n return ''\n }\n}\n\n// create first-party session cookie for authentication with 1 year expiry;\n// an empty token (sign-out) deletes the cookie instead of storing an empty value\nexport function setSessionCookie(\n token: string,\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(cookieName, token, token ? MAX_AGE_ONE_YEAR : 0)\n}\n\n// retrieve first-party session cookie\nexport function getSessionCookie(cookieName: string = DEFAULT_COOKIE_NAME) {\n return getCookie(cookieName)\n}\n\n// persist the anonymous user's reauth proof (`<userId>.<signature>`, signed by\n// the backend) alongside the session token, to come back after session expiry\nexport function setAnonymousReauthProofCookie(\n proof: string,\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(\n `${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`,\n proof,\n MAX_AGE_ONE_YEAR,\n )\n}\n\n// retrieve the persisted reauth proof; a cookie written before the proof\n// existed holds the bare user id instead\nexport function getAnonymousReauthProofCookie(\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n return getCookie(`${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`)\n}\n\n// remove the persisted proof once the anonymous user links a real account\n// (the linked anonymous user is deleted server-side, so it's stale)\nexport function clearAnonymousReauthProofCookie(\n cookieName: string = DEFAULT_COOKIE_NAME,\n) {\n setCookie(`${cookieName}${REAUTH_PROOF_COOKIE_SUFFIX}`, '', 0)\n}\n","import { AgentWidgetAppearance, AgentWidgetLayout } from 'models'\n\n/** An attribute of the element wins over the agent's setting, when it names a value of the enum. */\nfunction resolveSetting<Value extends string>(\n values: readonly string[],\n attribute: string | undefined,\n setting: Value | undefined,\n fallback: Value,\n): Value {\n if (attribute && values.includes(attribute)) {\n return attribute as Value\n }\n return setting ?? fallback\n}\n\nconst LAYOUTS: readonly string[] = Object.values(AgentWidgetLayout)\nconst APPEARANCES: readonly string[] = Object.values(AgentWidgetAppearance)\n\n/**\n * The layout the floating element shows (spec `widget-copilot.md`, D1): its\n * `layout` attribute wins over the agent's setting, and an attribute that\n * names no layout counts as absent.\n */\nexport function resolveWidgetLayout(\n attribute: string | undefined,\n setting: AgentWidgetLayout | undefined,\n): AgentWidgetLayout {\n return resolveSetting(\n LAYOUTS,\n attribute,\n setting,\n AgentWidgetLayout.Floating,\n )\n}\n\n/** How the floating card looks over the site, with the same rule as the layout. */\nexport function resolveWidgetAppearance(\n attribute: string | undefined,\n setting: AgentWidgetAppearance | undefined,\n): AgentWidgetAppearance {\n return resolveSetting(\n APPEARANCES,\n attribute,\n setting,\n AgentWidgetAppearance.Solid,\n )\n}\n","export * from './cookie'\nexport * from './layout'\n\nexport const AUTH_BASE_PATH = 'auth'\n\n/**\n * The backend of the Eight Wave cloud: where a widget with no `base-url`\n * talks, as it always has. A dedicated installation sets `base-url`; nothing\n * else of an installation is built into the bundle (README, \"Dedicated\n * installations\").\n */\nexport const DEFAULT_BACKEND_URL = 'https://ai-api.8wave.it'\n","import type { MaybeRefOrGetter } from 'vue'\nimport { computed, ref, toValue, watch } from 'vue'\nimport type {\n AgentBranding,\n AgentPublic,\n AuthMethods,\n WidgetDeployment,\n} from 'models'\nimport { createChatbotApiClient } from 'composables'\nimport {\n agentThemeStyle,\n resolveContrastColor,\n} from 'components/src/chat/utils'\nimport { DEFAULT_BACKEND_URL } from '~/utils'\n\nexport function useChatbotAgent(options: {\n baseUrl?: string\n basePath?: string\n organizationSlug?: MaybeRefOrGetter<string>\n agentId?: MaybeRefOrGetter<string>\n headers?: MaybeRefOrGetter<Record<string, string> | undefined>\n /**\n * Host-provided color scheme override, applied when the agent theme is\n * `auto`. Mirrors the precedence used by the chatbot store: agent theme,\n * then this override, then the OS `prefers-color-scheme`.\n */\n systemTheme?: MaybeRefOrGetter<'light' | 'dark' | undefined>\n /** Host-provided color scheme that wins over the agent theme too. */\n theme?: MaybeRefOrGetter<'light' | 'dark' | undefined>\n}) {\n const agent = ref<AgentPublic>()\n const branding = ref<AgentBranding>()\n const authMethods = ref<AuthMethods>()\n /** The deployment theme's stylesheet, or undefined while it is the default. */\n const deploymentCss = ref<string>()\n /** What the installation tells the widget: its app, its telemetry. */\n const deployment = ref<WidgetDeployment>()\n const requiresAuth = ref(false)\n const notFound = ref(false)\n const isLoading = ref(false)\n\n async function load() {\n const orgSlug = toValue(options.organizationSlug)\n const agentId = toValue(options.agentId)\n if (!orgSlug || !agentId) {\n return\n }\n const apiClient = createChatbotApiClient({\n baseUrl: options.baseUrl ?? DEFAULT_BACKEND_URL,\n basePath: options.basePath,\n headers: () => toValue(options.headers),\n })\n isLoading.value = true\n try {\n const result = await apiClient.getAgentAccess(orgSlug, agentId)\n authMethods.value = result.authMethods\n deploymentCss.value = result.deploymentBranding?.css\n deployment.value = result.deployment\n if (result.requiresAuth) {\n requiresAuth.value = true\n branding.value = result.branding ?? undefined\n agent.value = undefined\n } else {\n requiresAuth.value = false\n branding.value = undefined\n agent.value = result.agent ?? undefined\n }\n notFound.value = false\n } catch {\n notFound.value = true\n deploymentCss.value = undefined\n agent.value = undefined\n branding.value = undefined\n requiresAuth.value = false\n } finally {\n isLoading.value = false\n }\n }\n\n // Reload when org/agent changes\n watch(\n [\n () => toValue(options.organizationSlug),\n () => toValue(options.agentId),\n ],\n () => {\n load()\n },\n { immediate: true },\n )\n\n // Reload when headers change meaningfully (e.g. after login) and auth is required\n watch(\n () => toValue(options.headers),\n () => {\n if (requiresAuth.value) {\n load()\n }\n },\n )\n\n // Branding-aware theming: fall back to branding when agent is not available\n const source = computed(\n () => agent.value?.interface ?? branding.value?.interface,\n )\n\n const contrastColor = computed(() =>\n resolveContrastColor(source.value?.textColor, source.value?.mainColor),\n )\n const mainColor = computed(() => source.value?.mainColor)\n\n const themeClass = computed(() => {\n const theme = toValue(options.theme) ?? source.value?.theme\n if (theme && theme !== 'auto') {\n return ['theme', `theme--${theme}`]\n }\n const systemTheme = toValue(options.systemTheme)\n if (systemTheme) {\n return ['theme', `theme--${systemTheme}`]\n }\n return ['theme']\n })\n\n const themeStyle = computed(() =>\n agentThemeStyle(mainColor.value, contrastColor.value),\n )\n\n return {\n agent,\n branding,\n authMethods,\n deploymentCss,\n deployment,\n requiresAuth,\n notFound,\n isLoading,\n reload: load,\n contrastColor,\n mainColor,\n themeClass,\n themeStyle,\n }\n}\n","import { createI18n } from 'vue-i18n'\nimport it from './it.json'\nimport en from './en.json'\nimport enErrors from '@volverjs/zod-vue-i18n/locales/v4/en.json'\nimport itErrors from '@volverjs/zod-vue-i18n/locales/v4/it.json'\n\nexport const SUPPORTED_LOCALES = ['it', 'en'] as const\nexport type SupportedLocale = (typeof SUPPORTED_LOCALES)[number]\n\nfunction detectLocale(): SupportedLocale {\n const browserLang = navigator.language.split('-')[0]\n return (SUPPORTED_LOCALES as readonly string[]).includes(browserLang)\n ? (browserLang as SupportedLocale)\n : 'en'\n}\n\n/*\n * Setup i18n\n * https://vue-i18n.intlify.dev/\n */\n\nexport const i18n = createI18n<false>({\n locale: detectLocale(),\n legacy: false,\n globalInjection: true,\n fallbackWarn: false,\n messages: {\n it: {\n ...it,\n errors: { ...itErrors, ...it.errors },\n },\n en: {\n ...en,\n errors: { ...enErrors, ...en.errors },\n },\n },\n numberFormats: {\n it: {\n currencyEUR: {\n style: 'currency',\n currency: 'EUR',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n currencyUSD: {\n style: 'currency',\n currency: 'USD',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n EUR: {\n style: 'currency',\n currency: 'EUR',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n USD: {\n style: 'currency',\n currency: 'USD',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n decimal: {\n style: 'decimal',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n integer: {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n useGrouping: true,\n },\n compact: {\n style: 'decimal',\n notation: 'compact',\n compactDisplay: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n useGrouping: true,\n },\n seconds: {\n style: 'unit',\n unit: 'second',\n unitDisplay: 'long',\n maximumFractionDigits: 1,\n },\n },\n en: {\n currencyEUR: {\n style: 'currency',\n currency: 'EUR',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n currencyUSD: {\n style: 'currency',\n currency: 'USD',\n currencySign: 'accounting',\n notation: 'standard',\n maximumFractionDigits: 4,\n useGrouping: true,\n },\n EUR: {\n style: 'currency',\n currency: 'EUR',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n USD: {\n style: 'currency',\n currency: 'USD',\n currencyDisplay: 'narrowSymbol',\n notation: 'standard',\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n decimal: {\n style: 'decimal',\n minimumFractionDigits: 2,\n maximumFractionDigits: 2,\n useGrouping: true,\n },\n integer: {\n style: 'decimal',\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n useGrouping: true,\n },\n compact: {\n style: 'decimal',\n notation: 'compact',\n compactDisplay: 'short',\n minimumFractionDigits: 0,\n maximumFractionDigits: 1,\n useGrouping: true,\n },\n seconds: {\n style: 'unit',\n unit: 'second',\n unitDisplay: 'long',\n maximumFractionDigits: 1,\n },\n },\n },\n datetimeFormats: {\n it: {\n short: {\n dateStyle: 'short',\n },\n 'month-short': {\n month: 'short',\n },\n 'date-medium': {\n dateStyle: 'medium',\n },\n 'date-time': {\n dateStyle: 'short',\n timeStyle: 'short',\n },\n 'date-time-medium': {\n dateStyle: 'medium',\n timeStyle: 'short',\n },\n time: {\n timeStyle: 'short',\n },\n 'weekday-day': {\n weekday: 'short',\n day: 'numeric',\n },\n },\n en: {\n short: {\n dateStyle: 'short',\n },\n 'month-short': {\n month: 'short',\n },\n 'date-medium': {\n dateStyle: 'medium',\n },\n 'date-time': {\n dateStyle: 'short',\n timeStyle: 'short',\n },\n 'date-time-medium': {\n dateStyle: 'medium',\n timeStyle: 'short',\n },\n time: {\n timeStyle: 'short',\n },\n 'weekday-day': {\n weekday: 'short',\n day: 'numeric',\n },\n },\n },\n})\n\n/**\n * `onResponse` hook for the better-auth clients. better-auth writes its error\n * messages in English only, so the `message` of an error response is replaced\n * by the translation of its code (`errors.<CODE>`), and every `error.message`\n * a page shows arrives in the user's language. A code with no translation\n * keeps better-auth's text, the `YOU_ARE_NOT_ALLOWED_TO_*` codes share one\n * message, a 429 reads as `errors.TOO_MANY_REQUESTS` whatever its body, and a\n * body that is not JSON (a proxy's page) gets the generic error instead of no\n * message. It never throws: a failure leaves the response as it came.\n */\nexport async function translateAuthError({\n response,\n}: {\n response: Response\n}): Promise<Response | undefined> {\n if (response.ok) {\n return\n }\n try {\n let body: Record<string, unknown> | undefined\n try {\n const parsed = await response.clone().json()\n body = parsed && typeof parsed === 'object' ? parsed : {}\n } catch {\n body = undefined\n }\n const code = typeof body?.code === 'string' ? body.code : undefined\n let key = `errors.${code}`\n if (response.status === 429) {\n key = 'errors.TOO_MANY_REQUESTS'\n } else if (code?.startsWith('YOU_ARE_NOT_ALLOWED_TO_')) {\n key = 'errors.NOT_ALLOWED'\n } else if (!body) {\n key = 'auth.genericError'\n }\n if (!i18n.global.te(key)) {\n return\n }\n return new Response(\n JSON.stringify({ ...body, message: i18n.global.t(key) }),\n {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n },\n )\n } catch {\n return\n }\n}\n","import type { MaybeRefOrGetter } from 'vue'\nimport type {\n BetterAuthClientOptions,\n BetterAuthClientPlugin,\n} from 'better-auth/client'\nimport type { AdditionalFieldsOptions } from 'auth/src/additional-fields'\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n ref,\n watch,\n toValue,\n} from 'vue'\nimport { createAuthClient } from 'better-auth/vue'\nimport {\n inferAdditionalFields,\n anonymousClient,\n} from 'better-auth/client/plugins'\nimport { translateAuthError } from 'i18n'\nimport {\n getSessionCookie,\n setSessionCookie,\n getAnonymousReauthProofCookie,\n setAnonymousReauthProofCookie,\n clearAnonymousReauthProofCookie,\n DEFAULT_BACKEND_URL,\n AUTH_BASE_PATH,\n} from '~/utils'\n\nfunction anonymousReauthClient() {\n return {\n id: 'anonymous-reauth' as const,\n getActions: ($fetch) => ({\n signIn: {\n /** A new session for the anonymous user the proof names. */\n anonymousReauth: async (data: { proof: string }) => {\n return $fetch<{\n token: string\n user: Record<string, unknown>\n }>('/sign-in/anonymous-reauth', {\n method: 'POST',\n body: data,\n })\n },\n },\n anonymousReauth: {\n /** The proof that brings the current anonymous user back. */\n proof: async () => {\n return $fetch<{ proof: string }>(\n '/anonymous-reauth/proof',\n {\n method: 'GET',\n },\n )\n },\n },\n }),\n pathMethods: {\n '/sign-in/anonymous-reauth': 'POST' as const,\n },\n } satisfies BetterAuthClientPlugin\n}\n\nfunction externalAuthClient() {\n return {\n id: 'external-auth' as const,\n getActions: ($fetch) => ({\n signIn: {\n externalToken: async (data: { token: string }) => {\n return $fetch<{\n token: string\n user: Record<string, unknown>\n }>('/sign-in/external-token', {\n method: 'POST',\n body: data,\n })\n },\n },\n externalToken: {\n /** Hands the current session a fresh token of its own user. */\n refresh: async (data: { token: string }) => {\n return $fetch<{ expiresAt: string | null }>(\n '/external-token/refresh',\n { method: 'POST', body: data },\n )\n },\n },\n }),\n pathMethods: {\n '/sign-in/external-token': 'POST' as const,\n '/external-token/refresh': 'POST' as const,\n },\n atomListeners: [\n {\n matcher: (path: string) => path === '/sign-in/external-token',\n signal: '$sessionSignal' as const,\n },\n ],\n } satisfies BetterAuthClientPlugin\n}\n\n/**\n * How long before its expiry the host is asked for a fresh external token: a\n * turn that starts after it would reach the MCP servers that take the token\n * without one.\n */\nconst EXTERNAL_TOKEN_EXPIRING_LEAD_MS = 60_000\n\n/** The shortest wait between two requests for a fresh token. */\nconst EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS = 10_000\n\n/**\n * When to ask the host for the next token, in ms from `now`, for a token\n * that expires at `expiresAt` (seconds, the `exp` claim). A minute before\n * the expiry, but never before half of the time left, nor within ten\n * seconds: a token that lives a minute or less, or a browser clock running\n * ahead of the provider's, would otherwise have the host asked again as soon\n * as it answers. Nothing for a token already expired here: asking cannot\n * help it.\n */\nexport function externalTokenExpiringDelay(\n expiresAt: number,\n now: number = Date.now(),\n): number | undefined {\n const remaining = expiresAt * 1000 - now\n if (remaining <= 0) {\n return undefined\n }\n return Math.max(\n remaining - EXTERNAL_TOKEN_EXPIRING_LEAD_MS,\n remaining / 2,\n EXTERNAL_TOKEN_EXPIRING_MIN_DELAY_MS,\n )\n}\n\n/**\n * The claims of a JWT, read without verifying it: enough to tell whether two\n * tokens name the same person and when one expires. The backend verifies\n * every token it is given.\n */\nfunction readTokenClaims(\n jwt: string,\n): { iss?: string; sub?: string; exp?: number } | undefined {\n const [, payload] = jwt.split('.')\n if (!payload) {\n return undefined\n }\n try {\n const base64 = payload.replace(/-/g, '+').replace(/_/g, '/')\n return JSON.parse(atob(base64))\n } catch {\n return undefined\n }\n}\n\n/** Same issuer and subject: a fresh token of the same person. */\nfunction isSameIdentity(a: string, b: string): boolean {\n const left = readTokenClaims(a)\n const right = readTokenClaims(b)\n return (\n !!left?.iss &&\n !!left.sub &&\n left.iss === right?.iss &&\n left.sub === right?.sub\n )\n}\n\n/**\n * The `type` better-auth's `oauthPopup` completion page posts. Written here\n * rather than imported: `better-auth/plugins` would pull every server plugin\n * into the widget bundle.\n */\nconst OAUTH_POPUP_MESSAGE_TYPE = 'better-auth:oauth-popup'\n\n/**\n * A random nonce tying the popup's answer to the call that opened it.\n * `getRandomValues` rather than `randomUUID`, which only exists on pages\n * served over HTTPS.\n */\nfunction createPopupNonce(): string {\n const bytes = crypto.getRandomValues(new Uint8Array(16))\n return Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')\n}\n\ntype AuthClientOptions = {\n baseURL?: string\n basePath?: string\n plugins: [\n ReturnType<typeof inferAdditionalFields<AdditionalFieldsOptions>>,\n ReturnType<typeof anonymousClient>,\n ReturnType<typeof anonymousReauthClient>,\n ReturnType<typeof externalAuthClient>,\n ]\n}\n\nexport type AuthClient = ReturnType<typeof createAuthClient<AuthClientOptions>>\n\ntype ClientFetchOptions = NonNullable<BetterAuthClientOptions['fetchOptions']>\n\nexport function useChatbotAuth(\n options: {\n baseUrl?: string\n basePath?: string\n externalToken?: MaybeRefOrGetter<string | undefined>\n awaitExternalToken?: boolean\n /**\n * Host-session mode: the widget never signs in on its own and sends\n * no Authorization header; the session comes from the host\n * platform's better-auth cookie (sent thanks to\n * `credentials: 'include'`). The session belongs to the host, so\n * account management is hidden and `signOut` is a no-op. Intended\n * for the widget embedded in the platform itself (Backoffice\n * copilot, spec platform-copilot-session-bridge.md); it only works\n * where the host cookie context works, not on third-party embeds.\n */\n useHostSession?: MaybeRefOrGetter<boolean | undefined>\n isActive?: MaybeRefOrGetter<boolean>\n cookieName?: string\n /** Called when a session is established or the user changes. */\n onSignedIn?: (detail: { userId: string; isAnonymous: boolean }) => void\n /** Called when the session ends without an immediate replacement. */\n onSignedOut?: () => void\n /**\n * Called when an external token sign-in fails (expired token, invalid\n * signature or disabled config): the host should provide a fresh token.\n */\n onExternalAuthExpired?: () => void\n /**\n * Called a minute before the external token of the session expires,\n * while the session goes on: the host should provide a fresh token,\n * which the session takes in place. The MCP servers that receive the\n * user's token need a valid one on every turn.\n */\n onExternalTokenExpiring?: () => void\n } = {},\n) {\n const _token = ref(getSessionCookie(options.cookieName))\n const useHostSession = computed(\n () => toValue(options.useHostSession) ?? false,\n )\n\n const token = computed({\n get: () => _token.value,\n set: (token: string) => {\n setSessionCookie(token, options.cookieName)\n _token.value = token\n },\n })\n\n const headers = computed<Record<string, string>>(() => ({\n // The widget's channel, which the backend reads from the Origin\n // except on the portal: there Agent Studio embeds this widget as its\n // assistant, and the origin alone would make it the App page.\n 'X-Agent-Channel': 'widget',\n ...(!useHostSession.value && token.value\n ? { Authorization: `Bearer ${token.value}` }\n : {}),\n }))\n\n // Both fetch callbacks are typed by hand. createAuthClient is generic over\n // its options and TypeScript defers context-sensitive functions inside a\n // generic argument until inference is done, by which point the inferred\n // options type no longer carries them and their parameters fall to\n // implicit any. Annotating them with the public option type restores the\n // contextual type without touching how the client itself is inferred.\n const onFetchSuccess: NonNullable<ClientFetchOptions['onSuccess']> = (\n ctx,\n ) => {\n if (useHostSession.value) {\n // The host session token must never be persisted as the widget's\n // own Bearer: it would keep impersonating the host after the mode\n // is turned off.\n return\n }\n const newTokenFromHeader = ctx.response.headers.get('set-auth-token')\n if (newTokenFromHeader) {\n token.value = newTokenFromHeader\n }\n }\n\n // Only host-session mode may exchange cookies: with credentials on, an\n // anonymous sign-in's Set-Cookie would REPLACE the user's platform session\n // cookie on the backend origin. better-auth's client asks for them on\n // every call, so the other modes leave them out here: passing its\n // `include` on, the widget's first visit to a site signed the same\n // browser out of Agent Studio (copilot bench, 2026-10-28).\n const customFetchImpl: NonNullable<\n ClientFetchOptions['customFetchImpl']\n > = (input, init) =>\n fetch(input, {\n ...init,\n credentials: useHostSession.value ? 'include' : 'omit',\n })\n\n const client = createAuthClient({\n baseURL: options.baseUrl ?? DEFAULT_BACKEND_URL,\n basePath: options.basePath ?? AUTH_BASE_PATH,\n plugins: [\n inferAdditionalFields<AdditionalFieldsOptions>(),\n anonymousClient(),\n anonymousReauthClient(),\n externalAuthClient(),\n ],\n fetchOptions: {\n onSuccess: onFetchSuccess,\n onResponse: translateAuthError,\n auth: {\n type: 'Bearer',\n // Host-session mode relies on the cookie alone: the widget's\n // stored Bearer (e.g. a previous anonymous session) would\n // shadow it.\n token: () => (useHostSession.value ? '' : token.value),\n },\n customFetchImpl,\n },\n }) as AuthClient\n\n const session = client.useSession()\n const isAuthenticating = ref(false)\n const externalToken = computed(() => toValue(options.externalToken))\n const isActive = computed(() => toValue(options.isActive) ?? true)\n\n /**\n * External token currently authorized for automatic (re-)authentication.\n * Follows the `externalToken` option and imperative sign-in calls; cleared\n * by `signOut`, so the watchers never re-login with a token the host has\n * withdrawn.\n */\n const activeExternalToken = ref(externalToken.value)\n\n // External token / host-session mode: the host application owns the auth\n // lifecycle, so the widget must not offer account management (sign-out,\n // profile).\n const isExternalAuth = computed(\n () =>\n !!externalToken.value ||\n !!options.awaitExternalToken ||\n !!activeExternalToken.value ||\n useHostSession.value,\n )\n\n /**\n * Serializes sign-in operations: a request arriving while another is in\n * flight runs right after it instead of being dropped. Each task re-checks\n * state when it starts, so superseded requests no-op.\n */\n let authChain: Promise<void> = Promise.resolve()\n function runExclusiveAuth(task: () => Promise<void>): Promise<void> {\n const run = authChain.then(task, task)\n authChain = run\n return run\n }\n\n // Notify the host on session transitions, whatever flow caused them\n // (anonymous, external token, email, social).\n watch(\n () => session.value.data?.user,\n (user, previousUser) => {\n if (user && user.id !== previousUser?.id) {\n options.onSignedIn?.({\n userId: user.id,\n isAnonymous: !!user.isAnonymous,\n })\n }\n if (!user && previousUser) {\n options.onSignedOut?.()\n }\n },\n )\n\n /** The users whose proof this page already asked for. */\n const reauthProofRequested = new Set<string>()\n\n /** Whether the stored proof is one of the anonymous user `userId`. */\n function holdsReauthProofOf(userId: string): boolean {\n return getAnonymousReauthProofCookie(options.cookieName).startsWith(\n `${userId}.`,\n )\n }\n\n /**\n * Asks the backend for the proof that brings the current anonymous user\n * back once its session expires, and keeps it. Asked once per user and\n * page, so a refusal does not loop: without a proof the visitor keeps the\n * session and only loses the way back after it.\n */\n async function storeReauthProof(userId: string): Promise<void> {\n if (reauthProofRequested.has(userId)) {\n return\n }\n reauthProofRequested.add(userId)\n try {\n const { data } = await client.anonymousReauth.proof()\n // The session may have changed while the request was in flight.\n if (data?.proof?.startsWith(`${userId}.`)) {\n setAnonymousReauthProofCookie(data.proof, options.cookieName)\n }\n } catch {\n // Best effort, as above.\n }\n }\n\n async function signInAnonymously(): Promise<void> {\n const { data } = await client.signIn.anonymous()\n if (data?.token) {\n token.value = data.token\n if (data.user?.id) {\n await storeReauthProof(data.user.id as string)\n }\n }\n }\n\n /**\n * Attempts to create a new session for an existing anonymous user.\n * Returns true if re-auth succeeded, false otherwise.\n */\n async function tryAnonymousReauth(): Promise<boolean> {\n const proof = getAnonymousReauthProofCookie(options.cookieName)\n if (!proof) {\n return false\n }\n if (!proof.includes('.')) {\n // A bare user id, stored before the proof existed: the backend\n // refuses it, so it is not even sent.\n clearAnonymousReauthProofCookie(options.cookieName)\n return false\n }\n try {\n const { data } = await client.signIn.anonymousReauth({ proof })\n if (data?.token) {\n token.value = data.token\n await session.value.refetch()\n return true\n }\n } catch {\n // The user may have been deleted: fall back to a new one.\n }\n return false\n }\n\n /** Re-authenticates the stored anonymous user, or creates a fresh one. */\n async function reauthOrSignInAnonymously(): Promise<void> {\n const reauthed = await tryAnonymousReauth()\n if (!reauthed) {\n await signInAnonymously()\n }\n }\n\n /**\n * The external token was rejected (expired, invalid or config disabled):\n * notify the host so it can provide a fresh one, then apply the fallback\n * (keep waiting in `awaitExternalToken` mode, anonymous otherwise).\n */\n async function handleExternalTokenFailure(\n failedExternalToken: string,\n ): Promise<void> {\n if (activeExternalToken.value !== failedExternalToken) {\n // Withdrawn (sign-out) or replaced while the request was in flight\n return\n }\n options.onExternalAuthExpired?.()\n if (options.awaitExternalToken) {\n return\n }\n // The anonymous session that takes over carries no external token:\n // nothing to refresh, nobody to ask before it expires.\n trackSessionExternalToken(undefined)\n await reauthOrSignInAnonymously()\n }\n\n /**\n * The external token the current session was opened, or last refreshed,\n * with: the one the backend hands the MCP servers that take it. Unknown\n * for a session restored from the cookie.\n */\n let sessionExternalToken: string | undefined\n /** The session (its Bearer) the token above belongs to. */\n let sessionExternalTokenOwner: string | undefined\n let expiringTimer: ReturnType<typeof setTimeout> | undefined\n\n /**\n * The external token of the session in use, or nothing once another\n * session took its place (another user, an email or social sign-in): what\n * was recorded for the previous one must neither be refreshed nor asked\n * for again.\n */\n function currentSessionExternalToken(): string | undefined {\n return sessionExternalTokenOwner === token.value\n ? sessionExternalToken\n : undefined\n }\n\n /** Records the session's token and asks for the next one before it expires. */\n function trackSessionExternalToken(value: string | undefined): void {\n sessionExternalToken = value\n sessionExternalTokenOwner = value ? token.value : undefined\n clearTimeout(expiringTimer)\n expiringTimer = undefined\n const expiresAt = value ? readTokenClaims(value)?.exp : undefined\n const delay =\n typeof expiresAt === 'number'\n ? externalTokenExpiringDelay(expiresAt)\n : undefined\n if (delay === undefined || !options.onExternalTokenExpiring) {\n return\n }\n expiringTimer = setTimeout(() => {\n if (currentSessionExternalToken() === value) {\n options.onExternalTokenExpiring?.()\n }\n }, delay)\n }\n\n if (getCurrentScope()) {\n onScopeDispose(() => clearTimeout(expiringTimer))\n }\n\n /**\n * Hands the current session a fresh token of its own user, without\n * opening another session. False when the backend refuses it (another\n * person, an invalid token, no session any more): a full sign-in follows.\n */\n async function refreshSessionExternalToken(\n newExternalToken: string,\n ): Promise<boolean> {\n try {\n const { error } = await client.externalToken.refresh({\n token: newExternalToken,\n })\n if (error) {\n return false\n }\n // Withdrawn (sign-out) or replaced while the request was in\n // flight: nothing to track, and nobody to ask for the next one.\n if (activeExternalToken.value === newExternalToken) {\n trackSessionExternalToken(newExternalToken)\n }\n return true\n } catch {\n return false\n }\n }\n\n /** Raw token exchange; must run inside `runExclusiveAuth`. */\n async function exchangeExternalToken(\n newExternalToken: string,\n ): Promise<void> {\n isAuthenticating.value = true\n try {\n // A fresh token of the person already signed in: the session\n // takes it in place, instead of being replaced by another one.\n const tracked = currentSessionExternalToken()\n if (\n session.value.data &&\n tracked &&\n isSameIdentity(tracked, newExternalToken)\n ) {\n if (await refreshSessionExternalToken(newExternalToken)) {\n return\n }\n if (activeExternalToken.value !== newExternalToken) {\n // Withdrawn (sign-out) or replaced while the refresh was\n // in flight: no sign-in with a token nobody wants.\n return\n }\n }\n const { data } = await client.signIn.externalToken({\n token: newExternalToken,\n })\n if (activeExternalToken.value !== newExternalToken) {\n // Withdrawn (sign-out) or replaced while the request was in flight\n return\n }\n if (data?.token) {\n token.value = data.token\n trackSessionExternalToken(newExternalToken)\n await session.value.refetch()\n return\n }\n await handleExternalTokenFailure(newExternalToken)\n } catch {\n await handleExternalTokenFailure(newExternalToken)\n } finally {\n isAuthenticating.value = false\n }\n }\n\n /** External token currently queued or in flight, to drop duplicate requests. */\n let pendingExternalToken: string | undefined\n\n /**\n * Last external token an exchange was attempted with, whatever the\n * trigger. The session watcher consults it so a token that was already\n * tried is never auto-retried: a rejected token must not loop between\n * exchange and fallback. Deliberate retries (prop change, imperative\n * `signIn`, 401 handler) bypass it.\n */\n let attemptedExternalToken: string | undefined\n\n /** The cookie-restored external session was reconciled with the host state. */\n let externalSessionReconciled = false\n\n async function signInWithExternalToken(\n newExternalToken: string,\n ): Promise<void> {\n if (!newExternalToken || pendingExternalToken === newExternalToken) {\n return\n }\n activeExternalToken.value = newExternalToken\n attemptedExternalToken = newExternalToken\n pendingExternalToken = newExternalToken\n try {\n await runExclusiveAuth(async () => {\n if (activeExternalToken.value !== newExternalToken) {\n // Superseded while waiting for the previous operation\n return\n }\n await exchangeExternalToken(newExternalToken)\n })\n } finally {\n pendingExternalToken = undefined\n }\n }\n\n async function signInAnonymouslyWithFallback(): Promise<void> {\n if (isAuthenticating.value) {\n // The `[isActive, session]` watcher retries on the next session change\n return\n }\n await runExclusiveAuth(async () => {\n if (activeExternalToken.value || useHostSession.value) {\n // A host-owned sign-in was requested in the meantime\n return\n }\n isAuthenticating.value = true\n try {\n await reauthOrSignInAnonymously()\n } finally {\n isAuthenticating.value = false\n }\n })\n }\n\n watch(\n [isActive, session],\n ([newIsActive, newSession]) => {\n if (!newIsActive) {\n return\n }\n if (\n !newSession.isPending &&\n !newSession.isRefetching &&\n !isAuthenticating.value &&\n !newSession.data\n ) {\n if (useHostSession.value) {\n // Host-session mode: the session comes from the host\n // cookie, the widget never signs in on its own. No\n // session means the host is not (or no longer) logged in.\n return\n }\n if (activeExternalToken.value) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n if (options.awaitExternalToken) {\n return\n }\n signInAnonymouslyWithFallback()\n return\n }\n\n const user = newSession.data?.user\n\n if (useHostSession.value) {\n // Host-session mode: the session is read from (and owned by)\n // the host cookie, none of the widget-session housekeeping\n // below applies.\n return\n }\n\n // A session created by an external token exchange (the only kind\n // with `hardExpiresAt`) may have been restored from the cookie\n // after a page navigation, where prop changes cannot be observed:\n // reconcile it once with the auth state the host declares now.\n if (\n newSession.data?.session?.hardExpiresAt &&\n !externalSessionReconciled\n ) {\n externalSessionReconciled = true\n if (!activeExternalToken.value) {\n // The host no longer provides a token (it logged out\n // before this page load): drop the stale session. The\n // usual fallback rules apply (keep waiting in\n // `awaitExternalToken` mode, anonymous otherwise).\n signOut()\n return\n }\n if (attemptedExternalToken !== activeExternalToken.value) {\n // Re-exchange the current token, so a token minted for a\n // different user replaces the restored session and an\n // expired one raises `external-auth-expired` right away.\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n }\n\n // A fresh token the host handed while the widget was inactive:\n // the session takes it now, before a turn needs it. The exchange\n // refreshes it in place when it names the same person. Attempted\n // once per token, so a refused one does not loop.\n const tracked = currentSessionExternalToken()\n if (\n user &&\n !user.isAnonymous &&\n tracked &&\n activeExternalToken.value &&\n activeExternalToken.value !== tracked &&\n attemptedExternalToken !== activeExternalToken.value\n ) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n\n // Upgrade an anonymous session restored from the cookie when an\n // external token is available (e.g. the user logged into the host\n // app between page loads). Attempted once per token.\n if (\n user?.isAnonymous &&\n activeExternalToken.value &&\n attemptedExternalToken !== activeExternalToken.value\n ) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n\n // Backfill the proof of an anonymous session that has none, or\n // only the bare user id stored before the proof existed: a live\n // session is what the backend hands a proof to.\n if (\n user?.isAnonymous &&\n user.id &&\n !holdsReauthProofOf(user.id as string)\n ) {\n storeReauthProof(user.id as string)\n }\n },\n { immediate: true },\n )\n\n // Host-session mode toggle: on entry re-read the session from the host\n // cookie (the widget Bearer is already suppressed by the mode); on exit\n // re-read without the cookie, so the `[isActive, session]` watcher\n // re-establishes the widget's own flow (anonymous or external token).\n watch(useHostSession, () => {\n session.value.refetch()\n })\n\n watch(externalToken, (newToken, previousToken) => {\n if (newToken) {\n // Track the intent even when inactive: the `[isActive, session]`\n // watcher signs in with it once the widget becomes active.\n activeExternalToken.value = newToken\n if (isActive.value) {\n signInWithExternalToken(newToken)\n }\n return\n }\n // The host withdrew the token (logged out): sign out without\n // re-authenticating; the fallback rules apply (keep waiting in\n // `awaitExternalToken` mode, anonymous otherwise).\n if (previousToken && activeExternalToken.value === previousToken) {\n signOut()\n }\n })\n\n function onError(error: { type: string; title: string; status: number }) {\n if (error.status !== 401) {\n return\n }\n if (useHostSession.value) {\n // The widget cannot recover a host session on its own (a 401\n // here means the host session expired): re-read it so the UI\n // reflects the signed-out state.\n session.value.refetch()\n return\n }\n if (activeExternalToken.value) {\n signInWithExternalToken(activeExternalToken.value)\n return\n }\n if (options.awaitExternalToken) {\n return\n }\n signInAnonymouslyWithFallback()\n }\n\n const userId = computed(() => session.value.data?.user?.id)\n\n /**\n * The second step of an email sign-in for an account with two-step\n * verification (docs/specs/released/two-factor-authentication.md, D4). better-auth\n * keeps the challenge in a cookie, which a cross-origin widget never\n * holds: the backend hands its value over in the sign-in answer and takes\n * it back in a header.\n */\n const twoFactorChallenge = ref<{ token: string; methods: string[] }>()\n\n // Auth methods for widget login screen\n async function signInWithEmail(\n email: string,\n password: string,\n rememberMe?: boolean,\n ) {\n const result = await client.signIn.email({\n email,\n password,\n rememberMe,\n })\n const challenge = result.data as {\n twoFactorRedirect?: boolean\n twoFactorToken?: string | null\n twoFactorMethods?: string[]\n } | null\n if (challenge?.twoFactorRedirect) {\n twoFactorChallenge.value = challenge.twoFactorToken\n ? {\n token: challenge.twoFactorToken,\n methods: challenge.twoFactorMethods ?? [],\n }\n : undefined\n // The anonymous user stays until the code is verified (D9 of the\n // two-factor spec): its proof goes in `verifyTwoFactor`, so a\n // challenge left behind keeps the way back to its chats.\n return result\n }\n // Capture the session token from the response body. Relying solely on\n // the `set-auth-token` header is unreliable here, so we mirror the\n // anonymous/social flows and store the token explicitly.\n if (result.data?.token) {\n token.value = result.data.token\n // Signing in from an anonymous session links (and deletes) the\n // anonymous user server-side, so its stored proof no longer brings\n // anyone back: drop it so a later sign-out falls straight back to\n // a fresh anonymous session.\n clearAnonymousReauthProofCookie(options.cookieName)\n }\n return result\n }\n\n const TWO_FACTOR_PATHS = {\n totp: '/two-factor/verify-totp',\n otp: '/two-factor/verify-otp',\n backup: '/two-factor/verify-backup-code',\n } as const\n\n /** Fetch options of a request that answers the challenge in flight. */\n function twoFactorRequest(challenge: { token: string }) {\n return {\n method: 'POST' as const,\n headers: { 'x-two-factor-token': challenge.token },\n // No bearer: the challenge is the identity of this request, and a\n // session token would turn it into a verification of that session.\n auth: { type: 'Bearer' as const, token: '' },\n }\n }\n\n const lostChallenge = {\n data: null,\n error: { code: 'INVALID_TWO_FACTOR_COOKIE', message: undefined },\n }\n\n /** Answers the challenge with a code of the app, the email or a backup code. */\n async function verifyTwoFactor(\n kind: keyof typeof TWO_FACTOR_PATHS,\n code: string,\n ) {\n const challenge = twoFactorChallenge.value\n if (!challenge) {\n return lostChallenge\n }\n const result = await client.$fetch<{ token?: string }>(\n TWO_FACTOR_PATHS[kind],\n { ...twoFactorRequest(challenge), body: { code } },\n )\n if (result.data?.token) {\n token.value = result.data.token\n twoFactorChallenge.value = undefined\n // The verification linked and deleted the anonymous user, as an\n // email sign-in without a second factor does.\n clearAnonymousReauthProofCookie(options.cookieName)\n }\n return result\n }\n\n /** Sends the code by email, for an account whose factor is the email. */\n async function sendTwoFactorCode() {\n const challenge = twoFactorChallenge.value\n if (!challenge) {\n return lostChallenge\n }\n return client.$fetch<{ status: boolean }>(\n '/two-factor/send-otp',\n twoFactorRequest(challenge),\n )\n }\n\n /** Back to the sign-in form: the challenge left behind simply expires. */\n function cancelTwoFactor() {\n twoFactorChallenge.value = undefined\n }\n\n function signUpWithEmail(params: {\n email: string\n password: string\n name: string\n }) {\n return client.signUp.email(params)\n }\n\n function requestPasswordReset(email: string, redirectTo: string) {\n return client.requestPasswordReset({ email, redirectTo })\n }\n\n /**\n * Opens a popup for social OAuth sign-in.\n *\n * The popup navigates top-level to better-auth's `/oauth-popup/start` on\n * the backend origin, so the OAuth `state` cookie is set first-party there\n * and survives the round trip (a cross-origin XHR `signIn.social` would set\n * it as a third-party cookie that browsers drop, causing `state_mismatch`).\n * The server binds the flow to this page's origin and, on the callback,\n * posts the token of the session it just created to that origin only. The\n * message is taken only from the popup this call opened, from the backend\n * origin, carrying the nonce this call generated.\n *\n * better-auth's own `signIn.popup` is not used: it keeps the token to\n * itself, and the widget authenticates with its own stored Bearer.\n */\n async function signInWithSocialPopup(\n provider: 'google' | 'microsoft',\n onAuthSuccess?: () => void,\n ): Promise<{ popupBlocked: boolean }> {\n const baseUrl = options.baseUrl ?? DEFAULT_BACKEND_URL\n const basePath = options.basePath ?? AUTH_BASE_PATH\n const nonce = createPopupNonce()\n const startUrl = new URL(`${baseUrl}/${basePath}/oauth-popup/start`)\n startUrl.searchParams.set('provider', provider)\n startUrl.searchParams.set('popupOrigin', window.location.origin)\n startUrl.searchParams.set('popupNonce', nonce)\n\n const popup = window.open(\n startUrl.toString(),\n 'eightwave-oauth',\n 'width=600,height=700,menubar=no,toolbar=no',\n )\n\n if (!popup) {\n return { popupBlocked: true }\n }\n\n return new Promise((resolve) => {\n const allowedOrigin = new URL(baseUrl).origin\n // Resolve too if the user closes the popup without completing OAuth.\n const closedPollId = setInterval(() => {\n if (popup?.closed) {\n finish()\n }\n }, 500)\n\n function finish() {\n window.removeEventListener('message', onOAuthMessage)\n clearInterval(closedPollId)\n resolve({ popupBlocked: false })\n }\n\n function onOAuthMessage(event: MessageEvent) {\n const isTrustedOAuthMessage =\n event.origin === allowedOrigin &&\n event.source === popup &&\n event.data?.type === OAUTH_POPUP_MESSAGE_TYPE &&\n event.data.nonce === nonce\n if (!isTrustedOAuthMessage) {\n return\n }\n popup?.close()\n // A refusal or a failure at the provider comes back as\n // `error`, with no token: the user simply stays as they were.\n if (typeof event.data.token === 'string' && event.data.token) {\n token.value = event.data.token\n // Unlike the email flow, the anonymous user was not\n // linked: the popup's callback carries neither its bearer\n // nor its cookie (see the auth-and-tenancy gotchas). Its\n // proof stays, so a sign-out leads back to its chats.\n session.value.refetch().then(() => onAuthSuccess?.())\n }\n finish()\n }\n\n window.addEventListener('message', onOAuthMessage)\n })\n }\n\n /**\n * Signs the current user out and clears the locally stored session token.\n * Withdraws the active external token first, so the watchers never\n * re-authenticate with it: in external mode the host signs the widget back\n * in (prop change or `signInWithExternalToken`), while in the other modes\n * the `[isActive, session]` watcher re-establishes an anonymous session\n * (re-using the stored anonymous reauth proof when present).\n */\n async function signOut(): Promise<void> {\n if (useHostSession.value) {\n // The session belongs to the host application (cookie): revoking\n // it from the widget would log the user out of the host too.\n // Leaving host-session mode is the host's move (prop change).\n return\n }\n activeExternalToken.value = undefined\n trackSessionExternalToken(undefined)\n const revokedToken = token.value\n try {\n await client.signOut()\n } finally {\n // A concurrent exchange may have stored a fresh session token\n // while the revoke request was in flight (e.g. a host `signIn`\n // racing the mount-time reconcile): only clear our own token,\n // never the newer one.\n if (token.value === revokedToken) {\n token.value = ''\n }\n await session.value.refetch()\n }\n }\n\n return {\n client,\n session,\n isAuthenticating,\n isExternalAuth,\n token,\n headers,\n onError,\n userId,\n signInWithEmail,\n twoFactorChallenge,\n verifyTwoFactor,\n sendTwoFactorCode,\n cancelTwoFactor,\n signUpWithEmail,\n requestPasswordReset,\n signInSocial: client.signIn.social,\n signInWithSocialPopup,\n signInWithExternalToken,\n signOut,\n }\n}\n","import { getCurrentInstance, onBeforeUnmount, onMounted } from 'vue'\n\n/**\n * Prevents external focus-trapping libraries (e.g. Bootstrap 5 modals) from\n * stealing focus away from elements inside this custom element's shadow root.\n *\n * Bootstrap modals attach a `focusin` listener on `document` that pulls focus\n * back whenever it leaves the modal subtree. Because our custom element lives\n * outside the modal in the DOM, every focus event that escapes the shadow root\n * is treated as a \"focus escape\" and gets redirected back into the modal.\n *\n * Fix: intercept `focusin` at the shadow root boundary in the **bubble phase**\n * and stop its propagation. The event still reaches every internal element\n * normally (capture → target → bubble up through the shadow tree), but is\n * stopped at the shadow root before it can re-target and continue to `document`.\n *\n * Must be called inside a `.ce.vue` root component's `<script setup>`.\n */\nexport function useFocusTrapBypass() {\n let shadowRoot: ShadowRoot | null = null\n\n const stopFocusPropagation = (event: Event) => {\n event.stopPropagation()\n }\n\n onMounted(() => {\n const instance = getCurrentInstance()\n const rootNode = instance?.proxy?.$el?.getRootNode()\n\n if (!(rootNode instanceof ShadowRoot)) {\n return\n }\n\n shadowRoot = rootNode\n shadowRoot.addEventListener('focusin', stopFocusPropagation)\n })\n\n onBeforeUnmount(() => {\n if (!shadowRoot) {\n return\n }\n\n shadowRoot.removeEventListener('focusin', stopFocusPropagation)\n shadowRoot = null\n })\n}\n"],"mappings":";;;;;;;;;;;AAEA,IAAMY,IAAsB,iBAItBC,IAA6B,QAC7BC,IAAmB;AAEzB,SAASC,EAAU,GAAc,GAAe,GAAgB;CAC5D,IAAI;EAKA,SAAS,SAAS,GAAGC,EAA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,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,KAAK;IACD,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,uBAAuB;GAC3B;EACJ;EACA,IAAI;GACA,aAAa;IACT,OAAO;IACP,UAAU;IACV,cAAc;IACd,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,aAAa;IACT,OAAO;IACP,UAAU;IACV,cAAc;IACd,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,KAAK;IACD,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,KAAK;IACD,OAAO;IACP,UAAU;IACV,iBAAiB;IACjB,UAAU;IACV,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,UAAU;IACV,gBAAgB;IAChB,uBAAuB;IACvB,uBAAuB;IACvB,aAAa;GACjB;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,aAAa;IACb,uBAAuB;GAC3B;EACJ;CACJ;CACA,iBAAiB;EACb,IAAI;GACA,OAAO,EACH,WAAW,QACf;GACA,eAAe,EACX,OAAO,QACX;GACA,eAAe,EACX,WAAW,SACf;GACA,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