@vellumai/web 0.12.0-staging.1 → 0.12.0-staging.2

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 (372) hide show
  1. package/dist/activation-mascots.svg +115 -0
  2. package/dist/activation-pill-mascots.svg +74 -0
  3. package/dist/assets/{a2a-invite-ZujDyWPb.js → a2a-invite-DOlvPnsj.js} +1 -1
  4. package/dist/assets/{about-page-vIrbZaLK.js → about-page-CAHLo_IM.js} +1 -1
  5. package/dist/assets/{account-page-fK6Q6ZUM.js → account-page-CR9m-bbG.js} +1 -1
  6. package/dist/assets/{account-shell-BbzmYhbU.js → account-shell-CfKMHHXQ.js} +1 -1
  7. package/dist/assets/acp-run-detail-panel-BBEBzZSw.js +3 -0
  8. package/dist/assets/activation-BYAGAleJ.js +1 -0
  9. package/dist/assets/activation-CEdyqKUu.js +1 -0
  10. package/dist/assets/activation-DEdwceum.js +1 -0
  11. package/dist/assets/activation-DF1oj8j7.js +1 -0
  12. package/dist/assets/activation-list-route-WkR2XN13.js +1 -0
  13. package/dist/assets/activation-tasks-BJZEpFIy.js +1 -0
  14. package/dist/assets/activation-tasks-Bk658x3i.js +1 -0
  15. package/dist/assets/activation-tasks-K8Swziqu.js +1 -0
  16. package/dist/assets/activation-tasks-wz108byj.js +1 -0
  17. package/dist/assets/{activity-redirect-page-B9uI-KQV.js → activity-redirect-page-D5jSj1d4.js} +1 -1
  18. package/dist/assets/activity-steps-panel-C91mUEgr.js +1 -0
  19. package/dist/assets/{add-credits-modal-CQJ7I-0b.js → add-credits-modal-BtOBq6__.js} +1 -1
  20. package/dist/assets/ai-page-BjjHb_KN.js +1 -0
  21. package/dist/assets/{android-billing-handoff-CCX_qjXn.js → android-billing-handoff-C_65hbFm.js} +1 -1
  22. package/dist/assets/{api-key-screen-CO4hHAV1.js → api-key-screen-DAWDc1tS.js} +1 -1
  23. package/dist/assets/{app-info-BCNihzgQ.js → app-info--nQmKvGC.js} +1 -1
  24. package/dist/assets/archive-redirect-page-BlzqQ5_P.js +1 -0
  25. package/dist/assets/assistant-status-panel-CXq4xqak.js +1 -0
  26. package/dist/assets/{auth-welcome-screen-C9qP-KoZ.js → auth-welcome-screen-YynWXFYd.js} +1 -1
  27. package/dist/assets/avatar-random-T8euI8sG.js +2 -0
  28. package/dist/assets/{await-org-header-settled-BwnbihhQ.js → await-org-header-settled-DzQQ7QxL.js} +1 -1
  29. package/dist/assets/background-task-detail-panel-DGc2RnBm.js +1 -0
  30. package/dist/assets/billing-page-eSvbiGuR.js +3 -0
  31. package/dist/assets/{billing-redirect-page-DtQDbryY.js → billing-redirect-page-BAtaOafH.js} +1 -1
  32. package/dist/assets/bookmarks-page-UeYoXk3X.js +1 -0
  33. package/dist/assets/{bundle-confirm-page-xWXjFp69.js → bundle-confirm-page-CrNXSEwP.js} +1 -1
  34. package/dist/assets/channel-transcript-panel-BdOlGjnN.js +1 -0
  35. package/dist/assets/channels-page-route-CTDjdZZV.js +1 -0
  36. package/dist/assets/chat-info-panel-CIcb19Yz.js +1 -0
  37. package/dist/assets/{checkout-continuation-B9k2wNrT.js → checkout-continuation-DCEWSKgL.js} +1 -1
  38. package/dist/assets/checkout-page-CjZEKzRZ.js +1 -0
  39. package/dist/assets/checkout-return-target-RlOhwSvu.js +1 -0
  40. package/dist/assets/command-palette-D2wqOJue.js +1 -0
  41. package/dist/assets/{command-palette-window-page-BVBpySgr.js → command-palette-window-page-Bg2nuHq5.js} +1 -1
  42. package/dist/assets/common-DTjszpuj.js +1 -0
  43. package/dist/assets/common-DmcKuTke.js +1 -0
  44. package/dist/assets/common-Hpbr_vpQ.js +1 -0
  45. package/dist/assets/{community-page-DU-qDO94.js → community-page-BLhzGTuy.js} +1 -1
  46. package/dist/assets/{companion-accent-Bw9urL-h.js → companion-accent-gsn9VuVB.js} +1 -1
  47. package/dist/assets/{companion-layout-CpBAlBPD.js → companion-layout-BES0UfBy.js} +1 -1
  48. package/dist/assets/companion-surface-page-kl9ej_zQ.js +1 -0
  49. package/dist/assets/{companion-watch-frame-page-CGQiIqjN.js → companion-watch-frame-page-CX0lYK6Y.js} +1 -1
  50. package/dist/assets/connect-page-8LGXfYwr.js +1 -0
  51. package/dist/assets/{consent-controls-C9CK_6mt.js → consent-controls-BRXg7A0b.js} +1 -1
  52. package/dist/assets/contacts-gateway-Cm83W9Sw.js +1 -0
  53. package/dist/assets/contacts-page-route-YdSPP6ct.js +1 -0
  54. package/dist/assets/{credential-entry-page-BePf8lqy.js → credential-entry-page-B0E7m9Ka.js} +1 -1
  55. package/dist/assets/credentials-page-KL8TseTX.js +1 -0
  56. package/dist/assets/{csv-preview-D6BgCvWg.js → csv-preview-DDWd92MO.js} +1 -1
  57. package/dist/assets/danger-zone-redirect-page-CeG41nRv.js +1 -0
  58. package/dist/assets/debug-page-Cq9veQE7.js +4 -0
  59. package/dist/assets/deploy-dialogs-DiKerPg3.js +1 -0
  60. package/dist/assets/{detail-card-BxI8klTT.js → detail-card-B0OGBJ1-.js} +1 -1
  61. package/dist/assets/{detail-panel-stop-button-yy-BlpAG.js → detail-panel-stop-button-B6n2CDuJ.js} +1 -1
  62. package/dist/assets/{detail-primitives-BmDXZ3Gt.js → detail-primitives-MMaUWytS.js} +1 -1
  63. package/dist/assets/developer-page--7O3Jeje.js +1 -0
  64. package/dist/assets/devices-redirect-page-De4zPGBG.js +1 -0
  65. package/dist/assets/{dictation-overlay-page-CxYkmSA7.js → dictation-overlay-page-BebL8Sje.js} +1 -1
  66. package/dist/assets/{document-viewer-page-BtnTG7DW.js → document-viewer-page-R_dKhaWy.js} +1 -1
  67. package/dist/assets/{ellipsis-vertical-DADudCz4.js → ellipsis-vertical-BMOhP0Zs.js} +1 -1
  68. package/dist/assets/emails-page-CqVlJ1LT.js +1 -0
  69. package/dist/assets/environment-store-yY-PFyNj.js +1 -0
  70. package/dist/assets/esm-CEQ5-BPY.js +2 -0
  71. package/dist/assets/esm-CZUymCSO.js +1 -0
  72. package/dist/assets/{esm-Dk9SdDAD.js → esm-DUr8Sd7e.js} +1 -1
  73. package/dist/assets/esm-DyNBzk7k.js +2 -0
  74. package/dist/assets/esm-V26rZBqv.js +2 -0
  75. package/dist/assets/esm-VDGp8N8o.js +2 -0
  76. package/dist/assets/esm-bBYOtNIe.js +2 -0
  77. package/dist/assets/{esm-Dl792NhE.js → esm-hPUUgGy5.js} +2 -2
  78. package/dist/assets/{esm-BGgsNk0r.js → esm-krw2tVOJ.js} +1 -1
  79. package/dist/assets/{file-diff-view-GvaxlqVi.js → file-diff-view-EiQSECOw.js} +1 -1
  80. package/dist/assets/{file-editor-y8q5YmrU.js → file-editor-B_RqvjQp.js} +1 -1
  81. package/dist/assets/general-page-DZ2OQRcR.js +2 -0
  82. package/dist/assets/hatching-screen-BsUtOe4T.js +1 -0
  83. package/dist/assets/{hosting-screen-Bg3Zcz9P.js → hosting-screen-CnZGwkfa.js} +1 -1
  84. package/dist/assets/icons-xHdc0dPY.js +1 -0
  85. package/dist/assets/identity-page-route-DojUio39.js +7 -0
  86. package/dist/assets/index-CleA12ha.js +379 -0
  87. package/dist/assets/index-_KUyDosG.css +2 -0
  88. package/dist/assets/inspect-page-BE_JG1N4.js +9 -0
  89. package/dist/assets/integrations-page-KDXF3d-g.js +1 -0
  90. package/dist/assets/intelligence-layout-STvbMPLB.js +1 -0
  91. package/dist/assets/intelligence-layout-slots-store-DMLOaMGU.js +1 -0
  92. package/dist/assets/keyboard-shortcuts-redirect-page-DXaUnoFR.js +1 -0
  93. package/dist/assets/{latest-assistant-text-BOWFdsws.js → latest-assistant-text-mcgHfCbd.js} +1 -1
  94. package/dist/assets/library-detail-page-CCmvUHtD.js +1 -0
  95. package/dist/assets/library-page-DlTszOAL.js +1 -0
  96. package/dist/assets/login-page-CUNLD9gj.js +1 -0
  97. package/dist/assets/logout-page-DcyTUY-b.js +1 -0
  98. package/dist/assets/{logs-layout-BUUG4A54.js → logs-layout-BqkRgpwq.js} +1 -1
  99. package/dist/assets/{markdown-preview-QuFs8xZ0.js → markdown-preview-CG-FNmRz.js} +1 -1
  100. package/dist/assets/{media-preview-CyIyyMbk.js → media-preview-CCq9FQiT.js} +1 -1
  101. package/dist/assets/memory-page-route-BHUAp-C2.js +2 -0
  102. package/dist/assets/memory-router-playground-page-Dt9vB83b.js +1 -0
  103. package/dist/assets/message-files-panel-DpvaRorj.js +1 -0
  104. package/dist/assets/{metric-card-DOP22IvU.js → metric-card-CgEc3VST.js} +1 -1
  105. package/dist/assets/notifications-page-kX-DNd3J.js +1 -0
  106. package/dist/assets/{oauth-complete-page-Bg-W9np_.js → oauth-complete-page-_act6krk.js} +1 -1
  107. package/dist/assets/{oauth-popup-complete-page-BxqlB9cf.js → oauth-popup-complete-page-D9d5IH9z.js} +2 -2
  108. package/dist/assets/pairing-page-DJRUbeSZ.js +1 -0
  109. package/dist/assets/password-reset-page-Cegloo1P.js +1 -0
  110. package/dist/assets/pdf-file-preview-3kkKGH7o.js +1 -0
  111. package/dist/assets/{peeking-eyes-DzPVjsGl.js → peeking-eyes-DNBQeifP.js} +1 -1
  112. package/dist/assets/personality-page-CmZHiyRo.js +1 -0
  113. package/dist/assets/personality-page-DjPVfIFL.js +1 -0
  114. package/dist/assets/{personality-sliders-NpMaqjxr.js → personality-sliders-D0p9kgNx.js} +1 -1
  115. package/dist/assets/plans-page-CCY1BUZx.js +1 -0
  116. package/dist/assets/{platform-loopback-page-Dw5ZfNqu.js → platform-loopback-page-vdNjdoVw.js} +1 -1
  117. package/dist/assets/plugin-detail-page-Co0YswmF.js +1 -0
  118. package/dist/assets/plugins-page-DxCCY6yP.js +1 -0
  119. package/dist/assets/{preview-error-Z2VhCOcU.js → preview-error-DyczP1Cl.js} +1 -1
  120. package/dist/assets/privacy-page-nfyEw6V_.js +1 -0
  121. package/dist/assets/privacy-screen-CSYkxRBc.js +1 -0
  122. package/dist/assets/{provider-callback-page-44p-Qde5.js → provider-callback-page-Cms4b36-.js} +1 -1
  123. package/dist/assets/{provider-key-DA5daEzq.js → provider-key-B2zz48-r.js} +1 -1
  124. package/dist/assets/{provider-signup-page-CsKLFmzH.js → provider-signup-page-nO1KOWei.js} +1 -1
  125. package/dist/assets/{provisioning-targets-BLTBrT0f.js → provisioning-targets-BZJdjS_6.js} +1 -1
  126. package/dist/assets/{quick-input-page-DuGprlyM.js → quick-input-page-CtMMOIj7.js} +1 -1
  127. package/dist/assets/{rehype-katex-BgUVZdyw.js → rehype-katex-qwWAif3X.js} +1 -1
  128. package/dist/assets/{research-mock-page-DGBvAz0R.js → research-mock-page-TkBJ2Xzt.js} +1 -1
  129. package/dist/assets/research-onboarding-route-BBvprgLG.js +50 -0
  130. package/dist/assets/review-terms-screen-CdlPmf8I.js +1 -0
  131. package/dist/assets/schedules-BH4Qj3v_.js +1 -0
  132. package/dist/assets/schedules-page-BwWZDVOO.js +1 -0
  133. package/dist/assets/security-redirect-page-BflZPXbv.js +1 -0
  134. package/dist/assets/select-assistant-screen-s2j8iyBA.js +1 -0
  135. package/dist/assets/{self-hosted-servers-CSmSutTd.js → self-hosted-servers-BbfoTPnN.js} +1 -1
  136. package/dist/assets/{service-form-controls-0q5YMHpl.js → service-form-controls-B4TOUC0S.js} +1 -1
  137. package/dist/assets/{setting-row-DD_cFv_d.js → setting-row-DqAfZdv2.js} +1 -1
  138. package/dist/assets/settings-divider-CM41jU8r.js +1 -0
  139. package/dist/assets/{settings-layout-5TIuyIlR.js → settings-layout-dXTKjyLn.js} +1 -1
  140. package/dist/assets/share-feedback-modal-Bf_f-1Md.js +2 -0
  141. package/dist/assets/{sidebar-tree-B-0Yag_R.js → sidebar-tree-Bk7IUERw.js} +1 -1
  142. package/dist/assets/{signup-page-CORbOy_3.js → signup-page-C-3fDL0D.js} +1 -1
  143. package/dist/assets/{signup-shell-Cmaq_kqj.js → signup-shell-DqL_hfoj.js} +1 -1
  144. package/dist/assets/skill-detail-page-CVduyZVJ.js +2 -0
  145. package/dist/assets/skill-detail-panel-BxZAnZbg.js +1 -0
  146. package/dist/assets/{skill-removal-dialog-HT2BVhQJ.js → skill-removal-dialog-D3tHR3Ld.js} +1 -1
  147. package/dist/assets/skills-page-C-0iE9BV.js +1 -0
  148. package/dist/assets/sounds-page-_EVUXllQ.js +1 -0
  149. package/dist/assets/{start-screen-C8ZJNm6Y.js → start-screen-yHd9KDX3.js} +1 -1
  150. package/dist/assets/{stt-language-picker-modal-DYAbjuNH.js → stt-language-picker-modal-BUc9OzaG.js} +1 -1
  151. package/dist/assets/subagent-detail-panel-rXvn591h.js +1 -0
  152. package/dist/assets/superpowers-page-BZt2aSZX.js +1 -0
  153. package/dist/assets/system-events-page-C8lfUiSV.js +1 -0
  154. package/dist/assets/system-events-redirect-page-8LxoBVmn.js +1 -0
  155. package/dist/assets/{text-preview-CRmrXzbi.js → text-preview-DW6f8CZi.js} +1 -1
  156. package/dist/assets/{theme-stage-page-DvejGAik.js → theme-stage-page-DzWIjgFX.js} +1 -1
  157. package/dist/assets/{tiptap-document-editor-BBfhbOfo.js → tiptap-document-editor-7zjNquKo.js} +2 -2
  158. package/dist/assets/tool-detail-panel-UBD8L_LV.js +15 -0
  159. package/dist/assets/{trait-cycle-row-CFG6YTUV.js → trait-cycle-row-CSwys30K.js} +1 -1
  160. package/dist/assets/upgrade-cancel-page-o-OcUT1B.js +1 -0
  161. package/dist/assets/{upgrade-success-page-CxEsofA0.js → upgrade-success-page-D2BicwBj.js} +1 -1
  162. package/dist/assets/usage-redirect-page-BmlaczMS.js +1 -0
  163. package/dist/assets/use-app-delete-B8jp3vIE.js +1 -0
  164. package/dist/assets/use-assistant-identity-details-BRqAQ7pS.js +1 -0
  165. package/dist/assets/use-checkout-dismiss-refresh-DX3GymbX.js +1 -0
  166. package/dist/assets/{use-edge-swipe-back-CC5KICyO.js → use-edge-swipe-back-CbTl-FwD.js} +2 -2
  167. package/dist/assets/{use-hotkey-recorder-BxGna8XE.js → use-hotkey-recorder-BKNmxbXj.js} +1 -1
  168. package/dist/assets/use-invite-link-dialog-Daa3jhkP.js +1 -0
  169. package/dist/assets/{use-platform-assistant-id-BRh7__ps.js → use-platform-assistant-id-Dj8c4xX-.js} +1 -1
  170. package/dist/assets/use-return-to-short-circuit-DusBrJ_h.js +1 -0
  171. package/dist/assets/{use-side-list-room-KIvOD4zT.js → use-side-list-room-3ENOwQ0t.js} +1 -1
  172. package/dist/assets/{use-skill-actions-BCJvRbcW.js → use-skill-actions-BjY9oa7a.js} +1 -1
  173. package/dist/assets/{use-skill-detail-files-DidC7o6_.js → use-skill-detail-files-kPuMdyDL.js} +1 -1
  174. package/dist/assets/use-supports-credentials-settings-BuLaPijC.js +1 -0
  175. package/dist/assets/use-transcript-message-by-id-DOMa4nxw.js +1 -0
  176. package/dist/assets/{vendor-CV8wawxx.js → vendor-C_e0Rl2s.js} +2 -2
  177. package/dist/assets/voice-page-DuWSfI5B.js +1 -0
  178. package/dist/assets/{wake-detail-panel-Cl4efrsm.js → wake-detail-panel-D34xuHov.js} +1 -1
  179. package/dist/assets/weather-forecast-display-D1iB5UK2.js +1 -0
  180. package/dist/assets/{web-rLK7aHD3.js → web-9D8isJOk.js} +1 -1
  181. package/dist/assets/{web-B7Y6zjYj.js → web-BkmK5STh.js} +1 -1
  182. package/dist/assets/{web-BEBOyL2B.js → web-BpX3Y-_s.js} +1 -1
  183. package/dist/assets/{web-BZzdQ9pk.js → web-Bulr9QQn.js} +1 -1
  184. package/dist/assets/{web-J5TpUYg8.js → web-C_Ui7gb5.js} +1 -1
  185. package/dist/assets/{web-DU-rNdfR.js → web-CaauzE8c.js} +1 -1
  186. package/dist/assets/{web-BBa5psPY.js → web-CeDxhWFH.js} +1 -1
  187. package/dist/assets/{web-v3Sg2PMW.js → web-y4PoIMXz.js} +1 -1
  188. package/dist/assets/{web-BOqVDQt4.js → web-ykYrL9yl.js} +1 -1
  189. package/dist/assets/welcome-screen-Dw3nj99H.js +1 -0
  190. package/dist/assets/{workflow-detail-panel-Cj0nHReK.js → workflow-detail-panel-BbS4Uq2Q.js} +1 -1
  191. package/dist/assets/workspace-page-CmL3AaIw.js +1 -0
  192. package/dist/index.html +4 -4
  193. package/package.json +1 -1
  194. package/dist/assets/acp-run-detail-panel-DsjV1EUX.js +0 -3
  195. package/dist/assets/activity-steps-panel-qmXapo3l.js +0 -1
  196. package/dist/assets/ai-page-Bhqv3xAY.js +0 -1
  197. package/dist/assets/archive-redirect-page-DSb1SX7w.js +0 -1
  198. package/dist/assets/assistant-status-panel-CJuaxSU4.js +0 -1
  199. package/dist/assets/avatar-random-BTss-L3h.js +0 -2
  200. package/dist/assets/background-task-detail-panel-MlRoT__z.js +0 -1
  201. package/dist/assets/billing-page-BFshUZcX.js +0 -3
  202. package/dist/assets/bookmarks-page-6KvAXov6.js +0 -1
  203. package/dist/assets/channel-transcript-panel-d7ljfjMX.js +0 -1
  204. package/dist/assets/channels-page-route-Do_KTLZ8.js +0 -1
  205. package/dist/assets/chat-info-panel-DcVuXGtY.js +0 -1
  206. package/dist/assets/checkout-page-DfxAArMc.js +0 -1
  207. package/dist/assets/checkout-return-target-C7v_E-4b.js +0 -1
  208. package/dist/assets/command-palette-B_pYOi7y.js +0 -1
  209. package/dist/assets/common-BwTsuJS0.js +0 -1
  210. package/dist/assets/common-C8F4Ck2i.js +0 -1
  211. package/dist/assets/common-Pd0MI_So.js +0 -1
  212. package/dist/assets/companion-surface-page-B4SkqGVL.js +0 -1
  213. package/dist/assets/connect-page-B0ZRs47i.js +0 -1
  214. package/dist/assets/contacts-gateway-Dox96bwY.js +0 -1
  215. package/dist/assets/contacts-page-route-DmaeWdie.js +0 -1
  216. package/dist/assets/credentials-page-CX5iANZ5.js +0 -1
  217. package/dist/assets/danger-zone-redirect-page-BGJTqqyv.js +0 -1
  218. package/dist/assets/debug-page-BSops80I.js +0 -4
  219. package/dist/assets/deploy-dialogs-BPTgsXOx.js +0 -1
  220. package/dist/assets/developer-page-BhWFNmYK.js +0 -1
  221. package/dist/assets/devices-redirect-page-15zw0yzR.js +0 -1
  222. package/dist/assets/emails-page-D5RwsfGj.js +0 -1
  223. package/dist/assets/environment-store-WFLJCPJE.js +0 -1
  224. package/dist/assets/esm-BRd6ii0N.js +0 -2
  225. package/dist/assets/esm-CAyJeylE.js +0 -2
  226. package/dist/assets/esm-CVGx4tdT.js +0 -2
  227. package/dist/assets/esm-Dm3aeuGe.js +0 -1
  228. package/dist/assets/esm-OKy-T4ws.js +0 -2
  229. package/dist/assets/esm-VMeibMx_.js +0 -2
  230. package/dist/assets/folder-open-BDPMS2Bk.js +0 -1
  231. package/dist/assets/general-page-CzZX5e43.js +0 -2
  232. package/dist/assets/hatching-screen-Dhz0Khb7.js +0 -1
  233. package/dist/assets/icons-J6Mg9wGk.js +0 -1
  234. package/dist/assets/identity-page-route-Dud7k0QC.js +0 -7
  235. package/dist/assets/index-8UA9Y4Ao.js +0 -379
  236. package/dist/assets/index-DpGgrxCV.css +0 -2
  237. package/dist/assets/inspect-page-Dc1rdkP9.js +0 -9
  238. package/dist/assets/integrations-page-Clk-J4Cd.js +0 -1
  239. package/dist/assets/intelligence-layout-ADzECfOe.js +0 -1
  240. package/dist/assets/keyboard-shortcuts-redirect-page-CbiNVjGd.js +0 -1
  241. package/dist/assets/library-detail-page-BscImHC_.js +0 -1
  242. package/dist/assets/library-page-BEshfTJW.js +0 -1
  243. package/dist/assets/login-page-COBkMN_5.js +0 -1
  244. package/dist/assets/logout-page-ChnlgTU5.js +0 -1
  245. package/dist/assets/memory-page-route-BluGsa3J.js +0 -2
  246. package/dist/assets/memory-router-playground-page-D9Q4tGF2.js +0 -1
  247. package/dist/assets/message-files-panel-CQYcvU13.js +0 -1
  248. package/dist/assets/notifications-page-C0OOOstz.js +0 -1
  249. package/dist/assets/page-shell-Bla97arW.js +0 -1
  250. package/dist/assets/pairing-page-CZYQSh9a.js +0 -1
  251. package/dist/assets/password-reset-page-Czi7XijF.js +0 -1
  252. package/dist/assets/pdf-file-preview-44mv91Cv.js +0 -1
  253. package/dist/assets/personality-page-BuAOY8vA.js +0 -1
  254. package/dist/assets/personality-page-FD8sfxak.js +0 -1
  255. package/dist/assets/plans-page-CJ2F-3_s.js +0 -1
  256. package/dist/assets/plugin-detail-page-D6fF_dqD.js +0 -1
  257. package/dist/assets/plugins-page-BVROeTlq.js +0 -1
  258. package/dist/assets/privacy-page-BKsBZ8x1.js +0 -1
  259. package/dist/assets/privacy-screen-Dexo6eOj.js +0 -1
  260. package/dist/assets/repeat-CCwj4O1J.js +0 -1
  261. package/dist/assets/research-onboarding-route-gAeEwsD1.js +0 -50
  262. package/dist/assets/review-terms-screen-ieOZDgkt.js +0 -1
  263. package/dist/assets/schedules-CqtjyBUG.js +0 -1
  264. package/dist/assets/schedules-page-DgCTN3Do.js +0 -1
  265. package/dist/assets/security-redirect-page-DLxnlC29.js +0 -1
  266. package/dist/assets/select-assistant-screen-CoXciw6D.js +0 -1
  267. package/dist/assets/settings-divider-BM98PYnd.js +0 -1
  268. package/dist/assets/share-feedback-modal-BYyAGdRN.js +0 -2
  269. package/dist/assets/skill-detail-page-Dyx69rh5.js +0 -2
  270. package/dist/assets/skill-detail-panel-DNnuq8E7.js +0 -1
  271. package/dist/assets/skills-page-CYJpCjxa.js +0 -1
  272. package/dist/assets/sounds-page-DIwFM0zv.js +0 -1
  273. package/dist/assets/subagent-detail-panel-C7KSxdNW.js +0 -1
  274. package/dist/assets/superpowers-page-B-6PdXGb.js +0 -1
  275. package/dist/assets/system-events-page-DUUREvoY.js +0 -1
  276. package/dist/assets/system-events-redirect-page-CGeoRqpa.js +0 -1
  277. package/dist/assets/tool-detail-panel-CbOVBWLE.js +0 -15
  278. package/dist/assets/upgrade-cancel-page-CMa2zqCb.js +0 -1
  279. package/dist/assets/usage-redirect-page-feeRZq1Y.js +0 -1
  280. package/dist/assets/use-app-delete-Blc_lK4-.js +0 -1
  281. package/dist/assets/use-assistant-identity-details-B_Xl6WaJ.js +0 -1
  282. package/dist/assets/use-checkout-dismiss-refresh-B9TBs5mG.js +0 -1
  283. package/dist/assets/use-invite-link-dialog-BN02hmlY.js +0 -1
  284. package/dist/assets/use-return-to-short-circuit-BvHiJfG2.js +0 -1
  285. package/dist/assets/use-supports-credentials-settings-BIOShSIo.js +0 -1
  286. package/dist/assets/use-transcript-message-by-id-sDB9lKJT.js +0 -1
  287. package/dist/assets/voice-page-DcVetb6W.js +0 -1
  288. package/dist/assets/weather-forecast-display-fxkTGyYh.js +0 -1
  289. package/dist/assets/welcome-screen-Bc_uUKsM.js +0 -1
  290. package/dist/assets/workspace-page-5a_O4mZP.js +0 -1
  291. /package/dist/assets/{account-DlHR5tom.js → account-BF5lrfyX.js} +0 -0
  292. /package/dist/assets/{account-DFBVUaFj.js → account-Bxy_vX-K.js} +0 -0
  293. /package/dist/assets/{account-DK-uFjDM.js → account-DDtCvPF5.js} +0 -0
  294. /package/dist/assets/{account-BRMQN3Hp.js → account-Diu-bFrX.js} +0 -0
  295. /package/dist/assets/{app-types-R2BjVd4u.js → app-types-Dij41aJ8.js} +0 -0
  296. /package/dist/assets/{build.umd-BDQjXK5l.js → build.umd-BrZECSr1.js} +0 -0
  297. /package/dist/assets/{channels-BlN6h5Yf.js → channels-BCLfuOUD.js} +0 -0
  298. /package/dist/assets/{channels-oV3BofDQ.js → channels-BIVOatvA.js} +0 -0
  299. /package/dist/assets/{channels-CYyjWubA.js → channels-C9mCB0CJ.js} +0 -0
  300. /package/dist/assets/{channels-Fuiz6Bx7.js → channels-CDirkQc7.js} +0 -0
  301. /package/dist/assets/{chat-DatZlEOI.js → chat-BOrB9oHu.js} +0 -0
  302. /package/dist/assets/{chat-Dcr3nKow.js → chat-C1MeXG-2.js} +0 -0
  303. /package/dist/assets/{chat-CIhnpdUa.js → chat-CWzsWu23.js} +0 -0
  304. /package/dist/assets/{chat-nxDOj1GL.js → chat-eAA7-NU8.js} +0 -0
  305. /package/dist/assets/{common-CqRcxmv_.js → common-BztqCOmk.js} +0 -0
  306. /package/dist/assets/{contacts-Dh9S5trj.js → contacts-4xLilqUA.js} +0 -0
  307. /package/dist/assets/{contacts-BD1ZjH4R.js → contacts-CnVtG-pl.js} +0 -0
  308. /package/dist/assets/{contacts-DO23uT5c.js → contacts-DE8gWrSn.js} +0 -0
  309. /package/dist/assets/{contacts-DS4DGhkC.js → contacts-DIgSZ4hU.js} +0 -0
  310. /package/dist/assets/{credential-requests-B2nbIPCm.js → credential-requests-BFLeXf78.js} +0 -0
  311. /package/dist/assets/{credential-requests-SsPu1I49.js → credential-requests-CPxFLVT9.js} +0 -0
  312. /package/dist/assets/{credential-requests-Cq0W2SLQ.js → credential-requests-Qe84hNEC.js} +0 -0
  313. /package/dist/assets/{credential-requests-orDT3GcS.js → credential-requests-lDkcsmmB.js} +0 -0
  314. /package/dist/assets/{definitions-vY30nmPg.js → definitions-BTebkxyz.js} +0 -0
  315. /package/dist/assets/{definitions-CIDzXl-8.js → definitions-BjZOswgM.js} +0 -0
  316. /package/dist/assets/{diff-rows-w3WozbDH.js → diff-rows-6HtO6KNr.js} +0 -0
  317. /package/dist/assets/{emoji-catalog-data-0ErKKUgg.js → emoji-catalog-data-QQIw94Eu.js} +0 -0
  318. /package/dist/assets/{format-countdown-Ck7dI0Xw.js → format-countdown-C-J64lue.js} +0 -0
  319. /package/dist/assets/{format-file-size-BCpFMv3k.js → format-file-size-Daiq0gMr.js} +0 -0
  320. /package/dist/assets/{home-BG3X65Tv.js → home-BteaphB_.js} +0 -0
  321. /package/dist/assets/{home-BUeCo3yU.js → home-CCUv41ef.js} +0 -0
  322. /package/dist/assets/{home-BF9986ga.js → home-DO7A2tVm.js} +0 -0
  323. /package/dist/assets/{home-C8krCVKm.js → home-tbbkVcjW.js} +0 -0
  324. /package/dist/assets/{intelligence-y6vN_Mdd.js → intelligence-Bla65nm5.js} +0 -0
  325. /package/dist/assets/{intelligence-D3QpZ2xn.js → intelligence-Db527yzW.js} +0 -0
  326. /package/dist/assets/{intelligence-DPqYLHNd.js → intelligence-s33k1wI2.js} +0 -0
  327. /package/dist/assets/{intelligence-u56Yi_NI.js → intelligence-xiqKApFj.js} +0 -0
  328. /package/dist/assets/{library-CdIFgs3T.js → library-BRmAQI9e.js} +0 -0
  329. /package/dist/assets/{library-C-Qksx7x.js → library-BhC14-NO.js} +0 -0
  330. /package/dist/assets/{library-6ZRxzyy2.js → library-ClpjgmQn.js} +0 -0
  331. /package/dist/assets/{library-CS5eEGWr.js → library-DuuiJut6.js} +0 -0
  332. /package/dist/assets/{link-click-k5mmNwCu.js → link-click-e-Fdx5JV.js} +0 -0
  333. /package/dist/assets/{logs-CrmkpO3a.js → logs-CQYFdGa_.js} +0 -0
  334. /package/dist/assets/{logs-Dz-GMURf.js → logs-DwYHebVx.js} +0 -0
  335. /package/dist/assets/{logs-D0cXFJMX.js → logs-NHN9-mUP.js} +0 -0
  336. /package/dist/assets/{logs-DAwJbr-Q.js → logs-SCSd0kUm.js} +0 -0
  337. /package/dist/assets/{machine-sizes-C3GmmuDZ.js → machine-sizes-DadN4uVk.js} +0 -0
  338. /package/dist/assets/{onboarding-Bp4I4_8q.js → onboarding-8Qvub-HF.js} +0 -0
  339. /package/dist/assets/{onboarding-SOv21YJD.js → onboarding-BqMOEnu1.js} +0 -0
  340. /package/dist/assets/{onboarding-DfDEWpm3.js → onboarding-Do0E1QsF.js} +0 -0
  341. /package/dist/assets/{onboarding-DWCktMSZ.js → onboarding-ml_qpGn-.js} +0 -0
  342. /package/dist/assets/{onboarding-step-layout-DnL_IbCm.js → onboarding-step-layout-COS57xjn.js} +0 -0
  343. /package/dist/assets/{pdf-D2FMVYiD.js → pdf-B2KVp4ZG.js} +0 -0
  344. /package/dist/assets/{plugin-attribution-CeJvw31w.js → plugin-attribution-zkdgIHRG.js} +0 -0
  345. /package/dist/assets/{radio-card-nav-BsBWpdyn.js → radio-card-nav-DCE3wYLZ.js} +0 -0
  346. /package/dist/assets/{remote-web-BDlWdbTR.js → remote-web-BIYYINs1.js} +0 -0
  347. /package/dist/assets/{remote-web-Csjf67ib.js → remote-web-CSrWAyIC.js} +0 -0
  348. /package/dist/assets/{remote-web-Cs7J640n.js → remote-web-D3chXkbO.js} +0 -0
  349. /package/dist/assets/{remote-web-BqT1bCst.js → remote-web-DfCFOpuR.js} +0 -0
  350. /package/dist/assets/{schedules-blEdQ6yp.js → schedules-BBaBmcJG.js} +0 -0
  351. /package/dist/assets/{schedules-De4Odvkc.js → schedules-CjtoHUii.js} +0 -0
  352. /package/dist/assets/{schedules-De57J4ta.js → schedules-CpR8IZ0O.js} +0 -0
  353. /package/dist/assets/{schedules-2XQ76whr.js → schedules-jUeeTvGp.js} +0 -0
  354. /package/dist/assets/{settings-CqYNz8kW.js → settings-C63GjmJb.js} +0 -0
  355. /package/dist/assets/{settings-CuRkdN0w.js → settings-CrvJCEjH.js} +0 -0
  356. /package/dist/assets/{settings-hFa4u0Fj.js → settings-D4bcxNIG.js} +0 -0
  357. /package/dist/assets/{settings-CBz3nIpZ.js → settings-Dn888InQ.js} +0 -0
  358. /package/dist/assets/{signup-onboarding-handoff-BUG9xNxh.js → signup-onboarding-handoff-DsARDCO5.js} +0 -0
  359. /package/dist/assets/{skill-icon-DEUidmqq.js → skill-icon-FPL5xeRb.js} +0 -0
  360. /package/dist/assets/{status-badge-pill-CBQvTIk7.js → status-badge-pill-DsYKTPMw.js} +0 -0
  361. /package/dist/assets/{terminal-DFgjzYGN.js → terminal-BDTudyuW.js} +0 -0
  362. /package/dist/assets/{terminal-CRBKHZm5.js → terminal-BkBRbIo0.js} +0 -0
  363. /package/dist/assets/{terminal-DoWOKxv3.js → terminal-DOjJsvsr.js} +0 -0
  364. /package/dist/assets/{terminal-C0WX32KF.js → terminal-DzafX5hx.js} +0 -0
  365. /package/dist/assets/{usage-window-5RXvRuB8.js → usage-window-C3F8jUQI.js} +0 -0
  366. /package/dist/assets/{use-truncated-blob-text-CvqS5q0a.js → use-truncated-blob-text-B50a7Mkr.js} +0 -0
  367. /package/dist/assets/{workspace-DLF1k434.js → workspace-B3qxH51y.js} +0 -0
  368. /package/dist/assets/{workspace-Bt8Q3v-7.js → workspace-BUMgSIAc.js} +0 -0
  369. /package/dist/assets/{workspace-BLgcfQq4.js → workspace-DBbRFlwk.js} +0 -0
  370. /package/dist/assets/{workspace-Bu0imBiz.js → workspace-LUczKAWY.js} +0 -0
  371. /package/dist/assets/{xterm-CJ0yCq-Z.js → xterm-BQMgK3JF.js} +0 -0
  372. /package/dist/assets/{xterm-addon-fit-IkN_XlHG.js → xterm-addon-fit-Cb7BiyPE.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{N as t,Qn as n,Zn as r,er as i,j as a}from"./vendor-CV8wawxx.js";import{b as o,f as s,g as c,t as l}from"./react-DPM_L_aA.js";import{$t as u,Ci as d,Hr as f,P as p,Tr as m,Vr as h,Y as g,Yn as _,Zn as v,ct as y,i as b,q as x,rn as S,rr as C,tn as w,tt as T,vt as E,x as D,zr as O}from"./icons-J6Mg9wGk.js";import{Af as k,Ay as A,Bd as j,By as M,Cr as N,Dc as P,Dg as F,Ec as I,Es as L,Hd as R,Hy as z,Iu as B,Jy as V,Ly as H,My as U,Of as ee,Om as W,Oy as G,Q as te,Qf as K,Rd as ne,Ry as q,Tc as re,Tl as ie,Ts as ae,Ud as oe,Uy as J,Vd as se,Vv as ce,Xf as le,Xy as ue,Yv as de,Zy as fe,_y as pe,an as me,ay as he,cy as ge,ib as Y,jf as _e,jr as ve,kf as ye,kg as be,nb as X,ny as xe,ri as Se,tb as Ce,zd as we,zi as Te,zy as Z}from"./index-8UA9Y4Ao.js";import{t as Ee}from"./use-platform-assistant-id-BRh7__ps.js";var De=d(`cable`,[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]),Oe=d(`calendar-plus`,[[`path`,{d:`M16 19h6`,key:`xwg31i`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M21 12.598V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8.5`,key:`1glfrc`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),ke={slack:`slack_channel`,discord:`discord_channel`,telegram:`telegram`};function Ae(e){return Object.entries(ke).some(([t,n])=>t===e&&n!==e)}var Q=e(o(),1),$=l();function je({displayName:e,providerKey:t,logoUrl:n,connections:r,connectionsLoading:i,oauthInProgress:o,onCancelConnect:s,disconnectingId:c,onConnect:l,onDisconnect:u,connectPresets:d=[]}){let{t:f}=a(`settings`);return i?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,$.jsx)(S,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):r.length===0?o?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,$.jsx)(N,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,$.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}),f(`managedOauthTab.waitingForAuthorization`),(0,$.jsx)(Y,{variant:`ghost`,size:`compact`,onClick:s,children:f(`managedOauthTab.cancel`)})]})]}):(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-10`,children:[(0,$.jsx)(N,{providerKey:t,displayName:e,logoUrl:n,size:48}),(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:f(`managedOauthTab.connectToContinue`)}),(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,$.jsx)(Y,{variant:`primary`,size:`compact`,leftIcon:(0,$.jsx)(y,{}),onClick:()=>l(),disabled:o,children:f(`managedOauthTab.connectAccount`)}),d.map(e=>(0,$.jsx)(Y,{variant:`outlined`,size:`compact`,leftIcon:(0,$.jsx)(Oe,{}),onClick:()=>l(e.scopes),disabled:o,children:e.label},e.id))]})]}):(0,$.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)]`,children:[(0,$.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(r=>{let i=c===r.id,a=r.account_label??f(`managedOauthTab.accountFallback`,{name:e});return(0,$.jsxs)(`li`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,$.jsx)(N,{providerKey:t,displayName:e,logoUrl:n,size:20}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default text-[var(--content-default)]`,children:a}),(0,$.jsx)(Y,{variant:`dangerOutline`,size:`compact`,iconOnly:i?(0,$.jsx)(S,{className:`animate-spin`}):(0,$.jsx)(D,{}),onClick:()=>u(r),disabled:i,"aria-label":f(`managedOauthTab.disconnectAriaLabel`,{account:a})})]},r.id)})}),(0,$.jsx)(`div`,{className:`border-t border-[var(--border-base)] px-4 py-3 dark:border-[var(--border-base)]`,children:o?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,$.jsx)(S,{className:`h-3.5 w-3.5 animate-spin`}),f(`managedOauthTab.waitingForAuthorization`),(0,$.jsx)(Y,{variant:`ghost`,size:`compact`,onClick:s,children:f(`managedOauthTab.cancel`)})]}):(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(Y,{variant:`primary`,size:`compact`,leftIcon:(0,$.jsx)(_,{}),onClick:()=>l(),disabled:o,children:f(`managedOauthTab.connectAccountLower`)}),d.map(e=>(0,$.jsx)(Y,{variant:`outlined`,size:`compact`,leftIcon:(0,$.jsx)(Oe,{}),onClick:()=>l(e.scopes),disabled:o,children:e.label},e.id))]})})]})}function Me(e){return e.length>16?`${e.slice(0,12)}…${e.slice(-4)}`:e.length>8?`${e.slice(0,8)}…`:e}function Ne(e){try{return new Date(e).toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`})}catch{return``}}function Pe({assistantId:e,providerKey:t,displayName:o,logoUrl:s}){let{t:c}=a(`settings`),l=i(),u=r({...j({path:{assistant_id:e},query:{provider_key:t}}),select:e=>e.apps}),d=r({...R({path:{assistant_id:e,providerKey:t}}),select:e=>e.oauth_callback_url}),p=u.data??[],m=d.data??null,h=n({queries:p.map(t=>({...ne({path:{assistant_id:e,appId:t.id}}),select:e=>e.connections}))}),g={};p.forEach((e,t)=>{g[e.id]=h[t]?.data??[]});let v=se({path:{assistant_id:e},query:{provider_key:t}}),b=k({onSuccess:()=>{l.invalidateQueries({queryKey:v}),M(``),F(``),O(!1),q.success(c(`yourOwnOauthTab.appAddedToast`,{name:o}))},onError:e=>{q.error(e.message||c(`yourOwnOauthTab.createFailedToast`))}}),x=ye({onSuccess:()=>{l.invalidateQueries({queryKey:v}),q.success(c(`yourOwnOauthTab.appDeletedToast`))},onError:e=>{q.error(e.message||c(`yourOwnOauthTab.deleteFailedToast`))}}),w=ee({onSuccess:e=>{`auth_url`in e&&(window.location.href=e.auth_url)},onError:e=>{q.error(e.message||c(`yourOwnOauthTab.connectFailedToast`))}}),T=_e(),[E,O]=(0,Q.useState)(!1),[A,M]=(0,Q.useState)(``),[P,F]=(0,Q.useState)(``),[I,L]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(null),[U,W]=(0,Q.useState)(null),G=b.isPending,te=x.isPending?x.variables?.path?.id??null:null,K=w.isPending?w.variables?.path?.appId??null:null,re=T.isPending?T.variables?.path?.id??null:null,ie=()=>{let n=A.trim(),r=P.trim();!n||!r||b.mutate({path:{assistant_id:e},body:{provider_key:t,client_id:n,client_secret:r}})},ae=()=>{let t=z;B(null),t&&x.mutate({path:{assistant_id:e,id:t.id}})},oe=t=>{w.mutate({path:{assistant_id:e,appId:t.id},body:{callback_transport:`gateway`,scopes:[]}})};return u.isLoading?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,$.jsx)(S,{className:`h-5 w-5 animate-spin text-[var(--content-disabled)]`})}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[p.length===0||E?(0,$.jsx)(X.Root,{children:(0,$.jsxs)(X.Body,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:p.length===0?c(`yourOwnOauthTab.addOwnApp`,{name:o}):c(`yourOwnOauthTab.addAnotherApp`,{name:o})}),(0,$.jsx)(`p`,{className:`text-body-small-lighter leading-relaxed text-[var(--content-tertiary)]`,children:c(`yourOwnOauthTab.credentialsNote`)})]}),m?(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:c(`yourOwnOauthTab.redirectUrl`)}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(V,{type:`text`,value:m,readOnly:!0,fullWidth:!0}),(0,$.jsx)(Y,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{be(m,{successMessage:c(`yourOwnOauthTab.copiedToast`),errorMessage:c(`yourOwnOauthTab.copyFailedToast`),onCopied:()=>{L(!0),setTimeout(()=>L(!1),2e3)}})},"aria-label":c(I?`yourOwnOauthTab.copiedAria`:`yourOwnOauthTab.copyRedirectAria`),iconOnly:I?(0,$.jsx)(f,{"aria-hidden":!0}):(0,$.jsx)(C,{"aria-hidden":!0})})]}),(0,$.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:c(`yourOwnOauthTab.redirectHint`)})]}):null,(0,$.jsx)(V,{label:c(`yourOwnOauthTab.clientId`),type:`text`,value:A,onChange:e=>M(e.target.value),placeholder:c(`yourOwnOauthTab.clientIdPlaceholder`),fullWidth:!0}),(0,$.jsx)(V,{label:c(`yourOwnOauthTab.clientSecret`),type:`password`,value:P,onChange:e=>F(e.target.value),placeholder:c(`yourOwnOauthTab.clientSecretPlaceholder`),fullWidth:!0}),(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1`,children:[p.length>0?(0,$.jsx)(Y,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>{O(!1),M(``),F(``)},disabled:G,children:c(`yourOwnOauthTab.cancel`)}):null,(0,$.jsx)(Y,{type:`button`,size:`compact`,onClick:ie,disabled:G||!A.trim()||!P.trim(),leftIcon:G?(0,$.jsx)(S,{className:`animate-spin`,"aria-hidden":!0}):(0,$.jsx)(y,{"aria-hidden":!0}),children:c(`yourOwnOauthTab.addApp`)})]})]})}):null,p.map(e=>{let n=g[e.id]??[],r=te===e.id,i=K===e.id;return(0,$.jsx)(X.Root,{children:(0,$.jsxs)(X.Body,{className:`flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,$.jsx)(`p`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:Me(e.client_id)}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:c(`yourOwnOauthTab.addedOn`,{date:Ne(e.created_at)})})]}),(0,$.jsx)(Y,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>B(e),disabled:r,"aria-label":c(`yourOwnOauthTab.deleteAppAria`,{id:Me(e.client_id)}),iconOnly:r?(0,$.jsx)(S,{className:`animate-spin`,"aria-hidden":!0}):(0,$.jsx)(D,{"aria-hidden":!0})})]}),n.length>0?(0,$.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)] overflow-hidden rounded-md border border-[var(--border-base)] dark:divide-[var(--border-base)] dark:border-[var(--border-base)]`,children:n.map(n=>{let r=re===n.id,i=n.account_info??c(`yourOwnOauthTab.accountFallback`,{name:o});return(0,$.jsxs)(`li`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,$.jsx)(N,{providerKey:t,displayName:o,logoUrl:s,size:18}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-lighter text-[var(--content-default)]`,children:i}),(0,$.jsx)(Y,{type:`button`,variant:`dangerOutline`,size:`compact`,onClick:()=>W({appId:e.id,connection:n}),disabled:r,"aria-label":c(`yourOwnOauthTab.disconnectAria`,{account:i}),iconOnly:r?(0,$.jsx)(S,{className:`animate-spin`,"aria-hidden":!0}):(0,$.jsx)(D,{"aria-hidden":!0})})]},n.id)})}):null,(0,$.jsx)(Y,{type:`button`,size:`compact`,onClick:()=>oe(e),disabled:i,className:`w-full`,leftIcon:i?(0,$.jsx)(S,{className:`animate-spin`,"aria-hidden":!0}):(0,$.jsx)(_,{"aria-hidden":!0}),children:c(i?`yourOwnOauthTab.waitingAuthorization`:`yourOwnOauthTab.connectAccount`)})]})},e.id)}),p.length>0&&!E?(0,$.jsx)(Y,{type:`button`,variant:`outlined`,size:`compact`,onClick:()=>O(!0),className:`w-full border-dashed`,leftIcon:(0,$.jsx)(y,{"aria-hidden":!0}),children:c(`yourOwnOauthTab.addAnotherAppButton`)}):null,(0,$.jsx)(H,{open:z!==null,title:c(`yourOwnOauthTab.deleteAppTitle`),message:z?c(`yourOwnOauthTab.deleteAppMessage`,{id:Me(z.client_id)}):``,confirmLabel:c(`yourOwnOauthTab.delete`),destructive:!0,onConfirm:ae,onCancel:()=>B(null)}),(0,$.jsx)(H,{open:U!==null,title:c(`yourOwnOauthTab.disconnectTitle`,{name:o}),message:U?c(`yourOwnOauthTab.disconnectMessage`,{account:U.connection.account_info??c(`yourOwnOauthTab.accountFallback`,{name:o})}):``,confirmLabel:c(`yourOwnOauthTab.disconnect`),destructive:!0,onConfirm:()=>{let t=U;W(null),t&&T.mutate({path:{assistant_id:e,id:t.connection.id}},{onSuccess:()=>{let n=we({path:{assistant_id:e,appId:t.appId}});l.invalidateQueries({queryKey:n}),l.invalidateQueries({queryKey:v}),q.success(c(`yourOwnOauthTab.disconnectedToast`,{name:o}))},onError:e=>{q.error(e.message||c(`yourOwnOauthTab.disconnectFailedToast`))}})},onCancel:()=>W(null)})]})}var Fe={};function Ie(e){return Fe[e]??[]}function Le({assistantId:e,platformAssistantId:t,providerKey:n,displayName:o,description:s,logoUrl:c,platformGate:l,onClose:u}){let{t:d}=a(`settings`),f=i(),p=l===`full`,m=!le(),[h,g]=(0,Q.useState)(l===`gated`&&m?`your-own`:`managed`),_=(0,Q.useMemo)(()=>[{value:`managed`,label:d(`integrationDetailModal.managedTab`)},{value:`your-own`,label:d(`integrationDetailModal.yourOwnTab`)}],[d]);(0,Q.useEffect)(()=>{!m&&h===`your-own`&&g(`managed`)},[m,h]);let[v,y]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(null),C=I({path:{assistant_id:t}}),{data:w,isLoading:T}=r({...re({path:{assistant_id:t}}),enabled:p}),E=(w??[]).filter(e=>e.provider===n&&e.connected),D=ve({assistantId:e,providerKey:n,providerLabel:o}),O=e=>{p&&D.connect(e)},k=D.status;(0,Q.useEffect)(()=>{k===`connected`&&q.success(d(`useOauthConnect.accountConnected`,{name:o,ns:`common`}))},[k,o,d]);let A=D.dismiss;(0,Q.useEffect)(()=>A,[A]);let j=D.errorMessage;(0,Q.useEffect)(()=>{j&&q.error(j)},[j]);let M={path:{assistant_id:t}},F=ie({onSuccess(e,t){q.success(d(`integrationDetailModal.disconnectedToast`,{name:o}));let n=t.path.connection_id;P(f,M,e=>e?.filter(e=>e.id!==n)),f.invalidateQueries({queryKey:C}),y(null)},onError(e){let t=xe(e,void 0,d(`integrationDetailModal.disconnectFailedToast`,{name:o}));q.error(t),y(null)}});Te(),(0,Q.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),u())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[u]);let L=e=>{S(e)},R=()=>{let e=x;S(null),e&&(y(e.id),F.mutate({path:{assistant_id:t,connection_id:e.id}}))},B=x?.account_label??d(`integrationDetailModal.accountFallback`,{name:o}),V=s?d(`integrationDetailModal.subtitleWithDescription`,{name:o,description:s}):d(`integrationDetailModal.subtitle`,{name:o});return(0,$.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,children:[(0,$.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`integration-modal-title`,className:`flex w-full max-w-[520px] flex-col overflow-hidden rounded-xl bg-white shadow-xl dark:bg-[var(--surface-lift)]`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b border-[var(--border-base)] px-5 py-4 dark:border-[var(--border-base)]`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(N,{providerKey:n,displayName:o,logoUrl:c,size:32}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{id:`integration-modal-title`,className:`text-title-small text-[var(--content-default)]`,children:d(`integrationDetailModal.title`,{name:o})}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:V})]})]}),(0,$.jsx)(Y,{variant:`ghost`,size:`compact`,iconOnly:(0,$.jsx)(b,{}),"aria-label":d(`integrationDetailModal.close`),onClick:u})]}),(0,$.jsxs)(`div`,{className:`space-y-4 px-5 py-4`,children:[l!==`gated`&&m&&(0,$.jsx)(z,{ariaLabel:d(`integrationDetailModal.oauthModeAriaLabel`),items:_,value:h,onChange:g}),h===`managed`&&l!==`gated`?l===`disabled`?(0,$.jsx)(me,{children:d(`integrationDetailModal.loginNotice`)}):(0,$.jsx)(je,{displayName:o,providerKey:n,logoUrl:c,connections:E,connectionsLoading:T,oauthInProgress:D.status===`attempting`,onCancelConnect:D.dismiss,disconnectingId:F.isPending?v:null,onConnect:O,onDisconnect:L,connectPresets:Ie(n)}):m?(0,$.jsx)(Pe,{assistantId:e,providerKey:n,displayName:o,logoUrl:c}):null]}),(0,$.jsx)(`div`,{className:`flex justify-end border-t border-[var(--border-base)] px-5 py-3 dark:border-[var(--border-base)]`,children:(0,$.jsx)(Y,{variant:`outlined`,size:`compact`,onClick:u,children:d(`integrationDetailModal.confirm`)})})]}),(0,$.jsx)(H,{open:x!==null,title:d(`integrationDetailModal.disconnectTitle`,{name:o}),message:x?d(`integrationDetailModal.disconnectMessage`,{account:B}):``,confirmLabel:d(`integrationDetailModal.disconnect`),destructive:!0,onConfirm:R,onCancel:()=>S(null)})]})}function Re({platformAssistantId:e,providerKey:t,displayName:n,description:r,logoUrl:o,connection:s,platformGate:c,onConfigure:l}){let{t:u}=a(`settings`),d=i(),f=!!s?.connected,[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=I({path:{assistant_id:e}}),v={path:{assistant_id:e}},y=ie({onSuccess(e,t){q.success(u(`integrationRow.disconnectedToast`,{name:n}));let r=t.path.connection_id;P(d,v,e=>e?.filter(e=>e.id!==r)),d.invalidateQueries({queryKey:_})},onError(e){let t=xe(e,void 0,u(`integrationRow.disconnectFailedToast`,{name:n}));q.error(t)}}),b=()=>{s?.id&&g(!0)};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(X.Root,{children:(0,$.jsxs)(X.Body,{padding:`sm`,className:`flex items-center gap-4 px-4`,children:[(0,$.jsx)(N,{providerKey:t,displayName:n,logoUrl:o,size:32}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`p`,{className:`truncate text-title-small text-[var(--content-default)]`,children:n}),r&&(0,$.jsx)(`p`,{className:`truncate text-body-medium-lighter text-[var(--content-tertiary)]`,children:r})]}),f&&c===`full`?(0,$.jsx)(`div`,{className:`shrink-0`,children:(0,$.jsx)(ze,{displayName:n,open:p,onOpenChange:m,onEditConnections:()=>{m(!1),l()},onDisable:()=>{m(!1),b()},disablePending:y.isPending})}):(0,$.jsx)(Y,{variant:`primary`,onClick:l,className:`shrink-0`,children:u(`integrationRow.enable`)})]})}),(0,$.jsx)(H,{open:h,title:u(`integrationRow.disconnectTitle`,{name:n}),message:u(`integrationRow.disconnectMessage`,{name:n}),confirmLabel:u(`integrationRow.disconnect`),destructive:!0,onConfirm:()=>{g(!1),s?.id&&y.mutate({path:{assistant_id:e,connection_id:s.id}})},onCancel:()=>g(!1)})]})}function ze({displayName:e,open:t,onOpenChange:n,onEditConnections:r,onDisable:i,disablePending:o}){let{t:s}=a(`settings`);return Se()?(0,$.jsxs)(Z.Root,{open:t,onOpenChange:n,children:[(0,$.jsx)(Z.Trigger,{asChild:!0,children:(0,$.jsx)(Y,{variant:`outlined`,rightIcon:(0,$.jsx)(h,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:s(`integrationRow.configure`)})}),(0,$.jsxs)(Z.Content,{children:[(0,$.jsx)(Z.Header,{children:(0,$.jsx)(Z.Title,{children:e})}),(0,$.jsxs)(Z.Body,{children:[(0,$.jsx)(U,{icon:E,label:s(`integrationRow.editConnections`),onSelect:r}),(0,$.jsx)(U,{icon:o?S:m,label:s(`integrationRow.disable`),onSelect:()=>{o||i()}})]})]})]}):(0,$.jsxs)(ue.Root,{open:t,onOpenChange:n,children:[(0,$.jsx)(ue.Trigger,{asChild:!0,children:(0,$.jsx)(Y,{variant:`outlined`,rightIcon:(0,$.jsx)(h,{}),"aria-haspopup":`menu`,"aria-expanded":t,children:s(`integrationRow.configure`)})}),(0,$.jsxs)(ue.Content,{align:`end`,sideOffset:4,role:`menu`,className:`w-56 overflow-hidden p-0`,children:[(0,$.jsx)(Y,{type:`button`,role:`menuitem`,variant:`ghost`,onClick:r,className:`w-full justify-start rounded-none`,leftIcon:(0,$.jsx)(E,{"aria-hidden":!0}),children:s(`integrationRow.editConnections`)}),(0,$.jsx)(Y,{type:`button`,role:`menuitem`,variant:`dangerGhost`,onClick:i,disabled:o,className:`w-full justify-start rounded-none`,leftIcon:o?(0,$.jsx)(S,{className:`animate-spin`,"aria-hidden":!0}):(0,$.jsx)(m,{"aria-hidden":!0}),children:s(`integrationRow.disable`)})]})]})}var Be=[{value:`none`,labelKey:`mcpAddServerModal.authNone`},{value:`oauth`,labelKey:`mcpAddServerModal.authOAuth`},{value:`bearer`,labelKey:`mcpAddServerModal.authBearer`},{value:`api-key`,labelKey:`mcpAddServerModal.authApiKey`}],Ve=[{value:`sse`,labelKey:`mcpAddServerModal.transportSse`},{value:`streamable-http`,labelKey:`mcpAddServerModal.transportStreamableHttp`},{value:`stdio`,labelKey:`mcpAddServerModal.transportStdio`}];function He(e){return Be.map(({value:t,labelKey:n})=>({value:t,label:e(n)}))}function Ue(e){return Ve.map(({value:t,labelKey:n})=>({value:t,label:e(n)}))}function We({open:e,onClose:t,onAdd:n,isPending:r}){let{t:i}=a(`settings`),o=(0,Q.useMemo)(()=>He(i),[i]),s=(0,Q.useMemo)(()=>Ue(i),[i]),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(`sse`),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(`none`),[b,x]=(0,Q.useState)(``),[S,C]=(0,Q.useState)(`X-API-Key`),[w,T]=(0,Q.useState)(``),E=(0,Q.useCallback)(()=>{l(``),d(`sse`),p(``),h(``),_(``),y(`none`),x(``),C(`X-API-Key`),T(``)},[]),D=(0,Q.useCallback)(()=>{r||(E(),t())},[r,E,t]),O=(0,Q.useCallback)(()=>{let e=c.trim();if(!e)return;let t={name:e,transportType:u};if(u===`stdio`){let e=m.trim();if(!e)return;t.command=e;let n=g.trim();n&&(t.args=n.split(/\s+/))}else{let e=f.trim();if(!e)return;t.url=e,v===`bearer`&&b.trim()?t.headers={Authorization:`Bearer ${b.trim()}`}:v===`api-key`&&S.trim()&&w.trim()?t.headers={[S.trim()]:w.trim()}:v===`oauth`&&(t.autoAuth=!0)}n(t)},[c,u,f,m,g,v,b,S,w,n]),k=u===`stdio`,A=c.trim()&&(k?m.trim():f.trim());return(0,$.jsx)(M.Root,{open:e,onOpenChange:e=>{e||D()},children:(0,$.jsxs)(M.Content,{size:`md`,children:[(0,$.jsxs)(M.Header,{icon:De,children:[(0,$.jsx)(M.Title,{children:i(`mcpAddServerModal.title`)}),(0,$.jsx)(M.Description,{children:i(`mcpAddServerModal.description`)})]}),(0,$.jsx)(M.Body,{children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-name`,children:i(`mcpAddServerModal.serverNameLabel`)}),(0,$.jsx)(V,{id:`mcp-name`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:i(`mcpAddServerModal.namePlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-transport`,children:i(`mcpAddServerModal.transportLabel`)}),(0,$.jsx)(`select`,{id:`mcp-transport`,value:u,onChange:e=>d(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:s.map(e=>(0,$.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),k?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-command`,children:i(`mcpAddServerModal.commandLabel`)}),(0,$.jsx)(V,{id:`mcp-command`,type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:i(`mcpAddServerModal.commandPlaceholder`),fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-args`,children:i(`mcpAddServerModal.argsLabel`)}),(0,$.jsx)(V,{id:`mcp-args`,type:`text`,value:g,onChange:e=>_(e.target.value),placeholder:i(`mcpAddServerModal.argsPlaceholder`),fullWidth:!0})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-url`,children:i(`mcpAddServerModal.serverUrlLabel`)}),(0,$.jsx)(V,{id:`mcp-url`,type:`url`,value:f,onChange:e=>p(e.target.value),placeholder:i(`mcpAddServerModal.urlPlaceholder`),fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-auth`,children:i(`mcpAddServerModal.authenticationLabel`)}),(0,$.jsx)(`select`,{id:`mcp-auth`,value:v,onChange:e=>y(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:o.map(e=>(0,$.jsx)(`option`,{value:e.value,children:e.label},e.value))})]}),v===`oauth`?(0,$.jsx)(`p`,{className:`rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2 text-body-small-lighter text-[var(--content-tertiary)]`,children:i(`mcpAddServerModal.oauthHint`)}):null,v===`bearer`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-bearer`,children:i(`mcpAddServerModal.bearerTokenLabel`)}),(0,$.jsx)(V,{id:`mcp-bearer`,type:`password`,value:b,onChange:e=>x(e.target.value),placeholder:i(`mcpAddServerModal.bearerPlaceholder`),fullWidth:!0})]}):null,v===`api-key`?(0,$.jsxs)(`div`,{className:`flex gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-header`,children:i(`mcpAddServerModal.headerNameLabel`)}),(0,$.jsx)(V,{id:`mcp-apikey-header`,type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:i(`mcpAddServerModal.apiKeyHeaderPlaceholder`),fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-apikey-value`,children:i(`mcpAddServerModal.apiKeyLabel`)}),(0,$.jsx)(V,{id:`mcp-apikey-value`,type:`password`,value:w,onChange:e=>T(e.target.value),placeholder:i(`mcpAddServerModal.apiKeyPlaceholder`),fullWidth:!0})]})]}):null]})]})}),(0,$.jsxs)(M.Footer,{children:[(0,$.jsx)(Y,{variant:`ghost`,onClick:D,disabled:r,children:i(`mcpAddServerModal.cancel`)}),(0,$.jsx)(Y,{variant:`primary`,onClick:O,disabled:!A||r,children:i(r?`mcpAddServerModal.adding`:`mcpAddServerModal.addServer`)})]})]})})}async function Ge(e){let{data:t,response:n}=await F.get({url:`/v1/assistants/{assistant_id}/internal/mcp/list`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP servers: ${n?.status}`);return t}async function Ke(e){let{data:t,response:n}=await F.get({url:`/v1/assistants/{assistant_id}/internal/mcp/tools-summary`,path:{assistant_id:e}});if(!n?.ok)throw Error(`Failed to fetch MCP tools summary: ${n?.status}`);return t}async function qe(e,t){let{response:n}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/update`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to update MCP server: ${n?.status}`)}async function Je(e,t){let{response:n}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/add`,path:{assistant_id:e},body:t});if(!n?.ok)throw Error(`Failed to add MCP server: ${n?.status}`)}async function Ye(e,t){let{response:n}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/remove`,path:{assistant_id:e},body:{name:t}});if(!n?.ok)throw Error(`Failed to remove MCP server: ${n?.status}`)}async function Xe(e,t){let{data:n,response:r}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/start`,path:{assistant_id:e},body:{serverId:t}});if(!r?.ok)throw Error(`Failed to start MCP auth: ${r?.status}`);return n}async function Ze(e,t){let{data:n,response:r}=await F.get({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/status/${encodeURIComponent(t)}`,path:{assistant_id:e}});if(!r?.ok)throw Error(`Failed to poll MCP auth status: ${r?.status}`);return n}async function Qe(e,t){let{response:n}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/auth/revoke`,path:{assistant_id:e},body:{serverId:t}});if(!n?.ok)throw Error(`Failed to revoke OAuth for ${t}: ${n?.status}`)}async function $e(e){let{response:t}=await F.post({url:`/v1/assistants/{assistant_id}/internal/mcp/reload`,path:{assistant_id:e},body:{}});if(!t?.ok)throw Error(`Failed to reload MCP servers: ${t?.status}`)}function et({variant:e,icon:t,label:n,onClick:r,disabled:i}){return L()?(0,$.jsx)(Y,{variant:e,iconOnly:t,onClick:r,disabled:i,tooltip:n,"aria-label":n}):(0,$.jsx)(Y,{variant:e,leftIcon:t,onClick:r,disabled:i,children:n})}var tt={connected:`positive`,"needs-auth":`negative`},nt=`negative`;function rt(e,t){switch(e){case`connected`:return t(`mcpServerCard.statusConnected`);case`needs-auth`:return t(`mcpServerCard.statusNeedsAuth`);default:return t(`mcpServerCard.statusError`)}}function it({server:e,toolsSummary:t,onRemove:n,onConfigure:r,onAuthenticate:i,onRevokeOAuth:o,isAuthenticating:s,isRevoking:c}){let{t:l}=a(`settings`),[d,f]=(0,Q.useState)(!1),p=tt[e.status]??nt,m=e.hasOAuth,g=m&&e.status!==`needs-auth`,_=e.status===`needs-auth`&&e.transport.type!==`stdio`,y=(0,Q.useCallback)(()=>n(e.id),[n,e.id]),b=(0,Q.useCallback)(()=>r(e.id),[r,e.id]),C=(0,Q.useCallback)(()=>i(e.id),[i,e.id]),T=(0,Q.useCallback)(()=>o(e.id),[o,e.id]),E=(0,Q.useCallback)(()=>f(e=>!e),[]);return(0,$.jsx)(X.Root,{children:(0,$.jsxs)(X.Body,{children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,$.jsx)(`span`,{className:`truncate text-body-large-default text-[var(--content-default)]`,children:e.id}),(0,$.jsx)(fe,{tone:p,children:rt(e.status,l)}),g?(0,$.jsx)(fe,{tone:`positive`,children:l(`mcpServerCard.authenticatedBadge`)}):null]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(`span`,{children:e.transport.type}),t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)(`span`,{children:l(`mcpServerCard.toolCount`,{count:t.toolCount})}),(0,$.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,$.jsx)(`span`,{children:l(`mcpServerCard.estimatedTokens`,{count:t.estimatedTokens.toLocaleString()})})]}):null]})]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[_?(0,$.jsx)(et,{variant:`primary`,icon:s?(0,$.jsx)(S,{className:`animate-spin`}):(0,$.jsx)(w,{}),label:l(s?`mcpServerCard.authenticating`:m?`mcpServerCard.reAuth`:`mcpServerCard.authenticate`),onClick:C,disabled:s}):null,m?(0,$.jsx)(Y,{variant:`dangerOutline`,iconOnly:c?(0,$.jsx)(S,{className:`animate-spin`}):(0,$.jsx)(u,{}),onClick:T,disabled:c,tooltip:l(`mcpServerCard.revokeOAuthTooltip`),"aria-label":l(`mcpServerCard.revoke`)}):null,(0,$.jsxs)(A.Root,{children:[(0,$.jsx)(A.Trigger,{asChild:!0,children:(0,$.jsx)(Y,{variant:`outlined`,iconOnly:(0,$.jsx)(v,{}),"aria-label":l(`mcpServerCard.moreActions`,{serverId:e.id})})}),(0,$.jsxs)(A.Content,{title:l(`mcpServerCard.moreActions`,{serverId:e.id}),showTitle:!0,closeLabel:l(`mcpServerCard.actionsSheetClose`),align:`end`,children:[(0,$.jsx)(A.Item,{icon:x,label:l(`mcpServerCard.configure`),onSelect:b}),(0,$.jsx)(A.Item,{icon:D,label:l(`mcpServerCard.removeServer`),tone:`destructive`,onSelect:y})]})]})]})]}),t&&t.tools.length>0?(0,$.jsxs)(`div`,{className:`mt-3 border-t border-[var(--border-base)] pt-2`,children:[(0,$.jsxs)(`button`,{type:`button`,onClick:E,className:`flex w-full cursor-pointer items-center gap-1 text-body-small-default text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:[d?(0,$.jsx)(h,{className:`h-3.5 w-3.5`}):(0,$.jsx)(O,{className:`h-3.5 w-3.5`}),l(`mcpServerCard.registeredTools`,{count:t.toolCount})]}),d?(0,$.jsx)(`div`,{className:`mt-2 max-h-60 overflow-y-auto`,children:t.tools.map(e=>(0,$.jsx)(pe,{title:e.name,subtitle:e.description||void 0,trailing:(0,$.jsx)(`span`,{className:`whitespace-nowrap text-body-small-default text-[var(--content-secondary)]`,children:l(`mcpServerCard.toolTokensAbbrev`,{count:e.estimatedTokens.toLocaleString()})})},e.name))}):null]}):null]})})}var at=[`none`,`bearer`,`api-key`];function ot(e,t){switch(e){case`none`:return t(`mcpServerDetailModal.authNone`);case`bearer`:return t(`mcpServerDetailModal.authBearerToken`);case`api-key`:return t(`mcpServerDetailModal.authApiKey`)}}function st({server:e,toolsSummary:t,onClose:n,onSave:r,isPending:i}){let{t:o}=a(`settings`),[s,c]=(0,Q.useState)(`none`),[l,u]=(0,Q.useState)(``),[d,f]=(0,Q.useState)(`X-API-Key`),[p,m]=(0,Q.useState)(``);(0,Q.useEffect)(()=>{e&&(c(e.authType),u(``),f(e.authHeaderName??`X-API-Key`),m(``))},[e]);let h=(0,Q.useCallback)(()=>{if(!e)return;let t=s!==e.authType,n=s===`bearer`&&l.trim()!==``,i=s===`api-key`&&d.trim()!==``&&p.trim()!==``,a=t||n||i,o;o=a?s===`none`?null:s===`bearer`&&l.trim()?{Authorization:`Bearer ${l.trim()}`}:s===`api-key`&&d.trim()&&p.trim()?{[d.trim()]:p.trim()}:void 0:void 0,r(e.id,{name:e.id,...o===void 0?{}:{headers:o}})},[e,s,l,d,p,r]),g=(0,Q.useCallback)(()=>{i||n()},[i,n]);return e?(0,$.jsx)(M.Root,{open:!!e,onOpenChange:e=>{e||g()},children:(0,$.jsxs)(M.Content,{size:`lg`,children:[(0,$.jsxs)(M.Header,{icon:De,children:[(0,$.jsx)(M.Title,{children:e.id}),(0,$.jsx)(M.Description,{children:o(`mcpServerDetailModal.description`,{transport:e.transport.type,status:e.status})})]}),(0,$.jsx)(M.Body,{children:(0,$.jsxs)(`div`,{className:`space-y-5`,children:[e.transport.type===`stdio`?null:(0,$.jsxs)($.Fragment,{children:[e.hasOAuth?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-[var(--border-element)] bg-[var(--surface-base)] px-3 py-2`,children:[(0,$.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:o(`mcpServerDetailModal.authentication`)}),(0,$.jsx)(`span`,{className:`rounded-full bg-[var(--surface-lift)] px-2 py-0.5 text-label-small-default text-[var(--content-default)]`,children:o(`mcpServerDetailModal.oauthBadge`)}),(0,$.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:o(`mcpServerDetailModal.oauthManagedHint`)})]}):null,e.hasOAuth?null:(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-auth`,children:o(`mcpServerDetailModal.authentication`)}),(0,$.jsx)(`select`,{id:`mcp-detail-auth`,value:s,onChange:e=>c(e.target.value),className:`w-full rounded-md border border-[var(--border-element)] bg-[var(--surface-lift)] px-3 py-1.5 text-body-medium-default text-[var(--content-default)] outline-none focus:ring-2 focus:ring-[var(--ring)]`,children:at.map(e=>(0,$.jsx)(`option`,{value:e,children:ot(e,o)},e))})]}),s===`bearer`&&!e.hasOAuth?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-bearer`,children:o(`mcpServerDetailModal.bearerToken`)}),(0,$.jsx)(V,{id:`mcp-detail-bearer`,type:`password`,value:l,onChange:e=>u(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`bearer`?o(`mcpServerDetailModal.bearerTokenPlaceholderKeep`):o(`mcpServerDetailModal.bearerTokenPlaceholder`),fullWidth:!0})]}):null,s===`api-key`&&!e.hasOAuth?(0,$.jsxs)(`div`,{className:`flex gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-header`,children:o(`mcpServerDetailModal.headerName`)}),(0,$.jsx)(V,{id:`mcp-detail-apikey-header`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:o(`mcpServerDetailModal.headerNamePlaceholder`),fullWidth:!0})]}),(0,$.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,$.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`mcp-detail-apikey-value`,children:o(`mcpServerDetailModal.apiKey`)}),(0,$.jsx)(V,{id:`mcp-detail-apikey-value`,type:`password`,value:p,onChange:e=>m(e.target.value),placeholder:e.hasStaticAuth&&e.authType===`api-key`?o(`mcpServerDetailModal.apiKeyPlaceholderKeep`):o(`mcpServerDetailModal.apiKeyPlaceholder`),fullWidth:!0})]})]}):null]}),t&&t.tools.length>0?(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-default)]`,children:o(`mcpServerDetailModal.registeredToolsHeading`,{count:t.toolCount})}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:o(`mcpServerDetailModal.tokenOverhead`,{count:t.estimatedTokens.toLocaleString()})}),(0,$.jsx)(`div`,{className:`max-h-64 overflow-y-auto rounded-lg border border-[var(--border-base)]`,children:(0,$.jsxs)(`table`,{className:`w-full text-body-small-default`,children:[(0,$.jsx)(`thead`,{children:(0,$.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] bg-[var(--surface-base)]`,children:[(0,$.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:o(`mcpServerDetailModal.tableTool`)}),(0,$.jsx)(`th`,{className:`px-3 py-2 text-left font-medium text-[var(--content-secondary)]`,children:o(`mcpServerDetailModal.tableDescription`)}),(0,$.jsx)(`th`,{className:`px-3 py-2 text-right font-medium text-[var(--content-secondary)]`,children:o(`mcpServerDetailModal.tableTokens`)})]})}),(0,$.jsx)(`tbody`,{children:t.tools.map(e=>(0,$.jsxs)(`tr`,{className:`border-b border-[var(--border-base)] last:border-b-0`,children:[(0,$.jsx)(`td`,{className:`px-3 py-2 font-medium text-[var(--content-default)]`,children:e.name}),(0,$.jsx)(`td`,{className:`max-w-xs truncate px-3 py-2 text-[var(--content-tertiary)]`,children:e.description||o(`mcpServerDetailModal.emptyDescription`)}),(0,$.jsx)(`td`,{className:`px-3 py-2 text-right text-[var(--content-tertiary)]`,children:o(`mcpServerDetailModal.toolEstimatedTokens`,{count:e.estimatedTokens.toLocaleString()})})]},e.name))})]})})]}):null]})}),(0,$.jsxs)(M.Footer,{children:[(0,$.jsx)(Y,{variant:`ghost`,onClick:g,disabled:i,children:o(`mcpServerDetailModal.cancel`)}),(0,$.jsx)(Y,{variant:`primary`,onClick:h,disabled:i,children:o(i?`mcpServerDetailModal.saving`:`mcpServerDetailModal.save`)})]})]})}):null}var ct=`mcp-servers`,lt=`mcp-tools-summary`;function ut(){let{t:e}=a(`settings`),t=te(),n=i(),o=s(),c=B.use.mcpAddServer(),l=B.use.hasHydrated(),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(!1),[v,b]=(0,Q.useState)(!1),[x,C]=(0,Q.useState)(!1),[w,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(null),{data:j,isLoading:M,isError:N}=r({queryKey:[ct,t],queryFn:()=>Ge(t)}),{data:P}=r({queryKey:[lt,t],queryFn:()=>Ke(t)}),F=(0,Q.useCallback)(()=>{n.invalidateQueries({queryKey:[ct,t]}),n.invalidateQueries({queryKey:[lt,t]})},[n,t]),I=(0,Q.useMemo)(()=>{let e=new Map;if(P)for(let t of P.servers)e.set(t.serverId,t);return e},[P]),L=(0,Q.useMemo)(()=>!f||!j?null:j.servers.find(e=>e.id===f)??null,[f,j]),R=(0,Q.useCallback)(async()=>{if(m){b(!0);try{await Ye(t,m),F(),q.success(e(`mcpPage.toastRemoved`,{serverId:m})),h(null)}catch{q.error(e(`mcpPage.toastRemoveFailed`,{serverId:m}))}finally{b(!1)}}},[m,t,F,e]),z=(0,Q.useCallback)(async n=>{O(n);let r;try{r=await Xe(t,n)}catch{q.error(e(`mcpPage.toastAuthStartFailed`,{serverId:n})),O(null);return}try{if(r.already_authenticated){q.success(e(`mcpPage.toastAlreadyAuthenticated`,{serverId:n})),F();return}window.open(r.auth_url,`_blank`,`noopener,noreferrer`);for(let r=0;r<60;r++){await new Promise(e=>setTimeout(e,3e3));let r=await Ze(t,n);if(r.status===`complete`){q.success(e(`mcpPage.toastAuthenticatedSuccess`,{serverId:n})),F();return}if(r.status===`error`){q.error(r.error??e(`mcpPage.toastAuthFailed`,{serverId:n}));return}}q.error(e(`mcpPage.toastAuthTimedOut`,{serverId:n}))}catch{q.error(e(`mcpPage.toastAuthPollingFailed`,{serverId:n}))}finally{O(null),F()}},[t,F,e]),V=(0,Q.useCallback)(async n=>{A(n);try{await Qe(t,n),F(),q.success(e(`mcpPage.toastOAuthRevoked`,{serverId:n}))}catch{q.error(e(`mcpPage.toastOAuthRevokeFailed`,{serverId:n}))}finally{A(null)}},[t,F,e]),U=(0,Q.useCallback)(async n=>{let r=n.autoAuth?window.open(`about:blank`,`_blank`,`noopener`):null;_(!0);try{await Je(t,n),F(),q.success(e(`mcpPage.toastAdded`,{name:n.name})),d(!1)}catch{q.error(e(`mcpPage.toastAddFailed`,{name:n.name})),r?.close(),_(!1);return}if(_(!1),n.autoAuth){O(n.name);try{let i=await Xe(t,n.name);if(i.already_authenticated){r?.close(),q.success(e(`mcpPage.toastAlreadyAuthenticated`,{serverId:n.name})),F();return}r?r.location.href=i.auth_url:window.open(i.auth_url,`_blank`,`noopener,noreferrer`);for(let r=0;r<60;r++){await new Promise(e=>setTimeout(e,3e3));let r=await Ze(t,n.name);if(r.status===`complete`){q.success(e(`mcpPage.toastAuthenticatedSuccess`,{serverId:n.name})),F();return}if(r.status===`error`){q.error(r.error??e(`mcpPage.toastAuthFailed`,{serverId:n.name}));return}}q.error(e(`mcpPage.toastAuthTimedOut`,{serverId:n.name}))}catch{r?.close(),q.error(e(`mcpPage.toastAuthStartFailed`,{serverId:n.name}))}finally{O(null),F()}}},[t,F,e]),ee=(0,Q.useCallback)(async(n,r)=>{C(!0);try{await qe(t,r),F(),q.success(e(`mcpPage.toastUpdated`,{serverId:n})),p(null)}catch{q.error(e(`mcpPage.toastUpdateFailed`,{serverId:n}))}finally{C(!1)}},[t,F,e]),W=(0,Q.useCallback)(async()=>{E(!0);try{await $e(t),F(),q.success(e(`mcpPage.toastReloadSuccess`))}catch{q.error(e(`mcpPage.toastReloadFailed`))}finally{E(!1)}},[t,F,e]),G=(0,Q.useCallback)(()=>{c?d(!0):ae(o,{prompt:e(`mcpPage.setupPrompt`)})},[c,o,e]),K=j?.servers??[];return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flow-root`,children:[(0,$.jsxs)(`div`,{className:`float-right ml-4 flex shrink-0 items-center gap-2`,children:[(0,$.jsx)(et,{variant:`outlined`,icon:(0,$.jsx)(T,{className:w?`animate-spin`:``}),label:e(`mcpPage.reloadButton`),onClick:W,disabled:w}),c?(0,$.jsx)(Y,{variant:`primary`,leftIcon:(0,$.jsx)(y,{}),onClick:()=>d(!0),children:e(`mcpPage.addServerButton`)}):null]}),(0,$.jsx)(`h2`,{className:`text-title-small text-[var(--content-default)]`,children:e(`mcpPage.title`)}),(0,$.jsx)(`p`,{className:`mt-0.5 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`mcpPage.subtitle`)})]}),P?(0,$.jsxs)(`div`,{className:`flex gap-4 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,$.jsx)(`span`,{children:e(`mcpPage.totalTools`,{count:P.totalToolCount})}),(0,$.jsx)(`span`,{children:e(`mcpPage.totalTokens`,{count:P.totalEstimatedTokens.toLocaleString()})})]}):null,M?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,$.jsx)(S,{className:`h-4 w-4 animate-spin`}),(0,$.jsx)(`span`,{children:e(`mcpPage.loading`)})]}):N?(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`mcpPage.loadError`)}):K.length===0?(0,$.jsxs)(`button`,{type:`button`,onClick:G,disabled:!l,className:`flex w-full flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center transition-colors hover:border-[var(--border-active)] hover:bg-[var(--surface-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:pointer-events-none`,children:[(0,$.jsx)(De,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`mcpPage.emptyTitle`)}),(0,$.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(c?`mcpPage.emptyAddSubtitle`:`mcpPage.emptyChatSubtitle`)})]}):(0,$.jsx)(`div`,{className:`space-y-2`,children:K.map(e=>(0,$.jsx)(it,{server:e,toolsSummary:I.get(e.id),onRemove:h,onConfigure:p,onAuthenticate:z,onRevokeOAuth:V,isAuthenticating:D===e.id,isRevoking:k===e.id},e.id))}),c?(0,$.jsx)(We,{open:u,onClose:()=>d(!1),onAdd:U,isPending:g}):null,(0,$.jsx)(st,{server:L,toolsSummary:f?I.get(f):void 0,onClose:()=>p(null),onSave:ee,isPending:x}),(0,$.jsx)(H,{open:!!m,title:e(`mcpPage.removeDialogTitle`),message:m?e(`mcpPage.removeDialogMessage`,{serverId:m}):``,confirmLabel:e(`mcpPage.removeDialogConfirm`),destructive:!0,isPending:v,onConfirm:R,onCancel:()=>h(null)})]})}function dt(){return(0,$.jsx)(ut,{})}var ft=`vellum:integrations:bannerDismissed`;function pt(e,t){return{denied:e(`integrationsPage.oauthErrorDenied`),state_invalid:e(`integrationsPage.oauthErrorStateInvalid`),state_expired:e(`integrationsPage.oauthErrorStateExpired`),exchange_failed:e(`integrationsPage.oauthErrorExchangeFailed`),identity_failed:e(`integrationsPage.oauthErrorIdentityFailed`)}[t]}function mt(e,t,n){if(t.trim())return e(`integrationsPage.emptySearchTitle`);switch(n){case`enabled`:return e(`integrationsPage.emptyEnabledTitle`);case`not-enabled`:return e(`integrationsPage.emptyAllEnabledTitle`);default:return e(`integrationsPage.emptyDefaultTitle`)}}function ht(e,t,n){if(t.trim())return e(`integrationsPage.emptySearchSubtitle`,{query:t.trim()});switch(n){case`enabled`:return e(`integrationsPage.emptyEnabledSubtitle`);case`not-enabled`:return e(`integrationsPage.emptyNotEnabledSubtitle`);default:return e(`integrationsPage.emptyDefaultSubtitle`)}}var gt=[{value:`all`,labelKey:`integrationsPage.filterAll`},{value:`enabled`,labelKey:`integrationsPage.filterEnabled`},{value:`not-enabled`,labelKey:`integrationsPage.filterNotEnabled`}];function _t(e,t){return e?.find(e=>e.provider===t)??null}function vt(e){return e===`mcp`?`mcp`:`oauth`}function yt(){let{t:e}=a(`settings`),[n]=c(),i=s(),o=K(),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(!0),[m,h]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(`all`),[y,b]=(0,Q.useState)(!0),[x,C]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{b(he(ft,`false`)===`true`)},[]);let w=()=>{b(!0),ge(ft,`true`)};(0,Q.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await W();e&&t.ok&&u(t.data)}catch(e){de(e,{context:`integrations.getAssistant`})}finally{e&&f(!1)}})(),()=>{e=!1}},[]);let{platformAssistantId:T,isLoading:E}=Ee(l?.id,o===`full`),{data:D,isLoading:O,isError:k}=r({...oe({path:{assistant_id:l?.id??``}}),select:e=>e.providers,enabled:!!l}),{data:A,isLoading:j}=r({...re({path:{assistant_id:T??``}}),enabled:!!T&&o===`full`});(0,Q.useEffect)(()=>{let t=n.get(`oauth_status`);if(!t)return;let r=n.get(`oauth_provider`),a=r?r.charAt(0).toUpperCase()+r.slice(1):null;if(t===`connected`)q.success(a?e(`integrationsPage.accountConnectedToast`,{providerLabel:a}):e(`integrationsPage.accountConnectedToastGeneric`));else if(t===`error`){let t=n.get(`oauth_code`)??`unknown`;q.error(pt(e,t)??(a?e(`integrationsPage.connectFailedToast`,{providerLabel:a}):e(`integrationsPage.connectFailedToastGeneric`)))}i(ce.settings.integrations,{replace:!0})},[n,i,e]);let M=(0,Q.useMemo)(()=>D?.filter(e=>e.supports_managed_mode)??[],[D]),N=(0,Q.useMemo)(()=>{let e=m.trim().toLowerCase(),t=e=>!!_t(A,e)?.connected,n=M.filter(n=>{if(Ae(n.provider_key))return t(n.provider_key);if(!e)return!0;let r=(n.display_name??n.provider_key).toLowerCase(),i=(n.description??``).toLowerCase();return r.includes(e)||i.includes(e)});return _!==`all`&&(n=n.filter(e=>{let n=t(e.provider_key);return _===`enabled`?n:!n})),[...n].sort((e,n)=>{let r=t(e.provider_key);if(r!==t(n.provider_key))return r?-1:1;let i=(e.display_name??e.provider_key).toLowerCase(),a=(n.display_name??n.provider_key).toLowerCase();return i.localeCompare(a)})},[M,A,m,_]),P=d||O||j||E,F=mt(e,m,_),I=ht(e,m,_),L=(0,Q.useMemo)(()=>x?M.find(e=>e.provider_key===x)??null:null,[M,x]),R=gt.map(({value:t,labelKey:n})=>({value:t,label:e(n)}));return(0,$.jsxs)(`div`,{className:`space-y-4`,children:[!y&&(0,$.jsx)(Ce,{tone:`info`,icon:(0,$.jsx)(p,{className:`h-3.5 w-3.5`}),onDismiss:w,children:(0,$.jsx)(t,{ns:`settings`,i18nKey:`integrationsPage.tipBanner`,components:{tip:(0,$.jsx)(`span`,{className:`text-body-medium-default`})}})}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(V,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:e(`integrationsPage.searchPlaceholder`),"aria-label":e(`integrationsPage.searchAriaLabel`),leftIcon:(0,$.jsx)(g,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),fullWidth:!0,wrapperClassName:`flex-1`}),(0,$.jsx)(G,{options:R,value:_,onChange:v,"aria-label":e(`integrationsPage.filterAriaLabel`),menuAlign:`end`,className:`w-36 shrink-0`})]}),(0,$.jsx)(`div`,{children:P?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,$.jsx)(S,{className:`h-4 w-4 animate-spin`}),(0,$.jsx)(`span`,{children:e(`integrationsPage.loading`)})]}):k?(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`integrationsPage.loadFailed`)}):l?N.length===0?(0,$.jsxs)(`div`,{className:`flex flex-col items-center gap-2 rounded-lg border border-dashed border-[var(--border-element)] px-4 py-12 text-center`,children:[(0,$.jsx)(g,{className:`h-6 w-6 text-[var(--content-disabled)]`}),(0,$.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:F}),(0,$.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:I})]}):(0,$.jsx)(`div`,{className:`space-y-2`,children:N.map(e=>(0,$.jsx)(Re,{platformAssistantId:T??l.id,providerKey:e.provider_key,displayName:e.display_name??e.provider_key,description:e.description,logoUrl:e.logo_url,connection:_t(A,e.provider_key),platformGate:o,onConfigure:()=>C(e.provider_key)},e.provider_key))}):(0,$.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`integrationsPage.noAssistant`)})}),L&&l&&(0,$.jsx)(Le,{assistantId:l.id,platformAssistantId:T??l.id,providerKey:L.provider_key,displayName:L.display_name??L.provider_key,description:L.description,logoUrl:L.logo_url,platformGate:o,onClose:()=>C(null)})]})}function bt(){let{t:e}=a(`settings`),[t,n]=c(),r=vt(t.get(`tab`));return(0,$.jsx)(`div`,{className:`space-y-6`,children:(0,$.jsxs)(J.Root,{value:r,onValueChange:e=>{let r=vt(e),i=new URLSearchParams(t);r===`mcp`?i.set(`tab`,`mcp`):i.delete(`tab`),n(i,{replace:!0})},children:[(0,$.jsxs)(J.List,{children:[(0,$.jsx)(J.Trigger,{value:`oauth`,children:e(`integrationsPage.tabOAuth`)}),(0,$.jsx)(J.Trigger,{value:`mcp`,children:e(`integrationsPage.tabMcp`)})]}),(0,$.jsx)(J.Panel,{value:`oauth`,className:`pt-4`,children:(0,$.jsx)(Q.Suspense,{children:(0,$.jsx)(yt,{})})}),(0,$.jsx)(J.Panel,{value:`mcp`,className:`pt-4`,children:(0,$.jsx)(dt,{})})]})})}export{bt as IntegrationsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,d as r,i,n as a,t as o}from"./react-DPM_L_aA.js";import{Br as s}from"./icons-J6Mg9wGk.js";import{Es as c,Ev as l,Rv as u,Vv as d,Zi as f,rb as p}from"./index-8UA9Y4Ao.js";import{t as m}from"./page-shell-Bla97arW.js";var h=e(n(),1),g=o(),_={schedules:`sections.schedules`,superpowers:`sections.superpowers`,plugins:`sections.superpowers`,skills:`sections.superpowers`,memory:`sections.memory`,library:`sections.library`,workspace:`sections.workspace`,contacts:`sections.contacts`,channels:`sections.channels`};function v(){let{t:e}=t(`intelligence`),n=l.use.name(),{pathname:o}=r(),v=c(),y=f.use.setTopBarCenter(),b=u(o),x=b?e(_[b.key]):null;return(0,h.useEffect)(()=>(y(v&&x?(0,g.jsx)(p,{variant:`body-medium-default`,className:`truncate text-[var(--content-secondary)]`,children:x}):null),()=>{y(null)}),[v,x,y]),b?(0,g.jsxs)(m,{children:[(0,g.jsxs)(`div`,{className:`mb-4 flex shrink-0 items-center gap-1.5`,children:[(0,g.jsx)(a,{to:d.identity,className:`-ml-2 flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors outline-none hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)] focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,"aria-label":e(`intelligenceLayout.backToAriaLabel`,{name:n||e(`identityOverview.defaultAssistantName`)}),title:e(`intelligenceLayout.backToTitle`,{name:n||e(`identityOverview.defaultAssistantName`)}),children:(0,g.jsx)(s,{className:`h-5 w-5`,"aria-hidden":!0})}),(0,g.jsx)(`h1`,{className:`text-title-large text-[var(--content-default)] max-md:hidden`,children:x})]}),(0,g.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,g.jsx)(i,{})})]}):(0,g.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,g.jsx)(i,{})})}export{v as IntelligenceLayout};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{b as t,f as n}from"./react-DPM_L_aA.js";import{Vv as r}from"./index-8UA9Y4Ao.js";var i=e(t(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(r.settings.keyboardShortcuts,{replace:!0})},[e]),null}export{a as KeyboardShortcutsRedirectPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,d as r,f as i,m as a,t as o}from"./react-DPM_L_aA.js";import{rn as s}from"./icons-J6Mg9wGk.js";import{$n as c,Es as l,Q as u,Rs as d,Ts as f,Vv as p,u as m,vh as h,vr as g,yr as _}from"./index-8UA9Y4Ao.js";import{t as v}from"./deploy-dialogs-BPTgsXOx.js";import{t as y}from"./use-edge-swipe-back-CC5KICyO.js";import{t as b}from"./app-types-R2BjVd4u.js";var x=e(n(),1),S=o();function C({enabled:e}){return e?(0,S.jsx)(`div`,{"aria-hidden":!0,className:`absolute inset-y-0 left-0 z-10`,style:{width:20}}):null}function w(){let{t:e}=t(`library`),{appId:n}=a(),o=u(),w=i(),{pathname:T}=r(),E=l(),D=g.use.isDeploying(),O=(0,x.useRef)(null),[k,A]=(0,x.useState)(null),[j,M]=(0,x.useState)(null),[N,P]=(0,x.useState)(!1),F=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(n)return F.current=n,A(null),M(null),h({path:{assistant_id:o,id:n},throwOnError:!0}).then(({data:e})=>{F.current===n&&(d(o,e.appId,e.html),A({appId:e.appId,dirName:e.dirName,name:e.name,html:e.html,origin:e.origin}))}).catch(e=>{F.current===n&&M(e instanceof Error?e.message:`Failed to open app`)}),()=>{F.current=null}},[o,n]);let I=(0,x.useCallback)(()=>{w(p.library.root)},[w]);y({containerRef:O,onBack:I,enabled:E,navKey:T,prefetchHref:p.library.root});let L=m(),R=(0,x.useCallback)(()=>{k&&L(k)},[k,L]),z=(0,x.useCallback)(async()=>{if(!(!k||N)){P(!0);try{await _(o,{id:k.appId,name:k.name},{exported:e(`libraryAppCard.exported`),failed:e(`libraryAppCard.shareFailed`)})}finally{P(!1)}}},[o,k,N,e]),B=(0,x.useCallback)(()=>{k&&g.getState().deployApp(o,k.appId,k.name,k.html)},[o,k]),V=(0,x.useCallback)(e=>{f(w,{prompt:e})},[w]);return n?j?(0,S.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4`,children:[(0,S.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:j}),(0,S.jsx)(`button`,{type:`button`,onClick:I,className:`text-body-medium-default text-[var(--primary-base)] underline`,children:e(`libraryDetailPage.backToLibrary`)})]}):k?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{ref:O,className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,S.jsx)(C,{enabled:E}),(0,S.jsx)(c,{appId:k.appId,appName:k.name,html:k.html,assistantId:o,onClose:I,...b(k.origin)?{}:{onEdit:R,onShare:z,isSharing:N,onDeploy:B,isDeploying:D},enableFullscreen:!0})]}),(0,S.jsx)(v,{assistantId:o,onStartConversation:V})]}):(0,S.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,S.jsx)(s,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`})}):null}export{w as LibraryDetailPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CV8wawxx.js";import{b as i,f as a,t as o}from"./react-DPM_L_aA.js";import{$n as s,Rn as c,Tn as l,Y as u,Zn as d,cn as f,dt as p,fi as m,ft as h,tt as g,un as _,x as v}from"./icons-J6Mg9wGk.js";import{Ay as y,Jr as b,Jy as x,Ls as S,Q as C,Ry as w,Ts as T,Vv as E,Xu as D,Zu as O,_a as k,er as A,i as j,ib as M,ii as N,la as P,qt as F,tr as I,vd as L,vr as R,yh as z}from"./index-8UA9Y4Ao.js";import{t as B}from"./deploy-dialogs-BPTgsXOx.js";import{n as V,r as H,t as U}from"./use-app-delete-Blc_lK4-.js";import{t as W}from"./app-types-R2BjVd4u.js";var G=e(i(),1),K=o();function q(e){return e===1?`1 word`:`${e} words`}function J({document:e,onOpen:t}){return(0,K.jsxs)(`div`,{className:`group relative flex flex-col gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:P(`relative flex w-full cursor-pointer flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)]`,`aspect-[16/10]`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:[(0,K.jsx)(c,{size:34,className:`text-[var(--content-tertiary)]`}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:q(e.wordCount)})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t(e.surfaceId),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.title}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:j(new Date(e.updatedAt))})]})]})}function Y({onNewConversation:e}){let{t}=r(`library`);return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4 py-24`,children:[(0,K.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,K.jsx)(_,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:t(`libraryEmptyState.heading`)}),(0,K.jsx)(`p`,{className:`max-w-md text-center text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:t(`libraryEmptyState.body`)}),e?(0,K.jsx)(M,{variant:`primary`,size:`regular`,onClick:e,children:t(`libraryEmptyState.newConversation`)}):null]})}function X({app:e,assistantId:t,isPinned:n,onOpen:i,onPin:a,onDelete:o,onDeploy:s,justImported:c,onAnimationEnd:l}){let{t:u}=r(`library`),d=W(e.origin),f=d?void 0:o,m=d?void 0:s,g=(0,G.useCallback)(()=>S(t,e.id),[t,e.id]),_=V(t,e,{exported:u(`libraryAppCard.exported`),failed:u(`libraryAppCard.shareFailed`)}),[y,b]=(0,G.useState)(!1),[x,C]=(0,G.useState)(!1),w=(0,G.useCallback)(()=>C(!0),[]),{deployedUrl:T}=I(t,e.id,{enabled:x&&m!=null}),E=(0,G.useCallback)(()=>{T!=null&&A(T)},[T]);return(0,K.jsx)(N,{trailingActions:[{id:`pin`,label:u(n?`libraryAppCard.unpin`:`libraryAppCard.pin`),icon:n?h:p,onSelect:()=>a(e)},...f?[{id:`delete`,label:u(`libraryAppCard.delete`),icon:v,variant:`destructive`,onSelect:()=>f(e)}]:[]],className:`rounded-xl`,children:(0,K.jsxs)(`div`,{"data-reveal-row":``,className:P(`relative flex flex-col gap-2`,c&&`animate-[card-entrance_400ms_ease-out]`),onAnimationEnd:c?l:void 0,onPointerEnter:w,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>i(e.id),className:P(`relative w-full cursor-pointer overflow-hidden rounded-xl`,`outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`),children:(0,K.jsx)(F,{name:e.name,icon:e.icon,loadHtml:g})}),(0,K.jsx)(`div`,{"data-reveal":``,className:`absolute right-2 top-2 z-20`,children:(0,K.jsx)(Z,{appName:e.name,isPinned:n,open:y,onOpenChange:e=>{e&&w(),b(e)},onPin:()=>a(e),onDelete:f?()=>f(e):void 0,onShare:d?void 0:_,onDeploy:m,deployedUrl:T,onCopyDeployedLink:E})}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:`flex cursor-pointer flex-col gap-0.5 px-0.5 text-left outline-none`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-large-default text-[color:var(--content-emphasised)]`,children:e.name}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:j(new Date(e.createdAt))})]})]})})}function Z({appName:e,isPinned:t,open:n,onOpenChange:i,onPin:a,onDelete:o,onShare:s,onDeploy:c,deployedUrl:u,onCopyDeployedLink:_}){let{t:b}=r(`library`),x=u!=null&&u!==``&&_!=null,S=b(`libraryAppCard.actionsTitle`,{appName:e});return(0,K.jsxs)(y.Root,{open:n,onOpenChange:i,children:[(0,K.jsx)(y.Trigger,{asChild:!0,children:(0,K.jsx)(M,{variant:`primary`,size:`compact`,iconOnly:(0,K.jsx)(d,{}),"aria-label":S,onClick:e=>e.stopPropagation()})}),(0,K.jsxs)(y.Content,{title:S,children:[(0,K.jsx)(y.Item,{icon:t?h:p,label:b(t?`libraryAppCard.unpin`:`libraryAppCard.pin`),onSelect:a}),s?(0,K.jsx)(y.Item,{icon:m,label:b(`libraryAppCard.share`),description:b(`libraryAppCard.shareSub`),onSelect:s}):null,c&&x?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y.Item,{icon:f,label:b(`libraryAppCard.deployed`),description:(0,K.jsx)(`span`,{className:`break-all`,children:u}),trailing:b(`libraryAppCard.copyLink`),onSelect:()=>_?.()}),(0,K.jsx)(y.Item,{icon:g,label:b(`libraryAppCard.redeploy`),description:b(`libraryAppCard.redeploySub`),onSelect:c})]}):c?(0,K.jsx)(y.Item,{icon:l,label:b(`libraryAppCard.deploy`),description:b(`libraryAppCard.deploySub`),onSelect:c}):null,o?(0,K.jsx)(y.Item,{icon:v,label:b(`libraryAppCard.delete`),tone:`destructive`,onSelect:o}):null]})]})}function Q({title:e,apps:t,assistantId:n,pinnedAppIds:r,lastImportedAppId:i,onOpen:a,onPin:o,onDelete:s,onDeploy:c,onAnimationEnd:l}){return t.length===0?null:(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:e}),(0,K.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6 [--swipe-item-surface:var(--surface-base)]`,children:t.map(e=>(0,K.jsx)(X,{app:e,assistantId:n,isPinned:r.has(e.id),onOpen:a,onPin:o,onDelete:s,justImported:e.id===i,onAnimationEnd:l,onDeploy:c?()=>c(e.id):void 0},e.id))})]})}var $=(e,t)=>t.updatedAt-e.updatedAt||t.createdAt-e.createdAt;function ee(e){let{pinnedAppIds:n}=b(e),{data:r=[],isLoading:i,error:a}=t({...D({path:{assistant_id:e}}),select:e=>e.apps}),{data:o=[],isLoading:s,error:c}=t({...L({path:{assistant_id:e}}),select:e=>e.documents}),l=i||s,u=a&&c?a instanceof Error?a.message:`Failed to load library`:null,[d,f]=(0,G.useState)(``),p=(0,G.useMemo)(()=>{if(!d.trim())return r;let e=d.toLowerCase();return r.filter(t=>t.name.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e))},[r,d]);return{apps:r,documents:o,filteredApps:p,pinnedApps:(0,G.useMemo)(()=>p.filter(e=>n.has(e.id)).sort($),[p,n]),recentApps:(0,G.useMemo)(()=>p.filter(e=>!n.has(e.id)).sort($),[p,n]),filteredDocuments:(0,G.useMemo)(()=>{if(!d.trim())return o;let e=d.toLowerCase();return o.filter(t=>t.title.toLowerCase().includes(e))},[o,d]),searchText:d,setSearchText:f,loading:l,error:u}}async function te(e,t){let{data:n,error:r,response:i}=await z({path:{assistant_id:e},body:t,bodySerializer:e=>e,headers:{"Content-Type":`application/octet-stream`},throwOnError:!1});if(!i||!i.ok){let e=(r&&typeof r==`object`&&`message`in r?r.message:null)??`Failed to import app.`;throw Error(e)}return n}function ne({assistantId:e,assistantName:t,onNewConversation:i,onOpenDocument:a,onOpenApp:o}){let{t:c}=r(`library`),l=n(),{togglePin:d,pinnedAppIds:f}=b(e),p=R.use.isDeploying(),{apps:m,documents:h,filteredApps:g,pinnedApps:_,recentApps:v,filteredDocuments:y,searchText:C,setSearchText:T,loading:E,error:D}=ee(e),{pendingDelete:A,isDeleting:j,requestDelete:N,confirmDelete:P,cancelDelete:F}=U(e),[I]=(0,G.useState)(()=>k()?void 0:`.vellum`),L=(0,G.useRef)(null),[z,V]=(0,G.useState)(!1),W=(0,G.useCallback)(async t=>{let n=t.target.files?.[0];if(!(!n||z)){V(!0);try{let t=await te(e,n);await l.invalidateQueries({queryKey:O({path:{assistant_id:e}})}),w.success(c(`libraryView.imported`,{name:t.name})),o(t.appId)}catch(e){w.error(e instanceof Error?e.message:c(`libraryView.importFailed`))}finally{V(!1),L.current&&(L.current.value=``)}}},[e,z,l,o,c]),q=(0,G.useCallback)(async t=>{if(p)return;let n=m.find(e=>e.id===t)?.name??`this app`;try{let r=await S(e,t);R.getState().deployApp(e,t,n,r)}catch{R.getState().deployApp(e,t,n,``)}},[e,p,m]),X=(0,G.useCallback)(e=>d(e.id),[d]);if(E)return(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--primary-base)]`,role:`status`,"aria-label":c(`libraryView.loadingAria`)})});if(D)return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-4 px-4`,children:[(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:D}),(0,K.jsx)(`button`,{type:`button`,className:`rounded-lg bg-[var(--primary-base)] px-4 py-2 text-body-medium-default text-[var(--content-inset)] transition-colors hover:bg-[var(--primary-hover)]`,onClick:()=>window.location.reload(),children:c(`libraryView.retry`)})]});let Z=m.length===0&&h.length===0;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,K.jsx)(`div`,{className:`mb-4 flex shrink-0 items-center justify-end gap-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`input`,{ref:L,type:`file`,accept:I,className:`hidden`,onChange:W}),(0,K.jsxs)(M,{variant:`outlined`,size:`regular`,onClick:()=>L.current?.click(),disabled:z,children:[z?(0,K.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}):(0,K.jsx)(s,{size:14}),(0,K.jsx)(`span`,{className:`ml-1.5`,children:c(`libraryView.import`)})]})]})}),Z?(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(Y,{onNewConversation:i?()=>i():void 0})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`mb-6 shrink-0`,children:(0,K.jsx)(x,{fullWidth:!0,type:`text`,placeholder:c(`libraryView.searchPlaceholder`),value:C,onChange:e=>T(e.target.value),leftIcon:(0,K.jsx)(u,{size:16})})}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:g.length===0&&y.length===0?(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,K.jsx)(u,{size:32,className:`mb-4 text-[var(--content-tertiary)]`}),(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:c(`libraryView.noMatches`,{query:C})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,K.jsx)(Q,{title:c(`libraryView.pinned`),apps:_,assistantId:e,pinnedAppIds:f,onOpen:o,onPin:X,onDelete:N,onDeploy:q}),(0,K.jsx)(Q,{title:c(`libraryView.recents`),apps:v,assistantId:e,pinnedAppIds:f,onOpen:o,onPin:X,onDelete:N,onDeploy:q}),y.length>0?(0,K.jsxs)(`section`,{children:[(0,K.jsx)(`h2`,{className:`mb-4 text-body-small-emphasised text-[color:var(--content-secondary)]`,children:c(`libraryView.documents`)}),(0,K.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fill,minmax(max(220px,calc((100%-6rem)/5)),1fr))] gap-6`,children:y.map(e=>(0,K.jsx)(J,{document:e,onOpen:e=>{a&&a(e)}},e.surfaceId))})]}):null]})}),(0,K.jsx)(B,{assistantId:e,assistantName:t,onStartConversation:i}),(0,K.jsx)(H,{app:A,isDeleting:j,onConfirm:P,onCancel:F})]})]})}function re(){let e=C(),t=a();return(0,K.jsx)(ne,{assistantId:e,onNewConversation:(0,G.useCallback)(e=>{T(t,{prompt:e})},[t]),onOpenDocument:(0,G.useCallback)(e=>{t(E.document(e))},[t]),onOpenApp:(0,G.useCallback)(e=>{t(E.library.app(e))},[t])})}export{re as LibraryPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,d as r,t as i}from"./react-DPM_L_aA.js";import{Bg as a,Fo as o,Io as s,No as c,Po as l,Vv as u,Yv as d,g_ as f,ib as p,zg as m}from"./index-8UA9Y4Ao.js";import{n as h,r as g,t as _}from"./auth-welcome-screen-C9qP-KoZ.js";import{n as v,t as y}from"./use-return-to-short-circuit-BvHiJfG2.js";var b=e(n(),1),x=i();function S({returnTo:e}){let{t:n}=t(`account`),[r,i]=(0,b.useState)(null),[a,u]=(0,b.useState)(!1),f=async()=>{i(null),u(!0);try{await m({returnTo:e??null})}catch(e){if(l(e)){u(!1);return}d(e,{context:`native_login`,tags:{authError:o(e)??`unclassified`}}),i(n(s(e),{community:c})),u(!1)}};return(0,x.jsx)(g,{animateAvatarWaveIn:!0,fillsViewport:!0,children:(0,x.jsx)(h,{error:r,children:(0,x.jsx)(p,{type:`button`,variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{f()},disabled:a,children:n(`loginPage.signIn`)})})})}function C({returnTo:e}){let{t:n}=t(`account`),{search:i}=r(),a=f(e?`${u.account.signup}?returnTo=${encodeURIComponent(e)}`:u.account.signup,i);return(0,x.jsx)(_,{returnTo:e,errorContext:`web_login`,fillsViewport:!0,secondary:{label:n(`loginPage.signUp`),href:a}})}function w(){let e=a(),t=y();return t.kind===`wait`?(0,x.jsx)(g,{animateAvatarWaveIn:!0,fillsViewport:!0,children:(0,x.jsx)(v,{})}):t.kind===`redirect`?t.node:e?(0,x.jsx)(S,{returnTo:t.returnTo}):(0,x.jsx)(C,{returnTo:t.returnTo})}export{w as LoginPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,g as r,t as i}from"./react-DPM_L_aA.js";import{Vv as a,ep as o,m_ as s,qo as c}from"./index-8UA9Y4Ao.js";import{r as l,t as u}from"./account-shell-BbzmYhbU.js";var d=e(n(),1),f=i();function p(){let{t:e}=t(`account`),[n]=r(),i=o.use.logout(),p=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(p.current)return;p.current=!0;let e=s(n.get(`returnTo`),a.account.login),t=e.startsWith(`http`)||e===a.account.login?e:`${a.account.login}?returnTo=${encodeURIComponent(e)}`,r=!1;return i().then(()=>{r||c(t)},()=>{r||c(t)}),()=>{r=!0}},[i,n]),(0,f.jsx)(u,{children:(0,f.jsx)(l,{title:e(`logoutPage.title`)})})}export{p as LogoutPage};
