@vellumai/web 0.10.4 → 0.10.5-dev.202607022329.d89bf2f

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 (270) hide show
  1. package/dist/assets/{AnimatePresence-k-NoyzmC.js → AnimatePresence-uY0BR2n2.js} +1 -1
  2. package/dist/assets/{BundleConfirmPage-BcXA4t1n.js → BundleConfirmPage-BEQyQVeN.js} +1 -1
  3. package/dist/assets/{Combination-4Qc3vrtW.js → Combination-UBPhVLWy.js} +1 -1
  4. package/dist/assets/{about-page-BQQ9OMS-.js → about-page-Ck4iLq7E.js} +1 -1
  5. package/dist/assets/account-page-DmI8Zm1K.js +1 -0
  6. package/dist/assets/{account-shell-DLtzg6bW.js → account-shell-CL67zFht.js} +1 -1
  7. package/dist/assets/acp-run-detail-panel-gEL8OqNU.js +5 -0
  8. package/dist/assets/{add-credits-modal-p8hs2R5Q.js → add-credits-modal-BnXqKqkz.js} +1 -1
  9. package/dist/assets/advanced-page-BQvsLeue.js +1 -0
  10. package/dist/assets/ai-page-BcR8KPT5.js +1 -0
  11. package/dist/assets/{animated-avatar-BSEt2q64.js → animated-avatar-CEC1DGcI.js} +1 -1
  12. package/dist/assets/{api-Deex2etA.js → api-DnqFanVx.js} +1 -1
  13. package/dist/assets/api-key-screen-Ct1qhQGe.js +1 -0
  14. package/dist/assets/{archive-page-CjnYMSCA.js → archive-page-Dp4CDPFL.js} +1 -1
  15. package/dist/assets/assistant-api-BFL8kRU6.js +1 -0
  16. package/dist/assets/{assistant-feature-flag-store-oe00IJMB.js → assistant-feature-flag-store-C94SGLWJ.js} +1 -1
  17. package/dist/assets/{assistant-identity-store-iWGqR8uz.js → assistant-identity-store-cODRsfVo.js} +1 -1
  18. package/dist/assets/{assistant-status-panel-CUEIZEyr.js → assistant-status-panel-CWYmm239.js} +1 -1
  19. package/dist/assets/auth-store-DfeW0asJ.js +2 -0
  20. package/dist/assets/background-task-detail-panel-CH7efUDj.js +1 -0
  21. package/dist/assets/billing-page-tzTltPcQ.js +3 -0
  22. package/dist/assets/{bookmarks-page-G8JL2TRr.js → bookmarks-page-DQNTR2lx.js} +1 -1
  23. package/dist/assets/{browser-B4y6LCLX.js → browser-DM38C5zq.js} +2 -2
  24. package/dist/assets/build-state-C1h3J6U4.js +1 -0
  25. package/dist/assets/{button-D7s2Q_uG.js → button-D-AX8Voo.js} +1 -1
  26. package/dist/assets/by-tool-use-id-index-Dbdu-8Kf.js +1 -0
  27. package/dist/assets/chat-rA5AbKPD.js +1 -0
  28. package/dist/assets/{checkbox-BqCzUvXM.js → checkbox-ueHEk2G-.js} +1 -1
  29. package/dist/assets/{client-feature-flag-store-k_bI655l.js → client-feature-flag-store-CWOJ-CVU.js} +1 -1
  30. package/dist/assets/{client-identity-B8CM527c.js → client-identity-KGlckm6M.js} +1 -1
  31. package/dist/assets/{command-palette-0moHjYai.js → command-palette-Dlt7m1I6.js} +1 -1
  32. package/dist/assets/{command-palette-window-page-utfVpPv0.js → command-palette-window-page-DGfCcu4v.js} +1 -1
  33. package/dist/assets/{community-page-BLtaVXOe.js → community-page-BhuuMsyS.js} +1 -1
  34. package/dist/assets/{confirm-dialog-CfOXCE1N.js → confirm-dialog-bfBx6UYv.js} +1 -1
  35. package/dist/assets/{connect-page-Cu_qaH-z.js → connect-page-iwfq05E5.js} +1 -1
  36. package/dist/assets/{consent-controls-CwEkJRom.js → consent-controls-BzFFpG2p.js} +1 -1
  37. package/dist/assets/{contacts-gateway-B23m6emG.js → contacts-gateway-BDJYh797.js} +1 -1
  38. package/dist/assets/contacts-page-route-6RKPZpDS.js +9 -0
  39. package/dist/assets/{conversation-list-fetchers-B5KLYIZZ.js → conversation-list-fetchers-COStMaVO.js} +1 -1
  40. package/dist/assets/conversation-store-B8D6wE18.js +1 -0
  41. package/dist/assets/{danger-zone-redirect-page-ChVePZyJ.js → danger-zone-redirect-page-DK4QwO4q.js} +1 -1
  42. package/dist/assets/debug-page-D33Lzv5V.js +4 -0
  43. package/dist/assets/{deploy-dialogs-DYPOGbGL.js → deploy-dialogs-BhpmZiBK.js} +1 -1
  44. package/dist/assets/{detail-card-acc7KIet.js → detail-card-Bga8Jc8y.js} +1 -1
  45. package/dist/assets/detail-panel-stop-button-Dt15JaIv.js +1 -0
  46. package/dist/assets/detail-shell-BlzaPKeI.js +4 -0
  47. package/dist/assets/{developer-page-nLBkSigq.js → developer-page-D-cN0uAY.js} +1 -1
  48. package/dist/assets/{devices-page-CFg1FAIT.js → devices-page-Bi8jZe8c.js} +1 -1
  49. package/dist/assets/diagnostics-BAjanSbk.js +1 -0
  50. package/dist/assets/{dictation-overlay-page-CIIcRSZr.js → dictation-overlay-page-BurDS8z_.js} +1 -1
  51. package/dist/assets/{dist-B0Gf-knw.js → dist-CGS5MDkK.js} +1 -1
  52. package/dist/assets/{dist-cApvLul2.js → dist-Ddn3FnfV.js} +1 -1
  53. package/dist/assets/{document-viewer-page-CNWyP82k.js → document-viewer-page-BiaJTF17.js} +1 -1
  54. package/dist/assets/{dropdown-CL8VmqrY.js → dropdown-ChWAdhLG.js} +1 -1
  55. package/dist/assets/{earn-credits-modal-BkXk_l9a.js → earn-credits-modal-CAUyJwmh.js} +1 -1
  56. package/dist/assets/{emails-page-C9mr_lzm.js → emails-page-CAXZA30r.js} +1 -1
  57. package/dist/assets/esm--RA963YO.js +2 -0
  58. package/dist/assets/esm-BSRBg0oR.js +2 -0
  59. package/dist/assets/esm-CJ8uY1wn.js +2 -0
  60. package/dist/assets/esm-DTj81fJQ.js +1 -0
  61. package/dist/assets/{esm-B_Dgz4mc.js → esm-O9mDOR47.js} +2 -2
  62. package/dist/assets/esm-cB02a8J9.js +2 -0
  63. package/dist/assets/feature-flag-catalog-C8w5_UfU.js +1 -0
  64. package/dist/assets/{file-editor-BWfAnSsG.js → file-editor-ZqIEJw6T.js} +1 -1
  65. package/dist/assets/general-page-DIvhLrLC.js +1 -0
  66. package/dist/assets/hatching-screen-C0HPTyMQ.js +1 -0
  67. package/dist/assets/home-page-route-B3-EkviT.js +1 -0
  68. package/dist/assets/hosting-screen-DWqZD5MS.js +1 -0
  69. package/dist/assets/identity-page-route-HyRfxaiP.js +1 -0
  70. package/dist/assets/index-F6qy8udC.css +2 -0
  71. package/dist/assets/index-FlO-C4WJ.js +129 -0
  72. package/dist/assets/{input-C8kfrq9r.js → input-D4W4p0pZ.js} +1 -1
  73. package/dist/assets/{inspect-page-BWSvIJ2d.js → inspect-page-Dh2BRN8h.js} +4 -4
  74. package/dist/assets/{install-s7InKiDi.js → install-DwGUGZQw.js} +1 -1
  75. package/dist/assets/integrations-page-DwiPISi_.js +1 -0
  76. package/dist/assets/{intelligence-layout-B_UDPu0L.js → intelligence-layout-DZ-lWsS-.js} +1 -1
  77. package/dist/assets/{keyboard-shortcuts-page-E8rGDLiG.js → keyboard-shortcuts-page-CI4UDQMl.js} +1 -1
  78. package/dist/assets/{library-detail-page-BlrRC_ny.js → library-detail-page-Dijlp-Ed.js} +1 -1
  79. package/dist/assets/{library-page-Dct5o6_9.js → library-page-CI_i8xZv.js} +1 -1
  80. package/dist/assets/{list-row-Cw9JYESP.js → list-row-Di0MK3wu.js} +1 -1
  81. package/dist/assets/local-mode-CgrENuVf.js +39 -0
  82. package/dist/assets/{login-flow-BtdVqmTm.js → login-flow-Ds9vsrwI.js} +1 -1
  83. package/dist/assets/login-page-CCwMU8NR.js +1 -0
  84. package/dist/assets/{logout-page-BCcEjyS2.js → logout-page-DYzv53xW.js} +1 -1
  85. package/dist/assets/{logs-layout-Btvxnin8.js → logs-layout-BCn0lQCq.js} +1 -1
  86. package/dist/assets/{memory-router-playground-page-D5ruL9dQ.js → memory-router-playground-page-DgSeE_5U.js} +1 -1
  87. package/dist/assets/{menu-C_97pis4.js → menu-BLJEjTFD.js} +1 -1
  88. package/dist/assets/messages-ChEiS3wF.js +13 -0
  89. package/dist/assets/{metric-card-DqAVWY-G.js → metric-card-B5-OTPcX.js} +1 -1
  90. package/dist/assets/{mobile-sidebar-drawer-BBHy-x2N.js → mobile-sidebar-drawer-dkZfF4ic.js} +1 -1
  91. package/dist/assets/{modal-D0Q3UWD0.js → modal-BNAVT2FK.js} +1 -1
  92. package/dist/assets/mutation-error-Iab5I7oz.js +1 -0
  93. package/dist/assets/native-biometric-BK6_QtW5.js +6 -0
  94. package/dist/assets/{native-file-Bm3eyig_.js → native-file-DIJL6af-.js} +2 -2
  95. package/dist/assets/{notifications-page-cOGpYgqy.js → notifications-page-Dla1bt2V.js} +1 -1
  96. package/dist/assets/{oauth-complete-page-C2RjDFuA.js → oauth-complete-page-BMqf56bD.js} +1 -1
  97. package/dist/assets/{oauth-popup-complete-page-Cwy2jqJN.js → oauth-popup-complete-page-CdaOFiQI.js} +1 -1
  98. package/dist/assets/{page-shell-5T-Jxz7G.js → page-shell-rqT8-trD.js} +1 -1
  99. package/dist/assets/pairing-page-BDCtiLsq.js +1 -0
  100. package/dist/assets/{panel-item-nGTDevWP.js → panel-item-Q1g7DFJw.js} +1 -1
  101. package/dist/assets/{password-reset-page-yn0MrnNq.js → password-reset-page-T_0pamrF.js} +1 -1
  102. package/dist/assets/platform-detection-Ceodt3Hu.js +1 -0
  103. package/dist/assets/platform-loopback-page-BnZPdxIk.js +1 -0
  104. package/dist/assets/{plugin-detail-page-sX6m5HV3.js → plugin-detail-page-3mf9oR80.js} +1 -1
  105. package/dist/assets/plugins-page-TAy4hev4.js +1 -0
  106. package/dist/assets/plugins-surface-gCrqfOas.js +1 -0
  107. package/dist/assets/{popover-CL-JL6vG.js → popover-BUj2v1xo.js} +1 -1
  108. package/dist/assets/{prechat-qvhqEHmK.js → prechat-RG0Q0UrS.js} +1 -1
  109. package/dist/assets/prechat-route-CtfsGLw2.js +1 -0
  110. package/dist/assets/{prefs-OrKWJGM_.js → prefs-ef69V836.js} +1 -1
  111. package/dist/assets/privacy-page-BB9GR4ZD.js +1 -0
  112. package/dist/assets/privacy-screen-onaZtGUE.js +1 -0
  113. package/dist/assets/provider-callback-page-yXBMI0Uv.js +1 -0
  114. package/dist/assets/provider-key-Bf5qJwbE.js +1 -0
  115. package/dist/assets/provider-signup-page-8w9h5zSj.js +1 -0
  116. package/dist/assets/{quick-input-page-DA2vqGas.js → quick-input-page-CyO-UVOQ.js} +1 -1
  117. package/dist/assets/react-query.gen-BwkZCSTW.js +1 -0
  118. package/dist/assets/remote-gateway-session-BigLiDPm.js +1 -0
  119. package/dist/assets/{research-mock-page-DRkJQuq2.js → research-mock-page-COuqgh_8.js} +1 -1
  120. package/dist/assets/research-onboarding-route-B7TnjNJV.js +61 -0
  121. package/dist/assets/{resolved-assistants-store-Cp4J43BK.js → resolved-assistants-store-Dqf0LJrA.js} +1 -1
  122. package/dist/assets/return-to-yMLvlnXN.js +1 -0
  123. package/dist/assets/{review-terms-screen-Cmcw1D67.js → review-terms-screen-BLPeTbkx.js} +1 -1
  124. package/dist/assets/{schedules-B7I0imdw.js → schedules-D_sclJNA.js} +1 -1
  125. package/dist/assets/sdk.gen-zA5ns5LT.js +1 -0
  126. package/dist/assets/select-assistant-screen-C99Fb0km.js +1 -0
  127. package/dist/assets/{settings-layout-B9Uu1igg.js → settings-layout-sq8M5TJV.js} +1 -1
  128. package/dist/assets/share-feedback-modal-sXMDmgKy.js +1 -0
  129. package/dist/assets/{sidebar-tree-CHyPnNA0.js → sidebar-tree-rpSGyrYj.js} +1 -1
  130. package/dist/assets/signup-page-BhFDh2Lp.js +1 -0
  131. package/dist/assets/{signup-shell-DgwKMvn2.js → signup-shell-DMX1tgqB.js} +1 -1
  132. package/dist/assets/skills-page-QKhhIUlC.js +1 -0
  133. package/dist/assets/{sound-manager-BnZ7SwXM.js → sound-manager-45n1b-Bl.js} +1 -1
  134. package/dist/assets/{sounds-page-ZCBq6ru9.js → sounds-page-DBXH5tQz.js} +1 -1
  135. package/dist/assets/{src-mai-NajT.js → src-B-I7oowl.js} +3 -3
  136. package/dist/assets/{stat-square-B0S3fO7O.js → stat-square-8mff1dLC.js} +1 -1
  137. package/dist/assets/subagent-detail-panel-jJiEVAKj.js +4 -0
  138. package/dist/assets/subagent-store-C0UOU-pG.js +3 -0
  139. package/dist/assets/{system-events-page-CQUZjHbp.js → system-events-page-BODl2I6C.js} +1 -1
  140. package/dist/assets/{system-events-redirect-page-B6WgM0Vv.js → system-events-redirect-page-C16Xg1C_.js} +1 -1
  141. package/dist/assets/{tag-B_-QAvJF.js → tag-CW6WC4fE.js} +1 -1
  142. package/dist/assets/{tiptap-document-editor-tDTTC-Je.js → tiptap-document-editor-B_8p2exF.js} +2 -2
  143. package/dist/assets/{toast-2TW5tj1Y.js → toast-sdJJ6aTV.js} +1 -1
  144. package/dist/assets/tool-detail-panel-C3ycGHP8.js +2 -0
  145. package/dist/assets/trace-page-C5Oc1vIh.js +1 -0
  146. package/dist/assets/{upgrade-cancel-page-BVr06o5p.js → upgrade-cancel-page-DsiFRuzo.js} +1 -1
  147. package/dist/assets/{upgrade-success-page-CIBIIMbB.js → upgrade-success-page-DKb4tC71.js} +1 -1
  148. package/dist/assets/{usage-page-CcGNq6p_.js → usage-page-BJy1XgXv.js} +1 -1
  149. package/dist/assets/{use-active-assistant-id-D4UJEQM5.js → use-active-assistant-id-BVzVN4_g.js} +1 -1
  150. package/dist/assets/use-is-org-ready-NO84DVDo.js +1 -0
  151. package/dist/assets/use-onboarding-login-ULmWc73o.js +1 -0
  152. package/dist/assets/{use-reduced-motion-DmsjJfoE.js → use-reduced-motion-BG6r0Z46.js} +1 -1
  153. package/dist/assets/use-skill-categories-Bgl1CV8z.js +1 -0
  154. package/dist/assets/{utils-Bg9t-lBx.js → utils-P-AuKiE9.js} +1 -1
  155. package/dist/assets/viewer-store-BR99G-Ii.js +1 -0
  156. package/dist/assets/{voice-page-BOFy-jR_.js → voice-page-C8R_9E8j.js} +1 -1
  157. package/dist/assets/{weather-forecast-display-bZDWJOMu.js → weather-forecast-display-0tn6PGg8.js} +1 -1
  158. package/dist/assets/{web-CReVlJcu.js → web-CxyEb7Lp.js} +1 -1
  159. package/dist/assets/{web-BpH9TOnx.js → web-DFw1Yfb1.js} +1 -1
  160. package/dist/assets/{web-Cd-q_a1I.js → web-DGDlV45i.js} +1 -1
  161. package/dist/assets/{web-BlDBGu36.js → web-GWxiW7or.js} +1 -1
  162. package/dist/assets/{web-Cly_79wU.js → web-YggPvEM4.js} +1 -1
  163. package/dist/assets/{web-CWJUzKI_.js → web-b9SjJqdc.js} +1 -1
  164. package/dist/assets/{web-CFYymSzw.js → web-lNls6p99.js} +1 -1
  165. package/dist/assets/{welcome-screen-Cka_lktU.js → welcome-screen-BPSvhAJD.js} +1 -1
  166. package/dist/assets/workflow-detail-panel-CpusEKvv.js +1 -0
  167. package/dist/assets/workspace-page-BnQ2Z57D.js +1 -0
  168. package/dist/index.html +77 -74
  169. package/package.json +1 -1
  170. package/dist/assets/account-page-cTyLtFgE.js +0 -1
  171. package/dist/assets/acp-run-detail-panel-DaNqQ4AU.js +0 -5
  172. package/dist/assets/advanced-page-CK4tCgvV.js +0 -1
  173. package/dist/assets/ai-page-Bf5G1nk8.js +0 -1
  174. package/dist/assets/api-key-screen-BToN0-XM.js +0 -1
  175. package/dist/assets/assistant-api-D8xSkh-5.js +0 -1
  176. package/dist/assets/auth-store-B2Zo6DUE.js +0 -7
  177. package/dist/assets/billing-page-Cjqv3hFX.js +0 -3
  178. package/dist/assets/build-state-CtsLvNgP.js +0 -1
  179. package/dist/assets/chat-CdO26JJs.js +0 -1
  180. package/dist/assets/contacts-page-route-Swz0yPYv.js +0 -9
  181. package/dist/assets/conversation-store-SjqDbOcn.js +0 -1
  182. package/dist/assets/debug-page-CVw2bzGN.js +0 -4
  183. package/dist/assets/detail-shell-CoKg1S7U.js +0 -3
  184. package/dist/assets/diagnostics-CGIesPpg.js +0 -1
  185. package/dist/assets/esm-BPR7F84K.js +0 -1
  186. package/dist/assets/esm-C7SZoG5u.js +0 -2
  187. package/dist/assets/esm-CMxBpGk-.js +0 -2
  188. package/dist/assets/esm-XqRGVrcj.js +0 -2
  189. package/dist/assets/esm-oLFwK0Kw.js +0 -2
  190. package/dist/assets/feature-flag-catalog-C7oM7PZ_.js +0 -1
  191. package/dist/assets/funnel-CUPE93jb.js +0 -1
  192. package/dist/assets/general-page-Cx6tlYeL.js +0 -1
  193. package/dist/assets/hatching-screen-DbVpuOai.js +0 -1
  194. package/dist/assets/home-page-route-CweAnlJn.js +0 -1
  195. package/dist/assets/hosting-screen-DpWTAyj2.js +0 -1
  196. package/dist/assets/identity-page-route-TiI1OQgN.js +0 -1
  197. package/dist/assets/index-0XgM92Lz.js +0 -130
  198. package/dist/assets/index-N8IeZea9.css +0 -2
  199. package/dist/assets/integrations-page-CMYurvd3.js +0 -1
  200. package/dist/assets/local-mode-CvrNMtPF.js +0 -39
  201. package/dist/assets/login-page-sS8t_Aik.js +0 -1
  202. package/dist/assets/messages-B5v7xWiw.js +0 -13
  203. package/dist/assets/mutation-error-NiVTbM-q.js +0 -1
  204. package/dist/assets/pairing-page-DHF2ThH-.js +0 -1
  205. package/dist/assets/platform-loopback-page-DSx9flbF.js +0 -1
  206. package/dist/assets/plugins-page-_kqpdU-W.js +0 -1
  207. package/dist/assets/plugins-surface-KFX25A-q.js +0 -1
  208. package/dist/assets/prechat-route-D2HszqA0.js +0 -1
  209. package/dist/assets/privacy-page-BJfuoXgs.js +0 -1
  210. package/dist/assets/privacy-screen-BGNcisJ2.js +0 -1
  211. package/dist/assets/provider-callback-page-LZHmOo01.js +0 -1
  212. package/dist/assets/provider-key-DIchy_Bc.js +0 -1
  213. package/dist/assets/provider-signup-page-D327vCgu.js +0 -1
  214. package/dist/assets/react-query.gen-CsMIK93J.js +0 -1
  215. package/dist/assets/research-onboarding-route-Dk-9KwG_.js +0 -37
  216. package/dist/assets/return-to-D0TfUwsP.js +0 -1
  217. package/dist/assets/sdk.gen-BwKkHEki.js +0 -1
  218. package/dist/assets/select-assistant-screen-oJuFe0vU.js +0 -1
  219. package/dist/assets/share-feedback-modal-DN1agJEb.js +0 -1
  220. package/dist/assets/signup-page-BaIcYI50.js +0 -1
  221. package/dist/assets/skills-page-wOVBvBdB.js +0 -1
  222. package/dist/assets/subagent-detail-panel-C_GwZcyl.js +0 -4
  223. package/dist/assets/subagent-store-BANqfUgA.js +0 -3
  224. package/dist/assets/three-dot-indicator-DAKo-L_x.js +0 -1
  225. package/dist/assets/tool-detail-panel-DIk8Db76.js +0 -2
  226. package/dist/assets/trace-page-TdKZ1dXH.js +0 -1
  227. package/dist/assets/use-is-org-ready-Dj2-PRLz.js +0 -1
  228. package/dist/assets/use-onboarding-login-CyEAqbC7.js +0 -1
  229. package/dist/assets/viewer-store-BKkbfdPD.js +0 -1
  230. package/dist/assets/workflow-detail-panel-C_rq6yGi.js +0 -1
  231. package/dist/assets/workspace-page-4CJ_pIeB.js +0 -1
  232. package/dist/skills/meet-join/assets/icon.svg +0 -1
  233. /package/dist/assets/{app-info-VB6EcPqh.js → app-info-DJQFoVxX.js} +0 -0
  234. /package/dist/assets/{avatar-bundled-components-DUNo-SZc.js → avatar-bundled-components-w37NPF4o.js} +0 -0
  235. /package/dist/assets/{avatar-svg-compositor-DMVZdMXC.js → avatar-svg-compositor-CNy1XmWD.js} +0 -0
  236. /package/dist/assets/{build.umd-BO4u00Aj.js → build.umd-4R02MPXx.js} +0 -0
  237. /package/dist/assets/{composer-focus-CpeV_gfi.js → composer-focus-n921WsjZ.js} +0 -0
  238. /package/dist/assets/{conversation-selection-DA_7HozA.js → conversation-selection-CNssqGbG.js} +0 -0
  239. /package/dist/assets/{definitions-DiTBkL0Z.js → definitions-BughTGuV.js} +0 -0
  240. /package/dist/assets/{dist-FMUOufe0.js → dist-Ztj3rqLK.js} +0 -0
  241. /package/dist/assets/{edit-chat-session-B8pCxoj8.js → edit-chat-session-DcCgw5Qy.js} +0 -0
  242. /package/dist/assets/{effective-timezone-CND2iNaq.js → effective-timezone-B99h9zr7.js} +0 -0
  243. /package/dist/assets/{emoji-catalog-data-Bg0TbcxL.js → emoji-catalog-data-D8lRMt3A.js} +0 -0
  244. /package/dist/assets/{environment-store-DX2nQ26G.js → environment-store-CnVyTyZ7.js} +0 -0
  245. /package/dist/assets/{format-9aopHqZI.js → format-BDkwdD2m.js} +0 -0
  246. /package/dist/assets/{format-date-C4llqVi6.js → format-date-D4tzd1DT.js} +0 -0
  247. /package/dist/assets/{format-file-size-CCd1QKOV.js → format-file-size-BflZ4oxc.js} +0 -0
  248. /package/dist/assets/{haptics-sqdfYVvS.js → haptics-BE_0g4mc.js} +0 -0
  249. /package/dist/assets/{impersonate-version-flag-v7MjXJjg.js → impersonate-version-flag-DyVWQf97.js} +0 -0
  250. /package/dist/assets/{lib-BUVy-xYr.js → lib-BNGjysgr.js} +0 -0
  251. /package/dist/assets/{llm-dimension-lLHLPAPE.js → llm-dimension-8g-Go8uq.js} +0 -0
  252. /package/dist/assets/{misc-Bm2e0rTa.js → misc-CFzLzLPH.js} +0 -0
  253. /package/dist/assets/{native-deep-link-DGAUYRAY.js → native-deep-link-C2-dXaz_.js} +0 -0
  254. /package/dist/assets/{pdf-RkJbZQTD.js → pdf-B-YWzK66.js} +0 -0
  255. /package/dist/assets/{prechat-names-DqbiM_xi.js → prechat-names-NPlBAwCy.js} +0 -0
  256. /package/dist/assets/{proxy-i05YF9w2.js → proxy-BgtfAoJj.js} +0 -0
  257. /package/dist/assets/{public-asset-B78MSgNd.js → public-asset-C2P77n3W.js} +0 -0
  258. /package/dist/assets/{react-query.gen-DiTBi6eG.js → react-query.gen-gQ1_8EHv.js} +0 -0
  259. /package/dist/assets/{routes-Cj4wRAOK.js → routes-C6gxiCrz.js} +0 -0
  260. /package/dist/assets/{semver-ilCx6Qwk.js → semver-0cyB3qXO.js} +0 -0
  261. /package/dist/assets/{setting-row-DodPe3yk.js → setting-row-BGQgDyhv.js} +0 -0
  262. /package/dist/assets/{status-badge-pill-Bwe3k-op.js → status-badge-pill-j3ke1d9o.js} +0 -0
  263. /package/dist/assets/{step-indicator-dots-DjUaEVje.js → step-indicator-dots-Bc6X141I.js} +0 -0
  264. /package/dist/assets/{typed-storage-CNJeje_7.js → typed-storage-DjORmu8t.js} +0 -0
  265. /package/dist/assets/{usage-window-CL2KEFPC.js → usage-window-B-YOzKJi.js} +0 -0
  266. /package/dist/assets/{use-bus-subscription-CNRtVrPC.js → use-bus-subscription-BNaztnO7.js} +0 -0
  267. /package/dist/assets/{use-is-mobile-BGESxQUL.js → use-is-mobile-jACt_z2d.js} +0 -0
  268. /package/dist/assets/{workflow-status-PqQ1OqJN.js → workflow-status-ByHycBJ_.js} +0 -0
  269. /package/dist/assets/{xterm-CRS9jN9Y.js → xterm-B8LaLTHh.js} +0 -0
  270. /package/dist/assets/{xterm-addon-fit-gN9udZ6n.js → xterm-addon-fit--RE59D-m.js} +0 -0
@@ -1 +1 @@
1
- import{p as e,r as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{a as r}from"./routes-Cj4wRAOK.js";import{t as i}from"./assistant-identity-store-iWGqR8uz.js";import{t as a}from"./plugins-surface-KFX25A-q.js";var o=n();function s(){let n=i.use.version(),s=a(),{name:c}=e();return n===null?null:s?c?(0,o.jsx)(t,{to:`${r.plugins}?plugin=${encodeURIComponent(c)}`,replace:!0}):(0,o.jsx)(t,{to:r.plugins,replace:!0}):(0,o.jsx)(t,{to:r.identity,replace:!0})}export{s as PluginDetailPage};
1
+ import{p as e,r as t}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{a as r}from"./routes-C6gxiCrz.js";import{t as i}from"./assistant-identity-store-cODRsfVo.js";import{t as a}from"./plugins-surface-gCrqfOas.js";var o=n();function s(){let n=i.use.version(),s=a(),{name:c}=e();return n===null?null:s?c?(0,o.jsx)(t,{to:`${r.plugins}?plugin=${encodeURIComponent(c)}`,replace:!0}):(0,o.jsx)(t,{to:r.plugins,replace:!0}):(0,o.jsx)(t,{to:r.identity,replace:!0})}export{s as PluginDetailPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D-AX8Voo.js";import{h as o,r as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./useMutation-Lj4VunQV.js";import{t as d}from"./jsx-runtime-CVSDxk6A.js";import{t as f}from"./card-BibIM9x3.js";import{n as p,t as m}from"./panel-item-Q1g7DFJw.js";import"./src-B-I7oowl.js";import{t as h}from"./confirm-dialog-bfBx6UYv.js";import{t as g}from"./tag-CW6WC4fE.js";import{t as _}from"./popover-BUj2v1xo.js";import{t as v}from"./input-D4W4p0pZ.js";import{t as y}from"./toggle-X_kQW5my.js";import{n as b}from"./toast-sdJJ6aTV.js";import{t as x}from"./createLucideIcon-BlMXrA59.js";import{t as S}from"./arrow-left-CP-EhDNF.js";import{t as C}from"./check-D6WkI0gF.js";import{t as w}from"./cloud-off-rAv4OHmv.js";import{t as T}from"./external-link-RJkZLlff.js";import{i as E,n as ee,r as D,t as O}from"./use-skill-categories-Bgl1CV8z.js";import{t as k}from"./globe-D3P5sSKJ.js";import{t as te}from"./hard-drive-CZEg1Cqc.js";import{t as A}from"./loader-circle-BFRVtR3K.js";import{t as ne}from"./sparkles-Bla177ar.js";import{t as j}from"./triangle-alert-C3aHZq1F.js";import{t as M}from"./x-DxL-bCuT.js";import{Tn as N,kn as P,wn as re}from"./sdk.gen-zA5ns5LT.js";import{Jt as ie,Kt as ae,at as oe,et as se,it as F,nt as ce,qt as le}from"./react-query.gen-BwkZCSTW.js";import{a as I}from"./routes-C6gxiCrz.js";import{n as ue}from"./use-is-mobile-jACt_z2d.js";import{t as de}from"./assistant-identity-store-cODRsfVo.js";import{t as L}from"./misc-CFzLzLPH.js";import{Da as R,Di as z,Ea as B,Et as V,Ji as H,L as U,Oi as fe,Pa as W,Si as pe,sr as me,ua as he,ui as G}from"./index-FlO-C4WJ.js";import{t as ge}from"./use-active-assistant-id-BVzVN4_g.js";import{t as _e}from"./plugins-surface-gCrqfOas.js";var ve=x(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=e(r(),1),q=d(),ye={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function J({external:e=!1,size:t=`sm`,className:n}){let r=e?`📦`:`🧩`;return(0,q.jsx)(`span`,{className:L(`flex shrink-0 items-center justify-center`,ye[t],n),children:r})}var be=e=>`Remove "${e}" from this assistant?`,xe=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,Se=`Upgrade anyway`,Ce=`Failed to install plugin. Please try again.`,we=`Failed to remove plugin. Please try again.`,Te=`Failed to upgrade plugin. Please try again.`,Ee=`Failed to update plugin. Please try again.`;function De(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function Oe(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function ke(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Ae(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function Y(e){return e?e.slice(0,7):`unknown`}function X({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,q.jsx)(`dl`,{className:L(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,q.jsxs)(`div`,{className:`contents`,children:[(0,q.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,q.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,q.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,q.jsx)(T,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function je({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:i,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,K.useState)(!1),[g,_]=(0,K.useState)(!1),v=e.installed??!1,b=e.artifact??null,x=t?.status===`update-available`,S=x?`Upgrade ${Y(t?.local?.commit??null)} → ${Y(t?.remote?.commit??null)}`:void 0;return(0,q.jsxs)(q.Fragment,{children:[v?(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,q.jsx)(y,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,b?(0,q.jsx)(a,{asChild:!0,leftIcon:(0,q.jsx)(he,{"aria-hidden":!0}),children:(0,q.jsx)(`a`,{href:b.url,download:!0,children:b.label??`Download`})}):null,x?(0,q.jsx)(a,{type:`button`,onClick:()=>{if(l){_(!0);return}i()},disabled:c,title:S,leftIcon:c?(0,q.jsx)(A,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(R,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,q.jsx)(a,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,q.jsx)(A,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(G,{"aria-hidden":!0}),children:`Remove`})]}):(0,q.jsx)(a,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,q.jsx)(A,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(W,{"aria-hidden":!0}),children:`Install`}),(0,q.jsx)(h,{open:p,title:`Remove plugin`,message:be(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,q.jsx)(h,{open:g,title:`Upgrade plugin`,message:xe(e.name),confirmLabel:Se,destructive:!0,onConfirm:()=>{_(!1),i()},onCancel:()=>_(!1)})]})}function Z(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,q.jsx)(A,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Q(){return(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,q.jsx)(j,{className:`h-6 w-6`,"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,q.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function Me({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?Ce:t?we:n?Te:null;return r?(0,q.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,q.jsx)(j,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function Ne({external:e,className:t}){let n=e?{label:`External`,icon:k}:{label:`Local`,icon:te};return(0,q.jsx)(g,{tone:`neutral`,leftIcon:(0,K.createElement)(n.icon),className:t,children:n.label})}function Pe({onClick:e,isUpgrading:t=!1}={}){let n=(0,q.jsx)(g,{tone:`warning`,leftIcon:(0,K.createElement)(t?A:R,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,q.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var Fe=300*1e3;function Ie({assistantId:e,name:t,enabled:n=!0}){return l({...ce({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:Fe,retry:!1})}function Le(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function Re(e,t,n){let r=c(),i=n?.onRemoved,a=l({...se({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Ie({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,K.useCallback)(()=>me(r,e,t),[e,t,r]),u=ie({onSuccess:()=>{s(),b.success(`Installed ${t||`plugin`}`)}}),d=ae({onSuccess:()=>{s(),i?.()}}),f=le({onSuccess:e=>{s(),b.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${Y(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{u.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:u.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:u.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:Le(o)}}function ze(e){let t=c(),n={queryKey:F({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=u({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?N({path:{assistant_id:e,name:t},throwOnError:!1}):re({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),b.error(Ee)},onSettled:(n,r,i)=>{me(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function Be({assistantId:e,name:t,onBack:n,externalHint:r,enabled:i}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:m,isRemoving:h,isUpgrading:g,isInstallError:_,isRemoveError:v,isUpgradeError:y,hasLocalEdits:b}=Re(e,t,{onRemoved:n}),{toggle:x,togglingName:C}=ze(e);return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,q.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,q.jsx)(a,{type:`button`,variant:`ghost`,iconOnly:(0,q.jsx)(S,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,q.jsx)(Ve,{name:t,plugin:o,externalHint:r,drift:s,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:m,isRemoving:h,isUpgrading:g,hasLocalEdits:b,enabled:i,onToggle:()=>x(t,!i),isToggling:C===t})]}),(_||v||y)&&(0,q.jsx)(Me,{isInstallError:_,isRemoveError:v,isUpgradeError:y}),(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(U,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Ve({name:e,plugin:t,externalHint:n,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l,hasLocalEdits:u,enabled:d,onToggle:f,isToggling:p}){let m=t?.source?.kind===`github`,h=t?m:n,g=r?.status===`update-available`;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[h===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:h,size:`md`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,q.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,q.jsx)(Ne,{external:m}):null,g?(0,q.jsx)(Pe,{}):null]}),t?.description?(0,q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,q.jsx)(je,{plugin:t,drift:r,onInstall:i,onRemove:a,onUpgrade:o,isInstalling:s,isRemoving:c,isUpgrading:l,hasLocalEdits:u,enabled:d,onToggle:f,isToggling:p}):null]})}var He=e(i(),1);function Ue({assistantId:e,name:t,onBack:n,externalHint:r,enabled:i}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:p,isInstalling:m,isRemoving:h,isUpgrading:g,isInstallError:_,isRemoveError:v,isUpgradeError:y,hasLocalEdits:b}=Re(e,t,{onRemoved:n}),{toggle:x,togglingName:C}=ze(e),[w,T]=(0,K.useState)(null);(0,K.useEffect)(()=>{T(document.getElementById(`viewport-overlays`))},[]);let E=o?.source?.kind===`github`,ee=o?E:r,D=s?.status===`update-available`,O=o?.name??t,k=(0,q.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsx)(a,{variant:`ghost`,iconOnly:(0,q.jsx)(S,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[ee===void 0?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,q.jsx)(J,{external:ee,size:`md`}),(0,q.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[D?(0,q.jsx)(Pe,{}):null,o?(0,q.jsx)(Ne,{external:E}):null]})]}),o?.description?(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,q.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,q.jsx)(je,{plugin:o,drift:s,enabled:i,onToggle:()=>x(t,!i),isToggling:C===t,onInstall:u,onRemove:d,onUpgrade:p,isInstalling:m,isRemoving:h,isUpgrading:g,hasLocalEdits:b})}):null,(_||v||y)&&(0,q.jsx)(`div`,{className:`mt-3`,children:(0,q.jsx)(Me,{isInstallError:_,isRemoveError:v,isUpgradeError:y})}),(0,q.jsx)(f.Root,{asChild:!0,noPadding:!0,children:(0,q.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,q.jsx)(Z,{}):l||!o?(0,q.jsx)(Q,{}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(X,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,q.jsx)(U,{content:o.readme}):(0,q.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return w?(0,He.createPortal)(k,w):k}var We={value:`all`,label:`All`,icon:H},Ge={value:`available`,label:`Available`,icon:W};function Ke(e){return e?[We,{value:`active`,label:`Active`,icon:fe},{value:`off`,label:`Off`,icon:ve},Ge]:[We,{value:`installed`,label:`Installed`,icon:B},Ge]}function qe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i=!1,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(v,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search plugins`,"aria-label":`Search plugins`,leftIcon:(0,q.jsx)(pe,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,q.jsx)(A,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,q.jsx)(Je,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginToggleSupported:d})]})}function Je(e){let t=ue(),[n,r]=(0,K.useState)(!1),i=(0,q.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,q.jsx)(E,{"aria-hidden":!0}),"aria-label":`Filter plugins`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,q.jsx)(Ye,{...e,open:n,onOpenChange:r,trigger:i}):(0,q.jsxs)(_.Root,{open:n,onOpenChange:r,children:[(0,q.jsx)(_.Trigger,{asChild:!0,children:i}),(0,q.jsx)(_.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,q.jsx)(`ul`,{role:`listbox`,children:(0,q.jsx)(Qe,{label:`Status`,options:Ke(e.pluginToggleSupported),selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})})})]})}function Ye({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,pluginToggleSupported:l,open:u,onOpenChange:d,trigger:f}){let m=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,q.jsxs)(p.Root,{open:u,onOpenChange:d,children:[(0,q.jsx)(p.Trigger,{asChild:!0,children:f}),(0,q.jsxs)(p.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,q.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,q.jsx)(p.Header,{children:(0,q.jsx)(p.Title,{children:`Filters`})}),(0,q.jsxs)(p.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,q.jsx)(Xe,{label:`Status`,children:Ke(l).map(n=>(0,q.jsx)(Ze,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),n.length>0&&(0,q.jsxs)(Xe,{label:`Categories`,children:[(0,q.jsx)(Ze,{icon:H,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),m.map(e=>(0,q.jsx)(Ze,{icon:D(e.icon)??H,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,q.jsx)(p.Footer,{children:(0,q.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function Xe({label:e,children:t}){return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function Ze({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,q.jsx)(m,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,q.jsx)(C,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Qe({label:e,options:t,selected:n,onSelect:r}){return(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,q.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,q.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,q.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,q.jsx)(B,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function $e({item:e,drift:t,onSelect:n,onInstall:r,onRemove:i,onUpgrade:o,isInstalling:s=!1,isRemoving:c=!1,isUpgrading:l=!1}){let u=e.status===`available`,d=t?.status===`update-available`,p=e.enabled!==void 0,m=e.enabled===!1;return(0,q.jsx)(f.Root,{asChild:!0,children:(0,q.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:n,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsx)(J,{size:`sm`,external:e.external,className:m?`opacity-50`:void 0}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:m?`var(--content-tertiary)`:`var(--content-emphasised)`},children:e.name}),e.version?(0,q.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,e.version]}):null,d?(0,q.jsx)(Pe,{onClick:o,isUpgrading:l}):null]}),(0,q.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description??`No description provided.`}),e.issues&&e.issues.length>0?(0,q.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:e.issues.join(`; `),children:[e.issues[0],e.issues.length>1?` (+${e.issues.length-1} more)`:``]}):null]}),u?s?(0,q.jsx)(a,{type:`button`,iconOnly:(0,q.jsx)(A,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,q.jsx)(a,{type:`button`,iconOnly:(0,q.jsx)(W,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!r,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[p?(0,q.jsx)(g,{tone:e.enabled?`positive`:`neutral`,children:e.enabled?`Enabled`:`Disabled`}):null,(0,q.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:c?(0,q.jsx)(A,{className:`animate-spin`,"aria-hidden":!0}):(0,q.jsx)(G,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),i?.()},disabled:c||l||!i,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var et=300*1e3,$=[],tt=[];async function nt(e,t,n){let r=await P({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function rt(e,t){let[n,r]=(0,K.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,K.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function it(e,t=null){let n=t??void 0,r=l({queryKey:F({path:{assistant_id:e},query:{q:void 0,category:n}}),queryFn:({signal:t})=>nt(e,n,t),enabled:!!e,staleTime:et}),i=l({...V(e),enabled:!!e&&t!==null}),a=l({...oe({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e,staleTime:et}),o=(0,K.useMemo)(()=>{let e=t===null?r.data?.plugins:i.data?.plugins??r.data?.plugins;return new Set((e??$).map(e=>e.name))},[t,i.data?.plugins,r.data?.plugins]),s=(0,K.useMemo)(()=>{let e=r.data?.plugins??$,n=a.data?.matches??tt;return ke(De(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!o.has(e.name))))},[r.data?.plugins,a.data?.matches,t,o]),u=t===null?r.data:i.data,d=rt(e,u?.categoryCounts!==void 0),f=rt(e,(u?.plugins??$).some(e=>e.enabled!==void 0)),p=c(),m=(0,K.useRef)(null);return(0,K.useEffect)(()=>{if(m.current===e||!a.isSuccess)return;let t=u?.plugins;if(!t?.length)return;let n=new Map((a.data?.matches??tt).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(m.current=e,p.invalidateQueries({queryKey:F({path:{assistant_id:e},query:{q:void 0}})}))},[e,a.isSuccess,a.data?.matches,u?.plugins,p]),{items:s,isLoading:r.isLoading,catalogLoading:a.isLoading,isError:r.isError,isFetching:r.isFetching||a.isFetching,catalogError:a.isError,categorySupported:d,pluginToggleSupported:f,installedCategoryCounts:u?.categoryCounts,installedPlugins:u?.plugins??$,installedTotal:u?.totalCount,catalogMatches:a.data?.matches??tt,unfilteredInstalledNames:o}}var at=`vellum:plugins:tipDismissed`;function ot({assistantId:e}){let r=c(),i=ue(),[a,s]=o(),l=a.get(`plugin`),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(`all`),[m,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(null),[y,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,D]=(0,K.useState)(null),[k,te]=(0,K.useState)(()=>n(at,!1)),[A,ne]=(0,K.useState)(e);e!==A&&(ne(e),g(null));let j=e===A?m:null,{data:M=[]}=O(e),{items:N,isLoading:P,catalogLoading:re,isError:oe,isFetching:se,catalogError:F,categorySupported:ce,pluginToggleSupported:I,installedCategoryCounts:de,installedPlugins:L,installedTotal:R,catalogMatches:z,unfilteredInstalledNames:B}=it(e,j),V=(I?[`all`,`active`,`off`,`available`]:[`all`,`installed`,`available`]).includes(f)?f:`all`,{counts:H,totalCount:U}=st(de,L,R,z,B,V),fe=ce&&M.length>0,W=(0,K.useCallback)(t=>me(r,e,t),[e,r]),pe=ie({onMutate:e=>v(e.body.name),onSuccess:(e,t)=>b.success(`Installed ${t.body.name}`),onError:()=>b.error(Ce),onSettled:(e,t,n)=>{v(null),W(n.body.name)}}),he=ae({onMutate:e=>x(e.path.name),onSuccess:(e,t)=>b.success(`Removed ${t.path.name}`),onError:()=>b.error(we),onSettled:(e,t,n)=>{x(null),W(n.path.name)}}),G=le({onMutate:e=>C(e.path.name),onSuccess:(e,t)=>b.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${Y(e.toCommit)}`),onError:()=>b.error(Te),onSettled:(e,t,n)=>{C(null),W(n.path.name)}}),ge=(0,K.useCallback)(e=>s(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[s]),_e=(0,K.useCallback)(()=>s(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[s]),ve=(0,K.useCallback)(t=>{pe.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,pe]),ye=(0,K.useCallback)(()=>{w&&(he.mutate({path:{assistant_id:e,name:w.name}}),T(null))},[e,w,he]),J=(0,K.useCallback)(t=>{G.mutate({path:{assistant_id:e,name:t},body:{}})},[e,G]),Ee=(0,K.useCallback)(()=>{E&&(J(E.name),D(null))},[E,J]),De=(0,K.useCallback)((e,t)=>{if(Le(t)){D(e);return}J(e.name)},[J]),ke=(0,K.useCallback)(()=>{te(!0),t(at,!0)},[]),X=(0,K.useMemo)(()=>Ae(N,V).filter(e=>Oe(e,u)),[N,V,u]),je=se&&!P,Z=u.trim().length>0;if(l){let t=N.find(e=>e.name===l),n={assistantId:e,name:l,externalHint:t?.external,enabled:t?.enabled,onBack:_e};return i?(0,q.jsx)(Ue,{...n}):(0,q.jsx)(Be,{...n})}let Q=(0,q.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:P?(0,q.jsx)(dt,{}):oe?(0,q.jsx)(ft,{}):X.length===0?re&&(V===`all`||V===`available`)?(0,q.jsx)(dt,{}):(0,q.jsx)(pt,{filter:V,category:j}):(0,q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:X.map(t=>(0,q.jsx)(`li`,{children:t.status===`installed`?(0,q.jsx)(ct,{assistantId:e,item:t,onSelect:()=>ge(t),onRemove:()=>T(t),onUpgrade:e=>De(t,e),isRemoving:y===t.name,isUpgrading:S===t.name}):(0,q.jsx)($e,{item:t,onSelect:()=>ge(t),onInstall:()=>ve(t),isInstalling:_===t.name})},t.name))})});return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!k&&(0,q.jsx)(lt,{onDismiss:ke}),(0,q.jsx)(qe,{search:u,onSearchChange:d,filter:V,onFilterChange:p,isSearching:je,categories:fe?M:[],category:j,onCategoryChange:g,counts:H,totalCount:U,showCounts:!Z,pluginToggleSupported:I}),F&&!P&&!oe?(0,q.jsx)(ut,{}):null,fe?(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,q.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto md:block`,children:(0,q.jsx)(ee,{ariaLabel:`Plugin categories`,selected:j,onSelect:g,counts:H,totalCount:U,showCounts:!Z,categories:M})}),Q]}):Q,(0,q.jsx)(h,{open:w!==null,title:`Remove plugin`,message:w?be(w.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:ye,onCancel:()=>T(null)}),(0,q.jsx)(h,{open:E!==null,title:`Upgrade plugin`,message:E?xe(E.name):``,confirmLabel:Se,destructive:!0,onConfirm:Ee,onCancel:()=>D(null)})]})}function st(e,t,n,r,i,a){return(0,K.useMemo)(()=>{let o={},s=a!==`available`,c=a===`all`||a===`available`,l=a===`active`||a===`off`,u=l?t.filter(e=>a===`off`?e.enabled===!1:e.enabled!==!1):t;if(s)if(!l&&e&&Object.keys(e).length>0)Object.assign(o,e);else for(let e of u){let t=e.category??`system`;o[t]=(o[t]??0)+1}let d=0;if(c)for(let e of r){if(i.has(e.name))continue;let t=e.category??`system`;o[t]=(o[t]??0)+1,d+=1}let f=l?u.length:n??t.length;return{counts:o,totalCount:(s?f:0)+d}},[e,t,n,r,i,a])}function ct({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Ie({assistantId:e,name:t.name}).data;return(0,q.jsx)($e,{item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function lt({onDismiss:e}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(ne,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Browse the catalog below to install plugins that extend your assistant.`}),(0,q.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(M,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function ut(){return(0,q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,q.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`p`,{className:`flex-1`,children:`Catalog browsing is temporarily unavailable. Installed plugins are still listed below.`})]})}function dt(){return(0,q.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,q.jsx)(A,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function ft(){return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(j,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load plugins`}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function pt({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=mt(e,t);return(0,q.jsx)(f.Root,{children:(0,q.jsxs)(f.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,q.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,q.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,q.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function mt(e,t){if(t)return{title:`No plugins in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:H};switch(e){case`installed`:return{title:`No Plugins Installed`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:z};case`active`:return{title:`No Active Plugins`,subtitle:`Install a plugin from the catalog, or turn on an installed one.`,Icon:z};case`off`:return{title:`No Plugins Turned Off`,subtitle:`Installed plugins you turn off will appear here.`,Icon:z};case`available`:return{title:`No Plugins Available`,subtitle:`Every catalog plugin is already installed.`,Icon:B};default:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:z}}}function ht(){let e=de.use.version(),t=_e(),n=ge();return e===null?null:t?(0,q.jsx)(ot,{assistantId:n}):(0,q.jsx)(s,{to:I.identity,replace:!0})}export{ht as PluginsPage};
@@ -0,0 +1 @@
1
+ import{n as e}from"./utils-P-AuKiE9.js";var t=`0.10.3`;function n(){return e(t)}export{n as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,l as p,m,o as h,p as ee,s as te,u as ne,v as re,y as g}from"./button-D7s2Q_uG.js";import{t as _}from"./jsx-runtime-CVSDxk6A.js";import{a as v,o as y,t as b}from"./cn-DvW5mxZR.js";import{n as x,t as S}from"./dist-cApvLul2.js";import{a as ie,i as ae,n as C,r as oe,t as w}from"./Combination-4Qc3vrtW.js";var T=e(t(),1),E=_(),D=`Popper`,[O,k]=r(D),[se,A]=O(D),j=e=>{let{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return(0,E.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};j.displayName=D;var M=`PopperAnchor`,N=T.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:i,...a}=e,o=A(M,r),s=T.useRef(null),c=y(t,s),l=T.useRef(null);return T.useEffect(()=>{let e=l.current;l.current=i?.current||s.current,e!==l.current&&o.onAnchorChange(l.current)}),i?null:(0,E.jsx)(n.div,{...a,ref:c})});N.displayName=M;var P=`PopperContent`,[ce,F]=O(P),I=T.forwardRef((e,t)=>{let{__scopePopper:r,side:o=`bottom`,sideOffset:p=0,align:h=`center`,alignOffset:te=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:x=`partial`,hideWhenDetached:S=!1,updatePositionStrategy:ie=`optimized`,onPlaced:ae,...C}=e,oe=A(P,r),[w,D]=T.useState(null),O=y(t,e=>D(e)),[k,se]=T.useState(null),j=c(k),M=j?.width??0,N=j?.height??0,F=o+(h===`center`?``:`-`+h),I=typeof b==`number`?b:{top:0,right:0,bottom:0,left:0,...b},L=Array.isArray(v)?v:[v],le=L.length>0,R={padding:I,boundary:L.filter(ue),altBoundary:le},{refs:B,floatingStyles:V,placement:H,isPositioned:U,middlewareData:W}=a({strategy:`fixed`,placement:F,whileElementsMounted:(...e)=>re(...e,{animationFrame:ie===`always`}),elements:{reference:oe.anchor},middleware:[m({mainAxis:p+N,alignmentAxis:te}),_&&f({mainAxis:!0,crossAxis:!1,limiter:x===`partial`?ee():void 0,...R}),_&&l({...R}),d({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),k&&ne({element:k,padding:g}),de({arrowWidth:M,arrowHeight:N}),S&&u({strategy:`referenceHidden`,...R})]}),[G,fe]=z(H),K=i(ae);s(()=>{U&&K?.()},[U,K]);let pe=W.arrow?.x,me=W.arrow?.y,q=W.arrow?.centerOffset!==0,[J,he]=T.useState();return s(()=>{w&&he(window.getComputedStyle(w).zIndex)},[w]),(0,E.jsx)(`div`,{ref:B.setFloating,"data-radix-popper-content-wrapper":``,style:{...V,transform:U?V.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:J,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(` `),...W.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,E.jsx)(ce,{scope:r,placedSide:G,onArrowChange:se,arrowX:pe,arrowY:me,shouldHideArrow:q,children:(0,E.jsx)(n.div,{"data-side":G,"data-align":fe,...C,ref:O,style:{...C.style,animation:U?void 0:`none`}})})})});I.displayName=P;var L=`PopperArrow`,le={top:`bottom`,right:`left`,bottom:`top`,left:`right`},R=T.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=F(L,n),a=le[i.placedSide];return(0,E.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,E.jsx)(p,{...r,ref:t,style:{...r.style,display:`block`}})})});R.displayName=L;function ue(e){return e!==null}var de=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=z(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function z(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var B=j,V=N,H=I,U=R;function W(e){let t=G(e),n=T.forwardRef((e,n)=>{let{children:r,...i}=e,a=T.Children.toArray(r),o=a.find(K);if(o){let e=o.props.children,r=a.map(t=>t===o?T.Children.count(e)>1?T.Children.only(null):T.isValidElement(e)?e.props.children:null:t);return(0,E.jsx)(t,{...i,ref:n,children:T.isValidElement(e)?T.cloneElement(e,void 0,r):null})}return(0,E.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function G(e){let t=T.forwardRef((e,t)=>{let{children:n,...r}=e;if(T.isValidElement(n)){let e=me(n),i=pe(r,n.props);return n.type!==T.Fragment&&(i.ref=t?v(t,e):e),T.cloneElement(n,i)}return T.Children.count(n)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fe=Symbol(`radix.slottable`);function K(e){return T.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fe}function pe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function me(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q=`Popover`,[J,he]=r(q,[k]),Y=k(),[ge,X]=J(q),Z=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=T.useRef(null),[l,u]=T.useState(!1),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:q});return(0,E.jsx)(B,{...s,children:(0,E.jsx)(ge,{scope:t,contentId:g(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:o,children:n})})};Z.displayName=q;var _e=`PopoverAnchor`,ve=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(_e,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return T.useEffect(()=>(o(),()=>s()),[o,s]),(0,E.jsx)(V,{...a,...r,ref:t})});ve.displayName=_e;var ye=`PopoverTrigger`,be=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ye,r),o=Y(r),s=y(t,a.triggerRef),c=(0,E.jsx)(n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ne(a.open),...i,ref:s,onClick:x(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,E.jsx)(V,{asChild:!0,...o,children:c})});be.displayName=ye;var Q=`PopoverPortal`,[xe,Se]=J(Q,{forceMount:void 0}),Ce=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Q,t);return(0,E.jsx)(xe,{scope:t,forceMount:n,children:(0,E.jsx)(S,{present:n||a.open,children:(0,E.jsx)(te,{asChild:!0,container:i,children:r})})})};Ce.displayName=Q;var $=`PopoverContent`,we=T.forwardRef((e,t)=>{let n=Se($,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopePopover);return(0,E.jsx)(S,{present:r||a.open,children:a.modal?(0,E.jsx)(Ee,{...i,ref:t}):(0,E.jsx)(De,{...i,ref:t})})});we.displayName=$;var Te=W(`PopoverContent.RemoveScroll`),Ee=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(null),i=y(t,r),a=T.useRef(!1);return T.useEffect(()=>{let e=r.current;if(e)return C(e)},[]),(0,E.jsx)(w,{as:Te,allowPinchZoom:!0,children:(0,E.jsx)(Oe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),De=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return(0,E.jsx)(Oe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Oe=T.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X($,n),p=Y(n);return ae(),(0,E.jsx)(oe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,E.jsx)(H,{"data-state":Ne(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ke=`PopoverClose`,Ae=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ke,r);return(0,E.jsx)(n.button,{type:`button`,...i,ref:t,onClick:x(e.onClick,()=>a.onOpenChange(!1))})});Ae.displayName=ke;var je=`PopoverArrow`,Me=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,E.jsx)(U,{...i,...r,ref:t})});Me.displayName=je;function Ne(e){return e?`open`:`closed`}var Pe=Z,Fe=ve,Ie=be,Le=Ce,Re=we,ze=Ae,Be=Pe;function Ve(e){return(0,E.jsx)(Ie,{"data-slot":`popover-trigger`,...e})}function He(e){return(0,E.jsx)(ze,{"data-slot":`popover-close`,...e})}function Ue(e){return(0,E.jsx)(Fe,{"data-slot":`popover-anchor`,...e})}function We({className:e,children:t,sideOffset:n=6,align:r=`center`,ref:i,...a}){let s=o();return(0,E.jsx)(Le,{container:s??void 0,children:(0,E.jsx)(Re,{ref:i,"data-slot":`popover-content`,align:r,sideOffset:n,className:b(`z-50 rounded-lg bg-[var(--surface-lift)] p-2 shadow-[var(--shadow-popover)] outline-none`,`text-[color:var(--content-default)]`,`data-[state=open]:animate-[popoverIn_120ms_ease-out]`,e),...a,children:t})})}var Ge={Root:Be,Trigger:Ve,Content:We,Close:He,Anchor:Ue};export{B as a,H as i,V as n,k as o,U as r,Ge as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{C as n,E as r,S as i,_ as a,a as o,b as s,c,d as l,f as u,g as d,h as f,l as p,m,o as h,p as ee,s as te,u as ne,v as re,y as g}from"./button-D-AX8Voo.js";import{t as _}from"./jsx-runtime-CVSDxk6A.js";import{a as v,o as y,t as b}from"./cn-DvW5mxZR.js";import{n as x,t as S}from"./dist-Ddn3FnfV.js";import{a as ie,i as ae,n as C,r as oe,t as w}from"./Combination-UBPhVLWy.js";var T=e(t(),1),E=_(),D=`Popper`,[O,k]=r(D),[se,A]=O(D),j=e=>{let{__scopePopper:t,children:n}=e,[r,i]=T.useState(null);return(0,E.jsx)(se,{scope:t,anchor:r,onAnchorChange:i,children:n})};j.displayName=D;var M=`PopperAnchor`,N=T.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:i,...a}=e,o=A(M,r),s=T.useRef(null),c=y(t,s),l=T.useRef(null);return T.useEffect(()=>{let e=l.current;l.current=i?.current||s.current,e!==l.current&&o.onAnchorChange(l.current)}),i?null:(0,E.jsx)(n.div,{...a,ref:c})});N.displayName=M;var P=`PopperContent`,[ce,F]=O(P),I=T.forwardRef((e,t)=>{let{__scopePopper:r,side:o=`bottom`,sideOffset:p=0,align:h=`center`,alignOffset:te=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:v=[],collisionPadding:b=0,sticky:x=`partial`,hideWhenDetached:S=!1,updatePositionStrategy:ie=`optimized`,onPlaced:ae,...C}=e,oe=A(P,r),[w,D]=T.useState(null),O=y(t,e=>D(e)),[k,se]=T.useState(null),j=c(k),M=j?.width??0,N=j?.height??0,F=o+(h===`center`?``:`-`+h),I=typeof b==`number`?b:{top:0,right:0,bottom:0,left:0,...b},L=Array.isArray(v)?v:[v],le=L.length>0,R={padding:I,boundary:L.filter(ue),altBoundary:le},{refs:B,floatingStyles:V,placement:H,isPositioned:U,middlewareData:W}=a({strategy:`fixed`,placement:F,whileElementsMounted:(...e)=>re(...e,{animationFrame:ie===`always`}),elements:{reference:oe.anchor},middleware:[m({mainAxis:p+N,alignmentAxis:te}),_&&f({mainAxis:!0,crossAxis:!1,limiter:x===`partial`?ee():void 0,...R}),_&&l({...R}),d({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),k&&ne({element:k,padding:g}),de({arrowWidth:M,arrowHeight:N}),S&&u({strategy:`referenceHidden`,...R})]}),[G,fe]=z(H),K=i(ae);s(()=>{U&&K?.()},[U,K]);let pe=W.arrow?.x,me=W.arrow?.y,q=W.arrow?.centerOffset!==0,[J,he]=T.useState();return s(()=>{w&&he(window.getComputedStyle(w).zIndex)},[w]),(0,E.jsx)(`div`,{ref:B.setFloating,"data-radix-popper-content-wrapper":``,style:{...V,transform:U?V.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:J,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(` `),...W.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,E.jsx)(ce,{scope:r,placedSide:G,onArrowChange:se,arrowX:pe,arrowY:me,shouldHideArrow:q,children:(0,E.jsx)(n.div,{"data-side":G,"data-align":fe,...C,ref:O,style:{...C.style,animation:U?void 0:`none`}})})})});I.displayName=P;var L=`PopperArrow`,le={top:`bottom`,right:`left`,bottom:`top`,left:`right`},R=T.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=F(L,n),a=le[i.placedSide];return(0,E.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,E.jsx)(p,{...r,ref:t,style:{...r.style,display:`block`}})})});R.displayName=L;function ue(e){return e!==null}var de=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=z(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function z(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var B=j,V=N,H=I,U=R;function W(e){let t=G(e),n=T.forwardRef((e,n)=>{let{children:r,...i}=e,a=T.Children.toArray(r),o=a.find(K);if(o){let e=o.props.children,r=a.map(t=>t===o?T.Children.count(e)>1?T.Children.only(null):T.isValidElement(e)?e.props.children:null:t);return(0,E.jsx)(t,{...i,ref:n,children:T.isValidElement(e)?T.cloneElement(e,void 0,r):null})}return(0,E.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function G(e){let t=T.forwardRef((e,t)=>{let{children:n,...r}=e;if(T.isValidElement(n)){let e=me(n),i=pe(r,n.props);return n.type!==T.Fragment&&(i.ref=t?v(t,e):e),T.cloneElement(n,i)}return T.Children.count(n)>1?T.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fe=Symbol(`radix.slottable`);function K(e){return T.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===fe}function pe(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function me(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q=`Popover`,[J,he]=r(q,[k]),Y=k(),[ge,X]=J(q),Z=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Y(t),c=T.useRef(null),[l,u]=T.useState(!1),[d,f]=h({prop:r,defaultProp:i??!1,onChange:a,caller:q});return(0,E.jsx)(B,{...s,children:(0,E.jsx)(ge,{scope:t,contentId:g(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:T.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:T.useCallback(()=>u(!0),[]),onCustomAnchorRemove:T.useCallback(()=>u(!1),[]),modal:o,children:n})})};Z.displayName=q;var _e=`PopoverAnchor`,ve=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=X(_e,n),a=Y(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return T.useEffect(()=>(o(),()=>s()),[o,s]),(0,E.jsx)(V,{...a,...r,ref:t})});ve.displayName=_e;var ye=`PopoverTrigger`,be=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ye,r),o=Y(r),s=y(t,a.triggerRef),c=(0,E.jsx)(n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Ne(a.open),...i,ref:s,onClick:x(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:(0,E.jsx)(V,{asChild:!0,...o,children:c})});be.displayName=ye;var Q=`PopoverPortal`,[xe,Se]=J(Q,{forceMount:void 0}),Ce=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=X(Q,t);return(0,E.jsx)(xe,{scope:t,forceMount:n,children:(0,E.jsx)(S,{present:n||a.open,children:(0,E.jsx)(te,{asChild:!0,container:i,children:r})})})};Ce.displayName=Q;var $=`PopoverContent`,we=T.forwardRef((e,t)=>{let n=Se($,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopePopover);return(0,E.jsx)(S,{present:r||a.open,children:a.modal?(0,E.jsx)(Ee,{...i,ref:t}):(0,E.jsx)(De,{...i,ref:t})})});we.displayName=$;var Te=W(`PopoverContent.RemoveScroll`),Ee=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(null),i=y(t,r),a=T.useRef(!1);return T.useEffect(()=>{let e=r.current;if(e)return C(e)},[]),(0,E.jsx)(w,{as:Te,allowPinchZoom:!0,children:(0,E.jsx)(Oe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:x(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:x(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:x(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),De=T.forwardRef((e,t)=>{let n=X($,e.__scopePopover),r=T.useRef(!1),i=T.useRef(!1);return(0,E.jsx)(Oe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Oe=T.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=X($,n),p=Y(n);return ae(),(0,E.jsx)(oe,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,E.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,E.jsx)(H,{"data-state":Ne(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),ke=`PopoverClose`,Ae=T.forwardRef((e,t)=>{let{__scopePopover:r,...i}=e,a=X(ke,r);return(0,E.jsx)(n.button,{type:`button`,...i,ref:t,onClick:x(e.onClick,()=>a.onOpenChange(!1))})});Ae.displayName=ke;var je=`PopoverArrow`,Me=T.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Y(n);return(0,E.jsx)(U,{...i,...r,ref:t})});Me.displayName=je;function Ne(e){return e?`open`:`closed`}var Pe=Z,Fe=ve,Ie=be,Le=Ce,Re=we,ze=Ae,Be=Pe;function Ve(e){return(0,E.jsx)(Ie,{"data-slot":`popover-trigger`,...e})}function He(e){return(0,E.jsx)(ze,{"data-slot":`popover-close`,...e})}function Ue(e){return(0,E.jsx)(Fe,{"data-slot":`popover-anchor`,...e})}function We({className:e,children:t,sideOffset:n=6,align:r=`center`,ref:i,...a}){let s=o();return(0,E.jsx)(Le,{container:s??void 0,children:(0,E.jsx)(Re,{ref:i,"data-slot":`popover-content`,align:r,sideOffset:n,className:b(`z-50 rounded-lg bg-[var(--surface-lift)] p-2 shadow-[var(--shadow-popover)] outline-none`,`text-[color:var(--content-default)]`,`data-[state=open]:animate-[popoverIn_120ms_ease-out]`,e),...a,children:t})})}var Ge={Root:Be,Trigger:Ve,Content:We,Close:He,Anchor:Ue};export{B as a,H as i,V as n,k as o,U as r,Ge as t};
@@ -1 +1 @@
1
- var e=`Wake up, my friend!`;function t(t){let n=t.assistantName?.trim(),r=t.userName?.trim();return!n&&!r?e:`${n?`Hi ${n}`:`Hi`}${r?`, I'm ${r}`:``}. Nice to meet you.`}var n={gmail:`Gmail`,outlook:`Outlook`,"google-calendar":`Google Calendar`,slack:`Slack`,notion:`Notion`,linear:`Linear`,jira:`Jira`,github:`GitHub`,figma:`Figma`,"google-drive":`Google Drive`,excel:`Excel`,"apple-notes":`Apple Notes`},r={"code-building":`builds code, apps, or tools`,writing:`writes docs, emails, or content`,research:`does research and analysis`,"project-management":`plans and coordinates work`,scheduling:`handles meetings, calendar, and logistics`,personal:`handles life admin`},i={chatgpt:`ChatGPT`,claude:`Claude`,openclaw:`OpenClaw`,hermes:`Hermes`,manus:`Manus`,gemini:`Gemini`,copilot:`Copilot`};function a(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function o(e){return e.map(e=>n[e]??a(e))}function s(e){return e.map(e=>r[e]??e)}function c(e){return e.map(e=>i[e]??a(e))}function l(e){return{...e,tools:o(e.tools),tasks:s(e.tasks),priorAssistants:e.priorAssistants?.length?c(e.priorAssistants):e.priorAssistants}}function u(e){let t=l(e);return{preferredName:t.userName?.trim()||void 0,occupation:t.occupation?.trim()||void 0,commonWork:t.tasks,dailyTools:t.tools}}var d=`onboarding.prechat.pendingContext`;function f(){try{return globalThis.sessionStorage??null}catch{return null}}function p(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!Array.isArray(t.tools)||!t.tools.every(e=>typeof e==`string`)||!Array.isArray(t.tasks)||!t.tasks.every(e=>typeof e==`string`)||typeof t.tone!=`string`||t.userName!==void 0&&typeof t.userName!=`string`||t.occupation!==void 0&&typeof t.occupation!=`string`||t.assistantName!==void 0&&typeof t.assistantName!=`string`||t.googleConnected!==void 0&&typeof t.googleConnected!=`boolean`||t.googleScopes!==void 0&&(!Array.isArray(t.googleScopes)||!t.googleScopes.every(e=>typeof e==`string`))||t.priorAssistants!==void 0&&(!Array.isArray(t.priorAssistants)||!t.priorAssistants.every(e=>typeof e==`string`))||t.cohort!==void 0&&typeof t.cohort!=`string`||t.initialMessage!==void 0&&typeof t.initialMessage!=`string`||t.bootstrapTemplate!==void 0&&typeof t.bootstrapTemplate!=`string`||t.skills!==void 0&&(!Array.isArray(t.skills)||!t.skills.every(e=>typeof e==`string`))||t.title!==void 0&&typeof t.title!=`string`)}function m(e){let t=f();if(t!==null)try{t.removeItem(d),t.setItem(d,JSON.stringify(e))}catch{}}function h(){let e=f();if(e===null)return null;let t;try{t=e.getItem(d)}catch{return null}if(t===null)return null;try{e.removeItem(d)}catch{}let n;try{n=JSON.parse(t)}catch{return null}return p(n)?n:null}var g=`onboarding.prechat.assistantName`;function _(e){let t=e.trim();if(!t)return;let n=f();if(n!==null)try{n.setItem(g,t)}catch{}}function v(){let e=f();if(e===null)return null;try{let t=e.getItem(g);return e.removeItem(g),typeof t==`string`&&t.length>0?t:null}catch{return null}}function y(){let e=f();if(e===null)return null;let t;try{t=e.getItem(d)}catch{return null}if(t===null)return null;let n;try{n=JSON.parse(t)}catch{return null}return p(n)?n:null}export{l as a,_ as c,h as i,m as l,t as n,y as o,v as r,u as s,e as t};
1
+ var e=`Wake up, my friend!`;function t(t){let n=t.assistantName?.trim(),r=t.userName?.trim();return!n&&!r?e:`${n?`Hi ${n}`:`Hi`}${r?`, I'm ${r}`:``}. Nice to meet you.`}var n={gmail:`Gmail`,outlook:`Outlook`,"google-calendar":`Google Calendar`,slack:`Slack`,notion:`Notion`,linear:`Linear`,jira:`Jira`,github:`GitHub`,figma:`Figma`,"google-drive":`Google Drive`,excel:`Excel`,"apple-notes":`Apple Notes`},r={"code-building":`builds code, apps, or tools`,writing:`writes docs, emails, or content`,research:`does research and analysis`,"project-management":`plans and coordinates work`,scheduling:`handles meetings, calendar, and logistics`,personal:`handles life admin`},i={chatgpt:`ChatGPT`,claude:`Claude`,openclaw:`OpenClaw`,hermes:`Hermes`,manus:`Manus`,gemini:`Gemini`,copilot:`Copilot`};function a(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function o(e){return e.map(e=>n[e]??a(e))}function s(e){return e.map(e=>r[e]??e)}function c(e){return e.map(e=>i[e]??a(e))}function l(e){return{...e,tools:o(e.tools),tasks:s(e.tasks),priorAssistants:e.priorAssistants?.length?c(e.priorAssistants):e.priorAssistants}}function u(e){let t=l(e);return{preferredName:t.userName?.trim()||void 0,occupation:t.occupation?.trim()||void 0,commonWork:t.tasks,dailyTools:t.tools}}var d=`onboarding.prechat.pendingContext`;function f(){try{return globalThis.sessionStorage??null}catch{return null}}function p(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!Array.isArray(t.tools)||!t.tools.every(e=>typeof e==`string`)||!Array.isArray(t.tasks)||!t.tasks.every(e=>typeof e==`string`)||typeof t.tone!=`string`||t.userName!==void 0&&typeof t.userName!=`string`||t.occupation!==void 0&&typeof t.occupation!=`string`||t.assistantName!==void 0&&typeof t.assistantName!=`string`||t.googleConnected!==void 0&&typeof t.googleConnected!=`boolean`||t.googleScopes!==void 0&&(!Array.isArray(t.googleScopes)||!t.googleScopes.every(e=>typeof e==`string`))||t.priorAssistants!==void 0&&(!Array.isArray(t.priorAssistants)||!t.priorAssistants.every(e=>typeof e==`string`))||t.cohort!==void 0&&typeof t.cohort!=`string`||t.initialMessage!==void 0&&typeof t.initialMessage!=`string`||t.initialMessageHidden!==void 0&&typeof t.initialMessageHidden!=`boolean`||t.bootstrapTemplate!==void 0&&typeof t.bootstrapTemplate!=`string`||t.skills!==void 0&&(!Array.isArray(t.skills)||!t.skills.every(e=>typeof e==`string`))||t.title!==void 0&&typeof t.title!=`string`)}function m(e){let t=f();if(t!==null)try{t.removeItem(d),t.setItem(d,JSON.stringify(e))}catch{}}function h(){let e=f();if(e===null)return null;let t;try{t=e.getItem(d)}catch{return null}if(t===null)return null;try{e.removeItem(d)}catch{}let n;try{n=JSON.parse(t)}catch{return null}return p(n)?n:null}var g=`onboarding.prechat.assistantName`;function _(e){let t=e.trim();if(!t)return;let n=f();if(n!==null)try{n.setItem(g,t)}catch{}}function v(){let e=f();if(e===null)return null;try{let t=e.getItem(g);return e.removeItem(g),typeof t==`string`&&t.length>0?t:null}catch{return null}}function y(){let e=f();if(e===null)return null;let t;try{t=e.getItem(d)}catch{return null}if(t===null)return null;let n;try{n=JSON.parse(t)}catch{return null}return p(n)?n:null}export{l as a,_ as c,h as i,m as l,t as n,y as o,v as r,u as s,e as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-D4W4p0pZ.js";import{c as u,f as d,o as f}from"./local-mode-CgrENuVf.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{n as m}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-left-DghyKSEE.js";import{t as _}from"./loader-circle-BFRVtR3K.js";import{t as v}from"./pencil-B90pDI55.js";import{t as y}from"./x-DxL-bCuT.js";import{A as b,C as ee,a as x,j as S,n as C,o as w}from"./auth-store-DfeW0asJ.js";import{t as T}from"./client.gen-BHupOCJH.js";import{m as te}from"./native-biometric-BK6_QtW5.js";import{a as E}from"./routes-C6gxiCrz.js";import{r as D}from"./platform-detection-Ceodt3Hu.js";import{o as O,r as k}from"./prefs-ef69V836.js";import{t as A}from"./client-feature-flag-store-CWOJ-CVU.js";import{c as j,l as ne,n as M,t as re}from"./prechat-RG0Q0UrS.js";import{b as ie,r as ae,yt as N}from"./react-query.gen-gQ1_8EHv.js";import{n as oe,t as se}from"./browser-DM38C5zq.js";import{t as P}from"./public-asset-C2P77n3W.js";import{$t as F,Ct as ce,J as le,Qt as ue,Tt as de,Zt as fe,_t as I,bt as pe,ca as L,d as R,en as z,l as B,nn as me,q as V,rn as H,u as he,vt as ge,wt as _e}from"./index-FlO-C4WJ.js";import{n as U,r as ve}from"./prechat-names-NPlBAwCy.js";import{t as ye}from"./step-indicator-dots-Bc6X141I.js";var W=e(t(),1);async function be(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=s(),xe=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Se({onComplete:e}){function t(){R(),B(),e()}return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:xe.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(h,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,Ce=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)}];function we({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=te(),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(null),[b,x]=(0,W.useState)(!1),S=(0,W.useCallback)(()=>{d.current=null,x(!1)},[]),C=(0,W.useCallback)(()=>{h.current&&=(window.removeEventListener(`message`,h.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),w=(0,W.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),T=N();(0,W.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.current.close(),h.current&&window.removeEventListener(`message`,h.current),v.current&&window.removeEventListener(`storage`,v.current),y.current&&=(y.current(),null)},[]);let D=(0,W.useCallback)(async e=>{try{return(await c.fetchQuery({...ie({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[c]),O=(0,W.useCallback)(async()=>{let e=d.current?.platformAssistantId;w(),S(),r((e?await D(e):null)?.scopes_granted??[])},[S,w,D,r]),k=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?O():(w(),S())))},[S,w,O]),A=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=fe(e,window.location.origin,t.requestId);n&&k(n)},[k]),j=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=ue(e,t.requestId);n&&(k(n),window.localStorage.removeItem(z(t.requestId)))},[k]);me((0,W.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&k({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[k]));let ne=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(C(),h.current=A,v.current=j,l){x(!0),(async()=>{let n;try{n=await ee(e)}catch{S();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){se(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await D(e.platformAssistantId);d.current&&(t?await O():S(),C(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){C();return}u.current=n,x(!0),window.addEventListener(`message`,A),window.addEventListener(`storage`,j),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(z(e.requestId));if(t)try{let n=JSON.parse(t);if(F(n,e.requestId)){k(n),window.localStorage.removeItem(z(e.requestId)),C();return}}catch{}let n=await D(e.platformAssistantId);d.current&&(n?await O():(w(),S()),C())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{w(),S(),C();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${E.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(w(),S(),C())},onError(){w(),S(),C()}})})()},[e,S,w,D,k,A,j,O,l,C,T]),M=t||`your assistant`,re=t||`Your assistant`;return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${M} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:Ce.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${re} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:ne,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||T.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(_,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Te({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(Ee,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function Ee({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function De({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(ye,{current:u,total:d})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Oe=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:P(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:P(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:P(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:P(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:P(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:P(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:P(`/images/prior-assistants/copilot.svg`)}];function ke({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>q(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(J(e));(0,W.useEffect)(()=>{let t=J(e);if(t===m.current)return;let n=q(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Ae(n,e)||(m.current=J(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Oe.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),d?(0,G.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Ae(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(L,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:V.map(t=>{let n=le[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(h,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:P(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:P(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:P(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:P(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:P(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:P(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:P(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:P(`/images/integrations/github.svg`),logoSrcDark:P(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:P(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:P(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:P(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:P(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>Y(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(X(e));(0,W.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:o},t.id)),d?null:(0,G.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,G.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)($,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(L,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function $({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(H,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:r,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(ye,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?M(e):re}function Ke(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:I.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:I.controlWorkType,enabled:!t},{id:`tools`,funnelStep:I.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:I.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?I.gmailConnect:I.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:I.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=te(),n=O()&&k();return(0,W.useEffect)(()=>{!n&&!t&&e(E.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=x(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=te(),h=m.use.activeAssistantId(),g=d(),_=D()&&!he(),v=A.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(A.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=A.use.selfIntroGreeting(),T=ce(v),O=_e()??T,k=O===ge.paredDown,M=g?rt():null,re=et(),{currentStep:ie,setCurrentStep:N,clearPersistedStep:oe}=tt(l,p),se=C.use.platformSession(),P=S(se),[F,le]=(0,W.useState)(()=>new Set),[ue,fe]=(0,W.useState)(()=>new Set),[I,L]=(0,W.useState)(()=>new Set),{value:R,onChange:z}=Ve(g&&!P?``:u||f),[B,me]=(0,W.useState)(null),[V]=(0,W.useState)(()=>ve()),[H,U]=(0,W.useState)(``),[ye,xe]=(0,W.useState)(!1),[K,Ce]=(0,W.useState)([]),{data:Ee}=o({...ae(),enabled:!c&&s&&(!g||P)}),{data:Oe,isLoading:Ae}=o({queryKey:[`onboarding-recipe`,l],queryFn:be,enabled:!c&&s&&!p&&!g,staleTime:1/0}),q=Oe??null,J=Ee?.id??h??M,je=qe({localMode:g,platformSession:se,hasCachedPlatformAssistant:M!==null}),Me=je,Ne=je,Ie=async()=>{await b.checkAssistant(),e(`${E.assistant}?onboarding=1`,{replace:!0})};function Le(e,t=O){n||pe(e,{userId:l,variant:de(t)})}let ze=[...F].some(e=>Fe.has(e)),Y=p?Ye():Je({paredDown:k,canOfferPriorAssistants:Ne,canOfferGoogleStep:n?!1:Me,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}ne(Ke({mode:p?`native`:k?`paredDown`:`control`,recipe:p?null:q,selectedTools:F,selectedTasks:ue,selectedPriorAssistants:t?.selectedPriorAssistants??I,tone:B??q?.tone??`grounded`,userName:R,assistantName:H,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:ye,googleScopes:K,connectedScopes:t?.connectedScopes}));let r=H.trim();r&&j(r),p?(oe(),e(E.onboarding.privacy)):(b.markExpectingFirstMessage(),Ie())}let Z=(e,t)=>{e.funnelStep&&Le(e.funnelStep);let n=Qe(Y,e.id);n?N(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&N(t)};if(!re||Ae)return null;let $=Y.find(e=>e.id===ie)??Y[0];return $?$.id===`nativeName`?(0,G.jsx)(De,{userName:R,assistantName:H,displayedAssistantNames:V,onUserNameChange:z,onAssistantNameChange:U,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,G.jsx)(Be,{selectedGroupId:B,onGroupChange:me,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,G.jsx)(Te,{userName:R,assistantName:H,selectedGroupId:B,displayedAssistantNames:V,onUserNameChange:z,onAssistantNameChange:U,onGroupChange:me,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ue,onChange:fe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:F,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(ke,{selectedAssistants:I,onChange:L,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;L(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(we,{assistantId:J,assistantName:H,onConnect:e=>{xe(!0),Ce(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Se,{onComplete:()=>Z($)}):null:null}function at(){return(0,G.jsx)(it,{})}export{at as PreChatRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-B2Zo6DUE.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{n as i}from"./device-settings-BBwtGKJb.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-DfeW0asJ.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function b(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function x(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{y as a,m as c,u as d,d as f,b as i,f as l,v as n,h as o,x as p,g as r,p as s,_ as t,l as u};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{O as s,t as c}from"./button-D-AX8Voo.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-DvW5mxZR.js";import{t as m}from"./card-BibIM9x3.js";import{t as h}from"./dropdown-ChWAdhLG.js";import{t as g}from"./confirm-dialog-bfBx6UYv.js";import{t as _}from"./notice-CqRgVmeL.js";import{t as v}from"./tag-CW6WC4fE.js";import{t as y}from"./input-D4W4p0pZ.js";import{t as b}from"./toggle-X_kQW5my.js";import{n as x}from"./toast-sdJJ6aTV.js";import{t as S}from"./chevron-right-B6vEpVY0.js";import{t as C}from"./loader-circle-BFRVtR3K.js";import{t as w}from"./pencil-B90pDI55.js";import{t as T}from"./x-DxL-bCuT.js";import{f as E,n as D,r as O}from"./auth-store-DfeW0asJ.js";import{t as k}from"./sdk.gen-DmWuY0SL.js";import{c as A,i as ee,m as te,n as ne,o as j,r as re,s as ie,t as ae}from"./native-biometric-BK6_QtW5.js";import{a as oe,i as se}from"./routes-C6gxiCrz.js";import{n as M,t as ce}from"./react-query.gen-gQ1_8EHv.js";import{B as le,Fr as N,H as ue,Mn as de,Nn as fe,Nr as pe,Oa as me,Pr as he,Tn as P,V as F,g as I,h as L,jn as R,m as z,p as B,ui as ge,x as _e,yi as V}from"./index-FlO-C4WJ.js";import{t as H}from"./use-active-assistant-id-BVzVN4_g.js";import{t as U}from"./detail-card-Bga8Jc8y.js";import{t as W}from"./setting-row-BGQgDyhv.js";var G=e(o(),1),K=f(),q=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,r]=(0,G.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||P(0)}]}function xe({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(b,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Se(){return(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Ce({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=fe(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=ve.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await R(e.sourceKind):await de(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(Se,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(xe,{row:e,onToggle:p},e.id))}),r&&(0,K.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function we(){let e=N({platformHostedOnly:!0}),t=pe(),n=he(),r=l(),{data:i,isLoading:a,isError:o}=u({...ce(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await k({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{M(r,void 0,e),x.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{x.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(b,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,K.jsx)(_e,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function Te(){let e=te(),[t,n]=(0,G.useState)(()=>ee()),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`Face ID`),[s,c]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(re().then(i),ne().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)j(!1),await ae(),n(!1);else{let e=A();e&&await ie(e),j(!0),n(!0)}}finally{c(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(b,{checked:t,onChange:()=>void l(),disabled:s})]})})}function J(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=B.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Ee(){let e=H(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>L(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,d]=(0,G.useState)(`strict`),[f,p]=(0,G.useState)(!1),g=(0,G.useRef)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||g.current||(a(z(n.interactive).id),s(z(n.autonomous).id),d(z(n.headless).id),v(!0))},[n]),(0,G.useEffect)(()=>()=>{y.current!==null&&(clearTimeout(y.current),y.current=null,b.current?.(),b.current=null)},[]);let x=(0,G.useCallback)((n,r,i)=>{if(!e||!_)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,G.useCallback)((e,t,n)=>{y.current!==null&&clearTimeout(y.current),b.current=()=>x(e,t,n),y.current=setTimeout(()=>{b.current?.(),y.current=null,b.current=null},500)},[x]),w=(0,G.useCallback)(e=>{g.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,G.useCallback)(e=>{g.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,G.useCallback)(e=>{g.current=!0,d(e),C(i,o,e)},[i,o,C]),D=B.find(e=>e.id===i),O=B.find(e=>e.id===o),k=B.find(e=>e.id===c),A=!e||!_;return(0,K.jsxs)(m,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your tolerance determines which levels auto-approve.`}),r&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:i,onChange:w,options:Y,disabled:A})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,K.jsx)(me,{className:`h-4 w-4`}):(0,K.jsx)(S,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:o,onChange:T,options:Y,disabled:A})}),O&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:c,onChange:E,options:Y,disabled:A})}),k&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var X=e(s(),1),De=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Z=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[g,v]=(0,G.useState)(null),b=s.trim(),x=b.length>0&&!p,S=(0,G.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;m(!0),v(null);try{await ue(e,t.id,{risk:l,description:i}),r()}catch(e){v(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,x,d,t,r,l,a,b]);return(0,X.createPortal)((0,K.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void S(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[g&&(0,K.jsx)(_,{tone:`error`,children:g}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(h,{value:a,onChange:o,disabled:!0,options:De.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(y,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Z.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(y,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,disabled:!x,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(!1),y=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([F(e),F(e,{origin:`default`})]);return Ae(t,n)}return F(e)},[e]),x=(0,G.useCallback)(async()=>{o(!0);try{i(await y(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[y,m]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await y(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[y,m]);let S=(0,G.useCallback)(async()=>{if(f)try{await le(e,f.id),x()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,x]);return(0,X.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(b,{checked:m,onChange:h,label:`Show all defaults`}),(0,K.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(_,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(V,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(v,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(v,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(v,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(ge,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,K.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),x()}}),(0,K.jsx)(g,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void S(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(m,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(V,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,K.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=N({platformHostedOnly:!0}),t=O(),a=t,o=D.use.user()?.id??null,[s,c]=(0,G.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>i(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(Te,{}),(0,K.jsx)(Ce,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Ee,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:t?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:se(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),E(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),E(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(we,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{f as o}from"./local-mode-CgrENuVf.js";import{t as s}from"./is-electron-C_ZTVhv8.js";import{d as c,i as l,n as u}from"./auth-store-DfeW0asJ.js";import{m as d}from"./native-biometric-BK6_QtW5.js";import{a as f}from"./routes-C6gxiCrz.js";import{d as p,f as m,l as h,u as g}from"./prefs-ef69V836.js";import{t as _}from"./client-feature-flag-store-CWOJ-CVU.js";import{Ct as v,St as y,Tt as b,_t as x,bt as S,rn as C}from"./index-FlO-C4WJ.js";import{t as w}from"./step-indicator-dots-Bc6X141I.js";import{n as T,t as E}from"./consent-controls-BzFFpG2p.js";var D=e(t(),1);function O({researchOnboardingEnabled:e,isNative:t,isLocalMode:n}){return e&&!t&&!n?f.onboarding.research:f.onboarding.hatching}var k=a();function A(){let e=r(),[t]=i(),a=u.use.user()?.id??null,A=s(),j=d(),M=_.use.stringFlags().preChatOnboardingExperiment20260606??`control`,N=_.use.researchOnboarding(),P=v(M),[F,I]=g(),[L,R]=p(),[z,B]=m(),[V,H]=h(),U=l();(0,D.useEffect)(()=>{j||y()},[j]);let W=t.get(`preview`)===`true`,G=(0,D.useCallback)(e=>{},[]),K=W?G:I,q=W?G:R,J=W?G:B,Y=W?G:H,X=(0,D.useCallback)(()=>{if(W){e(`${f.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:z,privacy:V,shareAnalytics:F,shareDiagnostics:L,hasPlatformSession:U}),!j){let e=b(P);S(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({researchOnboardingEnabled:N,isNative:j,isLocalMode:o()})}${i?`?${i}`:``}`)},[V,U,j,W,e,P,N,t,F,L,z,a]);return(0,k.jsx)(C,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:F,shareDiagnostics:L,onShareAnalyticsChange:K,onShareDiagnosticsChange:q,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:V,tosAccepted:z,onPrivacyChange:Y,onTosChange:J,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!z||!V,onClick:X,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BG-GkiMq.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-CgrENuVf.js";import{D as l,n as u}from"./auth-store-DfeW0asJ.js";import{c as d}from"./api-DnqFanVx.js";import{S as f,_ as p}from"./native-biometric-BK6_QtW5.js";import{a as m}from"./routes-C6gxiCrz.js";import{a as h,i as g}from"./login-flow-Ds9vsrwI.js";import{n as _}from"./index-FlO-C4WJ.js";import{r as v,t as y}from"./account-shell-CL67zFht.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=u.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await f(),r=p(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await d();if(e.ok&&e.data.length>0&&(await s(e.data,l.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
@@ -0,0 +1 @@
1
+ import{D as e,Gn as t,Rt as n,k as r}from"./sdk.gen-zA5ns5LT.js";var i=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0,defaultModel:`claude-sonnet-4-6`},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0,defaultModel:`gpt-5.4-mini`},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0,defaultModel:`gemini-3-flash-preview`},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1,defaultModel:`llama3.2`,models:[{id:`llama3.2`,displayName:`Llama 3.2`,contextWindowTokens:128e3,maxOutputTokens:4096},{id:`mistral`,displayName:`Mistral`,contextWindowTokens:32768,maxOutputTokens:4096}]},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0,defaultModel:`accounts/fireworks/models/minimax-m3`},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`x-ai/grok-4.20-beta`,displayName:`Grok 4.20 Beta`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-r1-0528`,displayName:`DeepSeek R1`,contextWindowTokens:163840,maxOutputTokens:32e3}]},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key (optional)`,docsUrl:null,requiresKey:!0}],a=i[0];function o(e){return i.find(t=>t.id===e)}function s(e){let t=o(e);return t?.defaultModel??t?.models?.[0]?.id}var c=`onboarding.providerKey`,l=`custom-balanced`,u=2e5;function d(e){try{if(e===null){sessionStorage.removeItem(c);return}sessionStorage.setItem(c,JSON.stringify(e))}catch{}}function f(e){return typeof e==`object`&&!!e&&`provider`in e&&typeof e.provider==`string`&&`key`in e&&typeof e.key==`string`&&(!(`model`in e)||typeof e.model==`string`)&&(!(`baseUrl`in e)||typeof e.baseUrl==`string`)&&(!(`customModels`in e)||typeof e.customModels==`string`)}function p(){try{let e=sessionStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return f(t)?t:null}catch{return null}}function m(){let e=p();try{sessionStorage.removeItem(c)}catch{}return e}async function h(e,n,r){let{response:i}=await t({path:{assistant_id:e},body:{type:`api_key`,name:n,value:r},throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to write provider secret`),{status:i?.status})}async function g(e,t,r,i){let a=t===`openai-compatible`,o=r||a?{type:`api_key`,credential:`credential/${t}/api_key`}:{type:`none`},s=a&&i?.baseUrl?i.baseUrl:void 0,c=a&&i?.customModels?i.customModels.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):void 0,{response:l}=await n({path:{assistant_id:e},body:{name:t,provider:t,auth:o,...s===void 0?{}:{base_url:s},...c===void 0?{}:{models:c}},throwOnError:!1});if(!l?.ok&&l?.status!==409)throw Object.assign(Error(`Failed to create provider connection`),{status:l?.status})}function _(e,t){let n=o(e)?.models?.find(e=>e.id===t),r={provider:e,model:t,provider_connection:e,source:`user`,label:`Balanced`,description:`Good balance of quality, cost, and speed`,maxTokens:n?.maxOutputTokens??16e3,contextWindow:{maxInputTokens:n?.contextWindowTokens??u}};return e===`ollama`?(r.effort=`none`,r.thinking={enabled:!1,streamThinking:!1}):(r.effort=`high`,r.thinking={enabled:!0,streamThinking:!0}),r}async function v(t,n,r){let{response:i}=await e({path:{assistant_id:t,name:l},body:_(n,r),throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to set provider profile`),{status:i?.status})}async function y(e){let{response:t}=await r({path:{assistant_id:e},body:{llm:{activeProfile:l}},throwOnError:!1});if(!t?.ok)throw Object.assign(Error(`Failed to activate provider profile`),{status:t?.status})}async function b(e){let t=m();if(!t)return;let n=t.key.trim(),r=n.length>0,i=t.provider===`openai-compatible`;(r||i)&&await h(e,t.provider,n),await g(e,t.provider,r,{baseUrl:t.baseUrl,customModels:t.customModels});let a=t.model?.trim(),o=t.customModels?.split(`,`).map(e=>e.trim()).find(e=>e),c=a||o||s(t.provider);c&&(await v(e,t.provider,c),await y(e))}export{i as a,a as i,p as n,s as o,d as r,o as s,b as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{n as o}from"./auth-store-DfeW0asJ.js";import{C as s,T as c,x as l}from"./native-biometric-BK6_QtW5.js";import{a as u}from"./routes-C6gxiCrz.js";import{a as d,o as f}from"./login-flow-Ds9vsrwI.js";import{i as p,n as m,r as h,t as g}from"./account-shell-CL67zFht.js";import{t as _}from"./signup-shell-DMX1tgqB.js";var v=e(t(),1),y=a();function b(){let e=n(),[t]=r(),a=o.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await l();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await c({email:x,username:C});if(!t.ok){if(s(t)){await a();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(i,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-C_ZTVhv8.js";import{t as i}from"./arrow-up-nBfZxfhi.js";import{t as a}from"./public-asset-B78MSgNd.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:a(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:a(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(i,{size:16})})]})})}export{u as QuickInputPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-C_ZTVhv8.js";import{t as i}from"./arrow-up-nBfZxfhi.js";import{t as a}from"./public-asset-C2P77n3W.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:a(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:a(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(i,{size:16})})]})})}export{u as QuickInputPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./useMutation-Lj4VunQV.js";import{t}from"./queryOptions-BtNi-_9H.js";import{t as n}from"./infiniteQueryOptions-C6p49ZmI.js";import{t as r}from"./client.gen-DU1JkKSB.js";import{$n as i,An as a,C as ee,Cn as te,Cr as ne,Ct as re,Dn as ie,E as ae,En as oe,Et as o,F as se,Ht as ce,I as le,Jn as ue,Lt as de,M as fe,N as s,Nn as pe,O as me,On as he,P as ge,Pn as c,T as _e,Tt as ve,U as ye,Vt as be,Wn as xe,Xn as Se,Yn as Ce,Zn as we,_n as Te,an as Ee,bn as De,bt as Oe,dr as ke,en as Ae,er as je,fr as Me,gn as Ne,gt as l,hn as u,in as d,it as f,j as p,jn as m,jt as h,k as g,kt as _,lr as v,mn as y,o as b,pn as Pe,pr as Fe,qn as Ie,rn as Le,tn as Re,tr as ze,vn as Be,vt as Ve,w as He,wt as Ue,x as We,xt as Ge,yn as Ke,yt as qe,zt as Je}from"./sdk.gen-zA5ns5LT.js";var x=(e,t,n,i)=>{let a={_id:e,baseUrl:t?.baseUrl||(t?.client??r).getConfig().baseUrl};return n&&(a._infinite=n),i&&(a.tags=i),t?.body&&(a.body=t.body),t?.headers&&(a.headers=t.headers),t?.path&&(a.path=t.path),t?.query&&(a.query=t.query),[a]},S=e=>x(`appsGet`,e),Ye=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await b({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:S(e)}),C=e=>x(`bookmarksGet`,e),Xe=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await We({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:C(e)}),Ze=e=>x(`channelsAvailableGet`,e),Qe=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ee({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Ze(e)}),w=e=>x(`channelsReadinessGet`,e),$e=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await He({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:w(e)}),T=e=>x(`configGet`,e),E=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await _e({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:T(e)}),et=(e,t,n)=>e.setQueryData(E(t).queryKey,n),tt=e=>({mutationFn:async t=>{let{data:n}=await g({...e,...t,throwOnError:!0});return n}}),nt=t=>e({...tt(),...t}),rt=e=>x(`configLlmCallsitesGet`,e),it=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ae({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:rt(e)}),at=e=>x(`configLlmProfilesGet`,e),ot=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await me({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:at(e)}),st=e=>x(`consolidationConfigGet`,e),ct=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await p({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:st(e)}),lt=e=>({mutationFn:async t=>{let{data:n}=await fe({...e,...t,throwOnError:!0});return n}}),ut=t=>e({...lt(),...t}),dt=e=>x(`consolidationRunsGet`,e),ft=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await s({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:dt(e)}),D=(e,t)=>{let n={...e[0]};return t.body&&(n.body={...e[0].body,...t.body}),t.headers&&(n.headers={...e[0].headers,...t.headers}),t.path&&(n.path={...e[0].path,...t.path}),t.query&&(n.query={...e[0].query,...t.query}),n},O=e=>x(`consolidationRunsGet`,e,!0),pt=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=D(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await s({...e,...i,signal:r,throwOnError:!0});return a},queryKey:O(e)}),mt=e=>({mutationFn:async t=>{let{data:n}=await ge({...e,...t,throwOnError:!0});return n}}),ht=t=>e({...mt(),...t}),k=e=>x(`contactsGet`,e),A=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:k(e)}),gt=(e,t,n)=>e.setQueryData(A(t).queryKey,n),_t=e=>({mutationFn:async t=>{let{data:n}=await le({...e,...t,throwOnError:!0});return n}}),vt=t=>e({..._t(),...t}),yt=e=>x(`conversationstartersGet`,e),bt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await f({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:yt(e)}),j=e=>x(`conversationsByIdGet`,e),xt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ye({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:j(e)}),M=e=>x(`documentsGet`,e),St=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await l({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:M(e)}),N=e=>x(`groupsGet`,e),P=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Oe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:N(e)}),Ct=(e,t,n)=>e.setQueryData(P(t).queryKey,n),wt=e=>({mutationFn:async t=>{let{data:n}=await Ge({...e,...t,throwOnError:!0});return n}}),Tt=t=>e({...wt(),...t}),Et=e=>({mutationFn:async t=>{let{data:n}=await Ve({...e,...t,throwOnError:!0});return n}}),Dt=t=>e({...Et(),...t}),Ot=e=>({mutationFn:async t=>{let{data:n}=await qe({...e,...t,throwOnError:!0});return n}}),kt=t=>e({...Ot(),...t}),At=e=>x(`heartbeatConfigGet`,e),F=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:At(e)}),jt=(e,t,n)=>e.setQueryData(F(t).queryKey,n),Mt=e=>({mutationFn:async t=>{let{data:n}=await Ue({...e,...t,throwOnError:!0});return n}}),Nt=t=>e({...Mt(),...t}),Pt=e=>({mutationFn:async t=>{let{data:n}=await ve({...e,...t,throwOnError:!0});return n}}),Ft=t=>e({...Pt(),...t}),It=e=>x(`heartbeatRunsGet`,e),Lt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await o({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:It(e)}),I=e=>x(`heartbeatRunsGet`,e,!0),Rt=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=D(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await o({...e,...i,signal:r,throwOnError:!0});return a},queryKey:I(e)}),L=e=>x(`homeFeedGet`,e),zt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await _({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:L(e)}),Bt=(e,t,n)=>e.setQueryData(zt(t).queryKey,n),R=e=>x(`homeStateGet`,e),Vt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await h({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:R(e)}),Ht=e=>x(`identityGet`,e),z=e=>x(`inferenceProviderconnectionsGet`,e),Ut=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await de({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:z(e)}),Wt=e=>({mutationFn:async t=>{let{data:n}=await Je({...e,...t,throwOnError:!0});return n}}),B=e=>x(`integrationsSlackChannelConfigGet`,e),Gt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await be({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:B(e)}),Kt=e=>({mutationFn:async t=>{let{data:n}=await ce({...e,...t,throwOnError:!0});return n}}),qt=e=>x(`memoryV2NowtextGet`,e),Jt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ae({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:qt(e)}),Yt=e=>x(`memoryV2RouterprompttemplateGet`,e),Xt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Yt(e)}),Zt=e=>({mutationFn:async t=>{let{data:n}=await Le({...e,...t,throwOnError:!0});return n}}),Qt=t=>e({...Zt(),...t}),$t=e=>x(`memoryWorkerStatusGet`,e),V=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await d({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:$t(e)}),en=(e,t,n)=>e.setQueryData(V(t).queryKey,n),tn=e=>({mutationFn:async t=>{let{data:n}=await Ee({...e,...t,throwOnError:!0});return n}}),nn=t=>e({...tn(),...t}),H=e=>x(`oauthAppsGet`,e),rn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ne({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:H(e)}),an=e=>({mutationFn:async t=>{let{data:n}=await Te({...e,...t,throwOnError:!0});return n}}),on=t=>e({...an(),...t}),sn=e=>({mutationFn:async t=>{let{data:n}=await Pe({...e,...t,throwOnError:!0});return n}}),cn=t=>e({...sn(),...t}),U=e=>x(`oauthAppsByAppIdConnectionsGet`,e),ln=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await y({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:U(e)}),un=e=>({mutationFn:async t=>{let{data:n}=await u({...e,...t,throwOnError:!0});return n}}),dn=t=>e({...un(),...t}),fn=e=>({mutationFn:async t=>{let{data:n}=await Be({...e,...t,throwOnError:!0});return n}}),pn=t=>e({...fn(),...t}),mn=e=>x(`oauthProvidersGet`,e),hn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await De({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:mn(e)}),gn=e=>x(`oauthProvidersByProviderKeyGet`,e),_n=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:gn(e)}),vn=e=>x(`pluginsGet`,e),yn=e=>({mutationFn:async t=>{let{data:n}=await te({...e,...t,throwOnError:!0});return n}}),bn=t=>e({...yn(),...t}),W=e=>x(`pluginsByNameGet`,e),xn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await oe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:W(e)}),G=e=>x(`pluginsByNameInspectGet`,e),Sn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ie({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:G(e)}),Cn=e=>({mutationFn:async t=>{let{data:n}=await he({...e,...t,throwOnError:!0});return n}}),wn=t=>e({...Cn(),...t}),Tn=e=>({mutationFn:async t=>{let{data:n}=await a({...e,...t,throwOnError:!0});return n}}),En=t=>e({...Tn(),...t}),K=e=>x(`pluginsSearchGet`,e),Dn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await m({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:K(e)}),On=e=>x(`retrospectiveConfigGet`,e),kn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await pe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:On(e)}),An=e=>x(`retrospectiveRunsGet`,e),jn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await c({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:An(e)}),q=e=>x(`retrospectiveRunsGet`,e,!0),Mn=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=D(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await c({...e,...i,signal:r,throwOnError:!0});return a},queryKey:q(e)}),Nn=e=>x(`schedulesGet`,e),Pn=e=>x(`schedulesByIdRunsGet`,e),J=e=>x(`secretsGet`,e),Fn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await xe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:J(e)}),Y=e=>x(`skillsGet`,e),In=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await we({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Y(e)}),Ln=e=>({mutationFn:async t=>{let{data:n}=await Ie({...e,...t,throwOnError:!0});return n}}),Rn=t=>e({...Ln(),...t}),zn=e=>x(`skillsByIdFilesGet`,e),Bn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ce({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:zn(e)}),Vn=e=>x(`skillsByIdFilesContentGet`,e),Hn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ue({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Vn(e)}),Un=e=>x(`skillsCategoriesGet`,e),X=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Un(e)}),Z=e=>x(`soundsAvailableGet`,e),Wn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await i({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Z(e)}),Q=e=>x(`soundsConfigGet`,e),$=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await je({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Q(e)}),Gn=(e,t,n)=>e.setQueryData($(t).queryKey,n),Kn=e=>({mutationFn:async t=>{let{data:n}=await ze({...e,...t,throwOnError:!0});return n}}),qn=e=>x(`ttsProvidersGet`,e),Jn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await v({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:qn(e)}),Yn=e=>x(`usageBreakdownGet`,e),Xn=e=>x(`usageDailyGet`,e),Zn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Xn(e)}),Qn=e=>x(`usageSeriesGet`,e),$n=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Me({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Qn(e)}),er=e=>x(`usageTotalsGet`,e),tr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Fe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:er(e)}),nr=e=>({mutationFn:async t=>{let{data:n}=await ne({...e,...t,throwOnError:!0});return n}}),rr=t=>e({...nr(),...t});export{hn as $,Rt as A,tr as At,Wt as B,Qt as Bt,St as C,Q as Ct,Ct as D,Yn as Dt,N as E,Jn as Et,Vt as F,Dt as Ft,Xt as G,pn as Gt,B as H,cn as Ht,R as I,kt as It,ln as J,En as Jt,V as K,bn as Kt,Ht as L,Tt as Lt,Lt as M,ut as Mt,L as N,ht as Nt,F as O,Zn as Ot,Bt as P,vt as Pt,_n as Q,Ut as R,Nt as Rt,bt as S,$ as St,P as T,Kn as Tt,Kt as U,dn as Ut,Gt as V,nn as Vt,Jt as W,on as Wt,rn as X,rr as Xt,U as Y,Rn as Yt,H as Z,A as _,X as _t,Qe as a,Dn as at,xt as b,Wn as bt,E as c,Mn as ct,it as d,Pn as dt,xn as et,ot as f,Nn as ft,ft as g,Bn as gt,O as h,Hn as ht,C as i,vn as it,I as j,nt as jt,jt as k,$n as kt,T as l,q as lt,pt as m,J as mt,S as n,Sn as nt,$e as o,K as ot,ct as p,Fn as pt,en as q,wn as qt,Xe as r,G as rt,w as s,kn as st,Ye as t,W as tt,et as u,jn as ut,k as v,In as vt,M as w,Gn as wt,j as x,Z as xt,gt as y,Y as yt,z,Ft as zt};
@@ -0,0 +1 @@
1
+ import{ct as e,et as t,rt as n}from"./local-mode-CgrENuVf.js";var r=`/v1/remote-web/pairing-token`,i=`/v1/remote-web/pairing-challenge`,a=`/v1/guardian/refresh`,o=5,s=5e3,c=`vellum:remote-gateway:refresh-lock`,l=`vellum-remote-gateway-refresh`,u=2e4,d=2e4,f=100,p=0,m=null,h=class extends Error{status;constructor(e,t){super(t),this.name=`RemoteWebPairingError`,this.status=e}};function g(e,...t){for(let n of t){let t=e.get(n)?.trim();if(t)return t}return null}function _(e){let t=new URLSearchParams(e.search),n=e.hash.startsWith(`#`)?e.hash.slice(1):e.hash;if(n){let e=new URLSearchParams(n);for(let[n,r]of e)t.has(n)||t.set(n,r)}return t}function v(e){let t=_(typeof e==`string`?new URL(e,window.location.origin):e);return{deviceCode:g(t,`deviceCode`,`device_code`),userCode:g(t,`userCode`,`user_code`)}}function y(e=window.location){let t=/\/assistant(?:\/|$)/.exec(e.pathname);return t&&t.index>0?e.pathname.slice(0,t.index).replace(/\/+$/,``):``}function b(e,t=window.location){return`${y(t)}${e}`}function x(){return`${window.location.origin}${y()}`}function S(e){if(typeof e==`string`){let t=Date.parse(e);return Number.isFinite(t)?t:0}return e>0xe8d4a51000?e:e*1e3}function C(){return!n()||p<=0?!0:Date.now()>=p-s}function w(e){let t=e;return t?.status===`approved`&&typeof t.accessToken==`string`&&(typeof t.accessTokenExpiresAt==`string`||typeof t.accessTokenExpiresAt==`number`)&&(typeof t.refreshAfter==`string`||typeof t.refreshAfter==`number`)}function T(e){let t=e;return typeof t?.deviceCode==`string`&&typeof t.userCode==`string`&&typeof t.verificationUri==`string`&&typeof t.expiresAt==`string`&&typeof t.expiresInSeconds==`number`&&typeof t.intervalSeconds==`number`}function E(e){return new Promise(t=>setTimeout(t,e))}function D(){try{let e=localStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return typeof t.owner!=`string`||typeof t.expiresAt!=`number`?null:{owner:t.owner,expiresAt:t.expiresAt}}catch{return null}}function O(e){try{let t=D();return t&&t.expiresAt>Date.now()?!1:(localStorage.setItem(c,JSON.stringify({owner:e,expiresAt:Date.now()+u})),D()?.owner===e)}catch{return!0}}function k(e){try{D()?.owner===e&&localStorage.removeItem(c)}catch{}}async function A(e){let t=`${Date.now()}:${Math.random().toString(36).slice(2)}`,n=Date.now()+d;for(;!O(t);){if(Date.now()>=n)return e();await E(f)}try{return await e()}finally{k(t)}}async function j(e){let t=typeof navigator<`u`?navigator.locks??null:null;return t?t.request(l,e):A(e)}function M(n){p=S(n.refreshAfter),e({accessToken:n.accessToken,accessTokenExpiresAt:n.accessTokenExpiresAt}),t({url:`${window.location.origin}${y()}`,token:n.accessToken})}async function N(e,t){let n=await fetch(b(r),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({deviceCode:e}),signal:t}),i=await n.json().catch(()=>null);if(n.status===202){let e=i??{};return{status:`pending`,expiresAt:typeof e.expiresAt==`string`?e.expiresAt:``,intervalSeconds:typeof e.intervalSeconds==`number`&&e.intervalSeconds>0?e.intervalSeconds:o}}if(!n.ok)throw new h(n.status,`Pairing token exchange failed: ${n.status}`);if(!w(i))throw new h(502,`Pairing token exchange returned an invalid response`);return i}async function P(e){let t=await fetch(b(i),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:JSON.stringify({publicBaseUrl:x()}),signal:e}),n=await t.json().catch(()=>null);if(!t.ok)throw new h(t.status,`Pairing challenge creation failed: ${t.status}`);if(!T(n))throw new h(502,`Pairing challenge creation returned an invalid response`);return n}async function F(){if(!C())return!0;let e=await fetch(b(a),{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`},body:`{}`});if(!e.ok)return!1;let t=await e.json().catch(()=>null);return w({...t,status:`approved`})?(M({...t,status:`approved`}),!0):!1}async function I(){return C()?(m??=j(F).finally(()=>{m=null}),m):!0}export{v as a,N as i,M as n,I as o,P as r,y as s,h as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-Cj4wRAOK.js";import{t as s}from"./client-feature-flag-store-k_bI655l.js";import{t as c}from"./conversation-store-SjqDbOcn.js";import{t as l}from"./conversation-selection-DA_7HozA.js";import{en as u}from"./index-0XgM92Lz.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-C6gxiCrz.js";import{t as s}from"./client-feature-flag-store-CWOJ-CVU.js";import{t as c}from"./conversation-store-B8D6wE18.js";import{t as l}from"./conversation-selection-CNssqGbG.js";import{an as u}from"./index-FlO-C4WJ.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};