@@ -1,2 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{I as t,Xn as n,Zn as r,er as i,j as a}from"./vendor-CV8wawxx.js";import{b as o,f as s,t as c}from"./react-DPM_L_aA.js";import{$ as l,Br as u,Ft as d,P as f,Rr as p,Vr as m,Wt as h,Y as g,ct as _,i as v,n as y,q as b,qt as x,rn as S,t as ee,tt as C}from"./icons-J6Mg9wGk.js";import{$v as te,Ao as w,By as T,Do as ne,Hy as E,Iu as re,Kh as ie,Q as D,Ry as O,Ts as ae,Vv as oe,Yh as k,Yy as se,do as A,ey as ce,hi as j,ib as M,ko as N,mn as P,ny as F,rb as I,yu as le}from"./index-8UA9Y4Ao.js";var L=e(o(),1),R={x:600,y:450},ue=`memory_tab_v1`,de=crypto.randomUUID();function z(e){typeof window>`u`||le()&&j([{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:Date.now(),screen:`memory`,session_id:de,step_name:e,funnel_version:ue}])}var B=Math.PI*(3-Math.sqrt(5)),V=7,H=2.4,U=34,fe=10;function W(e){return Math.min(U,V+H*Math.sqrt(e))}function pe(e){return e===`concept`||e===`skill`||e===`capability`||e===`pending`?e:`other`}function G(e){return e===`link`||e===`learned`?e:`other`}function me(e,t={}){let n=t.center??R,r=e.nodes,i=r.length;if(i===0)return{nodes:[],edges:[]};let a=new Map;r.forEach((e,t)=>a.set(e.id,t));let o=e.edges.filter(e=>e.source!==e.target&&a.has(e.source)&&a.has(e.target)),s=Array(i).fill(0),c=[];for(let e of o){let t=a.get(e.source),n=a.get(e.target);s[t]++,s[n]++,c.push([t,n])}let l=r.map((e,t)=>W(s[t])),u=70+26*Math.sqrt(i),d=r.map((e,t)=>{let r=(t+.5)/i,a=Math.acos(1-2*r),o=t*B,s=u*Math.cbrt(r),c=Math.sin(a);return{x:n.x+s*c*Math.cos(o),y:n.y+s*c*Math.sin(o),z:s*Math.cos(a),vx:0,vy:0,vz:0}}),f=t.iterations??Math.max(90,Math.min(340,Math.round(46e3/i))),p=.011,m=.82,h=.5,g=1,_=1-.001**(1/f);for(let e=0;e<f;e++){for(let e=0;e<i;e++){let t=d[e];for(let n=e+1;n<i;n++){let r=d[n],i=t.x-r.x,a=t.y-r.y,o=t.z-r.z,s=i*i+a*a+o*o;s<.01&&(i=(e-n)*.1+.1,a=.1,o=.05,s=i*i+a*a+o*o);let c=Math.sqrt(s),l=6400/s,u=i/c*l,f=a/c*l,p=o/c*l;t.vx+=u,t.vy+=f,t.vz+=p,r.vx-=u,r.vy-=f,r.vz-=p}}for(let[e,t]of c){let n=d[e],r=d[t],i=r.x-n.x,a=r.y-n.y,o=r.z-n.z,s=Math.sqrt(i*i+a*a+o*o)||.01,c=.05*(s-140),l=i/s*c,u=a/s*c,f=o/s*c;n.vx+=l,n.vy+=u,n.vz+=f,r.vx-=l,r.vy-=u,r.vz-=f}for(let e=0;e<i;e++){let t=d[e];t.vx+=(n.x-t.x)*p,t.vy+=(n.y-t.y)*p,t.vz+=(0-t.z)*p,t.x+=t.vx*g*h,t.y+=t.vy*g*h,t.z+=t.vz*g*h,t.vx*=m,t.vy*=m,t.vz*=m}g*=1-_}for(let e=0;e<10;e++){let e=!1;for(let t=0;t<i;t++){let n=d[t];for(let r=t+1;r<i;r++){let i=d[r],a=i.x-n.x,o=i.y-n.y,s=i.z-n.z,c=Math.sqrt(a*a+o*o+s*s),u=l[t]+l[r]+fe;if(c>=u)continue;c<.01&&(a=(r-t)*.1+.1,o=.1,s=.05,c=Math.sqrt(a*a+o*o+s*s));let f=(u-c)/2,p=a/c*f,m=o/c*f,h=s/c*f;n.x-=p,n.y-=m,n.z-=h,i.x+=p,i.y+=m,i.z+=h,e=!0}}if(!e)break}return{nodes:r.map((e,t)=>{let n={id:e.id,x:d[t].x,y:d[t].y,z:d[t].z,radius:l[t],label:e.label,kind:pe(e.kind),degree:s[t]};return e.summary&&(n.summary=e.summary),e.updatedAtMs!==void 0&&(n.updatedAtMs=e.updatedAtMs),n}),edges:o.map((e,t)=>{let n={id:`${e.source}__${e.target}__${t}`,fromId:e.source,toId:e.target,kind:G(e.kind),directed:e.directed??!1};return e.description&&(n.description=e.description),n})}}var K=c();function he({title:e,detail:t,action:n}){return(0,K.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e}),t?(0,K.jsx)(`p`,{className:`max-w-sm text-body-small-default`,style:{color:`var(--content-tertiary)`},children:t}):null,n?(0,K.jsx)(`div`,{className:`mt-2`,children:n}):null]})}function q(){return t(`getMemoryGraphNode.failureMessage`,{ns:`intelligence`})}function J(e,t){return n({queryKey:[`memory-graph-node`,e,t],enabled:!!(e&&t),queryFn:async()=>{let{data:n,error:r,response:i}=await k({path:{assistant_id:e},query:{id:t??``},throwOnError:!1});if(ce(i,r,q()),!i.ok)throw new te(i.status,F(r,i,q()));return n??{found:!1}}})}var ge={concept:`#467CC8`,skill:`#DB4B77`,capability:`#0E9B8B`,pending:`#F1B21E`,other:`#8D99A5`},_e=[`#467CC8`,`#E86B40`,`#7A5AF5`,`#22B8CF`,`#3DB85E`,`#E9C91A`,`#E83F5B`,`#6ECF87`,`#F39B74`,`#F5C94E`],Y={concept:`conceptGraphConstants.nodeKind.concept`,skill:`conceptGraphConstants.nodeKind.skill`,capability:`conceptGraphConstants.nodeKind.capability`,pending:`conceptGraphConstants.nodeKind.pending`,other:`conceptGraphConstants.nodeKind.other`};function ve(e){return t(Y[e],{ns:`intelligence`})}var ye=`#F1B21E`;function be(e){if(e.length<=4)return e.map((e,t)=>({node:e,index:t}));let t=e.slice(-3).map((t,n)=>({node:t,index:e.length-3+n}));return[{node:e[0],index:0},`ellipsis`,...t]}function xe(e){return e?new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`}):null}var X=600;function Se(e){let t=e.slice(0,X),n=t.lastIndexOf(`
2
- `);return n>X/2?e.slice(0,n):t}function Ce({content:e}){let[t,n]=(0,L.useState)(!1),{t:r}=a(`intelligence`);return e.length<=X?(0,K.jsx)(P,{content:e}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(P,{content:t?e:Se(e)}),(0,K.jsx)(M,{variant:`ghost`,size:`compact`,className:`-ml-2 mt-1`,onClick:()=>n(e=>!e),rightIcon:t?(0,K.jsx)(p,{size:16,"aria-hidden":!0}):(0,K.jsx)(m,{size:16,"aria-hidden":!0}),children:r(t?`conceptDetailPanel.showLess`:`conceptDetailPanel.readFullNote`)})]})}function we({assistantId:e,node:t,trail:n,neighbors:i,onTravel:o,onCrumb:s,onClose:c,onOpenThread:l}){let{t:d}=a(`intelligence`),p=r(J(e,t.id)),m=p.data,g=xe(t.updatedAtMs),_=m?.title??t.label,y=be(n);return(0,L.useEffect)(()=>{let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),c())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,K.jsxs)(`div`,{"data-graph-panel":!0,className:`absolute inset-0 z-20 flex justify-end`,onPointerDown:e=>e.stopPropagation(),onPointerMove:e=>e.stopPropagation(),onPointerUp:e=>e.stopPropagation(),children:[(0,K.jsx)(`div`,{className:`absolute inset-0`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 16%, transparent)`},onClick:c}),(0,K.jsxs)(`aside`,{className:`relative flex h-full min-h-0 w-full max-w-md flex-col overflow-hidden`,style:{backgroundColor:`var(--surface-lift)`,borderLeft:`1px solid var(--border-base)`},children:[n.length>1?(0,K.jsxs)(`nav`,{"aria-label":d(`conceptDetailPanel.trailAriaLabel`),className:`flex shrink-0 items-center gap-1 overflow-hidden border-b px-5 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>s(n.length-2),"aria-label":d(`conceptDetailPanel.backAriaLabel`),className:`-ml-1 mr-0.5 flex shrink-0 items-center rounded p-0.5 hover:bg-[color-mix(in_srgb,var(--content-tertiary)_14%,transparent)]`,style:{color:`var(--content-tertiary)`},children:(0,K.jsx)(u,{size:16,"aria-hidden":!0})}),y.map((e,t)=>(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[t>0?(0,K.jsx)(`span`,{"aria-hidden":!0,children:`›`}):null,e===`ellipsis`?(0,K.jsx)(`span`,{"aria-hidden":!0,children:`…`}):e.index===n.length-1?(0,K.jsx)(`span`,{"aria-current":`page`,className:`max-w-[9rem] truncate`,style:{color:`var(--content-default)`},children:e.node.label}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>s(e.index),className:`max-w-[8rem] truncate rounded hover:underline`,style:{color:`var(--content-tertiary)`},children:e.node.label})]},e===`ellipsis`?`ellipsis`:e.index))]}):null,(0,K.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-3 border-b px-5 py-4`,style:{borderColor:`var(--border-base)`},children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`truncate text-title-small`,style:{color:`var(--content-default)`},title:m?.title??t.label,children:m?.title??t.label}),g?(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:d(`conceptDetailPanel.updated`,{date:g})}):null]}),(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(v,{"aria-hidden":!0}),onClick:c,"aria-label":d(`conceptDetailPanel.closeAriaLabel`),tintColor:`var(--content-tertiary)`})]}),(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,style:{touchAction:`pan-y`},children:[p.isLoading?(0,K.jsx)(`div`,{className:`flex justify-center py-8`,children:(0,K.jsx)(`div`,{className:`h-5 w-5 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})}):p.isError?(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`conceptDetailPanel.loadError`)}):m?.found&&m.content?.trim()?(0,K.jsx)(Ce,{content:m.content},t.id):(0,K.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`conceptDetailPanel.emptyContent`)}),i.length>0?(0,K.jsxs)(`section`,{className:`mt-6 border-t pt-4`,style:{borderColor:`var(--border-base)`},children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-baseline justify-between gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:d(`conceptDetailPanel.wiredTo`)}),(0,K.jsx)(`span`,{className:`text-body-small-default tabular-nums`,style:{color:`var(--content-tertiary)`},children:d(`conceptDetailPanel.connectionCount`,{count:i.length})})]}),(0,K.jsx)(`ul`,{className:`flex list-none flex-col gap-0.5`,children:i.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{type:`button`,onClick:()=>o({id:e.id,label:e.label}),className:`flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-body-medium-default hover:bg-[color-mix(in_srgb,var(--content-tertiary)_12%,transparent)]`,style:{color:`var(--content-default)`},children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`h-1.5 w-1.5 shrink-0 rounded-full`,style:{backgroundColor:e.kind===`learned`?ye:`var(--content-tertiary)`}}),(0,K.jsx)(`span`,{className:`truncate`,children:e.label})]})},e.id))})]}):null]}),l?(0,K.jsxs)(`footer`,{className:`flex shrink-0 gap-2 border-t px-5 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,K.jsx)(M,{variant:`outlined`,size:`regular`,className:`flex-1`,leftIcon:(0,K.jsx)(h,{size:16,"aria-hidden":!0}),onClick:()=>l(d(`conceptDetailPanel.askPrompt`,{title:_})),children:d(`conceptDetailPanel.askAboutThis`)}),(0,K.jsx)(M,{variant:`primary`,size:`regular`,className:`flex-1`,leftIcon:(0,K.jsx)(f,{size:16,"aria-hidden":!0}),onClick:()=>l(d(`conceptDetailPanel.refinePrompt`,{title:_})),children:d(`conceptDetailPanel.refine`)})]}):null]})]})}function Te({onDismiss:e}){let{t}=a(`intelligence`);return(0,K.jsxs)(`div`,{"data-graph-control":!0,className:`pointer-events-auto absolute left-1/2 top-4 z-10 flex w-[min(30rem,calc(100%-6rem))] -translate-x-1/2 items-start gap-3 rounded-xl px-4 py-3`,style:{backgroundColor:`var(--surface-lift)`,border:`1px solid var(--border-base)`,boxShadow:`0 4px 12px rgba(0, 0, 0, 0.25)`},children:[(0,K.jsx)(`span`,{className:`mt-0.5 shrink-0`,style:{color:`var(--primary-base)`},"aria-hidden":!0,children:(0,K.jsx)(f,{size:18})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:t(`conceptGraphIntroBanner.title`)}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:t(`conceptGraphIntroBanner.description`)})]}),(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(v,{"aria-hidden":!0}),onClick:e,"aria-label":t(`conceptGraphIntroBanner.dismissAriaLabel`),tintColor:`var(--content-tertiary)`})]})}var Ee=8;function De({nodeKinds:e,coloredByTheme:t,themes:n,hasLinks:r,hasLearned:i,onToggleLink:o,onToggleLearned:s,linkActive:c,learnedActive:l}){let{t:u}=a(`intelligence`);return(0,K.jsxs)(`div`,{"data-graph-control":!0,className:`pointer-events-none absolute bottom-4 left-4 flex flex-col gap-1.5 rounded-lg px-3 py-2`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 78%, transparent)`,border:`1px solid var(--border-base)`},children:[e.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 rounded-full`,style:{backgroundColor:ge[e]}}),(0,K.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:ve(e)})]},e)),t&&(n&&n.length>0?(0,K.jsxs)(K.Fragment,{children:[n.slice(0,Ee).map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`inline-block h-2.5 w-2.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),(0,K.jsx)(`span`,{className:`max-w-[9rem] truncate text-[11px]`,style:{color:`var(--content-tertiary)`},title:e.concepts?.join(` · `)??e.name,children:e.name})]},t)),n.length>Ee&&(0,K.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:u(`conceptGraphLegend.moreThemes`,{count:n.length-Ee})})]}):(0,K.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:u(`conceptGraphLegend.coloredByTheme`)})),(e.length>0||t)&&(r||i)&&(0,K.jsx)(`div`,{className:`mt-0.5 border-t pt-1.5`,style:{borderColor:`var(--border-base)`}}),r&&(0,K.jsx)(Oe,{swatchStyle:{borderTop:`2px solid var(--content-tertiary)`},label:u(`conceptGraphLegend.link`),onToggle:o,active:c}),i&&(0,K.jsx)(Oe,{swatchStyle:{borderTop:`2px dashed #F1B21E`},label:u(`conceptGraphLegend.learned`),onToggle:s,active:l})]})}function Oe({swatchStyle:e,label:t,onToggle:n,active:r}){let i=(0,K.jsx)(`span`,{className:`inline-block h-0 w-4`,style:e}),a=(0,K.jsx)(`span`,{className:`text-[11px]`,style:{color:`var(--content-tertiary)`},children:t});return n?(0,K.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":r,className:`pointer-events-auto flex cursor-pointer items-center gap-2 border-0 bg-transparent p-0 transition-opacity`,style:{opacity:r===!1?.4:1},children:[i,a]}):(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i,a]})}var Z=8;function ke(e,t){let n=e.length;if(n===0)return new Map;let r=new Map;e.forEach((e,t)=>r.set(e.id,t));let i=e.map(()=>[]);for(let e of t){let t=r.get(e.fromId),n=r.get(e.toId);t===void 0||n===void 0||t===n||(i[t].push(n),i[n].push(t))}let a=e.map((e,t)=>t);for(let e=0;e<Z;e++)for(let e=0;e<n;e++){let t=i[e];if(t.length===0)continue;let n=new Map;for(let e of t)n.set(a[e],(n.get(a[e])??0)+1);let r=a[e],o=-1;for(let[e,t]of n)(t>o||t===o&&e<r)&&(r=e,o=t);a[e]=r}let o=new Map,s=new Map;return e.forEach((e,t)=>{let n=a[t],r=o.get(n);r===void 0&&(r=o.size,o.set(n,r)),s.set(e.id,r)}),s}function Q(){return t(`memoryUnavailable.prompts.v2`,{ns:`intelligence`})}function Ae(){return t(`memoryUnavailable.prompts.v1`,{ns:`intelligence`})}function je(){return t(`memoryUnavailable.prompts.enable`,{ns:`intelligence`})}function Me(){return{title:t(`memoryUnavailable.statusError.title`,{ns:`intelligence`}),detail:t(`memoryUnavailable.statusError.detail`,{ns:`intelligence`}),action:`retry`}}function Ne(e){return e===`off`?{title:t(`memoryUnavailable.off.title`,{ns:`intelligence`}),detail:t(`memoryUnavailable.off.detail`,{ns:`intelligence`}),action:`settings`,prompt:je()}:e===`v1`||e===`v2`?{title:t(`memoryUnavailable.legacy.title`,{ns:`intelligence`}),detail:t(`memoryUnavailable.legacy.detail`,{ns:`intelligence`}),action:`upgrade`,prompt:e===`v1`?Ae():Q()}:{title:t(`memoryUnavailable.unknown.title`,{ns:`intelligence`}),detail:t(`memoryUnavailable.unknown.detail`,{ns:`intelligence`}),action:`none`}}function Pe({assistantId:e,onOpenThread:t}){let{t:n}=a(`intelligence`),o=s(),c=i(),l=r(N(e));(0,L.useEffect)(()=>{ne(c,e)},[c,e]);let u=A(`memoryOptOut`),d=re.use.settingsDeveloperNav(),p=u&&d===!0;if(l.isLoading)return null;let m=l.data?.kind===`ready`?l.data.tier:void 0,h=l.isError?Me():Ne(m),g=h.prompt,_=null;return h.action===`upgrade`&&t&&g?_=(0,K.jsx)(M,{variant:`primary`,size:`compact`,leftIcon:(0,K.jsx)(f,{}),onClick:()=>{z(`upgrade_v3_clicked`),t(g)},children:n(`memoryUpgradePrompt.upgradeMemory`)}):h.action===`retry`?_=(0,K.jsx)(M,{variant:`outlined`,size:`compact`,leftIcon:(0,K.jsx)(C,{}),onClick:()=>{l.refetch()},children:n(`memoryUpgradePrompt.tryAgain`)}):h.action===`settings`&&p?_=(0,K.jsx)(M,{variant:`outlined`,size:`compact`,leftIcon:(0,K.jsx)(b,{}),onClick:()=>o(`${oe.settings.developer}?tab=memory`),children:n(`memoryUpgradePrompt.memorySettings`)}):h.action===`settings`&&t&&g&&(_=(0,K.jsx)(M,{variant:`primary`,size:`compact`,leftIcon:(0,K.jsx)(f,{}),onClick:()=>{z(`enable_memory_clicked`),t(g)},children:n(`memoryUpgradePrompt.turnMemoryOn`)})),(0,K.jsx)(he,{title:h.title,detail:h.detail,action:_})}function Fe({value:e,onChange:t}){let{t:n}=a(`intelligence`),r=[{value:`all`,label:n(`recencyLens.all`)},{value:`month`,label:n(`recencyLens.month`)},{value:`week`,label:n(`recencyLens.week`)}];return(0,K.jsx)(E,{ariaLabel:n(`recencyLens.ariaLabel`),items:r,value:e,onChange:t,className:`!w-auto [&>*]:!flex-none`})}var Ie=`vellum:memoryGraph:introDismissed:`;function Le(e){return`${Ie}${e}`}function $(e){if(!e)return!0;try{return window.localStorage.getItem(Le(e))===`1`}catch{return!0}}function Re(e){let[t,n]=(0,L.useState)(()=>$(e));return(0,L.useEffect)(()=>{n($(e))},[e]),[t,(0,L.useCallback)(()=>{n(!0);try{window.localStorage.setItem(Le(e),`1`)}catch{}},[e])]}var ze=[`concept`,`skill`,`capability`,`pending`,`other`],Be=.13,Ve=2600,He=.006,Ue=1.15,We=3,Ge=.32,Ke=.45,qe=3,Je=4,Ye=1440*60*1e3,Xe=14*Ye,Ze=12,Qe=2*Ye,$e=80,et=340,tt=.12,nt=.05,rt=.03,it=12,at=2600;function ot(e){let t=getComputedStyle(e);return{content:t.getPropertyValue(`--content-default`).trim()||`#e5e7eb`,tertiary:t.getPropertyValue(`--content-tertiary`).trim()||`#8792a0`}}function st(e){return e.kind===`learned`?`Learned association`:e.description??`Linked concepts`}function ct(e,t,n){return t==null?!1:e==null||n-e>t}function lt(e,t){let n=t?e.get(t):void 0;return e=>t!=null&&(e===t||(n?.has(e)??!1))}function ut({assistantId:e,className:t,isFullscreen:n,onToggleFullscreen:i,onOpenThread:o,headerAction:s,handleRef:c}){let{t:u}=a(`intelligence`),f=(0,L.useRef)(null),p=(0,L.useRef)(null),m=r(w(e)),h=m.data?.kind===`ready`?m.data.graph:null,_=(0,L.useMemo)(()=>h?me(h):{nodes:[],edges:[]},[h]),b=m.data?.kind===`ready`&&_.nodes.length>0,S=(0,L.useMemo)(()=>ke(_.nodes,_.edges),[_.nodes,_.edges]),C=(0,L.useMemo)(()=>{let e=new Map;for(let t of _.nodes){let n=S.get(t.id);if(n==null||t.degree===0)continue;let r=e.get(n);r?r.push(t):e.set(n,[t])}return[...e.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.degree-e.degree||(e.id<t.id?-1:1)).slice(0,3);return{hubId:n[0].id,color:_e[e%_e.length],name:n[0].label,concepts:n.map(e=>e.label),size:t.length}}).sort((e,t)=>t.size-e.size)},[S,_.nodes]),te=(0,L.useMemo)(()=>new Set(C.map(e=>e.hubId)),[C]),T=(0,L.useMemo)(()=>{let e=new Map,t=(t,n)=>{let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)};for(let e of _.edges)t(e.fromId,e.toId),t(e.toId,e.fromId);return e},[_.edges]),ne=(0,L.useMemo)(()=>{if(_.nodes.length===0)return 1;let e=_.nodes.map(e=>{let t=e.x-R.x,n=e.y-R.y;return Math.sqrt(t*t+n*n+e.z*e.z)+e.radius}).sort((e,t)=>e-t),t=Math.min(e.length-1,Math.floor(e.length*.92));return Math.max(1,e[t])},[_.nodes]),E=(0,L.useRef)({yaw:.5,pitch:.32,zoom:1,hoveredId:null,dragging:!1,moved:!1,lastX:0,lastY:0,lastInteractAt:-1/0,dirty:!0}),re=(0,L.useRef)([]),ie=(0,L.useRef)([]),D=(0,L.useRef)({content:`#e5e7eb`,tertiary:`#8792a0`}),O=(0,L.useRef)(null),ae=(0,L.useRef)(!1),oe=(0,L.useRef)(null),k=(0,L.useRef)(null),[se,A]=(0,L.useState)(null),[ce,j]=(0,L.useState)(null),[N,P]=(0,L.useState)([]),F=N.at(-1)??null,I=(0,L.useCallback)(e=>{z(`node_opened`),P(t=>[...t,e])},[]),le=(0,L.useRef)(null);(0,L.useEffect)(()=>{le.current=F?.id??null,E.current.dirty=!0},[F?.id]);let[ue,de]=Re(e),[B,V]=(0,L.useState)(``),[H,U]=(0,L.useState)(!1),fe=(0,L.useRef)(null);(0,L.useEffect)(()=>{H&&fe.current?.focus()},[H]);let W=(0,L.useRef)(!1),pe=B.trim().toLowerCase(),G=(0,L.useMemo)(()=>{if(!pe)return null;let e=new Set;for(let t of _.nodes)t.label.toLowerCase().includes(pe)&&e.add(t.id);return e},[pe,_.nodes]),q=(0,L.useRef)({active:!1,matches:null});(0,L.useEffect)(()=>{q.current={active:!!G,matches:G},E.current.dirty=!0},[G]),(0,L.useEffect)(()=>{B.trim()||(W.current=!1)},[B]);let J=(0,L.useMemo)(()=>!G||G.size===0?[]:_.nodes.filter(e=>G.has(e.id)).sort((e,t)=>t.degree-e.degree).slice(0,8),[G,_.nodes]),[Y,ve]=(0,L.useState)(`all`),be=(0,L.useRef)(null);(0,L.useEffect)(()=>{be.current=Y===`week`?7*Ye:Y===`month`?30*Ye:null,E.current.dirty=!0},[Y]);let xe=(0,L.useMemo)(()=>_.nodes.some(e=>e.updatedAtMs!=null),[_.nodes]);(0,L.useEffect)(()=>{!xe&&Y!==`all`&&ve(`all`)},[xe,Y]);let[X,Se]=(0,L.useState)({link:!0,learned:!0}),Ce=(0,L.useRef)(X);(0,L.useEffect)(()=>{Ce.current=X,E.current.dirty=!0},[X]),(0,L.useEffect)(()=>{V(``),ve(`all`),Se({link:!0,learned:!0}),P([]),W.current=!1},[e]);let Ee=(0,L.useCallback)(()=>{let e=E.current;e.yaw=.5,e.pitch=.32,e.zoom=1,e.lastInteractAt=-1/0,e.dirty=!0,A(null)},[]),Oe=(0,L.useCallback)(e=>{let t=E.current;t.zoom=Math.max(Ke,Math.min(qe,t.zoom*e)),t.lastInteractAt=performance.now(),t.dirty=!0},[]),Z=(0,L.useCallback)(e=>{O.current=e,E.current.lastInteractAt=performance.now(),E.current.dirty=!0},[]),Q=(0,L.useCallback)(e=>{I(e),Z(e.id)},[I,Z]),Ae=(0,L.useCallback)(e=>{oe.current={id:e,start:performance.now()},Z(e),window.setTimeout(()=>{E.current.dirty=!0},at+60)},[Z]),je=(0,L.useCallback)(e=>{_.nodes.some(t=>t.id===e)?Ae(e):k.current=e},[_.nodes,Ae]);(0,L.useEffect)(()=>{let e=k.current;e&&_.nodes.some(t=>t.id===e)&&(k.current=null,Ae(e))},[_.nodes,Ae]),(0,L.useImperativeHandle)(c,()=>({focusNode:je}),[je]);let Me=(0,L.useCallback)(()=>{P([]),V(``),A(null),O.current=null,ae.current=!0},[]),Ne=(0,L.useCallback)(e=>{V(``);let t=N.slice(0,e+1);P(t);let n=t.at(-1);n?Z(n.id):A(null)},[N,Z]),Ie=(0,L.useCallback)(e=>{V(``),Q(e)},[Q]),Le=(0,L.useMemo)(()=>{let e=F?.id;if(!e)return[];let t=T.get(e);if(!t||t.size===0)return[];let n=new Map(_.nodes.map(e=>[e.id,e.label])),r=new Map;for(let t of _.edges)t.fromId===e?r.set(t.toId,t.kind):t.toId===e&&r.set(t.fromId,t.kind);let i=[];for(let e of t){let t=n.get(e);t!=null&&i.push({id:e,label:t,kind:r.get(e)})}return i.sort((e,t)=>e.label.localeCompare(t.label)),i},[F?.id,T,_.nodes,_.edges]);(0,L.useEffect)(()=>{if(!b)return;let e=p.current,t=f.current;if(!e||!t)return;let n=e.getContext(`2d`);if(!n)return;let r=_.nodes,i=_.edges,a=S,o=te,s=T,c=new Set(r.map(e=>e.id)),l=ne,u=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;D.current=ot(t);let d=Math.min(window.devicePixelRatio||1,2),m=0,h=0,g=()=>{let n=t.getBoundingClientRect();m=n.width,h=n.height,d=Math.min(window.devicePixelRatio||1,2),e.width=Math.max(1,Math.round(m*d)),e.height=Math.max(1,Math.round(h*d)),e.style.width=`${m}px`,e.style.height=`${h}px`,D.current=ot(t),E.current.dirty=!0};g();let v=new ResizeObserver(g);v.observe(t);let y=new MutationObserver(()=>{D.current=ot(t),E.current.dirty=!0});y.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let x=0,ee=0,C=e=>{let t=ee?Math.min(.05,(e-ee)/1e3):0;ee=e;let f=E.current,p=D.current,g=Date.now(),_=O.current;if(!f.dragging&&e-f.lastInteractAt>Ve&&!u&&!_&&(f.yaw+=Be*t),_){let e=r.find(e=>e.id===_);if(!e)O.current=null;else{let t=e.x-R.x,n=e.y-R.y,r=e.z,i=-Math.atan2(t,r),a=Math.hypot(t,r),o=Math.max(-Ue,Math.min(Ue,Math.atan2(n,a))),s=Math.min(qe,1.6),c=u?1:.15,l=i-f.yaw;l=Math.atan2(Math.sin(l),Math.cos(l)),f.yaw+=l*c,f.pitch+=(o-f.pitch)*c,f.zoom+=(s-f.zoom)*c,f.dirty=!0,Math.abs(l)<.01&&Math.abs(o-f.pitch)<.01&&Math.abs(s-f.zoom)<.02&&(O.current=null)}}if(ae.current&&!f.dragging){let e=u?1:.15;f.pitch+=(.32-f.pitch)*e,f.zoom+=(1-f.zoom)*e,f.dirty=!0,Math.abs(.32-f.pitch)<.01&&Math.abs(1-f.zoom)<.02&&(ae.current=!1)}if(u&&!f.dirty){x=requestAnimationFrame(C);return}f.dirty=!1;let v=Math.cos(f.yaw),y=Math.sin(f.yaw),b=Math.cos(f.pitch),S=Math.sin(f.pitch),te=We*l,w=Math.min(m,h)*.88/(2*l)*f.zoom,T=m/2,ne=h/2;n.setTransform(d,0,0,d,0,0),n.clearRect(0,0,m,h);let k=f.hoveredId,se=k?s.get(k):void 0,A=e=>!k||e===k||(se?.has(e)??!1),ce=q.current,j=ce.active,M=e=>!j||(ce.matches?.has(e)??!1),N=be.current,P=e=>ct(e.updatedAtMs,N,g),F=Ce.current,I=le.current,L=I!=null&&c.has(I),ue=lt(s,L?I:null),de=r.length<=$e?1:Math.max(tt,1-(r.length-$e)/(et-$e)*(1-tt)),z=Array(r.length);for(let e=0;e<r.length;e++){let t=r[e],n=t.x-R.x,i=t.y-R.y,a=t.z,o=n*v+a*y,s=-n*y+a*v,c=i*b-s*S,u=i*S+s*b,d=te/(te-u);z[e]={node:t,sx:T+o*w*d,sy:ne+c*w*d,sr:Math.max(1.2,t.radius*w*d),depth:Math.max(0,Math.min(1,(u+l)/(2*l)))}}let B=z.map((e,t)=>t).sort((e,t)=>z[e].depth-z[t].depth),V=new Map;for(let e of z)V.set(e.node.id,e);let H=[];n.lineCap=`round`;for(let e of i){let t=V.get(e.fromId),r=V.get(e.toId);if(!t||!r)continue;let i=e.kind===`learned`,a=I!=null&&(e.fromId===I||e.toId===I);if(!a&&(i?!F.learned:!F.link))continue;let o=j&&(!M(e.fromId)||!M(e.toId))||!a&&(P(t.node)||P(r.node)),s=k!=null&&(e.fromId===k||e.toId===k),c=(t.depth+r.depth)/2;!o&&(!L||a)&&H.push({ax:t.sx,ay:t.sy,bx:r.sx,by:r.sy,kind:e.kind,description:e.description,depth:c});let l=(i?.34:.28)*(.4+.6*c),u=i?l*de:l,d;d=o?.03:L?a?.9:rt:k==null?u:s?.9:A(e.fromId)&&A(e.toId)?l:.05,n.globalAlpha=d,n.strokeStyle=i?ye:p.tertiary,n.lineWidth=(s||L&&a?2:1)*(.6+.6*c),n.setLineDash(i?[4,4]:[]),n.beginPath(),n.moveTo(t.sx,t.sy),n.lineTo(r.sx,r.sy),n.stroke()}n.setLineDash([]);for(let t of B){let r=z[t],i=r.node,o=i.kind===`concept`?_e[(a.get(i.id)??0)%_e.length]:ge[i.kind],s=j&&!M(i.id),c=ue(i.id),l=s||P(i)&&!c,d=L?c&&!l:!l&&A(i.id),f=i.id===k,p=Ge+(1-Ge)*r.depth,m=L&&!c?p*nt:l?p*.08:d?p:p*.18,h=(f?16:i.degree>=Je?8:4)*r.depth,_=i.updatedAtMs;if(_){let n=g-_,i=Math.max(0,1-n/Xe);if(i>0){let a=i*Ze;!u&&n<Qe&&(a*=.55+.45*Math.sin(e/420+t*1.7)),h+=a*r.depth}}n.shadowColor=o,n.shadowBlur=d?h:0;let v=i.kind===`pending`;n.globalAlpha=m*(v?.3:.55),n.fillStyle=o,n.beginPath(),n.arc(r.sx,r.sy,r.sr,0,Math.PI*2),n.fill(),n.shadowBlur=0,n.globalAlpha=m,n.lineWidth=f?2.5:1.4,n.strokeStyle=o,n.setLineDash(v?[3,3]:[]),n.stroke(),n.setLineDash([]);let y=oe.current;if(y&&y.id===i.id){let t=e-y.start;if(t>at)oe.current=null;else if(u)n.globalAlpha=.7,n.lineWidth=1.5,n.beginPath(),n.arc(r.sx,r.sy,r.sr+7,0,Math.PI*2),n.stroke();else for(let e=0;e<3;e++){let i=(t-e*320)/1100;i<=0||i>=1||(n.globalAlpha=(1-i)*.8,n.lineWidth=1.5,n.beginPath(),n.arc(r.sx,r.sy,r.sr+i*46*r.depth,0,Math.PI*2),n.stroke())}}}n.shadowBlur=0,n.textAlign=`center`,n.textBaseline=`top`,n.font=`11px ui-sans-serif, system-ui, sans-serif`;for(let e of B){let t=z[e],r=t.node,i=ue(r.id);if(j&&!M(r.id)||P(r)&&!i||!(L?i:j?t.depth>.3:k==null?o.has(r.id)||r.degree>=Je&&t.depth>.55:A(r.id)))continue;n.globalAlpha=(r.id===k||r.id===I?1:.85)*(.4+.6*t.depth),n.fillStyle=p.content;let a=r.label.length>22?`${r.label.slice(0,21)}…`:r.label;n.fillText(a,t.sx,t.sy+t.sr+3)}n.globalAlpha=1,re.current=z.map(e=>({id:e.node.id,sx:e.sx,sy:e.sy,sr:e.sr,depth:e.depth,updatedAtMs:e.node.updatedAtMs})),ie.current=H,x=requestAnimationFrame(C)};return x=requestAnimationFrame(C),()=>{cancelAnimationFrame(x),v.disconnect(),y.disconnect()}},[b,_,T,ne,S,te]);let $=(0,L.useCallback)((e,t)=>{let n=q.current,r=be.current,i=lt(T,le.current),a=Date.now(),o=null,s=-1;for(let c of re.current){if(n.active&&!(n.matches?.has(c.id)??!1)||!i(c.id)&&ct(c.updatedAtMs,r,a))continue;let l=e-c.sx,u=t-c.sy;l*l+u*u<=(c.sr+5)*(c.sr+5)&&c.depth>s&&(o=c.id,s=c.depth)}return o},[T]),ut=(0,L.useCallback)((e,t)=>{let n=null,r=1/0,i=-1;for(let a of ie.current){let o=a.bx-a.ax,s=a.by-a.ay,c=o*o+s*s,l=0;c>0&&(l=((e-a.ax)*o+(t-a.ay)*s)/c,l=Math.max(0,Math.min(1,l)));let u=e-(a.ax+l*o),d=t-(a.ay+l*s),f=Math.sqrt(u*u+d*d);f>5||(f<r||f===r&&a.depth>i)&&(n={kind:a.kind,description:a.description},r=f,i=a.depth)}return n},[]),dt=e=>{let t=f.current.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}},ft=(0,L.useCallback)(e=>{if(e.button!==0||e.target.closest(`[data-graph-control]`))return;let t=E.current;O.current=null,t.dragging=!0,t.moved=!1,t.lastX=e.clientX,t.lastY=e.clientY,t.lastInteractAt=performance.now(),e.currentTarget.setPointerCapture(e.pointerId)},[]),pt=(0,L.useCallback)(e=>{let t=E.current;if(t.dragging){let n=e.clientX-t.lastX,r=e.clientY-t.lastY;(Math.abs(n)>2||Math.abs(r)>2)&&(t.moved=!0),t.yaw+=n*He,t.pitch=Math.max(-Ue,Math.min(Ue,t.pitch+r*He)),t.lastX=e.clientX,t.lastY=e.clientY,t.lastInteractAt=performance.now(),t.dirty=!0;return}let{x:n,y:r}=dt(e),i=$(n,r);if(i!==t.hoveredId&&(t.hoveredId=i,t.dirty=!0),i)j(null);else{let e=ut(n,r);j(e?st(e):null)}},[$,ut]),mt=(0,L.useCallback)(e=>{let t=E.current;if(!t.dragging)return;t.dragging=!1,t.lastInteractAt=performance.now(),t.dirty=!0;let n=e.currentTarget;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),!t.moved){let{x:t,y:n}=dt(e),r=$(t,n);if(r){let e=_.nodes.find(e=>e.id===r);e&&Q({id:e.id,label:e.label,updatedAtMs:e.updatedAtMs})}else A(null)}},[$,_.nodes,Q]),ht=(0,L.useCallback)(()=>{let e=E.current;j(null),!(e.dragging||e.hoveredId==null)&&(e.hoveredId=null,e.dirty=!0,A(null))},[]);(0,L.useEffect)(()=>{let e=f.current;if(!e||!b)return;let t=e=>{if(e.target.closest?.(`[data-graph-panel]`))return;e.preventDefault();let t=E.current;t.zoom=Math.max(Ke,Math.min(qe,t.zoom*(1-e.deltaY/500))),t.lastInteractAt=performance.now(),t.dirty=!0};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[b]);let gt=(0,L.useMemo)(()=>{let e=new Set(_.nodes.map(e=>e.kind));return ze.filter(t=>e.has(t))},[_.nodes]),_t=(0,L.useMemo)(()=>_.edges.some(e=>e.kind===`learned`),[_.edges]),vt=(0,L.useMemo)(()=>_.edges.some(e=>e.kind!==`learned`),[_.edges]);(0,L.useEffect)(()=>{!(vt&&_t)&&(!X.link||!X.learned)&&Se({link:!0,learned:!0})},[vt,_t,X]);let yt=m.data?.kind===`ready`&&!ue,bt=_.nodes.length,xt=_.edges.length,St=new Set(S.values()).size,Ct=(e,t)=>`${e} ${t}${e===1?``:`s`}`,wt=yt?null:se??ce,Tt=b&&(_.nodes.length>it||!!B),Et=!!(i||s)||b,Dt;return Dt=m.isLoading?(0,K.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,K.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})}):m.isError?(0,K.jsx)(he,{title:u(`conceptGraphView.loadErrorTitle`),detail:u(`conceptGraphView.loadErrorDetail`)}):m.data?.kind===`unsupported`?(0,K.jsx)(Pe,{assistantId:e,onOpenThread:o}):b?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`canvas`,{ref:p,className:`absolute inset-0 h-full w-full`}),(_.nodes.length>it||Y!==`all`)&&xe?(0,K.jsx)(`div`,{"data-graph-control":!0,className:`absolute left-4 top-4 z-10`,children:(0,K.jsx)(Fe,{value:Y,onChange:ve})}):null,(0,K.jsx)(De,{nodeKinds:gt.filter(e=>e!==`concept`),coloredByTheme:gt.includes(`concept`),themes:C,hasLinks:vt,hasLearned:_t,...vt&&_t?{onToggleLink:()=>Se(e=>({...e,link:!e.link})),onToggleLearned:()=>Se(e=>({...e,learned:!e.learned})),linkActive:X.link,learnedActive:X.learned}:{}}),(0,K.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 right-4 text-[11px]`,style:{color:`var(--content-tertiary)`},children:u(`conceptGraphView.dragToRotateHint`)}),h?.truncated?(0,K.jsx)(`div`,{className:`pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full px-3 py-1 text-[11px]`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-tertiary)`},children:u(`conceptGraphView.truncatedNotice`,{count:_.nodes.length})}):null,(0,K.jsxs)(`div`,{"data-graph-control":!0,className:`absolute right-4 top-4 flex flex-col gap-1`,children:[(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(ee,{}),onClick:()=>Oe(1.25),"aria-label":u(`conceptGraphView.zoomInAriaLabel`),tooltip:u(`conceptGraphView.zoomInAriaLabel`)}),(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(y,{}),onClick:()=>Oe(.8),"aria-label":u(`conceptGraphView.zoomOutAriaLabel`),tooltip:u(`conceptGraphView.zoomOutAriaLabel`)}),(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(l,{}),onClick:Ee,"aria-label":u(`conceptGraphView.resetViewAriaLabel`),tooltip:u(`conceptGraphView.resetViewAriaLabel`)})]})]}):(0,K.jsx)(he,{title:u(`conceptGraphView.emptyTitle`),detail:u(`conceptGraphView.emptyDetail`)}),(0,K.jsxs)(`div`,{className:`@container flex select-none flex-col overflow-hidden rounded-xl ${t??``}`,style:{backgroundColor:`var(--surface-base)`},children:[Et?(0,K.jsxs)(`div`,{className:`flex h-12 flex-none items-center gap-2 px-3`,style:{borderBottom:`1px solid var(--border-base)`},children:[i?(0,K.jsx)(M,{variant:`ghost`,iconOnly:n?(0,K.jsx)(d,{}):(0,K.jsx)(x,{}),onClick:i,"aria-label":u(n?`conceptGraphView.exitFullscreenAriaLabel`:`conceptGraphView.enterFullscreenAriaLabel`),tooltip:u(n?`conceptGraphView.exitFullscreenAriaLabel`:`conceptGraphView.enterFullscreenAriaLabel`)}):null,Tt?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(M,{variant:`ghost`,iconOnly:(0,K.jsx)(g,{}),onClick:()=>U(!0),"aria-label":u(`conceptGraphView.searchConceptsAriaLabel`),tooltip:u(`conceptGraphView.searchConceptsAriaLabel`),className:H?`hidden`:`@2xl:hidden`}),(0,K.jsxs)(`div`,{className:`relative ${H?``:`hidden @2xl:block`}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-full px-2.5 py-1`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`},children:[(0,K.jsx)(g,{size:14,"aria-hidden":!0,style:{color:`var(--content-tertiary)`}}),(0,K.jsx)(`input`,{ref:fe,type:`text`,value:B,onChange:e=>{let t=e.target.value;t.trim()&&!W.current&&(z(`search`),W.current=!0),V(t)},onKeyDown:e=>{e.key===`Escape`?(B||H)&&(e.preventDefault(),e.stopPropagation(),V(``),U(!1)):e.key===`Enter`&&J.length>0&&(e.preventDefault(),Z(J[0].id))},placeholder:u(`conceptGraphView.searchConceptsPlaceholder`),"aria-label":u(`conceptGraphView.searchConceptsAriaLabel`),className:`w-36 bg-transparent text-[12px] outline-none placeholder:text-[var(--content-tertiary)]`,style:{color:`var(--content-default)`}}),B?(0,K.jsx)(`span`,{className:`text-[11px] tabular-nums`,style:{color:`var(--content-tertiary)`},children:G?.size??0}):null,B||H?(0,K.jsx)(`button`,{type:`button`,onClick:()=>{V(``),U(!1)},"aria-label":u(`conceptGraphView.clearSearchAriaLabel`),className:`flex items-center`,style:{color:`var(--content-tertiary)`},children:(0,K.jsx)(v,{size:13})}):null]}),B&&J.length>0?(0,K.jsx)(`ul`,{className:`absolute left-0 top-full z-30 mt-1.5 flex max-h-56 w-52 list-none flex-col overflow-y-auto rounded-xl py-1`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 92%, transparent)`,border:`1px solid var(--border-base)`},children:J.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>{Q({id:e.id,label:e.label,updatedAtMs:e.updatedAtMs}),V(``),U(!1)},className:`block w-full truncate px-3 py-1 text-left text-[12px] hover:bg-[color-mix(in_srgb,var(--content-tertiary)_14%,transparent)]`,style:{color:`var(--content-default)`},children:e.label})},e.id))}):null]})]}):null,(0,K.jsx)(`div`,{className:`pointer-events-none mx-auto min-w-0`,children:wt?(0,K.jsx)(`div`,{className:`truncate rounded-full px-3 py-1 text-[12px]`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-default)`},children:wt}):b&&!yt&&!H?(0,K.jsxs)(`div`,{className:`rounded-full px-3 py-1 text-[11px] tabular-nums`,style:{backgroundColor:`color-mix(in srgb, var(--surface-base) 82%, transparent)`,border:`1px solid var(--border-base)`,color:`var(--content-tertiary)`},children:[(0,K.jsxs)(`span`,{className:`@max-md:hidden`,children:[Ct(bt,`neuron`),` · `,Ct(xt,`synapse`),` ·`,` `,Ct(St,`lobe`)]}),(0,K.jsxs)(`span`,{className:`hidden @max-md:inline`,children:[bt,` · `,xt,` · `,St]})]}):null}),s?(0,K.jsx)(`div`,{className:`flex-none`,children:s}):null]}):null,(0,K.jsxs)(`div`,{ref:f,className:`relative min-h-0 flex-1`,style:{backgroundImage:`radial-gradient(circle at center, color-mix(in srgb, var(--content-tertiary) 8%, transparent), transparent 62%)`,touchAction:`none`,cursor:b?`grab`:`default`},onPointerDown:b?ft:void 0,onPointerMove:b?pt:void 0,onPointerUp:b?mt:void 0,onPointerCancel:b?mt:void 0,onPointerLeave:b?ht:void 0,children:[yt?(0,K.jsx)(Te,{onDismiss:de}):null,Dt,b&&F?(0,K.jsx)(we,{assistantId:e,node:F,trail:N,neighbors:Le,onTravel:Ie,onCrumb:Ne,onClose:Me,onOpenThread:o}):null]})]})}async function dt(e,t){let{data:n}=await ie({path:{assistant_id:e},body:{content:t},throwOnError:!0});return n}function ft({open:e,onOpenChange:t,assistantId:n,onCreated:r}){let{t:o}=a(`intelligence`),s=i(),[c,l]=(0,L.useState)(``),[u,d]=(0,L.useState)(!1),f=(0,L.useCallback)(async()=>{let e=c.trim();if(e){d(!0);try{let i=await dt(n,e);if(!i.success){O.error(i.message||o(`createMemoryModal.saveError`));return}O.success(i.pendingNodeId?o(`createMemoryModal.savedFoundToast`):o(`createMemoryModal.savedPendingToast`)),l(``),t(!1),r?.(i.pendingNodeId),await Promise.all([s.invalidateQueries({queryKey:w(n).queryKey}),s.invalidateQueries({queryKey:N(n).queryKey})])}catch(e){let t=e instanceof Error?e.message:o(`createMemoryModal.createError`);O.error(t)}finally{d(!1)}}},[n,c,t,r,s,o]);return(0,K.jsx)(T.Root,{open:e,onOpenChange:t,children:(0,K.jsxs)(T.Content,{size:`sm`,children:[(0,K.jsx)(T.Header,{children:(0,K.jsx)(T.Title,{children:o(`createMemoryModal.title`)})}),(0,K.jsx)(T.Body,{children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,K.jsx)(se,{label:o(`createMemoryModal.contentLabel`),placeholder:o(`createMemoryModal.contentPlaceholder`),value:c,onChange:e=>l(e.target.value),disabled:u,rows:3,fullWidth:!0}),(0,K.jsx)(I,{as:`p`,variant:`body-medium-lighter`,className:`text-(--content-secondary)`,children:o(`createMemoryModal.helperText`)})]})}),(0,K.jsxs)(T.Footer,{children:[(0,K.jsx)(T.Close,{asChild:!0,children:(0,K.jsx)(M,{variant:`outlined`,disabled:u,children:o(`createMemoryModal.cancel`)})}),(0,K.jsx)(M,{variant:`primary`,onClick:f,disabled:u||!c.trim(),leftIcon:u?(0,K.jsx)(S,{className:`animate-spin`}):void 0,children:o(u?`createMemoryModal.creating`:`createMemoryModal.create`)})]})]})})}function pt({onOpenThread:e}){let{t}=a(`intelligence`),n=D(),[i,o]=(0,L.useState)(!1),s=(0,L.useRef)(null),c=r(w(n)),l=r(N(n)),u=c.data?.kind===`ready`&&l.data?.kind===`ready`,d=(0,L.useRef)(!1);return(0,L.useEffect)(()=>{d.current||(d.current=!0,z(`opened`))},[]),(0,K.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[(0,K.jsx)(ut,{assistantId:n,className:`h-full w-full`,onOpenThread:e,handleRef:s,headerAction:u?(0,K.jsx)(M,{variant:`primary`,size:`compact`,leftIcon:(0,K.jsx)(_,{}),onClick:()=>o(!0),children:t(`memoryPage.createMemory`)}):void 0}),u?(0,K.jsx)(ft,{open:i,onOpenChange:o,assistantId:n,onCreated:e=>{e&&s.current?.focusNode(e)}}):null]})}function mt(){let e=s();return(0,K.jsx)(pt,{onOpenThread:t=>{z(`chat_from_node`),ae(e,{prompt:t})}},D())}export{mt as MemoryPageRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{I as t,Jn as n,N as r,Zn as i,j as a}from"./vendor-CV8wawxx.js";import{b as o,t as s}from"./react-DPM_L_aA.js";import{Fd as c,Jh as l,Mi as u,Pd as d,Q as f,ap as p,ld as m,nb as h,ph as g}from"./index-8UA9Y4Ao.js";var _=e(o(),1),v=class extends Error{status;constructor(e,t){super(t),this.name=`SimulateMemoryRouterError`,this.status=e}};async function y(e,t,n){let{data:r,response:i}=await l({path:{assistant_id:e},body:t,signal:n,throwOnError:!1}),a=i?await i.clone().text().catch(()=>``):``;if(!i||!i.ok)throw new v(i?.status??0,a||i?.statusText||`Failed to simulate memory router`);if(!r)throw new v(i.status,`Empty response from memory router simulator endpoint`);return{response:r,rawRequest:JSON.stringify(t,null,2),rawResponse:b(a)}}function b(e){if(e.length===0)return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function x(e){return n({mutationFn:async t=>{if(!e)throw new v(0,`Missing assistantId`);return y(e,t)}})}function S(e){return i({...m({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4})}function ee(e){return i({...c({path:{assistant_id:e}}),enabled:!!e,staleTime:1440*60*1e3})}function C(e){return i({...d({path:{assistant_id:e}}),enabled:!!e,staleTime:1/0})}var w=s();function T(){let{t:e}=a(`chat`),t=u(),n=p(),r=g.use.memoryRouterPlayground();return n?(0,w.jsx)($,{children:e(`memoryRouterPlaygroundPage.loading`)}):!t||!r?(0,w.jsx)($,{children:e(`memoryRouterPlaygroundPage.notAvailable`)}):(0,w.jsx)(D,{})}var E={tier1:``,tier2:``,batch:``,profile:``,customPrompt:``};function D(){let{t:e}=a(`chat`),t=f(),n=x(t),r=x(t),i=S(t),o=ee(t),s=C(t),[c,l]=(0,_.useState)(``),[u,d]=(0,_.useState)([{assistantMessage:``,userMessage:``}]),[p,m]=(0,_.useState)(!1);(0,_.useEffect)(()=>{if(p)return;let e=s.data?.nowText;typeof e==`string`&&c===``&&l(e)},[s.data?.nowText,c,p]);let[h,g]=(0,_.useState)(E),[v,y]=(0,_.useState)(E),[b,T]=(0,_.useState)(null),[D,k]=(0,_.useState)(null),M=u[u.length-1].userMessage,P=t=>{let i=t===`A`?h:v,a=t===`A`?T:k,o=t===`A`?n:r;a(null);let s;try{s=O(i)}catch(t){a(t instanceof Error?t.message:e(`memoryRouterPlaygroundPage.invalidOverrideInput`));return}let l=i.profile.trim().length>0?i.profile:void 0,d=i.customPrompt.trim().length>0?i.customPrompt:void 0,f=u.map((e,t)=>t===u.length-1?{...e,userMessage:e.userMessage.trim()}:e);o.mutate({recentTurnPairs:f,nowText:c,...s?{configOverrides:s}:{},...l===void 0?{}:{profileOverride:l},...d===void 0?{}:{routerPromptOverride:d}})},F=()=>{P(`A`),P(`B`)},I=M.trim().length>0,L=I&&!n.isPending,z=I&&!r.isPending;return(0,w.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-y-auto`,children:(0,w.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-6`,children:[(0,w.jsx)(A,{}),(0,w.jsx)(j,{nowText:c,onNowTextChange:e=>{m(!0),l(e)},onReloadNowText:()=>{let e=s.data?.nowText;typeof e==`string`&&(l(e),m(!1))},nowTextLoading:s.isLoading,pairs:u,onPairsChange:d}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,w.jsx)(N,{paneId:`A`,overrides:h,onChange:g,onRun:()=>P(`A`),canRun:L,isRunning:n.isPending,profiles:i.data?.profiles??[],activeProfile:i.data?.activeProfile??null,defaultPromptTemplate:o.data?.template??``}),(0,w.jsx)(N,{paneId:`B`,overrides:v,onChange:y,onRun:()=>P(`B`),canRun:z,isRunning:r.isPending,profiles:i.data?.profiles??[],activeProfile:i.data?.activeProfile??null,defaultPromptTemplate:o.data?.template??``})]}),(0,w.jsx)(`div`,{className:`flex justify-end`,children:(0,w.jsx)(te,{onClick:F,disabled:!I||n.isPending||r.isPending,isRunning:n.isPending||r.isPending})}),(0,w.jsx)(ne,{visible:n.data!==void 0&&r.data!==void 0}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2`,children:[(0,w.jsx)(R,{paneId:`A`,userMessage:M,mutation:n,otherResult:r.data?.response,validation:b}),(0,w.jsx)(R,{paneId:`B`,userMessage:M,mutation:r,otherResult:n.data?.response,validation:D})]})]})})}function O(e){let t={...k(`tier1_size`,e.tier1),...k(`tier2_size`,e.tier2),...k(`batch_size`,e.batch)};return Object.keys(t).length===0?void 0:t}function k(e,n){let r=n.trim();if(r===``)return{};if(r===`null`)return{[e]:null};let i=Number(r);if(!Number.isInteger(i)||i<1)throw Error(t(`chat:memoryRouterPlaygroundPage.overrideMustBePositiveInteger`,{fieldName:e,value:r}));return{[e]:i}}function A(){let{t:e}=a(`chat`);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`h1`,{className:`text-body-large-default`,style:{color:`var(--content-default)`},children:e(`memoryRouterPlaygroundPage.title`)}),(0,w.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:(0,w.jsx)(r,{ns:`chat`,i18nKey:`memoryRouterPlaygroundPage.description`,components:{code:(0,w.jsx)(`code`,{})}})})]})}function j({nowText:e,onNowTextChange:t,onReloadNowText:n,nowTextLoading:r,pairs:i,onPairsChange:o}){let{t:s}=a(`chat`),c=(e,t)=>{o(i.map((n,r)=>r===e?{...n,...t}:n))},l=()=>{o([{assistantMessage:``,userMessage:``},...i])},u=e=>{e!==i.length-1&&o(i.filter((t,n)=>n!==e))};return(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,w.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:s(`memoryRouterPlaygroundPage.conversationalContextTitle`)}),(0,w.jsx)(M,{id:`memory-router-playground-now`,label:s(`memoryRouterPlaygroundPage.nowBlockLabel`),value:e,onChange:t,rows:6,monospace:!0,placeholder:s(r?`memoryRouterPlaygroundPage.nowLoadingPlaceholder`:`memoryRouterPlaygroundPage.nowDefaultPlaceholder`),trailing:(0,w.jsx)(`button`,{type:`button`,onClick:n,disabled:r,className:`rounded px-2 py-1 text-label-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r?`not-allowed`:`pointer`},children:s(`memoryRouterPlaygroundPage.reloadNowButton`)})}),(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,w.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:s(`memoryRouterPlaygroundPage.recentPairsLabel`)}),(0,w.jsx)(`button`,{type:`button`,onClick:l,className:`rounded px-2 py-1 text-label-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:`pointer`},children:s(`memoryRouterPlaygroundPage.addOlderPairButton`)})]}),i.map((e,t)=>{let n=t===i.length-1;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-md border p-3`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`},children:[(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,w.jsxs)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:[s(`memoryRouterPlaygroundPage.pairLabel`,{index:t+1,total:i.length}),n?s(`memoryRouterPlaygroundPage.pairMostRecentSuffix`):``]}),!n&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>u(t),className:`rounded px-2 py-1 text-label-medium-default`,style:{background:`transparent`,color:`var(--system-negative-strong)`,border:`none`,cursor:`pointer`},children:s(`memoryRouterPlaygroundPage.removeButton`)})]}),(0,w.jsx)(M,{id:`memory-router-playground-pair-${t}-assistant`,label:s(`memoryRouterPlaygroundPage.assistantReplyLabel`),value:e.assistantMessage,onChange:e=>c(t,{assistantMessage:e}),rows:3,placeholder:t===0&&i.length===1?s(`memoryRouterPlaygroundPage.firstTurnAssistantPlaceholder`):s(`memoryRouterPlaygroundPage.assistantReplyPlaceholder`)}),(0,w.jsx)(M,{id:`memory-router-playground-pair-${t}-user`,label:s(n?`memoryRouterPlaygroundPage.justArrivedUserLabel`:`memoryRouterPlaygroundPage.userMessageLabel`),value:e.userMessage,onChange:e=>c(t,{userMessage:e}),rows:3,placeholder:s(n?`memoryRouterPlaygroundPage.lastUserPlaceholder`:`memoryRouterPlaygroundPage.userMessagePlaceholder`),required:n})]},t)})]})})}function M({id:e,label:t,value:n,onChange:r,rows:i,placeholder:a,monospace:o,trailing:s,required:c}){return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(`label`,{htmlFor:e,className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:[t,c?` *`:``]}),s]}),(0,w.jsx)(`textarea`,{id:e,value:n,onChange:e=>r(e.target.value),rows:i,placeholder:a,className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,resize:`vertical`,...o?{fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`}:{}}})]})}function N({paneId:e,overrides:t,onChange:n,onRun:r,canRun:i,isRunning:o,profiles:s,activeProfile:c,defaultPromptTemplate:l}){let{t:u}=a(`chat`);return(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,w.jsx)(`div`,{className:`text-body-medium-default`,style:{color:X(e)},children:u(`memoryRouterPlaygroundPage.configTitle`,{paneId:e})}),(0,w.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,w.jsx)(I,{paneId:e,label:`tier1_size`,value:t.tier1,onChange:e=>n({...t,tier1:e})}),(0,w.jsx)(I,{paneId:e,label:`tier2_size`,value:t.tier2,onChange:e=>n({...t,tier2:e})}),(0,w.jsx)(I,{paneId:e,label:`batch_size`,value:t.batch,onChange:e=>n({...t,batch:e})})]}),(0,w.jsx)(F,{paneId:e,value:t.profile,onChange:e=>n({...t,profile:e}),profiles:s,activeProfile:c}),(0,w.jsx)(P,{paneId:e,value:t.customPrompt,onChange:e=>n({...t,customPrompt:e}),defaultTemplate:l}),(0,w.jsx)(`div`,{className:`flex justify-end`,children:(0,w.jsx)(`button`,{type:`button`,onClick:r,disabled:!i,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:i?`var(--system-positive-strong)`:`var(--surface-overlay)`,color:i?`var(--content-on-positive)`:`var(--content-disabled)`,border:`none`,cursor:i?`pointer`:`not-allowed`},children:o?u(`memoryRouterPlaygroundPage.running`):u(`memoryRouterPlaygroundPage.runPane`,{paneId:e})})})]})})}function P({paneId:e,value:t,onChange:n,defaultTemplate:r}){let{t:i}=a(`chat`),[o,s]=(0,_.useState)(!1),c=`memory-router-playground-${e}-prompt`,l=t.trim().length>0;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>s(e=>!e),className:`text-label-medium-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[o?`▾`:`▸`,` `,i(`memoryRouterPlaygroundPage.systemPrompt`),` `,(0,w.jsxs)(`span`,{style:{color:`var(--content-tertiary)`},children:[`(`,i(l?`memoryRouterPlaygroundPage.promptModeCustom`:`memoryRouterPlaygroundPage.promptModeBundled`),`)`]})]}),o&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`button`,{type:`button`,onClick:()=>n(r),disabled:r.length===0,className:`rounded px-2 py-1 text-label-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:r.length===0?`not-allowed`:`pointer`},children:i(`memoryRouterPlaygroundPage.loadDefault`)}),(0,w.jsx)(`button`,{type:`button`,onClick:()=>n(``),disabled:!l,className:`rounded px-2 py-1 text-label-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`,border:`none`,cursor:l?`pointer`:`not-allowed`},children:i(`memoryRouterPlaygroundPage.reset`)})]})]}),o&&(0,w.jsx)(`textarea`,{id:c,value:t,onChange:e=>n(e.target.value),rows:12,placeholder:i(`memoryRouterPlaygroundPage.customPromptPlaceholder`),className:`rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,resize:`vertical`,minHeight:`120px`}})]})}function F({paneId:e,value:t,onChange:n,profiles:r,activeProfile:i}){let{t:o}=a(`chat`),s=`memory-router-playground-${e}-profile`,c=i!==null&&i.length>0?o(`memoryRouterPlaygroundPage.inheritActiveWithProfile`,{profile:i}):o(`memoryRouterPlaygroundPage.inheritActive`);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`label`,{htmlFor:s,className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:o(`memoryRouterPlaygroundPage.llmProfilesOverride`)}),(0,w.jsxs)(`select`,{id:s,value:t,onChange:e=>n(e.target.value),className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`},children:[(0,w.jsx)(`option`,{value:``,children:c}),r.map(e=>(0,w.jsx)(`option`,{value:e,children:e},e))]})]})}function I({paneId:e,label:t,value:n,onChange:r}){let{t:i}=a(`chat`),o=`memory-router-playground-${e}-${t}`;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`label`,{htmlFor:o,className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:t}),(0,w.jsx)(`input`,{id:o,value:n,onChange:e=>r(e.target.value),placeholder:i(`memoryRouterPlaygroundPage.inheritPlaceholder`),className:`rounded-md border px-3 py-2 text-body-medium-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`}})]})}function te({onClick:e,disabled:t,isRunning:n}){let{t:r}=a(`chat`);return(0,w.jsx)(`button`,{type:`button`,onClick:e,disabled:t,className:`rounded-md px-4 py-2 text-body-medium-default transition-colors`,style:{background:t?`var(--surface-overlay)`:`var(--primary-base)`,color:t?`var(--content-disabled)`:`var(--content-on-primary)`,border:`none`,cursor:t?`not-allowed`:`pointer`},children:r(n?`memoryRouterPlaygroundPage.running`:`memoryRouterPlaygroundPage.runBoth`)})}function ne({visible:e}){let{t}=a(`chat`);return e?(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4 rounded-md px-4 py-2 text-label-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--content-secondary)`},children:[(0,w.jsx)(L,{marker:`●`,markerColor:`var(--content-default)`,label:t(`memoryRouterPlaygroundPage.legendInBoth`)}),(0,w.jsx)(L,{marker:`◆`,markerColor:X(`A`),label:t(`memoryRouterPlaygroundPage.legendAOnly`)}),(0,w.jsx)(L,{marker:`◇`,markerColor:X(`B`),label:t(`memoryRouterPlaygroundPage.legendBOnly`)})]}):null}function L({marker:e,markerColor:t,label:n}){return(0,w.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,w.jsx)(`span`,{style:{color:t},children:e}),(0,w.jsx)(`span`,{children:n})]})}function R({paneId:e,userMessage:t,mutation:n,otherResult:r,validation:i}){let{t:o}=a(`chat`),s=n.data;return(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsx)(V,{paneId:e}),i!==null&&(0,w.jsx)(Q,{message:i}),n.isError&&(0,w.jsx)(Q,{message:n.error instanceof Error?n.error.message:o(`memoryRouterPlaygroundPage.failedToRunSimulation`)}),s!==void 0&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(H,{paneId:e,userMessage:t,result:s.response,otherResult:r}),(0,w.jsx)(z,{paneId:e,rawRequest:s.rawRequest,rawResponse:s.rawResponse})]})]})}function z({paneId:e,rawRequest:t,rawResponse:n}){let{t:r}=a(`chat`),[i,o]=(0,_.useState)(!1);return(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`text-label-medium-default`,style:{color:`var(--content-secondary)`,background:`transparent`,border:`none`,padding:0,cursor:`pointer`,textAlign:`left`},children:[i?`▾`:`▸`,` `,r(`memoryRouterPlaygroundPage.rawApiExchange`)]}),i&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,w.jsx)(B,{label:r(`memoryRouterPlaygroundPage.requestLabel`,{paneId:e}),body:t}),(0,w.jsx)(B,{label:r(`memoryRouterPlaygroundPage.responseLabel`,{paneId:e}),body:n})]})]})})}function B({label:e,body:t}){let{t:n}=a(`chat`);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,w.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,w.jsx)(`pre`,{className:`overflow-auto rounded-md border px-3 py-2 text-body-small-default`,style:{borderColor:`var(--border-base)`,background:`var(--surface-base)`,color:`var(--content-default)`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,maxHeight:`320px`,whiteSpace:`pre`},children:t.length===0?n(`memoryRouterPlaygroundPage.empty`):t})]})}function V({paneId:e}){let{t}=a(`chat`);return(0,w.jsx)(`div`,{className:`text-body-medium-default`,style:{color:X(e)},children:t(`memoryRouterPlaygroundPage.paneTitle`,{paneId:e})})}function H({paneId:e,userMessage:t,result:n,otherResult:r}){let{t:i}=a(`chat`),o=(0,_.useMemo)(()=>U(n,r),[n,r]),s=(0,_.useMemo)(()=>q(n),[n]);return(0,w.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,w.jsx)(G,{result:n,userMessage:t,otherResult:r,counts:(0,_.useMemo)(()=>W(o),[o])}),(0,w.jsx)(K,{result:n}),n.failureReason!==null&&(0,w.jsx)(Q,{message:i(`memoryRouterPlaygroundPage.routerFailure`,{reason:n.failureReason})}),s.length===0?(0,w.jsx)(ae,{}):s.map(t=>(0,w.jsx)(ie,{paneId:e,source:t.source,slugs:t.slugs,scores:n.scores,diff:o},t.source))]})}function U(e,t){let n=new Map;if(t===void 0){for(let t of e.selectedSlugs)n.set(t,`both`);return n}let r=new Set(t.selectedSlugs);for(let t of e.selectedSlugs)n.set(t,r.has(t)?`both`:`only-here`);return n}function W(e){let t=0,n=0;for(let r of e.values())r===`both`?t++:n++;return{total:e.size,shared:t,unique:n}}function G({result:e,userMessage:t,otherResult:n,counts:r}){let{t:i}=a(`chat`),o=[{label:i(`memoryRouterPlaygroundPage.summaryUserMessageLabel`),value:t},{label:i(`memoryRouterPlaygroundPage.totalCandidatePagesLabel`),value:e.totalCandidatePages.toLocaleString()},{label:i(`memoryRouterPlaygroundPage.selectedLabel`),value:i(`memoryRouterPlaygroundPage.selectedValue`,{count:e.selectedSlugs.length,maxPageIds:e.effectiveConfig.max_page_ids})}];return n!==void 0&&o.push({label:i(`memoryRouterPlaygroundPage.diffLabel`),value:i(`memoryRouterPlaygroundPage.diffValue`,{shared:r.shared,unique:r.unique})}),(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,w.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:i(`memoryRouterPlaygroundPage.summary`)}),(0,w.jsx)(Z,{rows:o})]})})}function K({result:e}){let{t}=a(`chat`),n=[`tier1_size`,`tier2_size`,`batch_size`,`max_page_ids`].map(n=>{let r=e.effectiveConfig[n],i=e.overrides[n];return{label:n,value:`${r===null?t(`memoryRouterPlaygroundPage.nullValue`):String(r)}${i===void 0?``:t(`memoryRouterPlaygroundPage.overrideSuffix`)}`}});return n.push({label:t(`memoryRouterPlaygroundPage.llmProfilesOverride`),value:e.profileOverride===null?t(`memoryRouterPlaygroundPage.inheritActive`):`${e.profileOverride}${t(`memoryRouterPlaygroundPage.overrideSuffix`)}`}),n.push({label:t(`memoryRouterPlaygroundPage.systemPromptConfigLabel`),value:e.routerPromptOverridden?t(`memoryRouterPlaygroundPage.promptModeCustom`):t(`memoryRouterPlaygroundPage.promptModeBundled`)}),(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,w.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:t(`memoryRouterPlaygroundPage.effectiveConfig`)}),(0,w.jsx)(Z,{rows:n})]})})}function q(e){let t=new Map;for(let n of e.selectedSlugs){let r=e.sourceBySlug[n];if(r===void 0)continue;let i=t.get(r)??[];i.push(n),t.set(r,i)}return[...t.keys()].sort((e,t)=>J(e)-J(t)).map(e=>({source:e,slugs:t.get(e)}))}function J(e){return e===`tier1`?0:e===`tier2`?1:e.startsWith(`tier3:`)?2+Number(e.slice(6)):2**53-1}function Y(e,t){return e===`tier1`?t(`memoryRouterPlaygroundPage.tier1Label`):e===`tier2`?t(`memoryRouterPlaygroundPage.tier2Label`):e.startsWith(`tier3:`)?t(`memoryRouterPlaygroundPage.tier3Label`,{batch:e.slice(6)}):e}function X(e){return e===`A`?`var(--system-mid-strong)`:`var(--primary-base)`}function re(e,t){return t===`both`?{color:`var(--content-default)`,marker:`●`}:{color:X(e),marker:e===`A`?`◆`:`◇`}}function ie({paneId:e,source:t,slugs:n,scores:r,diff:i}){let{t:o}=a(`chat`);return(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between`,children:[(0,w.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:Y(t,o)}),(0,w.jsx)(`span`,{className:`text-label-medium-default`,style:{color:`var(--content-secondary)`},children:o(`memoryRouterPlaygroundPage.pageCount`,{count:n.length})})]}),(0,w.jsx)(`ul`,{className:`flex flex-col gap-1`,children:n.map(n=>{let{color:a,marker:s}=re(e,i.get(n)??`only-here`);return(0,w.jsxs)(`li`,{className:`flex items-baseline justify-between gap-3`,children:[(0,w.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[(0,w.jsx)(`span`,{style:{color:a},children:s}),(0,w.jsx)(`code`,{className:`text-body-medium-default`,style:{color:a},children:n})]}),t===`tier2`&&(0,w.jsx)(`span`,{className:`tabular-nums text-label-medium-default`,style:{color:`var(--content-secondary)`},children:o(`memoryRouterPlaygroundPage.emaScore`,{score:(r[n]??0).toFixed(3)})})]},n)})})]})})}function ae(){let{t:e}=a(`chat`);return(0,w.jsx)(h,{children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 p-4`,children:[(0,w.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e(`memoryRouterPlaygroundPage.noPagesSelected`)}),(0,w.jsx)(`span`,{className:`text-body-small-lighter`,style:{color:`var(--content-secondary)`},children:e(`memoryRouterPlaygroundPage.emptySelectionHint`)})]})})}function Z({rows:e}){return(0,w.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(({label:e,value:t})=>(0,w.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,w.jsx)(`span`,{className:`shrink-0 text-label-medium-default`,style:{color:`var(--content-secondary)`},children:e}),(0,w.jsx)(`span`,{className:`text-right text-body-medium-lighter`,style:{color:`var(--content-default)`},children:t})]},e))})}function Q({message:e}){return(0,w.jsx)(`div`,{className:`rounded-md px-4 py-3 text-body-medium-default`,style:{background:`var(--surface-overlay)`,color:`var(--system-negative-strong)`},children:e})}function $({children:e}){return(0,w.jsx)(`div`,{className:`flex h-full w-full items-center justify-center p-8 text-label-medium-default`,style:{color:`var(--content-tertiary)`},children:e})}export{T as MemoryRouterPlaygroundPage};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-CV8wawxx.js";import{t}from"./react-DPM_L_aA.js";import{xt as n}from"./icons-J6Mg9wGk.js";import{Ct as r,b as i,v as a,x as o}from"./index-8UA9Y4Ao.js";import{t as s}from"./use-transcript-message-by-id-sDB9lKJT.js";var c=[];function l(e){let t=s(e);return t?t.attachments??c:null}var u=t();function d({payload:t,onClose:s}){let{t:c}=e(`chat`),{displayAttachments:d,renderSquare:f,previewModal:p}=r({attachments:l(t.messageId)??t.attachments,assistantId:t.assistantId});return(0,u.jsxs)(a,{Glyph:n,titleNode:(0,u.jsx)(o,{title:c(`messageFilesPanel.title`),count:d.length}),closeLabel:c(`messageFilesPanel.closeAria`),onClose:s,children:[d.length===0?(0,u.jsx)(i,{children:c(`messageFilesPanel.empty`)}):(0,u.jsx)(`div`,{className:`flex flex-wrap items-start gap-3`,children:d.map((e,t)=>f(e,t))}),p]})}export{d as MessageFilesPanel};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{E as t,j as n,k as r}from"./vendor-CV8wawxx.js";import{b as i,r as a,t as o}from"./react-DPM_L_aA.js";import{Ci as s,Yn as c}from"./icons-J6Mg9wGk.js";import{Gp as l,Qp as u,So as d,Vv as f,Yv as p,Zy as m,ib as h,nb as g,ru as _,xo as v}from"./index-8UA9Y4Ao.js";var y=s(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]),b=e(i(),1),x=r(`AndroidNotificationSettings`);function S(){return l()&&t.isPluginAvailable(`AndroidNotificationSettings`)}async function C(){if(S())try{await x.open()}catch(e){p(e,{context:`android_notification_settings_open`,level:`warning`})}}var w=o();function T(){let{t:e}=n(`settings`),t=S(),[r,i]=(0,b.useState)(null);(0,b.useEffect)(()=>{v().then(i)},[]),_(`app.resume`,({signal:e})=>{e!==`online`&&d().then(i)});let a;switch(r){case`granted`:a={description:e(`androidNotificationSettingsCard.grantedDescription`),label:e(`androidNotificationSettingsCard.grantedLabel`),tone:`positive`};break;case`denied`:a={description:e(`androidNotificationSettingsCard.deniedDescription`),label:e(`androidNotificationSettingsCard.deniedLabel`),tone:`negative`};break;case`prompt`:a={description:e(`androidNotificationSettingsCard.promptDescription`),label:e(`androidNotificationSettingsCard.promptLabel`),tone:`warning`};break;case`unsupported`:a={description:e(`androidNotificationSettingsCard.unsupportedDescription`),label:e(`androidNotificationSettingsCard.unsupportedLabel`),tone:`neutral`};break;default:a={description:e(`androidNotificationSettingsCard.checkingDescription`),label:e(`androidNotificationSettingsCard.checkingLabel`),tone:`neutral`};break}return(0,w.jsx)(g,{padding:`lg`,children:(0,w.jsxs)(`div`,{className:`flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,w.jsxs)(`div`,{className:`flex min-w-0 items-start gap-4`,children:[(0,w.jsx)(`span`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl bg-[var(--surface-base)] text-[var(--content-secondary)]`,children:(0,w.jsx)(y,{className:`size-5`,"aria-hidden":!0})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,w.jsx)(`h2`,{className:`text-title-small text-[var(--content-default)]`,children:e(`androidNotificationSettingsCard.title`)}),(0,w.jsx)(m,{tone:a.tone,children:a.label})]}),(0,w.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-secondary)]`,children:a.description})]})]}),t&&(0,w.jsx)(h,{variant:`outlined`,onClick:()=>void C(),disabled:r===null,rightIcon:(0,w.jsx)(c,{"aria-hidden":!0}),className:`self-start sm:self-auto`,children:e(`androidNotificationSettingsCard.openSettings`)})]})})}function E(){let{t:e}=n(`settings`);return u()?(0,w.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl space-y-6`,children:[(0,w.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,w.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-[var(--surface-lift)] text-[var(--content-secondary)]`,children:(0,w.jsx)(y,{className:`size-5`,"aria-hidden":!0})}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`h1`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:e(`notificationsPage.title`)}),(0,w.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-secondary)]`,children:e(`notificationsPage.description`)})]})]}),(0,w.jsx)(T,{})]}):(0,w.jsx)(a,{replace:!0,to:f.settings.general})}export{E as NotificationsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{b as t,t as n}from"./react-DPM_L_aA.js";import{eo as r,sb as i}from"./index-8UA9Y4Ao.js";var a=e(t(),1),o=n(),s=`var(--surface-overlay)`;function c({children:e,className:t,style:n,bleed:c=!0}){let l=r.use.setSurface(),u=n?.backgroundColor??s;return(0,a.useLayoutEffect)(()=>{if(c)return l(typeof u==`string`?u:s),()=>{l(null)}},[c,u,l]),(0,o.jsx)(`div`,{className:i(`flex min-h-0 flex-1 flex-col rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] px-6 py-5`,c&&`native-mobile:rounded-none native-mobile:border-0`,t),style:n,children:e})}export{c as t};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,d as r,f as i,t as a}from"./react-DPM_L_aA.js";import{Lr as o,Nr as s,R as c,rn as l}from"./icons-J6Mg9wGk.js";import{$_ as u,Hp as d,Lg as f,Q_ as p,Sm as m,Up as h,Vv as g,_m as _,av as v,bm as y,ib as b,m_ as x,py as S,t as C,vm as w,ym as T}from"./index-8UA9Y4Ao.js";import{r as E}from"./self-hosted-servers-CSmSutTd.js";var D=e(n(),1),O=a();function k(e){switch(e.kind){case`starting`:return{title:`Starting pairing`,body:`Creating a code for this browser.`};case`handoff_choice`:return{title:`Open in the Vellum app`,body:`Scanning from a phone with the Vellum app installed? Hand this pairing to the app.`};case`verifying`:return{title:`Pairing`,body:`Connecting this device to your assistant.`};case`approved`:return{title:`Connected`,body:`Opening your assistant.`};case`expired`:return{title:`Pairing expired`,body:`This pairing code is invalid or expired. Run vellum pair on the machine running your assistant to get a new one.`};case`error`:return{title:`Pairing failed`,body:e.message};case`polling`:return{title:`Waiting for approval`,body:`Confirm this code on the machine running your assistant.`}}}function A({state:e}){return e.kind===`approved`?(0,O.jsx)(s,{className:`h-5 w-5 text-[var(--system-positive-strong)]`,"aria-hidden":!0}):e.kind===`handoff_choice`?(0,O.jsx)(c,{className:`h-5 w-5 text-[var(--system-info-strong)]`,"aria-hidden":!0}):e.kind===`starting`||e.kind===`verifying`||e.kind===`polling`?(0,O.jsx)(l,{className:`h-5 w-5 animate-spin text-[var(--system-info-strong)]`,"aria-hidden":!0}):(0,O.jsx)(o,{className:`h-5 w-5 text-[var(--system-negative-strong)]`,"aria-hidden":!0})}function j(){try{let e=new URL(window.location.href);for(let t of[`deviceCode`,`device_code`,`userCode`,`user_code`])e.searchParams.delete(t);e.hash=``,window.history.replaceState(null,``,`${e.pathname}${e.search}`)}catch{}}var M=`vellum-assistant`,N=`ai.vellum.assistant`;function P(e,t){let n=new URLSearchParams({url:m(),code:e}),r=p();r&&n.set(`name`,r);let i=n.toString().replace(/\+/g,`%20`);return t===`ios`?`${M}://connect?${i}`:`intent://connect?${i}#Intent;scheme=${M};package=${N};S.browser_fallback_url=${encodeURIComponent(window.location.href)};end`}function F(){let e=u();if(!e)return null;try{return`${new URL(e).origin}${g.selectAssistant}?noAutoSkip=1`}catch{return null}}function I({deviceCode:e,platform:n,onContinueInBrowser:r}){let{t:i}=t(`remote-web`);return(0,O.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[(0,O.jsx)(b,{variant:`primary`,fullWidth:!0,asChild:!0,children:(0,O.jsx)(`a`,{href:(0,D.useMemo)(()=>P(e,n),[e,n]),children:i(`pairingPage.openInApp`)})}),(0,O.jsx)(b,{variant:`outlined`,fullWidth:!0,onClick:r,children:i(`pairingPage.continueInBrowser`)})]})}function L(){let{t:e}=t(`remote-web`),n=r(),a=i(),o=v(),s=(0,D.useMemo)(()=>x(new URLSearchParams(n.search).get(`returnTo`),g.assistant),[n.search]),c=(0,D.useMemo)(()=>S(`${n.pathname}${n.search}${n.hash}`),[n.pathname,n.search,n.hash]),l=(0,D.useMemo)(()=>!c.deviceCode||f()?null:d()?`android`:h()?`ios`:null,[c.deviceCode]),[u,p]=(0,D.useState)(()=>c.deviceCode?{deviceCode:c.deviceCode,userCode:c.userCode}:null),[m,M]=(0,D.useState)(()=>!l),[N,P]=(0,D.useState)(()=>l?{kind:`handoff_choice`}:c.deviceCode?{kind:`verifying`}:{kind:`starting`});(0,D.useEffect)(()=>{if(!o||u)return;let e=new AbortController;return(async()=>{try{let t=await T(e.signal);p({deviceCode:t.deviceCode,userCode:t.userCode}),P({kind:`polling`,expiresAt:t.expiresAt})}catch{if(e.signal.aborted)return;P({kind:`error`,message:`The assistant could not start pairing. Refresh the page to try again.`})}})(),()=>{e.abort()}},[o,u]),(0,D.useEffect)(()=>{if(!o||!u?.deviceCode||!m)return;let e=new AbortController,t=null,n=async()=>{try{let r=await y(u.deviceCode,e.signal);if(r.status===`pending`){P({kind:`polling`,expiresAt:r.expiresAt||null}),t=setTimeout(()=>void n(),Math.max(1,r.intervalSeconds)*1e3);return}w(r),j(),P({kind:`approved`}),t=setTimeout(()=>a(s,{replace:!0}),250)}catch(t){if(e.signal.aborted)return;if(t instanceof _&&t.status===401){P({kind:`expired`});return}if(t instanceof _&&t.code===`GUARDIAN_REPAIR_REQUIRED`){P({kind:`error`,message:`The assistant's trust database needs repair. Run guardian repair on the machine hosting the assistant, then retry this same pairing link — the code stays valid.`});return}P({kind:`error`,message:`The assistant could not complete pairing. Try starting a new pairing.`})}};return n(),()=>{e.abort(),t&&clearTimeout(t)}},[o,u?.deviceCode,m,a,s]);let L=(0,D.useCallback)(()=>{M(!0),P({kind:`verifying`})},[]),R=(0,D.useMemo)(()=>F(),[]),z=(0,D.useCallback)(()=>{E(null,`select-assistant?noAutoSkip=1`).then(e=>{!e&&R&&window.location.assign(R)})},[R]);if(!o)return(0,O.jsx)(C,{});let B=k(N);return(0,O.jsx)(`main`,{className:`flex min-h-svh items-center justify-center bg-[var(--surface-base)] px-6 py-10 text-[var(--content-default)]`,children:(0,O.jsxs)(`section`,{className:`w-full max-w-md rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] p-8 shadow-[var(--shadow-sm)]`,children:[(0,O.jsxs)(`div`,{className:`mb-5 flex items-center gap-3`,children:[(0,O.jsx)(A,{state:N}),(0,O.jsx)(`h1`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:B.title})]}),N.kind===`polling`&&u?.userCode?(0,O.jsxs)(`div`,{className:`mb-5 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-4 text-center`,children:[(0,O.jsx)(`div`,{className:`text-label-small-default uppercase tracking-wide text-[var(--content-tertiary)]`,children:e(`pairingPage.pairingCode`)}),(0,O.jsx)(`div`,{className:`mt-2 font-mono text-3xl font-semibold tracking-[0.18em] text-[var(--content-emphasised)]`,children:u.userCode})]}):null,(0,O.jsx)(`p`,{className:`text-body-medium-lighter leading-6 text-[var(--content-secondary)]`,children:B.body}),N.kind===`handoff_choice`&&u&&l?(0,O.jsx)(I,{deviceCode:u.deviceCode,platform:l,onContinueInBrowser:L}):null,N.kind===`polling`&&N.expiresAt?(0,O.jsx)(`p`,{className:`text-body-small-lighter mt-4 text-[var(--content-tertiary)]`,children:e(`pairingPage.expiresAt`,{time:new Date(N.expiresAt).toLocaleTimeString()})}):null,N.kind===`polling`&&R?(0,O.jsx)(b,{variant:`outlined`,fullWidth:!0,className:`mt-6`,onClick:z,children:e(`pairingPage.cancel`)}):null]})})}export{L as RemoteWebPairingPage};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./react-DPM_L_aA.js";import{Vv as n}from"./index-8UA9Y4Ao.js";var r=t();function i(){return(0,r.jsx)(e,{to:n.account.login,replace:!0})}export{i as PasswordResetPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./react-DPM_L_aA.js";import{t}from"./preview-error-Z2VhCOcU.js";import{Yn as n,gn as r,qn as i}from"./index-8UA9Y4Ao.js";var a=e();function o({blob:e,filename:o}){let s=i(e,`application/pdf`);return s===null?(0,a.jsx)(n,{}):(0,a.jsx)(`span`,{className:`block w-full [&_[data-slot=skeleton]]:w-full! [&_canvas]:w-full!`,children:(0,a.jsx)(r,{url:s,errorFallback:(0,a.jsx)(t,{filename:o})})})}export{o as PdfFilePreview};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{I as t,Zn as n,dn as r,er as i,fn as a,j as o,ln as s}from"./vendor-CV8wawxx.js";import{b as c,f as l,t as u}from"./react-DPM_L_aA.js";import{P as d,hi as f}from"./icons-J6Mg9wGk.js";import{Ci as p,Q as m,Ry as h,Vv as g,co as _,eo as v,fp as y,sb as b,wi as x,xi as S}from"./index-8UA9Y4Ao.js";import{i as C,n as w,r as T,t as E}from"./personality-sliders-NpMaqjxr.js";import{n as D,t as O}from"./peeking-eyes-DzPVjsGl.js";import{a as k,i as A,n as j,r as M,t as N}from"./use-assistant-identity-details-B_Xl6WaJ.js";import{r as P}from"./latest-assistant-text-BOWFdsws.js";var F=e(c(),1),I=u();function L({components:e,traits:t,stage:n,entrance:r=!1,entranceDelay:i=0}){let a=(0,F.useMemo)(()=>{let n=e.eyeStyles.find(e=>e.id===t.eyeStyle);return n?{paths:n.paths,bbox:p(n.paths.map(e=>S(e.svgPath)))}:null},[e,t.eyeStyle]);return a?(0,I.jsx)(D,{art:a,stage:n,entrance:r,entranceDelay:i}):null}var R=`#17191C`,z=24,B=.2,V=96,H=160,U=(0,F.createContext)(null);function W(){let e=(0,F.useContext)(U);if(!e)throw Error(`useAssistantStage must be used inside <AssistantStage>`);return e}function G({components:e,traits:t,customImageUrl:n,accentHex:r,entrance:i=!1,children:a,className:o}){let{ref:s,size:c}=x(),l=r??R,u=_(l),d=v.use.setSurface();(0,F.useLayoutEffect)(()=>(d(l),()=>{d(null)}),[l,d]);let f=!!(e&&t),p=!f&&!!n,m=Math.round(Math.min(H,Math.max(V,Math.min(c.w,c.h)*B))),h=c.h-m-z,g=f?Math.round(O*Math.min(c.w,c.h))+16:p?m+z+16:24;return(0,I.jsxs)(`div`,{ref:s,className:b(`relative flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-[var(--border-base)]`,`native-mobile:rounded-none native-mobile:border-0`,o),style:{backgroundColor:l,color:u.fg},children:[f&&e&&t&&(0,I.jsx)(L,{components:e,traits:t,stage:c,entrance:i}),p&&n&&(0,I.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2] overflow-hidden rounded-full ring-4 ring-white/25`,style:{left:(c.w-m)/2,top:h,width:m,height:m},children:(0,I.jsx)(`img`,{src:n,alt:``,className:`h-full w-full object-cover`,draggable:!1})}),(0,I.jsx)(U.Provider,{value:{stage:c,tone:u,bottomReserve:g},children:(0,I.jsx)(`div`,{className:`relative z-10 flex min-h-0 flex-1 flex-col`,children:a})})]})}var K=`rgba(36, 41, 46, 0.25)`,q=`#FDFDFC`;function J({axis:e,value:t,onValueChange:n,tone:i,disabled:c}){let{t:l}=o(`intelligence`),u=l(e.leftKey),d=l(e.rightKey);return(0,I.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:c?.7:1},children:[(0,I.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:i.fg},children:u}),(0,I.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:i.fg},children:d}),(0,I.jsxs)(s,{"data-owns-horizontal-drag":``,className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??k),disabled:c,min:0,max:100,step:1,"aria-label":l(`personalitySliderRow.rangeAriaLabel`,{left:u,right:d}),children:[(0,I.jsx)(a,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:K}}),(0,I.jsx)(r,{className:`block h-5 w-5 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100 sm:h-6 sm:w-6`,style:{backgroundColor:q}})]})]})}async function Y({assistantId:e,values:n,assistantName:r}){return M({assistantId:e,content:P(n,void 0,r),title:t(`applyPersonalityUpdate.conversationTitle`,{ns:`intelligence`}),context:`identity_personality_update`})}function X(){let{t:e}=o(`intelligence`),t=m(),r=l(),a=i(),{components:s,traits:c,customImageUrl:u,accentHex:d}=y(t),f=j(t),p=n({queryKey:T(t),queryFn:()=>w(t)}),[_,v]=(0,F.useState)(null),[b,x]=(0,F.useState)(!1),S=_??p.data??{},D=f.data?.identity?.name||e(`identityOverview.defaultAssistantName`);return(0,I.jsx)(G,{components:s,traits:c,customImageUrl:u,accentHex:d,entrance:!0,children:(0,I.jsx)(Z,{assistantName:D,values:S,onValueChange:(e,t)=>v({...S,[e]:t}),applying:b,onUpdate:()=>{x(!0);let n=E(S);Y({assistantId:t,values:n,assistantName:f.data?.identity?.name}).then(async i=>{x(!1),i?(await C(t,n),a.invalidateQueries({queryKey:T(t)}),a.invalidateQueries({queryKey:N(t)}),h.success(e(`personalityPage.updateSuccessToast`)),r(g.identity)):h.error(e(`personalityPage.updateErrorToast`))})},onBack:()=>void r(g.identity)})})}function Z({assistantName:e,values:t,onValueChange:n,applying:r,onUpdate:i,onBack:a}){let{t:s}=o(`intelligence`),{tone:c,bottomReserve:l}=W();return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`button`,{type:`button`,onClick:a,className:`absolute top-4 left-4 z-20 flex cursor-pointer items-center gap-1.5 rounded-full py-2 pr-4 pl-3 text-body-medium-default backdrop-blur-sm transition-all duration-150 active:scale-[0.97] ${c.isLight?`bg-black/10 hover:bg-black/20`:`bg-white/10 hover:bg-white/20`}`,style:{color:c.fg},children:[(0,I.jsx)(f,{className:`h-4 w-4`,"aria-hidden":!0}),s(`personalityPage.back`)]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:l},children:[(0,I.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:`12%`}}),(0,I.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2 text-center`,children:[(0,I.jsx)(`h1`,{className:`text-[2.6rem] leading-none max-sm:text-[2rem]`,style:{fontFamily:`var(--font-serif)`},children:s(`personalityPage.title`)}),(0,I.jsx)(`p`,{className:`max-w-md text-[15px]`,style:{color:c.fgMuted},children:s(`personalityPage.subtitle`)})]}),(0,I.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),(0,I.jsx)(`div`,{className:`flex w-full max-w-2xl shrink-0 flex-col`,children:A.map((e,i)=>(0,I.jsxs)(F.Fragment,{children:[i>0&&(0,I.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,I.jsx)(J,{axis:e,value:t[e.id]??k,onValueChange:t=>n(e.id,t),tone:c,disabled:r})]},e.id))}),(0,I.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-12`}),(0,I.jsx)(`button`,{type:`button`,onClick:i,disabled:r,className:`flex min-h-11 min-w-[240px] max-w-full shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] px-6 py-2 text-body-medium-default transition-transform duration-150 active:scale-[0.97] disabled:cursor-default disabled:opacity-80 disabled:active:scale-100`,style:{backgroundColor:c.isLight?`#1A1A1A`:`#FFFFFF`,color:c.isLight?`#FFFFFF`:`#1A1A1A`},children:r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-transparent`,style:{borderTopColor:c.isLight?`#FFFFFF`:`#1A1A1A`,borderRightColor:c.isLight?`#FFFFFF`:`#1A1A1A`}}),(0,I.jsx)(`span`,{className:`min-w-0 text-center`,children:s(`personalityPage.updatingPersonality`,{name:e})})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(d,{className:`h-4 w-4`,"aria-hidden":!0}),s(`personalityPage.updatePersonality`)]})})]})]})}export{X as PersonalityPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CV8wawxx.js";import{b as i,r as a,t as o}from"./react-DPM_L_aA.js";import{Iu as s,Q as c,Ry as l,Vv as u,Vy as d,ch as f,ib as p}from"./index-8UA9Y4Ao.js";import{t as m}from"./detail-card-BxI8klTT.js";import{i as h,n as g,r as _,t as v}from"./personality-sliders-NpMaqjxr.js";var y=e(i(),1),b=o(),x=[{id:f.companionCoworker,leftKey:`personalityPage.axes.companionCoworker.left`,rightKey:`personalityPage.axes.companionCoworker.right`},{id:f.genzBoomer,leftKey:`personalityPage.axes.genzBoomer.left`,rightKey:`personalityPage.axes.genzBoomer.right`},{id:f.executeCollaborate,leftKey:`personalityPage.axes.executeCollaborate.left`,rightKey:`personalityPage.axes.executeCollaborate.right`},{id:f.playfulSerious,leftKey:`personalityPage.axes.playfulSerious.left`,rightKey:`personalityPage.axes.playfulSerious.right`},{id:f.politeUnfiltered,leftKey:`personalityPage.axes.politeUnfiltered.left`,rightKey:`personalityPage.axes.politeUnfiltered.right`}];function S(){let{t:e}=r(`settings`),i=c(),o=n(),f=s.use.vellumHostedInference(),S=s.use.hasHydrated(),C=t({queryKey:_(i),queryFn:()=>g(i)}),[w,T]=(0,y.useState)(null),[E,D]=(0,y.useState)(!1),O=w??C.data??{};if(S&&!f)return(0,b.jsx)(a,{replace:!0,to:u.settings.general});let k=()=>{D(!0),h(i,v(O)).then(t=>{D(!1),t?(o.invalidateQueries({queryKey:_(i)}),l.success(e(`personalityPage.saveSuccessToast`))):l.error(e(`personalityPage.saveErrorToast`))})},A=E||C.isLoading;return(0,b.jsxs)(`div`,{"data-slot":`personality-page`,className:`space-y-6`,children:[(0,b.jsx)(m,{title:e(`personalityPage.title`),subtitle:e(`personalityPage.subtitle`),children:C.isError?(0,b.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`personalityPage.loadError`)}):(0,b.jsx)(`div`,{className:`flex flex-col gap-6`,children:x.map(t=>{let n=e(t.leftKey),r=e(t.rightKey);return(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,b.jsx)(`span`,{children:n}),(0,b.jsx)(`span`,{children:r})]}),(0,b.jsx)(d,{value:O[t.id]??50,onValueChange:e=>{typeof e==`number`&&T({...O,[t.id]:e})},min:0,max:100,step:1,disabled:A,"aria-label":e(`personalityPage.rangeAriaLabel`,{left:n,right:r})})]},t.id)})})}),(0,b.jsx)(p,{onClick:k,disabled:A||C.isError,children:e(E?`personalityPage.saving`:`personalityPage.save`)})]})}export{S as SettingsPersonalityPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jn as t,N as n,Zn as r,er as i,j as a}from"./vendor-CV8wawxx.js";import{b as o,f as s,g as c,t as l}from"./react-DPM_L_aA.js";import{Cn as u,Nr as d,hi as f,rn as p,sr as m,v as h,z as g}from"./icons-J6Mg9wGk.js";import{A as _,C as v,D as y,F as b,H as x,M as S,N as C,O as w,P as ee,R as T,T as E,V as te,a as ne,d as re,g as ie,h as ae,i as oe,j as D,k as se,m as O,n as ce,o as le,p as ue,r as de,t as fe,x as k,z as pe}from"./use-checkout-dismiss-refresh-B9TBs5mG.js";import{By as A,Fr as j,Hv as M,Iv as N,Mg as me,Oy as P,Pg as F,Qf as he,Qp as ge,Ry as _e,Vv as I,Xf as ve,Zf as ye,Zy as be,al as xe,bp as Se,e_ as Ce,fl as we,gl as Te,hl as Ee,ib as L,il as De,ll as Oe,ml as ke,ol as Ae,op as je,rb as R,sl as z}from"./index-8UA9Y4Ao.js";import{t as Me}from"./android-billing-handoff-CCX_qjXn.js";import{t as Ne}from"./checkout-return-target-C7v_E-4b.js";import{i as B,r as Pe,s as Fe,t as V}from"./machine-sizes-C3GmmuDZ.js";var H=e(o(),1),Ie=`__none__`,U=`__baseline__`,W=`${B[V]} machine (${Pe[V]})`;function Le(e){let{proPlan:t,seed:n,machineTier:r,storageTier:i,creditChoice:a,noBundleLabel:o}=e,s=t.machine_tiers,c=t.storage_tiers,l=t.credit_tiers??[],u=r===U,d=u?null:s.find(e=>e.tier===r)??null,f=u?W:d?.description??null,p=c.find(e=>e.tier===i)??null,m=a&&a!==`__none__`?l.find(e=>e.tier===a)??null:null,h=n!=null&&n.machineTier!=null?s.find(e=>e.tier===n.machineTier)??null:null,g=n==null?null:n.machineTier??`__baseline__`,_=n==null?void 0:n.machineTier==null?W:h?.description,v=n==null?null:c.find(e=>e.tier===n.storageTier)??null,y=n!=null&&n.creditTier!=null?l.find(e=>e.tier===n.creditTier)??null:null,b=n!=null&&n.machineTier!=null&&h==null,x=n!=null&&v==null,S=[{key:`base`,label:`Platform fee: ${se(t.base_price_cents)}`,changed:!1}];if(f!=null){let e=n!=null&&!b&&g!==r;S.push({key:`machine`,label:f,previousLabel:e?_:void 0,changed:e})}if(p!=null){let e=n!=null&&!x&&v?.tier!==p.tier;S.push({key:`storage`,label:D(p.storage_gib),previousLabel:e&&v!=null?D(v.storage_gib):void 0,changed:e})}let C=a===`__none__`?o:m==null?null:m.label;if(C!=null){let e=n!=null&&(n.creditTier??`__none__`)!==a,t=n?.creditTier==null?o:y?.label;S.push({key:`credit`,label:C,previousLabel:e?t:void 0,changed:e})}let w=t.base_price_cents+(d?.price_cents??0)+(p?.price_cents??0)+(m?.price_cents??0),ee=b||x||n!=null&&n.creditTier!=null&&y==null;if(n==null||ee)return{totalCents:w,previousTotalCents:null,deltaCents:null,rows:S};let T=t.base_price_cents+(h?.price_cents??0)+(v?.price_cents??0)+(y?.price_cents??0);return{totalCents:w,previousTotalCents:T,deltaCents:w-T,rows:S}}var Re=`https://www.vellum.ai/docs/pricing`,ze=`${Re}#machine-sizes`,Be=`${Re}#storage`,Ve=`${Re}#credit-bundles`,G=l();function K(e){return(0,G.jsxs)(`span`,{className:`text-[12px] font-medium text-[var(--content-disabled)]`,children:[`+`,se(e)]})}function q({label:e,docsUrl:t,docsLabel:n,learnMore:r}){return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-secondary)]`,children:e}),(0,G.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,"aria-label":n,onClick:e=>me(e,t),className:`text-[11px] font-medium text-[var(--content-tertiary)] underline hover:text-[var(--content-default)]`,children:r})]})}function He({open:e,proPlan:t,pending:n,currentStorageGib:r,initialSelection:i,onClose:o,onContinue:s}){let{t:c}=a(`settings`),l=c(`customPlanModal.noExtraUsage`),f=e?i??null:null,[p,h]=(0,H.useState)(()=>f?f.machineTier??`__baseline__`:``),[_,v]=(0,H.useState)(()=>f?.storageTier??``),[b,S]=(0,H.useState)(()=>f?f.creditTier??`__none__`:``),[C,ee]=(0,H.useState)({open:e,initialSelection:i});(C.open!==e||C.initialSelection!==i)&&(ee({open:e,initialSelection:i}),h(f?f.machineTier??`__baseline__`:``),v(f?.storageTier??``),S(f?f.creditTier??`__none__`:``));let T=t.machine_tiers,E=(0,H.useMemo)(()=>t.storage_tiers.filter(e=>!e.legacy||e.tier===i?.storageTier),[t.storage_tiers,i?.storageTier]),te=t.credit_tiers??[],ne=(0,H.useMemo)(()=>(t.credit_tiers??[]).filter(e=>!e.legacy),[t.credit_tiers]),re=e=>k(e)||e.legacy&&e.tier!==i?.storageTier||r!=null&&e.storage_gib<r,ie=i!=null&&i.machineTier==null,ae=[...ie?[{value:U,label:W,icon:(0,G.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0}),disabled:!0}]:[],...T.map(e=>({value:e.tier,label:e.description,icon:(0,G.jsx)(x,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:K(e.price_cents),disabled:k(e)}))],oe=E.map(e=>({value:e.tier,label:e.label,icon:(0,G.jsx)(u,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:K(e.price_cents),disabled:re(e)})),D=b&&b!==`__none__`?te.find(e=>e.tier===b)??null:null,O=D?.legacy?D:null,ce=[{value:Ie,label:l,icon:(0,G.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0})},...ne.map(e=>({value:e.tier,label:e.label,icon:(0,G.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:K(e.price_cents)})),...O?[{value:O.tier,label:O.label,icon:(0,G.jsx)(m,{className:`h-4 w-4`,"aria-hidden":!0}),suffix:K(O.price_cents),disabled:!0}]:[]],le=p===U,ue=le?null:T.find(e=>e.tier===p)??null,de=le?ie?{tier:null}:null:ue==null?null:{tier:ue.tier},fe=_!==``&&_===i?.storageTier,pe=E.find(e=>e.tier===_&&(fe||!re(e)))??null,j=b===`__none__`||b===i?.creditTier||ne.some(e=>e.tier===b),M=b!==``&&j?b:null,N=de!=null&&pe!=null&&M!=null,me=i!=null&&p===(i.machineTier??`__baseline__`)&&_===i.storageTier&&b===(i.creditTier??`__none__`),F=(0,H.useMemo)(()=>Le({proPlan:t,seed:i??null,machineTier:p,storageTier:_,creditChoice:b,noBundleLabel:l}),[t,i,p,_,b,l]);return(0,G.jsx)(A.Root,{open:e,onOpenChange:e=>{e||o()},children:(0,G.jsx)(A.Content,{size:`lg`,"data-theme":`light`,hideCloseButton:!0,overlayClassName:`backdrop-blur-[2px]`,className:`max-w-[820px] md:min-h-[min(608px,calc(100vh-4rem))]`,children:(0,G.jsx)(A.Body,{className:`p-4`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-8 md:flex-row md:gap-12`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6 md:flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--surface-active)] p-[14px]`,children:(0,G.jsx)(g,{className:`h-6 w-6 text-[var(--content-emphasised)]`,"aria-hidden":!0})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,G.jsx)(A.Title,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:c(`customPlanModal.title`)}),(0,G.jsx)(A.Description,{className:`mt-0 text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:c(`customPlanModal.subtitle`)})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(q,{label:c(`customPlanModal.machineSizeLabel`),docsUrl:ze,docsLabel:c(`customPlanModal.machineSizeDocsAriaLabel`),learnMore:c(`customPlanModal.learnMore`)}),(0,G.jsx)(P,{"aria-label":c(`customPlanModal.machineSizeAriaLabel`),placeholder:c(`customPlanModal.machineSizePlaceholder`),value:p,onChange:h,options:ae})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(q,{label:c(`customPlanModal.storageLabel`),docsUrl:Be,docsLabel:c(`customPlanModal.storageDocsAriaLabel`),learnMore:c(`customPlanModal.learnMore`)}),(0,G.jsx)(P,{"aria-label":c(`customPlanModal.storageAriaLabel`),placeholder:c(`customPlanModal.storagePlaceholder`),value:_,onChange:v,options:oe})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(q,{label:c(`customPlanModal.usageBundleLabel`),docsUrl:Ve,docsLabel:c(`customPlanModal.usageBundleDocsAriaLabel`),learnMore:c(`customPlanModal.learnMore`)}),(0,G.jsx)(P,{"aria-label":c(`customPlanModal.usageBundleAriaLabel`),placeholder:c(`customPlanModal.usageBundlePlaceholder`),value:b,onChange:S,options:ce})]})]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-16 md:pt-[5px]`,children:[(0,G.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:c(`customPlanModal.recap`)}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:se(F.totalCents)}),F.deltaCents!=null&&F.deltaCents!==0&&F.previousTotalCents!=null&&(0,G.jsx)(`span`,{className:`text-[12px] font-medium ${F.deltaCents>0?`text-[var(--system-positive-strong)]`:`text-[var(--system-negative-strong)]`}`,children:c(`customPlanModal.comparedToPrevious`,{delta:y(F.deltaCents),previous:w(F.previousTotalCents)})}),(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:c(`customPlanModal.totalBilledMonthly`)})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:c(`customPlanModal.yourSelection`)}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:F.rows.map(e=>(0,G.jsxs)(`li`,{className:`flex flex-col gap-2`,children:[e.previousLabel!=null&&(0,G.jsxs)(`div`,{className:`relative flex w-fit items-start gap-2`,children:[(0,G.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-disabled)]`,"aria-hidden":!0}),(0,G.jsx)(`s`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-disabled)] no-underline`,children:e.previousLabel}),(0,G.jsx)(`span`,{"aria-hidden":!0,className:`pointer-events-none absolute -left-1 right-0 top-[9px] h-px bg-[var(--content-disabled)]`})]}),(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 ${e.changed?`text-[var(--system-positive-strong)]`:`text-[var(--content-secondary)]`}`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium leading-[18px] text-[var(--content-secondary)]`,children:e.label})]})]},e.key))}),(0,G.jsx)(L,{variant:`primary`,fullWidth:!0,disabled:!N||me||n,onClick:()=>{!N||me||n||s({machineTier:de.tier,storageTier:pe.tier,creditTier:M===`__none__`?null:M})},children:c(`customPlanModal.continue`)}),(0,G.jsx)(L,{variant:`ghost`,fullWidth:!0,disabled:n,onClick:o,children:c(`customPlanModal.cancel`)})]})]})]})})})})}function Ue({className:e,onConfigure:t,configureDisabled:n,isCurrent:r=!1,currentSummary:i}){let{t:o}=a(`settings`);return(0,G.jsxs)(`div`,{className:`flex w-full flex-col items-center gap-8 ${e??``}`,children:[(0,G.jsx)(`p`,{className:`text-center text-[20px] font-medium text-[var(--content-tertiary)]`,children:o(`customPlanRow.prompt`)}),(0,G.jsxs)(`div`,{className:`flex w-[840px] max-w-full flex-col items-start gap-4 rounded-2xl bg-[var(--surface-lift)] p-4 sm:flex-row sm:items-center sm:justify-between sm:gap-6`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center rounded-xl bg-[var(--content-disabled)] p-[14px]`,children:(0,G.jsx)(g,{className:`h-6 w-6 text-[var(--aux-white)]`,"aria-hidden":!0})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[16px] font-medium text-[var(--content-emphasised)]`,children:o(`customPlanRow.title`)}),r?(0,G.jsx)(be,{className:`bg-[var(--feed-digest-weak)] text-[var(--content-default)]`,children:o(`customPlanRow.currentPlanTag`)}):null]}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-tertiary)]`,children:i??o(`customPlanRow.genericDescriptor`)})]})]}),(0,G.jsx)(`div`,{className:`flex shrink-0 items-center gap-3`,children:(0,G.jsx)(L,{variant:`outlined`,onClick:t,disabled:n,children:o(`customPlanRow.configure`)})})]})]})}function We({open:e,lostFeatures:t,viaPortal:n,pending:r,onCancel:i,onConfirm:o}){let{t:s}=a(`settings`),c=t.length>0;return(0,G.jsx)(A.Root,{open:e,onOpenChange:e=>{!e&&!r&&i()},children:(0,G.jsxs)(A.Content,{size:`md`,hideCloseButton:!0,children:[(0,G.jsx)(A.Header,{icon:h,children:(0,G.jsx)(A.Title,{children:s(`freeDowngradeConfirmModal.title`)})}),(0,G.jsxs)(A.Body,{children:[(0,G.jsx)(R,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:s(n?c?`freeDowngradeConfirmModal.bodyWithFeaturesPortal`:`freeDowngradeConfirmModal.bodyCancelOnlyPortal`:c?`freeDowngradeConfirmModal.bodyWithFeatures`:`freeDowngradeConfirmModal.bodyCancelOnly`)}),c?(0,G.jsx)(`ul`,{className:`mt-4 list-disc space-y-2 pl-5`,children:t.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsx)(R,{as:`span`,variant:`body-medium-default`,children:e})},e))}):null]}),(0,G.jsxs)(A.Footer,{children:[(0,G.jsx)(L,{variant:`outlined`,onClick:i,disabled:r,children:s(`freeDowngradeConfirmModal.cancel`)}),(0,G.jsx)(L,{variant:`danger`,onClick:o,disabled:r,"data-testid":`confirm-free-downgrade-button`,children:s(`freeDowngradeConfirmModal.confirm`)})]})]})})}function Ge({tierKey:e,name:t,tagline:n,priceLabel:r,priceCaption:i,ctaLabel:o,features:s,recommended:c=!1,tone:l=`dark`,isCurrent:u,intent:f=`upgrade`,pending:p,onCta:m}){let{t:h}=a(`settings`),g=f===`downgrade`&&!u;return(0,G.jsxs)(`div`,{"data-theme":l,className:`flex w-full flex-col gap-3 rounded-2xl bg-[var(--surface-lift)] p-3 sm:gap-4 sm:p-4`,children:[(0,G.jsx)(C,{tier:e,size:50}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex h-8 items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-[20px] font-medium text-[var(--content-emphasised)]`,children:t}),c&&!g&&!u?(0,G.jsx)(be,{className:`bg-[var(--feed-digest-weak)] text-[12px] font-semibold uppercase text-[var(--credits-accent)]`,children:h(`planColumnCard.recommended`)}):null]}),(0,G.jsx)(`p`,{className:`overflow-hidden text-[14px] font-medium leading-[18px] text-[var(--content-tertiary)] sm:h-9`,children:n})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`span`,{className:`text-[24px] font-medium text-[var(--content-default)]`,children:r}),(0,G.jsx)(`span`,{className:`text-[11px] font-medium text-[var(--content-tertiary)]`,children:i})]}),(0,G.jsx)(L,{variant:g?`outlined`:`primary`,fullWidth:!0,disabled:u||p,onClick:m,children:u?h(`planColumnCard.currentPlan`):o}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 sm:gap-4`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium text-[var(--content-tertiary)]`,children:h(`planColumnCard.includes`)}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:s.map(e=>(0,G.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,G.jsx)(d,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`text-[14px] font-medium text-[var(--content-secondary)]`,children:e})]},e))})]})]})}function Ke({enabled:e=!0}={}){let n=i(),a=Se(),o=e&&a,s=r({...ke(),enabled:o}),c=s.data,l=c!=null&&c.plan_id!==`base`,u=r({...we(),enabled:o&&l}),d=r({...De(),enabled:o&&l}).data?.plans.find(e=>e.id===`pro`)?.machine_tiers??[],f=e=>d.find(t=>t.tier===e)?.price_cents??null,p=t(z()),m=t(Oe()),h=t(Ae()),g={machineTier:u.data?.max_machine_tier??null,storageTier:u.data?.selected_storage_tier??null,storageGib:u.data?.selected_storage_gib??null,creditTier:c?.selected_credit_tier??null},_=c!=null&&c.plan_id!==`base`&&c.status!=null&&ue.has(c.status)&&c.cancel_at_period_end!==!0&&!c.cancel_at,v=!l||!u.isPending,y=!l||u.isSuccess&&u.data!=null&&!u.isFetching&&u.dataUpdatedAt>=s.dataUpdatedAt;return{changeTiers:async e=>{let t=e.machineTier!==g.machineTier,r=e.storageTier!==g.storageTier,i=e.creditTier!==g.creditTier,a=f(e.machineTier),o=f(g.machineTier),s=t&&a!=null&&o!=null&&a<o,c=[];if(t&&c.push(new Promise(t=>{p.mutate({body:{machine_tier:e.machineTier}},{onSuccess:()=>t({dimension:`machine`,ok:!0}),onError:e=>t({dimension:`machine`,ok:!1,error:e})})})),r&&c.push(new Promise(t=>{m.mutate({body:{storage_tier:e.storageTier}},{onSuccess:()=>t({dimension:`storage`,ok:!0}),onError:e=>t({dimension:`storage`,ok:!1,error:e})})})),i&&c.push(new Promise(t=>{h.mutate({body:{credit_tier:e.creditTier}},{onSuccess:()=>t({dimension:`credit`,ok:!0}),onError:e=>t({dimension:`credit`,ok:!1,error:e})})})),c.length===0)return{needsResize:!1,creditChanged:!1};let l=await Promise.all(c);await oe(n);let u=l.some(e=>e.ok&&e.dimension===`machine`)&&!s,d=l.some(e=>e.ok&&e.dimension===`storage`),_=u||d,v=l.some(e=>e.ok&&e.dimension===`credit`),y=l.filter(e=>!e.ok);if(y.length>0){let e=y.map(e=>O(e.error,`Failed to update ${e.dimension} tier.`)).join(` `);return _e.error(e),_||v?{needsResize:_,creditChanged:v}:null}return{needsResize:_,creditChanged:v}},isPending:p.isPending||m.isPending||h.isPending,current:g,eligible:_,currentReady:v,currentKnown:y,primaryAssistantId:y?u.data?.primary_assistant_id??null:null}}var qe=`#0A0A0B`,Je=8e3,Ye={upgrade:`upgrade`,downgrade:`downgrade`,switch:`change`};j();function J(e,t){return t(`plansPage.featureComputer`,{machine:E(e)})}function Xe(e,t,n){return[J(e,n),n(`plansPage.featureStorage`,{gib:e.storage_gib}),n(`plansPage.featureUsage`,{name:e.name}),...t]}function Ze(e,t){return v(e,t).join(` · `)}function Qe(){let{t:e}=a(`settings`),o=s(),[l,u]=c(),d=i(),m=M(),h=he({platformHostedOnly:!0}),g=ve(),v=ye(),y=h===`full`&&g,x=h===`full`&&v,C=r({...ke(),enabled:y}),w=r({...De(),enabled:y}),E=t(Te()),{changePackage:oe,isPending:D}=de(),{changeTiers:se,isPending:ue,current:k,currentReady:A,currentKnown:j,primaryAssistantId:me}=Ke({enabled:y});fe();let[P,be]=(0,H.useState)(!1),[we,Oe]=(0,H.useState)(!1),[Ae,R]=(0,H.useState)(!1),[z,B]=(0,H.useState)(null),[Pe,V]=(0,H.useState)(!1),[Ie,U]=(0,H.useState)(void 0),W=(0,H.useRef)(!1),[Le,ze]=(0,H.useState)(!1),Be=(0,H.useRef)(!1),[Ve,K]=(0,H.useState)(null),q=C.data,J=w.data?.plans.find(e=>e.id===`pro`),Qe=J?.packages??[],$e=Qe.length>0,Y=q?.plan_id===`pro`,et=Se(),tt=te(me,y&&et&&Y&&j),nt=j?tt:void 0,X=q?q.plan_id===`base`?`free`:b(q.package)?q.package.key:null:null,{cancelSubscription:rt,isPending:it}=ne(),at=ae(q),ot=re(le(q)),st=ge(),ct=new Set(w.data?.plans.find(e=>e.id===`base`)?.included_features??[]),lt=(J?.included_features??[]).filter(e=>!ct.has(e)),Z=P||D||it||ot.isPending,ut=(0,H.useMemo)(()=>!Y||k.storageTier==null?null:{machineTier:k.machineTier,storageTier:k.storageTier,creditTier:k.creditTier},[Y,k.machineTier,k.storageTier,k.creditTier]),Q=l.get(N),dt=!y&&!x,ft=y&&!w.isLoading&&!$e,$=dt||!(Q!=null&&!Le)&&(C.isError||ft);(0,H.useEffect)(()=>{$&&o(dt?I.settings.usageBilling:`${I.settings.usageBilling}&adjust_plan`,{replace:!0})},[$,dt,o]);let pt=()=>{(window.history.state?.idx??0)>0?o(-1):o(I.settings.usageBilling)},mt=async t=>{be(!0);try{let e=await E.mutateAsync({body:{...t,return_target:Ne()}});e.status===`redirect`&&e.checkout_url?(Ce(t.package?{kind:`package`,packageKey:t.package}:{kind:`custom`,machineTier:t.machine_tier??null,storageTier:t.storage_tier??null,creditTier:t.credit_tier??null}),je(d),F(e.checkout_url)):(await d.invalidateQueries({queryKey:Ee()}),await d.invalidateQueries({queryKey:xe()}))}catch(t){_e.error(O(t,e(`plansPage.checkoutFailedToast`)))}finally{be(!1)}},ht=(e,t)=>{if(q&&!Z){if(st){Me(I.plans);return}if(Y){if(e===`free`){R(!0);return}let n=Qe.find(t=>t.key===e);if(!n||T(X,n.key)===`current`)return;if(!ie(q)){o(`${I.settings.usageBilling}&adjust_plan`,{replace:t?.replaceOnBail===!0});return}B(n);return}e!==`free`&&mt({target_plan_id:`pro`,package:e,confirm:!0})}},gt=(0,H.useRef)(ht);(0,H.useEffect)(()=>{gt.current=ht}),(0,H.useEffect)(()=>{if(Q==null||W.current||$||!y||Be.current)return;Be.current=!0;let e=setTimeout(()=>{ze(!0)},Je),t=()=>{clearTimeout(e),ze(!0)};Promise.all([d.refetchQueries({queryKey:Ee()}),d.refetchQueries({queryKey:xe()})]).then(t,t)},[$,Q,y,d]),(0,H.useEffect)(()=>{Q==null||W.current||$||!y||!Le||(W.current=!0,Y&&Q!==`free`&&K(Q),u(e=>{let t=new URLSearchParams(e);return t.delete(N),t},{replace:!0}))},[Le,$,Q,y,Y,u]),(0,H.useEffect)(()=>{Ve==null||Q!=null||(K(null),gt.current(Ve,{replaceOnBail:!0}))},[Q,Ve]);let _t;if(q&&J&&$e){let t=Y&&X===null&&A&&k.storageGib!=null,r=t?Ze(k,J):void 0,i=async()=>{if(!at){R(!1),ot.mutate({});return}await rt()&&R(!1)},a=()=>({creditTier:k.creditTier,fromSnapshot:{machineSize:nt?.machine_size??null,storageGib:nt?.provisioned_storage_gib??null}}),o=z?X===null?`switch`:T(X,z.key)===`downgrade`?`downgrade`:`upgrade`:`upgrade`,s=async()=>{if(!z)return;let t=z,n=a(),r=X===null||!A||!j||Fe(k.machineTier,t.machine_tier),i=await oe(t.key);if(!i)return;if(B(null),i.status===`no_op`){_e.success(e(`plansPage.alreadyOnPlanToast`));return}let s=t.credit_tier??null;U({fromSnapshot:n.fromSnapshot,credits:s===n.creditTier?null:{fromTier:n.creditTier,toTier:s},direction:Ye[o],canLowerResources:r}),V(!0)},c=e=>mt({target_plan_id:`pro`,confirm:!0,machine_tier:e.machineTier,storage_tier:e.storageTier,credit_tier:e.creditTier}),l=async t=>{let n=a(),r=!j||Fe(k.machineTier,t.machineTier),i=await se(t);i&&(Oe(!1),i.needsResize||i.creditChanged?(U({fromSnapshot:n.fromSnapshot,credits:i.creditChanged?{fromTier:n.creditTier,toTier:t.creditTier}:null,direction:`change`,canLowerResources:r}),V(!0)):_e.success(e(`plansPage.planUpdatedToast`)))},u=()=>{if(!Z){if(st){Me(I.plans);return}Y&&!A||Oe(!0)}},d=[...Qe].sort((e,t)=>ee.indexOf(e.key)-ee.indexOf(t.key)),f=S(`free`),p=Y?`downgrade`:T(X,`free`),m=[e(`plansPage.freeFeatureSmallComputer`),e(`plansPage.freeFeatureStorage`,{gib:4}),e(`plansPage.freeFeaturePayAsYouGo`)];_t=(0,G.jsxs)(`div`,{className:`my-auto flex w-full flex-col items-center`,children:[(0,G.jsxs)(`header`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,G.jsx)(`h1`,{className:`text-[40px] text-[var(--content-emphasised)] sm:text-[60px]`,style:{fontFamily:`var(--font-serif)`,fontWeight:400,lineHeight:1.2,letterSpacing:`1.2px`},children:e(`plansPage.heading`)}),(0,G.jsx)(`p`,{className:`text-[20px] font-medium text-[var(--content-tertiary)]`,children:e(`plansPage.subheading`)})]}),(0,G.jsxs)(`div`,{className:`mt-6 grid w-full max-w-[1312px] grid-cols-1 items-start gap-4 sm:mt-10 sm:grid-cols-2 sm:gap-6 lg:grid-cols-4`,children:[(0,G.jsx)(Ge,{tierKey:`free`,name:`Base`,tagline:f?.tagline??``,priceLabel:e(`plansPage.freePriceLabel`),priceCaption:f?.priceCaption??e(`plansPage.foreverCaption`),ctaLabel:p===`downgrade`?e(`plansPage.downgradeTo`,{name:`Base`}):f?.cta??e(`plansPage.startFreeCta`),features:m,tone:`dark`,isCurrent:X===`free`,intent:p,pending:Z,onCta:()=>ht(`free`)}),d.map(t=>{let n=S(t.key),r=T(X,t.key);return(0,G.jsx)(Ge,{tierKey:t.key,name:t.name,tagline:n?.tagline??``,priceLabel:_(t.total_price_cents),priceCaption:n?.priceCaption??e(`plansPage.billedMonthlyCaption`),ctaLabel:r===`downgrade`?e(`plansPage.downgradeTo`,{name:t.name}):n?.cta??t.name,features:Xe(t,n?.extraFeatures??[],e),recommended:n?.recommended,tone:n?.recommended?`light`:`dark`,isCurrent:X===t.key,intent:r,pending:Z,onCta:()=>ht(t.key)},t.key)})]}),(0,G.jsx)(Ue,{className:`mt-6 sm:mt-10`,onConfigure:u,configureDisabled:Y&&!A||Z,isCurrent:t,currentSummary:r}),(0,G.jsx)(He,{open:we,proPlan:J,pending:P||ue,currentStorageGib:Y?k.storageGib:null,initialSelection:ut,onClose:()=>Oe(!1),onContinue:e=>{Y?l(e):c(e)}}),(0,G.jsx)(ce,{open:z!==null,relation:o,packageName:z?.name??``,targetPackage:z,pending:D,onCancel:()=>B(null),onConfirm:()=>void s()}),(0,G.jsx)(We,{open:Ae,lostFeatures:lt,viaPortal:!at,pending:it||ot.isPending,onCancel:()=>R(!1),onConfirm:()=>void i()}),(0,G.jsx)(pe,{mode:`resize`,open:Pe,onClose:()=>{V(!1),U(void 0)},resizeContext:Ie}),(0,G.jsx)(`p`,{className:`mt-6 text-center text-[12px] font-medium text-[var(--content-tertiary)] sm:mt-10`,children:(0,G.jsx)(n,{ns:`settings`,i18nKey:`plansPage.cancelAnytimeFooter`,components:{docsLink:(0,G.jsx)(`a`,{href:Re,target:`_blank`,rel:`noopener noreferrer`,className:`text-[var(--content-default)] underline`})}})})]})}else _t=(0,G.jsx)(`div`,{className:`my-auto flex items-center justify-center`,children:(0,G.jsx)(p,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`plansPage.loadingPlansAriaLabel`)})});return(0,G.jsxs)(`div`,{"data-theme":`dark`,className:`plans-takeover-canvas-enter relative h-full w-full overflow-y-auto`,style:{backgroundColor:qe},children:[(0,G.jsx)(`div`,{className:`absolute left-8 z-10 [-webkit-app-region:no-drag]`,style:{top:m?`3rem`:`2rem`},children:(0,G.jsx)(L,{variant:`outlined`,leftIcon:(0,G.jsx)(f,{className:`h-4 w-4`,"aria-hidden":!0}),onClick:pt,className:`[-webkit-app-region:no-drag]`,children:e(`plansPage.back`)})}),(0,G.jsx)(`div`,{className:`plans-takeover-content-enter flex min-h-full flex-col items-center px-4 pb-8 sm:px-6`,style:{paddingTop:m?`5rem`:`4rem`},children:_t})]})}function $e(){return(0,G.jsx)(Qe,{})}export{$e as PlansPage};
@@ -1 +0,0 @@
1
- import{m as e,r as t,t as n}from"./react-DPM_L_aA.js";import{Ev as r,Vv as i,_i as a}from"./index-8UA9Y4Ao.js";var o=n();function s(){let n=r.use.version(),s=a(),{name:c}=e();return n===null?null:!s||!c?(0,o.jsx)(t,{to:i.superpowers,replace:!0}):(0,o.jsx)(t,{to:`${i.superpowers}?plugin=${encodeURIComponent(c)}`,replace:!0})}export{s as PluginDetailPage};
@@ -1 +0,0 @@
1
- import{g as e,r as t,t as n}from"./react-DPM_L_aA.js";import{Vv as r}from"./index-8UA9Y4Ao.js";var i=n();function a(){let[n]=e(),a=n.toString();return(0,i.jsx)(t,{to:`${r.superpowers}${a?`?${a}`:``}`,replace:!0})}export{a as PluginsPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jn as t,N as n,Zn as r,er as i,j as a}from"./vendor-CV8wawxx.js";import{b as o,t as s,y as c}from"./react-DPM_L_aA.js";import{Vr as l,W as u,i as d,rn as f,vt as p,x as m,zr as h}from"./icons-J6Mg9wGk.js";import{$p as g,B as _,Bg as v,Bl as y,Bv as b,Er as x,Fm as S,Gg as C,Gi as w,Gv as T,Hg as E,Ig as D,Jv as ee,Jy as O,Ki as k,Kv as A,Ly as j,Mp as M,Oy as N,Q as P,Qf as F,R as I,Ry as L,Tr as R,Ug as te,V as ne,Vg as re,Vl as ie,Vp as ae,Vv as oe,Wg as z,Wi as se,Wv as B,Xf as ce,Zf as le,Zy as V,an as ue,ep as de,gu as fe,hu as pe,ib as H,nb as U,oc as me,qv as W,qy as G,sb as he,sc as ge,tb as K,tp as _e,wr as ve,z as q,zl as ye}from"./index-8UA9Y4Ao.js";import{t as J}from"./detail-card-BxI8klTT.js";import{t as Y}from"./setting-row-DD_cFv_d.js";import{t as be}from"./settings-divider-BM98PYnd.js";var X=e(o(),1),Z=s(),xe=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`},{id:`screen`,type:`system`,sourceKind:`screen`,availableOnWindows:!0},{id:`microphone`,type:`system`,sourceKind:`microphone`,availableOnWindows:!0},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,availableOnWindows:!0},{id:`notifications`,type:`system`,sourceKind:`notifications`,availableOnWindows:!0}],Se=[{id:`notificationBadges`,type:`local`}];function Ce(e,t,n){switch(e){case`accessibility`:return{label:t(`systemPermissionsCard.accessibilityLabel`),description:t(`systemPermissionsCard.accessibilityDescription`)};case`screen`:return{label:t(`systemPermissionsCard.screenLabel`),description:t(`systemPermissionsCard.screenDescription`)};case`microphone`:return{label:t(`systemPermissionsCard.microphoneLabel`),description:t(`systemPermissionsCard.microphoneDescription`)};case`speechRecognition`:return{label:t(`systemPermissionsCard.speechRecognitionLabel`),description:t(n?`systemPermissionsCard.speechRecognitionWindowsDescription`:`systemPermissionsCard.speechRecognitionDescription`)};case`notifications`:return{label:t(`systemPermissionsCard.notificationsLabel`),description:t(n?`systemPermissionsCard.notificationsWindowsDescription`:`systemPermissionsCard.notificationsDescription`)};default:throw Error(`Unsupported system permission row: ${e}`)}}function we(){let[e,t]=(0,X.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function Te(){let[e,t]=(0,X.useState)(()=>B(`dockBadgesEnabled`,!0));return(0,X.useEffect)(()=>ee(`dockBadgesEnabled`,()=>{t(B(`dockBadgesEnabled`,!0))}),[]),[e,e=>{t(e),A(`dockBadgesEnabled`,e),e||w(0)}]}function Ee({row:e,onToggle:t}){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(G,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:he(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,Z.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,Z.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,Z.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function De(){return(0,Z.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 Oe({compact:e=!1}){let{t}=a(),{state:n,loading:r,error:i,supported:o,refresh:s}=ie(),{pendingKind:c,run:l}=we(),[u,d]=Te(),f=ae()===`windows`,p=(0,X.useMemo)(()=>xe.filter(e=>!f||e.availableOnWindows),[f]),m=(0,X.useMemo)(()=>{let e=new Map;if(!n)return e;for(let t of p){let r=n[t.sourceKind];r&&r.status!==`not-applicable`&&e.set(t.id,{meta:t,item:r})}return e},[n,p]),h=(0,X.useMemo)(()=>{let e=p.map(e=>{let n=m.get(e.id)?.item;if(!n)return null;let r=Ce(e.id,t,f);return{id:e.id,label:r.label,description:r.description,checked:n.status===`granted`,disabled:c===e.id||n.status===`restricted`,...n.error?{error:n.error}:{}}}).filter(Boolean),n=se()===`taskbar icon`?t(`systemPermissionsCard.taskbarIcon`):t(`systemPermissionsCard.dockIcon`),r=k()?Se.map(e=>({id:e.id,label:t(`systemPermissionsCard.notificationBadgesLabel`),description:t(`systemPermissionsCard.notificationBadgesDescription`,{surface:n}),checked:u,disabled:c===e.id})):[];return[...e,...r]},[f,u,c,m,t,p]);if(!o&&h.length===0)return null;let g=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ye(e.sourceKind):await y(e.sourceKind),await s()},_=e=>{let t=m.get(e);if(t){l(e,()=>g(t.meta,t.item));return}e===`notificationBadges`&&l(e,async()=>{d(!u)})};return(0,Z.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,Z.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:t(`systemPermissionsCard.title`)}),r&&h.length===0?(0,Z.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(De,{}),t(`systemPermissionsCard.checking`)]}):(0,Z.jsx)(`div`,{className:`mt-3 space-y-2`,children:h.map(e=>(0,Z.jsx)(Ee,{row:e,onToggle:_},e.id))}),i&&(0,Z.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-md 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:i})]})}function ke(){let{t:e}=a(`settings`),n=F({platformHostedOnly:!0}),o=ce(),s=le(),c=i(),{data:l,isLoading:u,isError:d}=r({...me(),enabled:n===`full`&&o}),p=t({mutationFn:async e=>{let{data:t}=await S({body:{access_consented:e},throwOnError:!0});return t},onSuccess:t=>{ge(c,void 0,t),L.success(t?.access_consented?e(`accessConsentSetting.toastEnabled`):e(`accessConsentSetting.toastDisabled`))},onError:()=>{L.error(e(`accessConsentSetting.toastUpdateFailed`))}});if(n===`gated`)return null;let m=n===`full`&&s,h=l?.access_consented??!1,g=n!==`full`||!o||u||d||p.isPending;return(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`accessConsentSetting.title`)}),(0,Z.jsx)(`p`,{className:`mt-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`accessConsentSetting.description`)}),n===`full`&&d&&(0,Z.jsx)(`p`,{className:`mt-1 text-body-small-lighter text-[var(--system-negative-strong)]`,children:e(`accessConsentSetting.loadError`)})]}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:n===`disabled`?null:(0,Z.jsxs)(Z.Fragment,{children:[(p.isPending||m)&&(0,Z.jsx)(f,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,Z.jsx)(G,{checked:h,disabled:g,onChange:()=>p.mutate(!h)})]})})]}),n===`disabled`&&(0,Z.jsx)(ue,{className:`mt-3`,children:e(`accessConsentSetting.loginNotice`)})]})}function Ae(){let{t:e}=a(`settings`),t=v(),n=g(),[r,i]=(0,X.useState)(()=>te()),[o,s]=(0,X.useState)(null),[c,l]=(0,X.useState)(!1);if((0,X.useEffect)(()=>{if(!t)return;let e=!0;return E().then(t=>{e&&s(t)}),()=>{e=!1}},[t]),!t||!o?.available)return null;let u=async()=>{l(!0);try{if(r)z(!1),await re(),i(!1);else{let e=D();if(!e||!await C(e)){z(!1),i(!1);return}z(!0),i(!0)}}finally{l(!1)}};return(0,Z.jsx)(J,{title:e(`biometricSettingsCard.title`),children:(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`biometricSettingsCard.useForSignIn`,{label:o.label})}),(0,Z.jsx)(`p`,{className:`mt-1 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(n?`biometricSettingsCard.descriptionWithPasscode`:`biometricSettingsCard.description`,{label:o.label})})]}),(0,Z.jsx)(G,{checked:r,onChange:()=>void u(),disabled:c})]})})}var Q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function je(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...Q]}function Me(){return B(`mediaEmbedsEnabled`,!0)}function Ne(){let e=T(`mediaEmbedDomains`,``);return e?je(e):[...Q]}function Pe(){let{t:e}=a(`settings`),[t,n]=(0,X.useState)(()=>Me()),[r,i]=(0,X.useState)(()=>Ne()),[o,s]=(0,X.useState)(!1),[c,u]=(0,X.useState)(``),d=(0,X.useMemo)(()=>c.trim().toLowerCase(),[c]),f=e=>{n(e),A(`mediaEmbedsEnabled`,e)},p=e=>{i(e),W(`mediaEmbedDomains`,JSON.stringify(e))},g=()=>{if(d){if(r.includes(d)){u(``);return}p([...r,d]),u(``)}},_=e=>{p(r.filter(t=>t!==e))},v=()=>{p([...Q])},y=r.length===Q.length&&r.every((e,t)=>e===Q[t]);return(0,Z.jsxs)(J,{title:e(`mediaEmbedsCard.title`),subtitle:e(`mediaEmbedsCard.subtitle`),children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`mediaEmbedsCard.autoToggle`)}),(0,Z.jsx)(G,{checked:t,onChange:f})]}),t&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mt-4`,children:(0,Z.jsx)(be,{})}),(0,Z.jsxs)(H,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,Z.jsx)(l,{className:`h-4 w-4`,"aria-hidden":!0}):(0,Z.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}),e(`mediaEmbedsCard.allowlist`)]}),(0,Z.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e(`mediaEmbedsCard.domainCount`,{count:r.length})})]}),o&&(0,Z.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Z.jsx)(O,{label:e(`mediaEmbedsCard.addDomainLabel`),type:`text`,value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),g())},placeholder:e(`mediaEmbedsCard.addDomainPlaceholder`),fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(H,{variant:`primary`,size:`compact`,onClick:g,disabled:!d,children:e(`mediaEmbedsCard.add`)})]}),r.length>0&&(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)(H,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:e(`mediaEmbedsCard.resetDefaults`)})}),r.length>0&&(0,Z.jsx)(`ul`,{className:`space-y-2`,children:r.map(t=>(0,Z.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,Z.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:t}),(0,Z.jsx)(H,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(m,{}),onClick:()=>_(t),"aria-label":e(`mediaEmbedsCard.removeDomainAria`,{domain:t})})]},t))})]})]})]})}function Fe(){return(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let{t:e}=a(`settings`),t=P(),n=(0,X.useMemo)(()=>I.map(t=>({value:t.id,label:e(t.labelKey,t.label),icon:(0,Z.jsx)(t.icon,{className:`h-3.5 w-3.5`})})),[e]),o=i(),{data:s,isError:c}=r({queryKey:[`thresholds`,t],queryFn:()=>_(t),staleTime:3e4}),[u,d]=(0,X.useState)(`relaxed`),[f,p]=(0,X.useState)(`conservative`),[m,g]=(0,X.useState)(`strict`),[v,y]=(0,X.useState)(!1),b=(0,X.useRef)(!1),[x,S]=(0,X.useState)(!1),C=(0,X.useRef)(null),w=(0,X.useRef)(null);(0,X.useEffect)(()=>{!s||b.current||(d(q(s.interactive).id),p(q(s.autonomous).id),g(q(s.headless).id),S(!0))},[s]),(0,X.useEffect)(()=>()=>{C.current!==null&&(clearTimeout(C.current),C.current=null,w.current?.(),w.current=null)},[]);let T=(0,X.useCallback)((e,n,r)=>{if(!t||!x)return;let i=I.find(t=>t.id===e)?.riskThreshold,a=I.find(e=>e.id===n)?.riskThreshold,s=I.find(e=>e.id===r)?.riskThreshold;!i||!a||!s||ne(t,{interactive:i,autonomous:a,headless:s}).then(()=>{o.invalidateQueries({queryKey:[`thresholds`,t]})}).catch(()=>{})},[t,x,o]),E=(0,X.useCallback)((e,t,n)=>{C.current!==null&&clearTimeout(C.current),w.current=()=>T(e,t,n),C.current=setTimeout(()=>{w.current?.(),C.current=null,w.current=null},500)},[T]),D=(0,X.useCallback)(e=>{b.current=!0,d(e),E(e,f,m)},[f,m,E]),ee=(0,X.useCallback)(e=>{b.current=!0,p(e),E(u,e,m)},[u,m,E]),O=(0,X.useCallback)(e=>{b.current=!0,g(e),E(u,f,e)},[u,f,E]),k=I.find(e=>e.id===u),A=I.find(e=>e.id===f),j=I.find(e=>e.id===m),M=!t||!x;return(0,Z.jsxs)(U,{children:[(0,Z.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:e(`riskToleranceSettings.title`)}),(0,Z.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`riskToleranceSettings.description`)}),c&&(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-lighter text-[var(--system-negative-strong)]`,children:e(`riskToleranceSettings.loadError`)}),(0,Z.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`riskToleranceSettings.conversationsTitle`)}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`riskToleranceSettings.conversationsDescription`)}),(0,Z.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,Z.jsx)(N,{value:u,onChange:D,options:n,disabled:M})}),k&&(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:e(k.descriptionKey,k.description)})]}),(0,Z.jsx)(Fe,{}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>y(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":v,children:[v?(0,Z.jsx)(l,{className:`h-4 w-4`}):(0,Z.jsx)(h,{className:`h-4 w-4`}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:e(`riskToleranceSettings.advanced`)})]}),(0,Z.jsxs)(`div`,{className:v?`mt-4 space-y-4`:`hidden`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`riskToleranceSettings.backgroundTitle`)}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`riskToleranceSettings.backgroundDescription`)}),(0,Z.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,Z.jsx)(N,{value:f,onChange:ee,options:n,disabled:M})}),A&&(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:e(A.descriptionKey,A.description)})]}),(0,Z.jsx)(Fe,{}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`riskToleranceSettings.headlessTitle`)}),(0,Z.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`riskToleranceSettings.headlessDescription`)}),(0,Z.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,Z.jsx)(N,{value:m,onChange:O,options:n,disabled:M})}),j&&(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:e(j.descriptionKey,j.description)})]})]})]})]})]})}var Le=e(c(),1),Re=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`];function ze({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let{t:i}=a(`settings`),o=(0,X.useRef)(null),[s,c]=(0,X.useState)(t.tool),[l,u]=(0,X.useState)(t.pattern),[f,p]=(0,X.useState)(t.risk),[m,h]=(0,X.useState)(t.description??``),[g,_]=(0,X.useState)(!1),[v,y]=(0,X.useState)(null),b=[{value:`low`,label:i(`trustRuleFormModal.riskLow`),description:i(`trustRuleFormModal.riskLowDescription`)},{value:`medium`,label:i(`trustRuleFormModal.riskMedium`),description:i(`trustRuleFormModal.riskMediumDescription`)},{value:`high`,label:i(`trustRuleFormModal.riskHigh`),description:i(`trustRuleFormModal.riskHighDescription`)}],S=l.trim(),C=S.length>0&&!g,w=i(`trustRuleFormModal.defaultDescription`,{tool:s,pattern:S||i(`trustRuleFormModal.patternFallback`)}),T=(0,X.useCallback)(async n=>{if(n.preventDefault(),!C)return;let a=m.trim()||w;_(!0),y(null);try{await x(e,t.id,{risk:f,description:a}),r()}catch(e){y(e instanceof Error?e.message:i(`trustRuleFormModal.saveFailed`))}finally{_(!1)}},[e,C,w,m,t,r,f,i]);return(0,Le.createPortal)((0,Z.jsx)(`div`,{ref:o,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,X.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),n())},[n]),onClick:(0,X.useCallback)(e=>{e.target===o.current&&n()},[n]),children:(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,Z.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:i(`trustRuleFormModal.title`)}),(0,Z.jsx)(`button`,{type:`button`,onClick:n,"aria-label":i(`trustRuleFormModal.closeAriaLabel`),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,Z.jsx)(d,{className:`h-4 w-4`})})]}),(0,Z.jsxs)(`form`,{onSubmit:e=>void T(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[v&&(0,Z.jsx)(K,{tone:`error`,children:v}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:i(`trustRuleFormModal.toolLabel`)}),(0,Z.jsx)(`div`,{className:`mt-1`,children:(0,Z.jsx)(N,{value:s,onChange:c,disabled:!0,options:Re.map(e=>({value:e,label:e}))})})]}),(0,Z.jsx)(O,{label:i(`trustRuleFormModal.patternLabel`),type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:i(`trustRuleFormModal.patternPlaceholder`),disabled:!0}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:i(`trustRuleFormModal.riskLevelLabel`)}),(0,Z.jsx)(`div`,{className:`mt-2 flex gap-2`,children:b.map(e=>(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>p(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${f===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,Z.jsx)(`div`,{children:e.label}),(0,Z.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,Z.jsx)(O,{label:i(`trustRuleFormModal.descriptionLabel`),type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:w}),(0,Z.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,Z.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:i(`trustRuleFormModal.cancel`)}),(0,Z.jsx)(`button`,{type:`submit`,disabled:!C,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:i(g?`trustRuleFormModal.saving`:`trustRuleFormModal.save`)})]})]})]})}),document.body)}function Be(e){return e.origin===`default`&&!e.userModified}function Ve(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 He(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Ue({assistantId:e,onClose:t}){let{t:n}=a(`settings`),r=(0,X.useRef)(null),[i,o]=(0,X.useState)([]),[s,c]=(0,X.useState)(!0),[l,d]=(0,X.useState)(null),[f,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(!1),b=(0,X.useCallback)(e=>{switch(e){case`low`:return n(`trustRulesModal.riskLow`);case`medium`:return n(`trustRulesModal.riskMedium`);case`high`:return n(`trustRulesModal.riskHigh`)}},[n]),x=(0,X.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([R(e),R(e,{origin:`default`})]);return Ve(t,n)}return R(e)},[e]),S=(0,X.useCallback)(async()=>{c(!0);try{o(await x(v)),d(null)}catch(e){d(e instanceof Error?e.message:n(`trustRulesModal.loadErrorFallback`))}finally{c(!1)}},[x,v,n]);(0,X.useEffect)(()=>{let e=!1;return(async()=>{c(!0);try{let t=await x(v);e||(o(t),d(null))}catch(t){e||d(t instanceof Error?t.message:n(`trustRulesModal.loadErrorFallback`))}finally{e||c(!1)}})(),()=>{e=!0}},[x,v,n]);let C=(0,X.useCallback)(async()=>{if(g)try{await ve(e,g.id),S()}catch(e){d(e instanceof Error?e.message:n(`trustRulesModal.deleteErrorFallback`))}finally{_(null)}},[e,g,S,n]);return(0,Le.createPortal)((0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:r,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,X.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),t())},[t]),onClick:(0,X.useCallback)(e=>{e.target===r.current&&t()},[t]),children:(0,Z.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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,Z.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:n(`trustRulesModal.title`)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(G,{checked:v,onChange:y,label:n(`trustRulesModal.showAllDefaults`)}),(0,Z.jsx)(H,{variant:`outlined`,onClick:t,children:n(`trustRulesModal.done`)})]})]}),(0,Z.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[l&&(0,Z.jsx)(`div`,{className:`mb-3`,children:(0,Z.jsx)(K,{tone:`error`,children:l})}),s?(0,Z.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`trustRulesModal.loading`)}):i.length===0?(0,Z.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,Z.jsx)(u,{className:`h-8 w-8`}),(0,Z.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:n(`trustRulesModal.empty`)})]}):(0,Z.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:i.map(e=>{let t=Be(e);return(0,Z.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,Z.jsx)(V,{tone:He(e.risk),children:b(e.risk)}),e.origin===`default`&&(0,Z.jsx)(V,{tone:`neutral`,children:n(`trustRulesModal.defaultTag`)}),e.userModified&&(0,Z.jsx)(V,{tone:`warning`,children:n(`trustRulesModal.modifiedTag`)})]}),(0,Z.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,Z.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":n(`trustRulesModal.editRuleAria`,{tool:e.tool}),onClick:()=>h(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,Z.jsx)(p,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,Z.jsx)(H,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Z.jsx)(m,{className:`h-4 w-4`}),"aria-label":n(`trustRulesModal.deleteRuleAria`,{tool:e.tool}),onClick:()=>_(e)})]})]},e.id)})})]})]})}),f&&(0,Z.jsx)(ze,{assistantId:e,existingRule:f,onClose:()=>h(null),onSaved:()=>{h(null),S()}}),(0,Z.jsx)(j,{open:g!==null,title:n(`trustRulesModal.deleteTitle`),message:g?n(`trustRulesModal.deleteMessage`,{risk:b(g.risk).toLowerCase(),tool:g.tool,pattern:g.pattern}):``,confirmLabel:n(`trustRulesModal.delete`),cancelLabel:n(`trustRulesModal.cancel`),destructive:!0,onConfirm:()=>void C(),onCancel:()=>_(null)})]}),document.body)}function We(){let{t:e}=a(`settings`),t=P(),[n,r]=(0,X.useState)(!1);return(0,Z.jsxs)(U,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Z.jsx)(u,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,Z.jsxs)(`div`,{className:`flex-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:e(`trustRules.title`)}),(0,Z.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`trustRules.description`)})]}),(0,Z.jsx)(H,{variant:`outlined`,onClick:()=>r(!0),children:e(`trustRules.manage`)})]}),n&&(0,Z.jsx)(Ue,{assistantId:t,onClose:()=>r(!1)})]})}var Ge=[{value:`dontRetain`,labelKey:`privacyPage.retentionDontRetain`},{value:`oneHour`,labelKey:`privacyPage.retentionOneHour`},{value:`oneDay`,labelKey:`privacyPage.retentionOneDay`},{value:`sevenDays`,labelKey:`privacyPage.retentionSevenDays`},{value:`thirtyDays`,labelKey:`privacyPage.retentionThirtyDays`},{value:`ninetyDays`,labelKey:`privacyPage.retentionNinetyDays`},{value:`keepForever`,labelKey:`privacyPage.retentionKeepForever`}],Ke=`thirtyDays`;function $(){return(0,Z.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function qe(){let{t:e}=a(`settings`),t=F({platformHostedOnly:!0}),r=_e(),i=r,o=de.use.user()?.id??null,[s]=pe(),[c]=fe(),l=s??!0,u=c??!0,[d,f]=(0,X.useState)(()=>T(`llmLogRetention`,Ke)),p=(0,X.useMemo)(()=>Ge.map(t=>({value:t.value,label:e(t.labelKey)})),[e]);return(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[(0,Z.jsx)(Ae,{}),(0,Z.jsx)(Oe,{}),(0,Z.jsx)(We,{}),(0,Z.jsx)(Ie,{}),(0,Z.jsx)(Pe,{}),(0,Z.jsx)(J,{title:e(`privacyPage.title`),subtitle:r?(0,Z.jsx)(n,{ns:`settings`,i18nKey:`privacyPage.subtitleWithPolicy`,components:{policyLink:(0,Z.jsx)(`a`,{href:b(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`})}}):void 0,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{label:e(`privacyPage.shareAnalyticsLabel`),helperText:e(`privacyPage.shareAnalyticsHelper`),checked:l,onChange:()=>{M(`share_analytics`,!l,{userId:o,hasPlatformSession:r})},variant:`toggle-trailing`}),(0,Z.jsx)($,{}),(0,Z.jsx)(Y,{label:e(`privacyPage.shareDiagnosticsLabel`),helperText:e(`privacyPage.shareDiagnosticsHelper`),checked:u,onChange:()=>{M(`share_diagnostics`,!u,{userId:o,hasPlatformSession:r})},variant:`toggle-trailing`}),(0,Z.jsx)($,{})]}),(0,Z.jsx)(ke,{}),t!==`gated`&&(0,Z.jsx)($,{}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:e(`privacyPage.llmLogRetentionLabel`)}),(0,Z.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,Z.jsx)(N,{value:d,onChange:e=>{f(e),W(`llmLogRetention`,e)},options:p})}),(0,Z.jsx)(`p`,{className:`mt-2 text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`privacyPage.llmLogRetentionDescription`)})]})]})})]})}export{qe as PrivacyPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CV8wawxx.js";import{b as n,f as r,g as i,t as a}from"./react-DPM_L_aA.js";import{Bg as o,G_ as s,Hv as c,Iv as l,Lr as u,Nr as d,Nv as ee,Qg as f,Vv as p,Yg as m,Zg as h,_u as g,ep as _,fi as v,gu as y,i_ as b,ib as x,iv as S,jp as C,mi as w,mu as T,n_ as E,np as te,o_ as D,r_ as O,s_ as k,su as A,ui as j}from"./index-8UA9Y4Ao.js";import{t as M}from"./plugin-attribution-CeJvw31w.js";import{n as N,t as P}from"./consent-controls-C9CK_6mt.js";import{r as F,t as I}from"./checkout-continuation-B9k2wNrT.js";var L=e(n(),1),R=a();function z({current:e,total:n,color:r}){let{t:i}=t(`onboarding`);return(0,R.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":i(`stepIndicator.ariaLabel`,{current:e+1,total:n}),children:Array.from({length:n},(t,n)=>(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors`,style:r?{backgroundColor:r,opacity:n<=e?1:.3}:void 0,children:r?null:(0,R.jsx)(`div`,{className:`h-full w-full rounded-full bg-[var(--content-default)] ${n<=e?``:`opacity-20`}`})},n))})}function B(){let{t:e}=t(`onboarding`),n=r(),[a]=i(),l=_.use.user()?.id??null,m=c(),B=o(),[H,U]=y(),W=H??!0,[G,K]=g(),[q,J]=T(),Y=te(),X=F();(0,L.useEffect)(()=>{w()},[]);let Z=a.get(`preview`)===`true`,Q=(0,L.useCallback)(e=>{},[]),ne=Z?Q:U,re=Z?Q:K,ie=Z?Q:J,ae=E(),$=(0,L.useCallback)(e=>{if(Z)return;C({userId:l,tos:G,privacy:q,shareAnalytics:null,shareDiagnostics:W,hasPlatformSession:Y}),v(j.privacyTos,{userId:l});let t=A(a.get(`returnTo`));if(t){n(e?D(t):t,u);return}let r=a.get(`hosting`),i=new URLSearchParams;r&&i.set(`hosting`,r);let o=a.get(M);o&&i.set(M,o);let c=i.toString(),d=b({isLocalHatch:S()&&r!==null&&r!==`vellum-cloud`,skipResearch:e,selectedAssistantOnboarded:k(s.getState().assistants,ee()),newAssistant:O(a)}),m=e?D(`${d}${c?`?${c}`:``}`):`${d}${c?`?${c}`:``}`,g=f();if(g?.resumeAfterOnboarding===!0)if(X===`disabled`)h();else{let e=V(g);if(e){e.set(I,m),n(`${p.checkout}?${e.toString()}`,u);return}}n(m,u)},[q,Y,Z,n,a,W,X,G,l]);return(0,R.jsx)(d,{avatarWave:`beside`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${m?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[B&&(0,R.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,R.jsx)(z,{current:2,total:3})}),(0,R.jsx)(`h1`,{className:m?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`privacyScreen.title`)}),(0,R.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${m?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:e(`privacyScreen.body`)}),(0,R.jsx)(N,{electron:m,showAnalytics:!1,shareAnalytics:!1,shareDiagnostics:W,onShareAnalyticsChange:Q,onShareDiagnosticsChange:ne,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,R.jsx)(P,{electron:m,privacyConsent:q,tosAccepted:G,onPrivacyChange:ie,onTosChange:re,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,R.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${m?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,R.jsx)(x,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!G||!q,onClick:()=>$(!1),className:m?void 0:`h-11 text-base`,children:e(`privacyScreen.start`)}),ae&&(0,R.jsx)(x,{variant:`outlined`,size:`regular`,fullWidth:!0,disabled:!G||!q,onClick:()=>$(!0),className:m?void 0:`h-11 text-base`,children:e(`privacyScreen.skipToChat`)}),(0,R.jsx)(x,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:()=>n(S()?p.onboarding.hosting:p.onboarding.start,u),className:m?void 0:`h-11 text-base`,children:e(`actions.back`)})]})]})})}function V(e){return e.kind===`package`?new URLSearchParams({[l]:e.packageKey}):e.storageTier===null?null:m({machineTier:e.machineTier,storageTier:e.storageTier,creditTier:e.creditTier})}export{B as PrivacyScreen};
@@ -1 +0,0 @@
1
- import{Ci as e}from"./icons-J6Mg9wGk.js";var t=e(`repeat`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]);export{t};