@vellumai/web 0.12.2-dev.202609171225.565e464 → 0.12.2-dev.202609171516.2acdfd4

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 (318) hide show
  1. package/dist/assets/{a2a-invite-DBlDzShH.js → a2a-invite-S3W5OUQ8.js} +1 -1
  2. package/dist/assets/{about-page-DdLu4gin.js → about-page-C-GtkgKQ.js} +1 -1
  3. package/dist/assets/{account-page-CRCayJE1.js → account-page-Die0k4p1.js} +1 -1
  4. package/dist/assets/{account-shell-CIfUqVu1.js → account-shell-Dbc4GLZ8.js} +1 -1
  5. package/dist/assets/{acp-run-detail-panel-Be03WYUS.js → acp-run-detail-panel-DPmp98_U.js} +1 -1
  6. package/dist/assets/{activation-list-route-BiHOPkuW.js → activation-list-route-BWHGEsqz.js} +1 -1
  7. package/dist/assets/{activity-redirect-page-DM_5_I_D.js → activity-redirect-page-Bma7Mr49.js} +1 -1
  8. package/dist/assets/{activity-steps-panel-BXkDyFqw.js → activity-steps-panel-BWbcrAVW.js} +1 -1
  9. package/dist/assets/add-credits-modal-BcdNESW9.js +1 -0
  10. package/dist/assets/{add-credits-modal-CzEGqiQb.js → add-credits-modal-CxCacGMD.js} +1 -1
  11. package/dist/assets/{ai-page-BhWTbyQ2.js → ai-page-CQHFCjDW.js} +1 -1
  12. package/dist/assets/{android-billing-handoff-Cbg8fsR3.js → android-billing-handoff-Cw1ysvIK.js} +1 -1
  13. package/dist/assets/{api-key-screen-VGgQ3yZn.js → api-key-screen-BpmbJA0E.js} +1 -1
  14. package/dist/assets/app-1VZKPehC.js +392 -0
  15. package/dist/assets/app-DI85lCVu.css +2 -0
  16. package/dist/assets/{app-info-Clahy-Wt.js → app-info-BJtkRDIh.js} +1 -1
  17. package/dist/assets/{archive-redirect-page-DebwOmzE.js → archive-redirect-page-DjM6Ok_I.js} +1 -1
  18. package/dist/assets/assistant-inbox-B75G_OgY.js +1 -0
  19. package/dist/assets/assistant-inbox-BsS-suY6.js +1 -0
  20. package/dist/assets/assistant-inbox-ByPTwOwm.js +1 -0
  21. package/dist/assets/assistant-inbox-Di1LvnFM.js +1 -0
  22. package/dist/assets/{assistant-status-panel-B1FR7MM1.js → assistant-status-panel-DK9S4lgz.js} +1 -1
  23. package/dist/assets/auth-store-CjHqgBLP.js +1 -0
  24. package/dist/assets/{auth-welcome-screen-BeA5CpIk.js → auth-welcome-screen-BH65QcYU.js} +1 -1
  25. package/dist/assets/avatar-bundled-components-DqvuXI-O.js +1 -0
  26. package/dist/assets/{avatar-random-CWz7C9rs.js → avatar-random-LVBo5QRK.js} +2 -2
  27. package/dist/assets/{await-org-header-settled-BOJkVf_1.js → await-org-header-settled-B_cb553t.js} +1 -1
  28. package/dist/assets/{background-task-detail-panel-t9FRp_-Z.js → background-task-detail-panel-CdxsK6NR.js} +1 -1
  29. package/dist/assets/{billing-page-CL0Pdh_3.js → billing-page-Bgn6BG8V.js} +3 -3
  30. package/dist/assets/{billing-redirect-page-DDf6m-FK.js → billing-redirect-page-WDSWKFH7.js} +1 -1
  31. package/dist/assets/{bookmarks-page-UXQyS5kQ.js → bookmarks-page-DsV__cWA.js} +1 -1
  32. package/dist/assets/{bundle-confirm-page-Wg-3XwhK.js → bundle-confirm-page-CDZlExeH.js} +1 -1
  33. package/dist/assets/{channel-transcript-panel-HxUNeT8p.js → channel-transcript-panel-frtM8o3q.js} +1 -1
  34. package/dist/assets/{channels-page-route-Cz5m59Qi.js → channels-page-route-CUiTCk9h.js} +1 -1
  35. package/dist/assets/{chat-info-panel-DEanOgSg.js → chat-info-panel-ClI6ebj_.js} +1 -1
  36. package/dist/assets/{checkout-continuation-BKsgghES.js → checkout-continuation-BulwKXnr.js} +1 -1
  37. package/dist/assets/{checkout-page-C73ixDgx.js → checkout-page-CkK93wwA.js} +1 -1
  38. package/dist/assets/checkout-return-target-HspBICEX.js +1 -0
  39. package/dist/assets/{command-palette-DvhQJQSH.js → command-palette-CBFRny7u.js} +1 -1
  40. package/dist/assets/command-palette-DgmFO89K.js +1 -0
  41. package/dist/assets/{command-palette-window-page-DGDhA-B4.js → command-palette-window-page-BXAR42Mw.js} +1 -1
  42. package/dist/assets/{community-page-Dob0FV5_.js → community-page-CwpmiKhU.js} +1 -1
  43. package/dist/assets/{companion-accent-la8ZJ6IC.js → companion-accent-ubCKO3aQ.js} +1 -1
  44. package/dist/assets/{companion-dock-zones-page-CFJTproC.js → companion-dock-zones-page-DVZ6O5Z3.js} +1 -1
  45. package/dist/assets/{companion-layout-BuxIBkh-.js → companion-layout-DgqqJvcL.js} +1 -1
  46. package/dist/assets/{companion-popover-BBqEGBTZ.js → companion-popover-Cf5ITFsQ.js} +1 -1
  47. package/dist/assets/{companion-popover-page-Ck2zhqqG.js → companion-popover-page-BlP-q73q.js} +1 -1
  48. package/dist/assets/{companion-surface-page-D7cjO06j.js → companion-surface-page-CPoC6fzh.js} +1 -1
  49. package/dist/assets/{companion-watch-frame-page-pWwGxOZY.js → companion-watch-frame-page-D-fKHmac.js} +1 -1
  50. package/dist/assets/{connect-page-lW4ZEcOf.js → connect-page-BOOhRdAN.js} +1 -1
  51. package/dist/assets/{consent-controls--WNBdiwt.js → consent-controls-i0ai4F7A.js} +1 -1
  52. package/dist/assets/{contacts-gateway-CWKximoP.js → contacts-gateway-DM6gZwP0.js} +1 -1
  53. package/dist/assets/{contacts-page-route-8Nysvlx4.js → contacts-page-route-CJGWxEi9.js} +1 -1
  54. package/dist/assets/{copy-button-DPlyOF7A.js → copy-button-CgZo1eck.js} +1 -1
  55. package/dist/assets/{credential-entry-page-CRLQ3v95.js → credential-entry-page-BxcbnzCG.js} +1 -1
  56. package/dist/assets/{credentials-page-CcY2zM5u.js → credentials-page-dWp6pto9.js} +1 -1
  57. package/dist/assets/{csv-preview-Cx1awfot.js → csv-preview-Dh7oKdWY.js} +1 -1
  58. package/dist/assets/{danger-zone-redirect-page-CduOjFC8.js → danger-zone-redirect-page-Bca3uiwU.js} +1 -1
  59. package/dist/assets/{debug-page-B5rdWQOa.js → debug-page-Bu4cg9mR.js} +2 -2
  60. package/dist/assets/deploy-dialogs-BAboaRnq.js +1 -0
  61. package/dist/assets/{deploy-dialogs-Bcjd9rq0.js → deploy-dialogs-CirCIMHR.js} +1 -1
  62. package/dist/assets/{desktop-preview-content-V-sOQVf4.js → desktop-preview-content-1z7Kwmap.js} +2 -2
  63. package/dist/assets/{desktop-status-Br7Q6i6P.js → desktop-status-DWRR_4vI.js} +1 -1
  64. package/dist/assets/{desktop-viewer-DffX_ioO.js → desktop-viewer-Dt7CPtW_.js} +1 -1
  65. package/dist/assets/{detail-card-BkqRteiy.js → detail-card-N-3EizQA.js} +1 -1
  66. package/dist/assets/{detail-panel-stop-button-B-4csyQj.js → detail-panel-stop-button-Ba-HusQL.js} +1 -1
  67. package/dist/assets/{detail-primitives-ChhRyu-L.js → detail-primitives-C1Ob8_w-.js} +1 -1
  68. package/dist/assets/{developer-page-BHH-G3vb.js → developer-page-Bt0eUMWA.js} +1 -1
  69. package/dist/assets/{devices-redirect-page-Ci4S4x-o.js → devices-redirect-page-C-DVpVwD.js} +1 -1
  70. package/dist/assets/{dictation-overlay-page-DFWMmpSF.js → dictation-overlay-page-B9lCjIKF.js} +1 -1
  71. package/dist/assets/{document-load-BK4EO7RZ.js → document-load-DQjnTl3_.js} +1 -1
  72. package/dist/assets/document-load-i1Uz5oSB.js +1 -0
  73. package/dist/assets/{document-viewer-page-8sDnK841.js → document-viewer-page-BRH2RPiM.js} +1 -1
  74. package/dist/assets/{emails-page-DO9ZE3jU.js → emails-page-CSmJe_xG.js} +1 -1
  75. package/dist/assets/environment-store-D8RAr0eS.js +1 -0
  76. package/dist/assets/{esm-CkWCRmp8.js → esm-45XxzHqL.js} +1 -1
  77. package/dist/assets/esm-B7iJfc7t.js +2 -0
  78. package/dist/assets/esm-BWzYRgnz.js +2 -0
  79. package/dist/assets/esm-CfVieSav.js +2 -0
  80. package/dist/assets/{esm-DcW4PisK.js → esm-D9JqyPky.js} +1 -1
  81. package/dist/assets/esm-DKymu7Df.js +1 -0
  82. package/dist/assets/esm-Ddnm4FUm.js +1 -0
  83. package/dist/assets/esm-DmK6yYdC.js +2 -0
  84. package/dist/assets/{esm-hzkaqWNK.js → esm-DqCKqYab.js} +2 -2
  85. package/dist/assets/esm-UCoXmowf.js +2 -0
  86. package/dist/assets/{file-diff-view-C9bCfhOV.js → file-diff-view-BRdlQZkN.js} +1 -1
  87. package/dist/assets/{file-editor-CfRnh-Mo.js → file-editor-BX1bpi1D.js} +1 -1
  88. package/dist/assets/{general-page-DjjeWAtL.js → general-page-BdUgCSrY.js} +2 -2
  89. package/dist/assets/{hatching-screen-B9jbVOd6.js → hatching-screen-Cyc4lAWR.js} +1 -1
  90. package/dist/assets/{hosting-screen-CGLHzAHy.js → hosting-screen-CxMtePfp.js} +1 -1
  91. package/dist/assets/{identity-page-route-BuLKelGC.js → identity-page-route-D29k81bP.js} +1 -1
  92. package/dist/assets/{inspect-page-DKNTTk-0.js → inspect-page-DEGfta5A.js} +3 -3
  93. package/dist/assets/integrations-page-B8iLgQIE.js +1 -0
  94. package/dist/assets/{intelligence-layout-SSf_CqAg.js → intelligence-layout-IUVPVrdn.js} +1 -1
  95. package/dist/assets/intelligence-layout-slots-store-XQzWB59M.js +1 -0
  96. package/dist/assets/{keyboard-shortcuts-redirect-page-CO4tE0_q.js → keyboard-shortcuts-redirect-page-Qw3OAks0.js} +1 -1
  97. package/dist/assets/{latest-assistant-text-dvDZFw6m.js → latest-assistant-text-h1N5LrMh.js} +1 -1
  98. package/dist/assets/{library-detail-page-B7-d8yHD.js → library-detail-page-JAcdR7kZ.js} +1 -1
  99. package/dist/assets/{library-page-D2GjaHzY.js → library-page-ByrTE5_6.js} +1 -1
  100. package/dist/assets/local-mode-Du2OBjZk.js +1 -0
  101. package/dist/assets/{login-page-CFgNabXb.js → login-page-6RcOKK22.js} +1 -1
  102. package/dist/assets/{logout-page-DwDFjp0Z.js → logout-page-DblYRW1m.js} +1 -1
  103. package/dist/assets/{logs-layout-BBZ9RAjZ.js → logs-layout-JhpEkfWZ.js} +1 -1
  104. package/dist/assets/{markdown-preview-CaBuvjCf.js → markdown-preview-CQ8WsJp3.js} +1 -1
  105. package/dist/assets/{media-preview-BoHSPjgq.js → media-preview-jOhlUdZb.js} +1 -1
  106. package/dist/assets/{memory-page-route-BYhuTazu.js → memory-page-route-DxLUR0GU.js} +1 -1
  107. package/dist/assets/{memory-router-playground-page-0MqBO297.js → memory-router-playground-page-DnqroUdj.js} +1 -1
  108. package/dist/assets/{message-files-panel-DQG3vRZi.js → message-files-panel-CQXlAZSX.js} +1 -1
  109. package/dist/assets/{metric-card-CfWDowxR.js → metric-card-cwfFB3Mr.js} +1 -1
  110. package/dist/assets/native-attachment-pickers-Dx58AZMz.js +1 -0
  111. package/dist/assets/native-file-Cnb6cLcA.js +1 -0
  112. package/dist/assets/{notifications-page-DKf_7eYc.js → notifications-page-Cqk19BBS.js} +1 -1
  113. package/dist/assets/{oauth-complete-page-cDoKH693.js → oauth-complete-page-Cytjrlev.js} +1 -1
  114. package/dist/assets/{oauth-popup-complete-page-Cp0vjEmH.js → oauth-popup-complete-page-P4Bx_GGh.js} +1 -1
  115. package/dist/assets/paired-platform-identity-CBHLqzfc.js +1 -0
  116. package/dist/assets/{pairing-page-skO554fH.js → pairing-page-C6gyWuXk.js} +1 -1
  117. package/dist/assets/password-reset-page-b9lhYbnM.js +1 -0
  118. package/dist/assets/{pdf-file-preview-DC5vOcs5.js → pdf-file-preview-Cjqls9OB.js} +1 -1
  119. package/dist/assets/{peeking-eyes-C795qorf.js → peeking-eyes-DCaqSJCC.js} +1 -1
  120. package/dist/assets/{personality-page-fO74T0hs.js → personality-page-C7ihlk1-.js} +1 -1
  121. package/dist/assets/{personality-page-BkCqu5OB.js → personality-page-NyfVynFa.js} +1 -1
  122. package/dist/assets/{personality-sliders-sAKu2C74.js → personality-sliders-C_ZdkwBn.js} +1 -1
  123. package/dist/assets/{plans-page-C5BxyaZO.js → plans-page-DFg4RE9c.js} +1 -1
  124. package/dist/assets/{platform-loopback-page-CrowCjnc.js → platform-loopback-page-D-thw1dN.js} +1 -1
  125. package/dist/assets/{plugin-detail-page-DdUXGKxQ.js → plugin-detail-page-BocQQKq6.js} +1 -1
  126. package/dist/assets/{plugins-page-DfMdsxPx.js → plugins-page-9rzZkoF8.js} +1 -1
  127. package/dist/assets/plugins-surface-yiUYWamb.js +1 -0
  128. package/dist/assets/{preview-error-vi2B-l2a.js → preview-error-BQEuSx7t.js} +1 -1
  129. package/dist/assets/{privacy-page-znT2Mvu5.js → privacy-page-ZeP7TZlN.js} +1 -1
  130. package/dist/assets/{privacy-screen-Dofd5Mz8.js → privacy-screen-BkFw7Pu-.js} +1 -1
  131. package/dist/assets/{provider-callback-page-BjwoQL8R.js → provider-callback-page-BaCGoR4x.js} +1 -1
  132. package/dist/assets/{provider-key-CFsemHfe.js → provider-key-BBTgZXQf.js} +1 -1
  133. package/dist/assets/{provider-signup-page-Cqs--Pss.js → provider-signup-page-Cc9uU7ie.js} +1 -1
  134. package/dist/assets/{quick-input-page-RhvkuA-a.js → quick-input-page-6AUpuRi4.js} +1 -1
  135. package/dist/assets/referral-modal-BJtDqTIF.js +1 -0
  136. package/dist/assets/{referral-modal-D3YmuUji.js → referral-modal-DzFsyTZk.js} +1 -1
  137. package/dist/assets/{rehype-katex-Cj-PIKJ4.js → rehype-katex-BQU1WTFV.js} +1 -1
  138. package/dist/assets/{research-mock-page-DtY0W-jo.js → research-mock-page-C6VY1afT.js} +1 -1
  139. package/dist/assets/{research-onboarding-route-8bvvxnvF.js → research-onboarding-route-B2oGvSgp.js} +1 -1
  140. package/dist/assets/{review-terms-screen-DlpazHw3.js → review-terms-screen-fZspq6BZ.js} +1 -1
  141. package/dist/assets/routes-DuJD7qzp.js +1 -0
  142. package/dist/assets/{schedules-DzyEr3no.js → schedules-C04f-6Zm.js} +1 -1
  143. package/dist/assets/{schedules-page-CR1ee93h.js → schedules-page-BfrYYaXP.js} +1 -1
  144. package/dist/assets/{security-redirect-page-C3bkYPpB.js → security-redirect-page-tYsg653n.js} +1 -1
  145. package/dist/assets/{select-assistant-screen-Dzrgh4-3.js → select-assistant-screen-4oMPXLnw.js} +1 -1
  146. package/dist/assets/{self-hosted-servers-C9NSM8gD.js → self-hosted-servers-NoIpSFa0.js} +1 -1
  147. package/dist/assets/{service-form-controls-BtX2YnjY.js → service-form-controls-QNDXDZpl.js} +1 -1
  148. package/dist/assets/{setting-row-Dhzhn9MB.js → setting-row-DmOMKJOa.js} +1 -1
  149. package/dist/assets/settings-BPhWFoj2.js +3 -0
  150. package/dist/assets/settings-BUU_urKv.js +3 -0
  151. package/dist/assets/settings-D2CnDcqG.js +3 -0
  152. package/dist/assets/settings-DTZCnHDa.js +3 -0
  153. package/dist/assets/{settings-divider-D9PQS5sY.js → settings-divider-B1o1lqXE.js} +1 -1
  154. package/dist/assets/{settings-layout-DgPLIzdo.js → settings-layout-DYeE5r8J.js} +1 -1
  155. package/dist/assets/share-feedback-modal-BI3wZ75P.js +1 -0
  156. package/dist/assets/{share-feedback-modal-B7VbR0v7.js → share-feedback-modal-HPQobFda.js} +2 -2
  157. package/dist/assets/{sidebar-tree-J3jVmAh0.js → sidebar-tree-BWZv1YnG.js} +1 -1
  158. package/dist/assets/{signup-page-26zBZOTJ.js → signup-page-DR87-D9g.js} +1 -1
  159. package/dist/assets/{signup-shell-BqsMKj0N.js → signup-shell-CMGC2T8z.js} +1 -1
  160. package/dist/assets/{skill-detail-page-xDrQtE_K.js → skill-detail-page-DjI3DAnL.js} +1 -1
  161. package/dist/assets/{skill-detail-panel-CbQ0z2ls.js → skill-detail-panel-r4ZZch2L.js} +1 -1
  162. package/dist/assets/{skill-removal-dialog-CTrw0VTo.js → skill-removal-dialog-CBxV3DND.js} +1 -1
  163. package/dist/assets/{skills-page-DyoAyL-Y.js → skills-page-BqL6Gc_u.js} +1 -1
  164. package/dist/assets/{sounds-page-DN6yTY9n.js → sounds-page-vEFfSpER.js} +1 -1
  165. package/dist/assets/{start-screen-hgI5Ztmj.js → start-screen-DEpQFKsn.js} +1 -1
  166. package/dist/assets/{stt-language-picker-modal-5mPezSwB.js → stt-language-picker-modal-DxX07bYt.js} +1 -1
  167. package/dist/assets/{subagent-detail-panel-Dq6cXS-i.js → subagent-detail-panel-htjjpHcd.js} +1 -1
  168. package/dist/assets/{superpowers-page-B9eA7_2A.js → superpowers-page-kVaKuF1h.js} +1 -1
  169. package/dist/assets/{system-events-page-B2JPqyrn.js → system-events-page-DsggXWm5.js} +1 -1
  170. package/dist/assets/{system-events-redirect-page-C3FW7lke.js → system-events-redirect-page-nkvMfQUL.js} +1 -1
  171. package/dist/assets/{text-preview-cPzlZljx.js → text-preview-Zq3e6oAx.js} +1 -1
  172. package/dist/assets/{theme-stage-page-l6bxpzmD.js → theme-stage-page-Bljw4QZW.js} +1 -1
  173. package/dist/assets/{tiptap-document-editor-DZcFWtPf.js → tiptap-document-editor-xgudHmFv.js} +1 -1
  174. package/dist/assets/{tool-detail-panel-dCPxQfT2.js → tool-detail-panel-C_YQ2oSL.js} +1 -1
  175. package/dist/assets/tool-detail-panel-D_HPzTu7.js +1 -0
  176. package/dist/assets/{trait-cycle-row-CEqSGPz2.js → trait-cycle-row-B-vau_0l.js} +1 -1
  177. package/dist/assets/{upgrade-cancel-page-B-D_oeBx.js → upgrade-cancel-page-BSs3JiLK.js} +1 -1
  178. package/dist/assets/{upgrade-success-page-DCwSI4N0.js → upgrade-success-page-CIl9nqZ-.js} +1 -1
  179. package/dist/assets/{usage-redirect-page-DKaEQTLK.js → usage-redirect-page-CSF19svH.js} +1 -1
  180. package/dist/assets/{use-app-delete-Cl7y_3Ka.js → use-app-delete-DiPjRLRa.js} +1 -1
  181. package/dist/assets/{use-assistant-identity-details-DBNlc3LO.js → use-assistant-identity-details-DNwuuLLH.js} +1 -1
  182. package/dist/assets/{use-checkout-dismiss-refresh-D13I69hb.js → use-checkout-dismiss-refresh-9thdnSxg.js} +1 -1
  183. package/dist/assets/{use-edge-swipe-back-DW3HRHcT.js → use-edge-swipe-back-Bjgkaw_i.js} +1 -1
  184. package/dist/assets/{use-hotkey-recorder-Di3iXQJb.js → use-hotkey-recorder-BQ9JKgzA.js} +1 -1
  185. package/dist/assets/{use-invite-link-dialog-BSufG3vr.js → use-invite-link-dialog-CPA5JA2d.js} +1 -1
  186. package/dist/assets/{use-platform-assistant-id-CKhExZPC.js → use-platform-assistant-id-DmUopUSF.js} +1 -1
  187. package/dist/assets/use-plugins-list-wWWZEj81.js +1 -0
  188. package/dist/assets/{use-return-to-short-circuit-BIecKROR.js → use-return-to-short-circuit-XtwjM2wL.js} +1 -1
  189. package/dist/assets/{use-side-list-room-C4-lrJ7T.js → use-side-list-room-CwvpgAra.js} +1 -1
  190. package/dist/assets/{use-skill-actions-B3-h8aTL.js → use-skill-actions-DmsYHPlR.js} +1 -1
  191. package/dist/assets/{use-skill-detail-files-Bp1ZrmrD.js → use-skill-detail-files-zzQYy1s6.js} +1 -1
  192. package/dist/assets/use-supports-credentials-settings-DzCL7C5c.js +1 -0
  193. package/dist/assets/{use-transcript-message-by-id-CWtKMTjb.js → use-transcript-message-by-id-D7Yfrafc.js} +1 -1
  194. package/dist/assets/{vendor-DUzxlXbu.js → vendor-Dc7Mo5cU.js} +2 -2
  195. package/dist/assets/{voice-page-CUbLB1IH.js → voice-page-CG_8l-4I.js} +1 -1
  196. package/dist/assets/{wake-detail-panel-DXNbDu7k.js → wake-detail-panel-BZUN3Ank.js} +1 -1
  197. package/dist/assets/{weather-forecast-display-Dx_JDnVC.js → weather-forecast-display-DI-mNOgk.js} +1 -1
  198. package/dist/assets/{web-SBJYIwk0.js → web-B3OlhPmj.js} +1 -1
  199. package/dist/assets/{web-BIq0eRiB.js → web-Bmo-aiin.js} +1 -1
  200. package/dist/assets/{web-Dq2IVkFl.js → web-Btp6i3fG.js} +1 -1
  201. package/dist/assets/{web-8nc1FdUf.js → web-CPQ5LCS4.js} +1 -1
  202. package/dist/assets/{web-nBaaP7qv.js → web-CnwjfqVv.js} +1 -1
  203. package/dist/assets/{web-DaIUYGHw.js → web-D1m41k7P.js} +1 -1
  204. package/dist/assets/{web-BgEkRgce.js → web-DNTG9B77.js} +1 -1
  205. package/dist/assets/{web-DGjg0P8a.js → web-DRd5wEPc.js} +1 -1
  206. package/dist/assets/{web-BMzfWFM-.js → web-DWh6C3OS.js} +1 -1
  207. package/dist/assets/welcome-screen-DpgIpbIr.js +1 -0
  208. package/dist/assets/{workflow-detail-panel-CTOW3eOK.js → workflow-detail-panel-CUaM-3zz.js} +1 -1
  209. package/dist/assets/{workspace-page-DBWsGAaO.js → workspace-page-Vurh3q8D.js} +1 -1
  210. package/dist/index.html +3 -3
  211. package/package.json +1 -1
  212. package/dist/assets/add-credits-modal-Bjj5IcfD.js +0 -1
  213. package/dist/assets/app-BFMKh-Wt.css +0 -2
  214. package/dist/assets/app-n7D5Q-HS.js +0 -392
  215. package/dist/assets/auth-store-C6J2aPKg.js +0 -1
  216. package/dist/assets/avatar-bundled-components-L3rXWeWJ.js +0 -1
  217. package/dist/assets/checkout-return-target-DDDp8tMv.js +0 -1
  218. package/dist/assets/command-palette-Bqkpugfw.js +0 -1
  219. package/dist/assets/deploy-dialogs-CoLI4cjl.js +0 -1
  220. package/dist/assets/document-load-BRhCAhb0.js +0 -1
  221. package/dist/assets/environment-store-BeKdNCDQ.js +0 -1
  222. package/dist/assets/esm-BGKIdtva.js +0 -2
  223. package/dist/assets/esm-CeA0xUzc.js +0 -2
  224. package/dist/assets/esm-CskPvois.js +0 -2
  225. package/dist/assets/esm-DC5Xk3B0.js +0 -2
  226. package/dist/assets/esm-DbCpCgyJ.js +0 -1
  227. package/dist/assets/esm-DtH_yADh.js +0 -1
  228. package/dist/assets/esm-hhBjqEXz.js +0 -2
  229. package/dist/assets/integrations-page-DyiqZ_kn.js +0 -1
  230. package/dist/assets/intelligence-layout-slots-store-DqHNLKm3.js +0 -1
  231. package/dist/assets/local-mode-CMLuHoSn.js +0 -1
  232. package/dist/assets/native-attachment-pickers-Ck3NxYSR.js +0 -1
  233. package/dist/assets/native-file-D0OMqAkq.js +0 -1
  234. package/dist/assets/paired-platform-identity-DskZXcWX.js +0 -1
  235. package/dist/assets/password-reset-page-Dr8OrlGm.js +0 -1
  236. package/dist/assets/plugins-surface-BL69ztAA.js +0 -1
  237. package/dist/assets/referral-modal-WPGRXuLA.js +0 -1
  238. package/dist/assets/routes-DaWUVprK.js +0 -1
  239. package/dist/assets/settings-BaBLTX_4.js +0 -3
  240. package/dist/assets/settings-DYkeeCDS.js +0 -3
  241. package/dist/assets/settings-DrC1YWLC.js +0 -3
  242. package/dist/assets/settings-zLCbPrgt.js +0 -3
  243. package/dist/assets/share-feedback-modal-8OzEECo-.js +0 -1
  244. package/dist/assets/tool-detail-panel-Mme2rbul.js +0 -1
  245. package/dist/assets/use-plugins-list-BTPeAWTb.js +0 -1
  246. package/dist/assets/use-supports-credentials-settings-D1R1OKic.js +0 -1
  247. package/dist/assets/welcome-screen-bgD2LcV9.js +0 -1
  248. /package/dist/assets/{account-Cb-DyELI.js → account-B_JHsQ7Y.js} +0 -0
  249. /package/dist/assets/{account-RgxzlOwE.js → account-BdE9xiiS.js} +0 -0
  250. /package/dist/assets/{account-C8xg8kR6.js → account-DByPcLAh.js} +0 -0
  251. /package/dist/assets/{activation-fQ2w8k-_.js → activation-C0jvOpIw.js} +0 -0
  252. /package/dist/assets/{activation-Bgezxtsd.js → activation-CjfObHN6.js} +0 -0
  253. /package/dist/assets/{activation-Dq1qihrb.js → activation-Cs9FZ7su.js} +0 -0
  254. /package/dist/assets/{activation-tasks-DDUN5H65.js → activation-tasks-BIdR8oB6.js} +0 -0
  255. /package/dist/assets/{activation-tasks-v6hBb3kp.js → activation-tasks-BqMm-gES.js} +0 -0
  256. /package/dist/assets/{activation-tasks-BOXaCIAc.js → activation-tasks-D9QFkLUX.js} +0 -0
  257. /package/dist/assets/{build.umd-B4nySx9q.js → build.umd-CuYKVYcE.js} +0 -0
  258. /package/dist/assets/{channels-1fPalZ3Q.js → channels-BgmDV3yg.js} +0 -0
  259. /package/dist/assets/{channels-zwQvxHhS.js → channels-ButPDaP1.js} +0 -0
  260. /package/dist/assets/{channels-DUGt-c_s.js → channels-DJOsCglQ.js} +0 -0
  261. /package/dist/assets/{channels-Bp6785EE.js → channels-ao_qpzfd.js} +0 -0
  262. /package/dist/assets/{chat-CBbKX2hh.js → chat-BZM-_HVA.js} +0 -0
  263. /package/dist/assets/{chat-Cp6r9FuL.js → chat-DBnTHdZ_.js} +0 -0
  264. /package/dist/assets/{chat-CVcAmb4G.js → chat-Ddhqy6p0.js} +0 -0
  265. /package/dist/assets/{chat-DaQ9msXY.js → chat-JLp9gz-v.js} +0 -0
  266. /package/dist/assets/{common-twS-Xtq8.js → common-2SsDXv7P.js} +0 -0
  267. /package/dist/assets/{common-ue46KSet.js → common-BmacJcGg.js} +0 -0
  268. /package/dist/assets/{common-DbDGhUk1.js → common-CHUeQ07r.js} +0 -0
  269. /package/dist/assets/{common-B9fnih0e.js → common-CO-ZzXVu.js} +0 -0
  270. /package/dist/assets/{contacts-CwnIjST-.js → contacts-B1fs29IO.js} +0 -0
  271. /package/dist/assets/{contacts-7s5uUt1u.js → contacts-BC3u20ot.js} +0 -0
  272. /package/dist/assets/{contacts-Bb43JJJN.js → contacts-D-hYt1vp.js} +0 -0
  273. /package/dist/assets/{contacts-CNaEZ-fL.js → contacts-DZ0dUPpj.js} +0 -0
  274. /package/dist/assets/{credential-requests-J6rR1d8i.js → credential-requests-BTzncfcX.js} +0 -0
  275. /package/dist/assets/{credential-requests-BXKQ_K8b.js → credential-requests-Bbo1KiQ2.js} +0 -0
  276. /package/dist/assets/{credential-requests-BOCpSsQ3.js → credential-requests-DarWjx1l.js} +0 -0
  277. /package/dist/assets/{credential-requests-CoE9Lb8S.js → credential-requests-a3ty_CQg.js} +0 -0
  278. /package/dist/assets/{definitions-BfnfKapN.js → definitions-Dw0S2Kue.js} +0 -0
  279. /package/dist/assets/{definitions-C8lsOLos.js → definitions-uW59_E3r.js} +0 -0
  280. /package/dist/assets/{home-Dn0m9kBd.js → home-Ba50-ePU.js} +0 -0
  281. /package/dist/assets/{home-BVIzMQck.js → home-Dn83lNtr.js} +0 -0
  282. /package/dist/assets/{home-CCaaP5mz.js → home-uNCEHYNU.js} +0 -0
  283. /package/dist/assets/{home-DpWJt0sR.js → home-vNakvxwE.js} +0 -0
  284. /package/dist/assets/{intelligence-DGasqUYG.js → intelligence-BMwNCKUJ.js} +0 -0
  285. /package/dist/assets/{intelligence-CoqqSgFj.js → intelligence-C5iGRZnx.js} +0 -0
  286. /package/dist/assets/{intelligence-DsAUVOAd.js → intelligence-DbBmLA-o.js} +0 -0
  287. /package/dist/assets/{intelligence-2OGzDFvC.js → intelligence-onjWaSVH.js} +0 -0
  288. /package/dist/assets/{library-BfKxaPf0.js → library-BBlMmqjc.js} +0 -0
  289. /package/dist/assets/{library-DrPeM0_h.js → library-CuIWcirl.js} +0 -0
  290. /package/dist/assets/{library-t0vQjS7N.js → library-D6ctLR6f.js} +0 -0
  291. /package/dist/assets/{library-DO9JsNSy.js → library-x7Mvyr0R.js} +0 -0
  292. /package/dist/assets/{logs-M2b1TrMN.js → logs-BXyEWdqc.js} +0 -0
  293. /package/dist/assets/{logs-BuCPf34Y.js → logs-CaCTiIdg.js} +0 -0
  294. /package/dist/assets/{logs-C5iN-fuK.js → logs-DHQGGOtW.js} +0 -0
  295. /package/dist/assets/{logs-oZIjcpgE.js → logs-ZfHst0hW.js} +0 -0
  296. /package/dist/assets/{onboarding-DIUBmWBM.js → onboarding-BUIzSjep.js} +0 -0
  297. /package/dist/assets/{onboarding-Ce_CYrXg.js → onboarding-CBjJUBPn.js} +0 -0
  298. /package/dist/assets/{onboarding-By9JR2qu.js → onboarding-CzFJhucy.js} +0 -0
  299. /package/dist/assets/{onboarding-Bz72aOnk.js → onboarding-Muv5Kils.js} +0 -0
  300. /package/dist/assets/{pdf-BKWEs79u.js → pdf-DREAlG2U.js} +0 -0
  301. /package/dist/assets/{remote-web-DlydCzEK.js → remote-web-DBfjp6wl.js} +0 -0
  302. /package/dist/assets/{remote-web-yIqbgeYo.js → remote-web-DOZ-eyQZ.js} +0 -0
  303. /package/dist/assets/{remote-web-D_8aBk2_.js → remote-web-Dq6aZsrk.js} +0 -0
  304. /package/dist/assets/{remote-web-CdqK_lTu.js → remote-web-WaHVTMrL.js} +0 -0
  305. /package/dist/assets/{schedules-Bny8l_CP.js → schedules-B0L8TyFP.js} +0 -0
  306. /package/dist/assets/{schedules-KPfLvypq.js → schedules-CGZ6Nccv.js} +0 -0
  307. /package/dist/assets/{schedules-uSjJ_EjR.js → schedules-DoE9PC23.js} +0 -0
  308. /package/dist/assets/{schedules-cg2MRom9.js → schedules-UJxl03Ec.js} +0 -0
  309. /package/dist/assets/{terminal-DgXT91mg.js → terminal-BA49Abnn.js} +0 -0
  310. /package/dist/assets/{terminal-CM_nhgrt.js → terminal-BfdRfPO0.js} +0 -0
  311. /package/dist/assets/{terminal-CacAJB1i.js → terminal-CqxnRkP7.js} +0 -0
  312. /package/dist/assets/{terminal-CmV3W_IT.js → terminal-CrttnvS1.js} +0 -0
  313. /package/dist/assets/{workspace-hqnPWewF.js → workspace-AKEeEFWF.js} +0 -0
  314. /package/dist/assets/{workspace-9CiV_W5c.js → workspace-BYx3S57B.js} +0 -0
  315. /package/dist/assets/{workspace-DWS-BW9d.js → workspace-Cnq3vrii.js} +0 -0
  316. /package/dist/assets/{workspace-uAp0lLvq.js → workspace-fMhuS1x9.js} +0 -0
  317. /package/dist/assets/{xterm-DdbteOXE.js → xterm-B1tCoG0n.js} +0 -0
  318. /package/dist/assets/{xterm-addon-fit-LbAazlGK.js → xterm-addon-fit-CcSybFjN.js} +0 -0
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$_ as t,Gx as n,Ox as r,Ux as i,iS as a,nS as o,rS as s,ru as c,tS as l}from"./app-n7D5Q-HS.js";import{Zn as u,j as d}from"./vendor-DUzxlXbu.js";import{t as f,x as p}from"./react-B9IgSVeK.js";import{Jn as m,ci as h,fi as g,qi as _,v}from"./icons-DxrLl-Dj.js";var y=e(p(),1),b=f();function x(e){return e.replace(/\.00$/,``)}function S({icon:e,value:t,label:r}){return(0,b.jsxs)(`div`,{className:`flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-lg bg-[var(--surface-base)] px-2 py-1.5`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center text-[var(--content-default)]`,children:e}),(0,b.jsx)(n,{variant:`body-medium-default`,as:`span`,className:`text-[var(--content-default)]`,children:t}),(0,b.jsx)(n,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:r})]})}function C(){let{t:e}=d(),{data:r,isLoading:f,isError:p}=u(c()),{copy:C,copied:w}=t({successMessage:e(`referralContent.copySuccess`),errorMessage:e(`referralContent.copyError`)}),T=r?.is_eligible_for_credits===!1,E=s(),D=(0,y.useId)(),O=r?e(`referralContent.subtitleWithAmounts`,{creditAmount:x(r.referrer_credit_amount),earningCap:x(r.earning_cap)}):e(`referralContent.subtitleDefault`),k=r?(0,b.jsx)(l,{variant:`outlined`,className:a(`shrink-0`,T&&`pointer-events-none`),disabled:T,"aria-describedby":T?D:void 0,onClick:()=>C(r.referral_url),leftIcon:w?(0,b.jsx)(_,{className:`h-3.5 w-3.5`}):(0,b.jsx)(h,{className:`h-3.5 w-3.5`}),"data-testid":`referral-copy-button`,children:e(w?`referralContent.copied`:`referralContent.shareLink`)}):null;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(n,{as:`p`,variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:O}),f?(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,b.jsx)(m,{className:`h-4 w-4 animate-spin`}),e(`referralContent.loading`)]}):p||!r?(0,b.jsx)(i,{tone:`error`,children:e(`referralContent.loadError`)}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,b.jsx)(S,{icon:(0,b.jsx)(g,{className:`h-3.5 w-3.5`}),value:x(r.total_earned),label:e(`referralContent.creditsEarned`)}),(0,b.jsx)(S,{icon:(0,b.jsx)(v,{className:`h-3.5 w-3.5`}),value:r.referred_count,label:e(`referralContent.friendsReferred`)}),T?(0,b.jsx)(o,{content:e(`referralContent.gatedTooltip`),children:(0,b.jsx)(`span`,{tabIndex:E?0:void 0,className:`inline-flex shrink-0 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:k})}):k]}),T&&(0,b.jsx)(n,{as:`p`,id:D,variant:`body-small-default`,className:E?`sr-only`:`text-[var(--content-tertiary)]`,children:e(`referralContent.gatedTooltip`)})]})]})}function w({open:e,onOpenChange:t}){let{t:n}=d();return(0,b.jsx)(r.Root,{open:e,onOpenChange:t,children:(0,b.jsxs)(r.Content,{"data-testid":`referral-modal`,children:[(0,b.jsx)(r.Header,{children:(0,b.jsx)(r.Title,{children:n(`referralModal.title`)})}),(0,b.jsx)(r.Body,{children:(0,b.jsx)(C,{})})]})})}export{w as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$_ as t,Gx as n,Ox as r,Ux as i,iS as a,nS as o,rS as s,ru as c,tS as l}from"./app-1VZKPehC.js";import{Zn as u,j as d}from"./vendor-Dc7Mo5cU.js";import{t as f,x as p}from"./react-B9IgSVeK.js";import{Jn as m,ci as h,fi as g,qi as _,v}from"./icons-DxrLl-Dj.js";var y=e(p(),1),b=f();function x(e){return e.replace(/\.00$/,``)}function S({icon:e,value:t,label:r}){return(0,b.jsxs)(`div`,{className:`flex h-8 min-w-0 flex-1 items-center gap-1.5 rounded-lg bg-[var(--surface-base)] px-2 py-1.5`,children:[(0,b.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-3.5 w-3.5 shrink-0 items-center justify-center text-[var(--content-default)]`,children:e}),(0,b.jsx)(n,{variant:`body-medium-default`,as:`span`,className:`text-[var(--content-default)]`,children:t}),(0,b.jsx)(n,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:r})]})}function C(){let{t:e}=d(),{data:r,isLoading:f,isError:p}=u(c()),{copy:C,copied:w}=t({successMessage:e(`referralContent.copySuccess`),errorMessage:e(`referralContent.copyError`)}),T=r?.is_eligible_for_credits===!1,E=s(),D=(0,y.useId)(),O=r?e(`referralContent.subtitleWithAmounts`,{creditAmount:x(r.referrer_credit_amount),earningCap:x(r.earning_cap)}):e(`referralContent.subtitleDefault`),k=r?(0,b.jsx)(l,{variant:`outlined`,className:a(`shrink-0`,T&&`pointer-events-none`),disabled:T,"aria-describedby":T?D:void 0,onClick:()=>C(r.referral_url),leftIcon:w?(0,b.jsx)(_,{className:`h-3.5 w-3.5`}):(0,b.jsx)(h,{className:`h-3.5 w-3.5`}),"data-testid":`referral-copy-button`,children:e(w?`referralContent.copied`:`referralContent.shareLink`)}):null;return(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(n,{as:`p`,variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:O}),f?(0,b.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,b.jsx)(m,{className:`h-4 w-4 animate-spin`}),e(`referralContent.loading`)]}):p||!r?(0,b.jsx)(i,{tone:`error`,children:e(`referralContent.loadError`)}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,b.jsx)(S,{icon:(0,b.jsx)(g,{className:`h-3.5 w-3.5`}),value:x(r.total_earned),label:e(`referralContent.creditsEarned`)}),(0,b.jsx)(S,{icon:(0,b.jsx)(v,{className:`h-3.5 w-3.5`}),value:r.referred_count,label:e(`referralContent.friendsReferred`)}),T?(0,b.jsx)(o,{content:e(`referralContent.gatedTooltip`),children:(0,b.jsx)(`span`,{tabIndex:E?0:void 0,className:`inline-flex shrink-0 rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:k})}):k]}),T&&(0,b.jsx)(n,{as:`p`,id:D,variant:`body-small-default`,className:E?`sr-only`:`text-[var(--content-tertiary)]`,children:e(`referralContent.gatedTooltip`)})]})]})}function w({open:e,onOpenChange:t}){let{t:n}=d();return(0,b.jsx)(r.Root,{open:e,onOpenChange:t,children:(0,b.jsxs)(r.Content,{"data-testid":`referral-modal`,children:[(0,b.jsx)(r.Header,{children:(0,b.jsx)(r.Title,{children:n(`referralModal.title`)})}),(0,b.jsx)(r.Body,{children:(0,b.jsx)(C,{})})]})})}export{w as t};
@@ -1,4 +1,4 @@
1
- import{a as e,dt as t,ft as n,i as r,pt as i,r as a}from"./vendor-DUzxlXbu.js";var o=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},s=/([A-Z])/g,c=e=>e.replace(s,`-$1`).toLowerCase(),l={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},u=/[&><"']/g,d=e=>String(e).replace(u,e=>l[e]),f=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?f(e.body[0]):e:e.type===`font`?f(e.body):e,p=new Set([`mathord`,`textord`,`atom`]),m=e=>p.has(f(e).type),h=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},g={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function _(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function v(e){return e.default===void 0?_(Array.isArray(e.type)?e.type[0]:e.type):e.default}function y(e,t,n,r){var i=n[t];e[t]=i===void 0?v(r):r.processor?r.processor(i):i}var b=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(g)){var n=g[t];n&&y(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new o(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=h(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},x=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return re[ie[this.id]]}sub(){return re[ae[this.id]]}fracNum(){return re[oe[this.id]]}fracDen(){return re[se[this.id]]}cramp(){return re[ce[this.id]]}text(){return re[le[this.id]]}isTight(){return this.size>=2}},S=0,C=1,w=2,ee=3,T=4,te=5,ne=6,E=7,re=[new x(S,0,!1),new x(C,0,!0),new x(w,1,!1),new x(ee,1,!0),new x(T,2,!1),new x(te,2,!0),new x(ne,3,!1),new x(E,3,!0)],ie=[T,te,T,te,ne,E,ne,E],ae=[te,te,te,te,E,E,E,E],oe=[w,ee,T,te,ne,E,ne,E],se=[ee,ee,te,te,E,E,E,E],ce=[C,C,ee,ee,te,te,E,E],le=[S,C,w,ee,w,ee,w,ee],D={DISPLAY:re[S],TEXT:re[w],SCRIPT:re[T],SCRIPTSCRIPT:re[ne]},ue=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function de(e){for(var t=0;t<ue.length;t++)for(var n=ue[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var fe=[];ue.forEach(e=>e.blocks.forEach(e=>fe.push(...e)));function pe(e){for(var t=0;t<fe.length;t+=2)if(e>=fe[t]&&e<=fe[t+1])return!0;return!1}var O=e=>e+` `+e,me=80,he=function(e,t){return`M95,`+(622+e+t)+`
1
+ import{a as e,dt as t,ft as n,i as r,pt as i,r as a}from"./vendor-Dc7Mo5cU.js";var o=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},s=/([A-Z])/g,c=e=>e.replace(s,`-$1`).toLowerCase(),l={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},u=/[&><"']/g,d=e=>String(e).replace(u,e=>l[e]),f=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?f(e.body[0]):e:e.type===`font`?f(e.body):e,p=new Set([`mathord`,`textord`,`atom`]),m=e=>p.has(f(e).type),h=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},g={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function _(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function v(e){return e.default===void 0?_(Array.isArray(e.type)?e.type[0]:e.type):e.default}function y(e,t,n,r){var i=n[t];e[t]=i===void 0?v(r):r.processor?r.processor(i):i}var b=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(g)){var n=g[t];n&&y(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new o(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=h(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},x=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return re[ie[this.id]]}sub(){return re[ae[this.id]]}fracNum(){return re[oe[this.id]]}fracDen(){return re[se[this.id]]}cramp(){return re[ce[this.id]]}text(){return re[le[this.id]]}isTight(){return this.size>=2}},S=0,C=1,w=2,ee=3,T=4,te=5,ne=6,E=7,re=[new x(S,0,!1),new x(C,0,!0),new x(w,1,!1),new x(ee,1,!0),new x(T,2,!1),new x(te,2,!0),new x(ne,3,!1),new x(E,3,!0)],ie=[T,te,T,te,ne,E,ne,E],ae=[te,te,te,te,E,E,E,E],oe=[w,ee,T,te,ne,E,ne,E],se=[ee,ee,te,te,E,E,E,E],ce=[C,C,ee,ee,te,te,E,E],le=[S,C,w,ee,w,ee,w,ee],D={DISPLAY:re[S],TEXT:re[w],SCRIPT:re[T],SCRIPTSCRIPT:re[ne]},ue=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function de(e){for(var t=0;t<ue.length;t++)for(var n=ue[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var fe=[];ue.forEach(e=>e.blocks.forEach(e=>fe.push(...e)));function pe(e){for(var t=0;t<fe.length;t+=2)if(e>=fe[t]&&e<=fe[t+1])return!0;return!1}var O=e=>e+` `+e,me=80,he=function(e,t){return`M95,`+(622+e+t)+`
2
2
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
3
3
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
4
4
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ib as t}from"./app-n7D5Q-HS.js";import{j as n}from"./vendor-DUzxlXbu.js";import{f as r,r as i,t as a,x as o}from"./react-B9IgSVeK.js";var s=e(o(),1),c=a(),l=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}];function u(){let{t:e}=n(`chat`);r();let[a,o]=(0,s.useState)(`results`),[u,d]=(0,s.useState)(()=>new Map);return l.map((e,t)=>({fact:e,index:t})),(0,c.jsx)(i,{to:t.assistant,replace:!0})}export{u as ResearchMockPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ib as t}from"./app-1VZKPehC.js";import{j as n}from"./vendor-Dc7Mo5cU.js";import{f as r,r as i,t as a,x as o}from"./react-B9IgSVeK.js";var s=e(o(),1),c=a(),l=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}];function u(){let{t:e}=n(`chat`);r();let[a,o]=(0,s.useState)(`results`),[u,d]=(0,s.useState)(()=>new Map);return l.map((e,t)=>({fact:e,index:t})),(0,c.jsx)(i,{to:t.assistant,replace:!0})}export{u as ResearchMockPage};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$h as t,$r as n,A_ as r,Aa as i,Ai as a,Ap as o,Bo as s,C_ as c,Cb as l,Db as u,Dc as d,Di as f,Fh as p,Ga as m,Gb as h,Ha as g,Hr as _,Ib as v,Ix as y,Ja as b,Jh as x,Ka as S,Kh as C,Lh as w,Mi as T,Mp as E,Na as D,Oa as O,Oi as k,Op as A,Ph as j,Pu as ee,Qb as M,Qh as N,Qr as te,Qy as ne,Ri as P,Ro as re,S_ as F,Ta as ie,U_ as ae,Ua as oe,Ux as se,Wa as ce,Xg as I,Xr as L,Yh as le,Yr as ue,Yt as de,Zh as fe,ab as R,as as pe,e_ as me,ei as he,fx as ge,iS as z,ji as _e,k_ as ve,ky as ye,mi as B,om as be,qh as xe,qo as Se,qp as Ce,qr as we,sm as Te,tS as V,uh as Ee,wb as De,ys as Oe,zx as ke,zy as Ae}from"./app-n7D5Q-HS.js";import{N as je,Q as Me,Ut as Ne,Vt as Pe,Wt as Fe,_ as Ie,d as Le,dr as Re,er as H,f as U,g as W,h as G,j as K,m as ze}from"./vendor-DUzxlXbu.js";import{_ as Be,b as Ve,f as He,t as Ue,x as We}from"./react-B9IgSVeK.js";import{It as Ge,Jn as q,La as J,Ra as Ke,W as qe,Xt as Je,_t as Ye,i as Xe,ii as Ze,m as Qe}from"./icons-DxrLl-Dj.js";import{r as $e,t as et}from"./signup-onboarding-handoff-CEICxhlG.js";import{i as tt,t as nt}from"./personality-sliders-sAKu2C74.js";import{n as rt,t as it}from"./peeking-eyes-C795qorf.js";import{i as at,n as ot,r as st,t as ct}from"./latest-assistant-text-dvDZFw6m.js";import{n as lt,r as ut,t as dt}from"./onboarding-step-layout-D1cb8TW9.js";import{a as ft,i as pt,n as mt,o as ht,r as gt,s as _t,t as vt}from"./avatar-random-CWz7C9rs.js";import{n as yt}from"./plugin-attribution-DtahcNMf.js";import{t as bt}from"./await-org-header-settled-BOJkVf_1.js";var Y=e(We(),1),xt=[{id:`grounded`,label:`Grounded`,descriptor:`Calm and precise`,tagline:`Measured. No filler.`,names:[`Penn`,`Sage`,`Atlas`,`Orion`,`Reed`,`Quill`]},{id:`warm`,label:`Warm`,descriptor:`Warm and easy`,tagline:`Friendly and casual.`,names:[`Kit`,`Remy`,`Wren`,`Milo`,`Fenn`,`Cleo`]},{id:`energetic`,label:`Energetic`,descriptor:`Fast and direct`,tagline:`Brief. To the point.`,names:[`Nova`,`Ember`,`Cade`,`Lark`,`Vela`,`Ziggy`]},{id:`poetic`,label:`Poetic`,descriptor:`Quiet and observant`,tagline:`Listens, then replies.`,names:[`Luna`,`Iris`,`Vesper`,`Lyra`,`Juno`,`Ada`]}],St=`grounded`,Ct={randomized:`random_initial`,custom:`custom_name`};function wt(){return xt.flatMap(e=>e.names)}function Tt(e={}){let t=wt(),n=e.random??Math.random,r=e.exclude?t.filter(t=>t!==e.exclude):t,i=r.length>0?r:t;return i[Math.floor(n()*i.length)]??t[0]??``}var Et=12;function Dt(e,t){let n=e.slice(0,Et).map(e=>`- ${e.name} — ${e.description}`).join(`
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$h as t,$r as n,A_ as r,Aa as i,Ai as a,Ap as o,Bo as s,C_ as c,Cb as l,Db as u,Dc as d,Di as f,Fh as p,Ga as m,Gb as h,Ha as g,Hr as _,Ib as v,Ix as y,Ja as b,Jh as x,Ka as S,Kh as C,Lh as w,Mi as T,Mp as E,Na as D,Oa as O,Oi as k,Op as A,Ph as j,Pu as ee,Qb as M,Qh as N,Qr as te,Qy as ne,Ri as P,Ro as re,S_ as F,Ta as ie,U_ as ae,Ua as oe,Ux as se,Wa as ce,Xg as I,Xr as L,Yh as le,Yr as ue,Yt as de,Zh as fe,ab as R,as as pe,e_ as me,ei as he,fx as ge,iS as z,ji as _e,k_ as ve,ky as ye,mi as B,om as be,qh as xe,qo as Se,qp as Ce,qr as we,sm as Te,tS as V,uh as Ee,wb as De,ys as Oe,zx as ke,zy as Ae}from"./app-1VZKPehC.js";import{N as je,Q as Me,Ut as Ne,Vt as Pe,Wt as Fe,_ as Ie,d as Le,dr as Re,er as H,f as U,g as W,h as G,j as K,m as ze}from"./vendor-Dc7Mo5cU.js";import{_ as Be,b as Ve,f as He,t as Ue,x as We}from"./react-B9IgSVeK.js";import{It as Ge,Jn as q,La as J,Ra as Ke,W as qe,Xt as Je,_t as Ye,i as Xe,ii as Ze,m as Qe}from"./icons-DxrLl-Dj.js";import{r as $e,t as et}from"./signup-onboarding-handoff-CEICxhlG.js";import{i as tt,t as nt}from"./personality-sliders-C_ZdkwBn.js";import{n as rt,t as it}from"./peeking-eyes-DCaqSJCC.js";import{i as at,n as ot,r as st,t as ct}from"./latest-assistant-text-h1N5LrMh.js";import{n as lt,r as ut,t as dt}from"./onboarding-step-layout-D1cb8TW9.js";import{a as ft,i as pt,n as mt,o as ht,r as gt,s as _t,t as vt}from"./avatar-random-LVBo5QRK.js";import{n as yt}from"./plugin-attribution-DtahcNMf.js";import{t as bt}from"./await-org-header-settled-B_cb553t.js";var Y=e(We(),1),xt=[{id:`grounded`,label:`Grounded`,descriptor:`Calm and precise`,tagline:`Measured. No filler.`,names:[`Penn`,`Sage`,`Atlas`,`Orion`,`Reed`,`Quill`]},{id:`warm`,label:`Warm`,descriptor:`Warm and easy`,tagline:`Friendly and casual.`,names:[`Kit`,`Remy`,`Wren`,`Milo`,`Fenn`,`Cleo`]},{id:`energetic`,label:`Energetic`,descriptor:`Fast and direct`,tagline:`Brief. To the point.`,names:[`Nova`,`Ember`,`Cade`,`Lark`,`Vela`,`Ziggy`]},{id:`poetic`,label:`Poetic`,descriptor:`Quiet and observant`,tagline:`Listens, then replies.`,names:[`Luna`,`Iris`,`Vesper`,`Lyra`,`Juno`,`Ada`]}],St=`grounded`,Ct={randomized:`random_initial`,custom:`custom_name`};function wt(){return xt.flatMap(e=>e.names)}function Tt(e={}){let t=wt(),n=e.random??Math.random,r=e.exclude?t.filter(t=>t!==e.exclude):t,i=r.length>0?r:t;return i[Math.floor(n()*i.length)]??t[0]??``}var Et=12;function Dt(e,t){let n=e.slice(0,Et).map(e=>`- ${e.name} — ${e.description}`).join(`
2
2
  `);return n?`
3
3
  Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
4
4
  ${n}
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ap as t,Bu as n,Fs as ee,Gu as r,Hu as i,Ib as a,Lb as o,Op as s,Uu as c,Vu as l,Wu as te,qr as u,tS as d,zm as f,zu as p,zv as m}from"./app-n7D5Q-HS.js";import{j as h}from"./vendor-DUzxlXbu.js";import{_ as g,f as _,t as v,x as y}from"./react-B9IgSVeK.js";import{dt as b}from"./icons-DxrLl-Dj.js";import{n as x,t as S}from"./consent-controls--WNBdiwt.js";var C=e(y(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function ne(e){return w[e]??[]}function E(e){return T[e]??[]}var D=v();function O(){let{t:e}=h(`onboarding`),v=_(),[y]=g(),w=s.use.user()?.id??null,T=s.use.logout(),O=o(),k=t(),[A,j]=r(),[M,N]=i(),[P,F]=c(),[I,L]=te(),[R]=p(),[z]=n(),B=l(),V=P??!0,H=I??!0,[U]=(0,C.useState)(()=>!A),[W]=(0,C.useState)(()=>!M),[G]=(0,C.useState)(()=>!R),[K]=(0,C.useState)(()=>!z),q=!U&&!W&&!G&&!K,[J]=(0,C.useState)(()=>!B),Y=U||q,X=W||q,Z=G||q,Q=K||q||J,$=!q&&!U&&!W,re=q?`Terms & privacy`:$?`Review your privacy preferences`:J?`Before You Start`:`Updated terms`,ie=q?`Review your terms and privacy preferences anytime.`:$?`Confirm your privacy preferences to continue.`:J?`Review and accept the terms to start using your assistant. You can update your preferences anytime in Settings.`:`We've updated our terms. Please review and accept to continue.`,ae=(0,C.useCallback)(()=>{f({userId:w,tos:A,privacy:M,shareAnalytics:Z?V:null,shareDiagnostics:Q?H:null,hasPlatformSession:k}),v(m(y.get(`returnTo`),a.assistant),{replace:!0})},[M,k,v,y,V,H,Z,Q,A,w]),oe=(0,C.useCallback)(async()=>{await T(),ee(a.account.login)},[T]),se=Y&&!A||X&&!M;return(0,D.jsx)(u,{showCreatureFooter:!1,children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,D.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,D.jsx)(b,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,D.jsx)(`h1`,{className:`mt-5 ${O?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:re}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:ie}),(Z||Q)&&(0,D.jsx)(x,{electron:O,showAnalytics:Z,showDiagnostics:Q,shareAnalytics:V,shareDiagnostics:H,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(X||Y)&&(0,D.jsx)(S,{electron:O,showPrivacy:X,showTos:Y,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:X&&!J?E(`2026-06-22`):[],tosNotes:Y&&!J?ne(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,D.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,D.jsx)(d,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:se,onClick:ae,className:O?void 0:`h-11 text-base`,children:e(`actions.continue`)}),(0,D.jsx)(d,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:oe,className:O?void 0:`h-11 text-base`,children:e(`actions.logOut`)})]})]})})}export{O as ReviewTermsScreen};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ap as t,Bu as n,Fs as ee,Gu as r,Hu as i,Ib as a,Lb as o,Op as s,Uu as c,Vu as l,Wu as te,qr as u,tS as d,zm as f,zu as p,zv as m}from"./app-1VZKPehC.js";import{j as h}from"./vendor-Dc7Mo5cU.js";import{_ as g,f as _,t as v,x as y}from"./react-B9IgSVeK.js";import{dt as b}from"./icons-DxrLl-Dj.js";import{n as x,t as S}from"./consent-controls-i0ai4F7A.js";var C=e(y(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function ne(e){return w[e]??[]}function E(e){return T[e]??[]}var D=v();function O(){let{t:e}=h(`onboarding`),v=_(),[y]=g(),w=s.use.user()?.id??null,T=s.use.logout(),O=o(),k=t(),[A,j]=r(),[M,N]=i(),[P,F]=c(),[I,L]=te(),[R]=p(),[z]=n(),B=l(),V=P??!0,H=I??!0,[U]=(0,C.useState)(()=>!A),[W]=(0,C.useState)(()=>!M),[G]=(0,C.useState)(()=>!R),[K]=(0,C.useState)(()=>!z),q=!U&&!W&&!G&&!K,[J]=(0,C.useState)(()=>!B),Y=U||q,X=W||q,Z=G||q,Q=K||q||J,$=!q&&!U&&!W,re=q?`Terms & privacy`:$?`Review your privacy preferences`:J?`Before You Start`:`Updated terms`,ie=q?`Review your terms and privacy preferences anytime.`:$?`Confirm your privacy preferences to continue.`:J?`Review and accept the terms to start using your assistant. You can update your preferences anytime in Settings.`:`We've updated our terms. Please review and accept to continue.`,ae=(0,C.useCallback)(()=>{f({userId:w,tos:A,privacy:M,shareAnalytics:Z?V:null,shareDiagnostics:Q?H:null,hasPlatformSession:k}),v(m(y.get(`returnTo`),a.assistant),{replace:!0})},[M,k,v,y,V,H,Z,Q,A,w]),oe=(0,C.useCallback)(async()=>{await T(),ee(a.account.login)},[T]),se=Y&&!A||X&&!M;return(0,D.jsx)(u,{showCreatureFooter:!1,children:(0,D.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${O?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,D.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,D.jsx)(b,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,D.jsx)(`h1`,{className:`mt-5 ${O?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:re}),(0,D.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${O?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:ie}),(Z||Q)&&(0,D.jsx)(x,{electron:O,showAnalytics:Z,showDiagnostics:Q,shareAnalytics:V,shareDiagnostics:H,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(X||Y)&&(0,D.jsx)(S,{electron:O,showPrivacy:X,showTos:Y,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:X&&!J?E(`2026-06-22`):[],tosNotes:Y&&!J?ne(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,D.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${O?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,D.jsx)(d,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:se,onClick:ae,className:O?void 0:`h-11 text-base`,children:e(`actions.continue`)}),(0,D.jsx)(d,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:oe,className:O?void 0:`h-11 text-base`,children:e(`actions.logOut`)})]})]})})}export{O as ReviewTermsScreen};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./app-1VZKPehC.js";export{e as routeTree,t as router};
@@ -1 +1 @@
1
- import{F_ as e,I_ as t,L_ as n,M_ as r,N_ as i,P_ as a,Qb as o,R_ as s,Vx as c,Xb as l,Yb as u,j_ as d,z_ as f}from"./app-n7D5Q-HS.js";import{t as p}from"./react-B9IgSVeK.js";var m=p();function h({storageKey:e,detailKey:t,section:n,detail:r}){return(0,m.jsx)(c,{className:`min-h-0 flex-1`,storageKey:e,defaultRightWidth:480,minLeftWidth:320,minRightWidth:400,hideDivider:!0,left:(0,m.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col pr-[var(--app-spacing-lg)]`,children:n}),right:(0,m.jsx)(`div`,{className:`home-detail-drawer`,children:r},t)})}function g({children:e}){return(0,m.jsx)(`div`,{className:`fixed inset-0 z-30 bg-[var(--surface-overlay)]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`},children:e})}async function _(e,t){let{error:r,response:i}=await n({path:{assistant_id:e},body:t,throwOnError:!1});if(l(i,r,`Failed to create schedule.`),!i.ok)throw new u(i.status,o(r,i,`Failed to create schedule.`))}async function v(e,t,n){let{error:r,response:a}=await i({path:{assistant_id:e,id:t},body:n,throwOnError:!1});if(l(a,r,`Failed to update schedule.`),!a.ok)throw new u(a.status,o(r,a,`Failed to update schedule.`))}var y=`Failed to move schedules to the selected profile.`;async function b(e,t,n){let{data:r,error:i,response:a}=await s({path:{assistant_id:e},body:{...t==null?{}:{from:t},to:n},throwOnError:!1});if(l(a,i,y),!a.ok)throw new u(a.status,o(i,a,y));return r?.reassigned??0}async function x(t,n,r=10,i){let{data:a,error:s,response:c}=await e({path:{assistant_id:t,id:n},query:{limit:r,before:i},throwOnError:!1});if(l(c,s,`Failed to load schedule runs.`),!c.ok)throw new u(c.status,o(s,c,`Failed to load schedule runs.`));return{runs:a?.runs??[],nextCursor:a?.nextCursor??null}}async function S(e,t){let{data:n,error:r,response:i}=await f({path:{assistant_id:e},query:{from:t.from,to:t.to},throwOnError:!1});if(l(i,r,`Failed to load schedule usage.`),!i.ok)throw new u(i.status,o(r,i,`Failed to load schedule usage.`));return n?.summaries??[]}async function C(e,n,r){let{error:i,response:a}=await t({path:{assistant_id:e,id:n},body:{enabled:r},throwOnError:!1});if(l(a,i,`Failed to toggle schedule.`),!a.ok)throw new u(a.status,o(i,a,`Failed to toggle schedule.`))}async function w(e,t){let{error:n,response:i}=await r({path:{assistant_id:e,id:t},throwOnError:!1});if(l(i,n,`Failed to delete schedule.`),!i.ok&&i.status!==204)throw new u(i.status,o(n,i,`Failed to delete schedule.`))}async function T(e,t){let{error:n,response:r}=await d({path:{assistant_id:e,id:t},throwOnError:!1});if(l(r,n,`Failed to cancel schedule.`),!r.ok)throw new u(r.status,o(n,r,`Failed to cancel schedule.`))}async function E(e,t){let{error:n,response:r}=await a({path:{assistant_id:e,id:t},throwOnError:!1});if(l(r,n,`Failed to run schedule.`),!r.ok)throw new u(r.status,o(n,r,`Failed to run schedule.`))}export{S as a,C as c,g as d,x as i,v as l,_ as n,b as o,w as r,E as s,T as t,h as u};
1
+ import{F_ as e,I_ as t,L_ as n,M_ as r,N_ as i,P_ as a,Qb as o,R_ as s,Vx as c,Xb as l,Yb as u,j_ as d,z_ as f}from"./app-1VZKPehC.js";import{t as p}from"./react-B9IgSVeK.js";var m=p();function h({storageKey:e,detailKey:t,section:n,detail:r}){return(0,m.jsx)(c,{className:`min-h-0 flex-1`,storageKey:e,defaultRightWidth:480,minLeftWidth:320,minRightWidth:400,hideDivider:!0,left:(0,m.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col pr-[var(--app-spacing-lg)]`,children:n}),right:(0,m.jsx)(`div`,{className:`home-detail-drawer`,children:r},t)})}function g({children:e}){return(0,m.jsx)(`div`,{className:`fixed inset-0 z-30 bg-[var(--surface-overlay)]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`},children:e})}async function _(e,t){let{error:r,response:i}=await n({path:{assistant_id:e},body:t,throwOnError:!1});if(l(i,r,`Failed to create schedule.`),!i.ok)throw new u(i.status,o(r,i,`Failed to create schedule.`))}async function v(e,t,n){let{error:r,response:a}=await i({path:{assistant_id:e,id:t},body:n,throwOnError:!1});if(l(a,r,`Failed to update schedule.`),!a.ok)throw new u(a.status,o(r,a,`Failed to update schedule.`))}var y=`Failed to move schedules to the selected profile.`;async function b(e,t,n){let{data:r,error:i,response:a}=await s({path:{assistant_id:e},body:{...t==null?{}:{from:t},to:n},throwOnError:!1});if(l(a,i,y),!a.ok)throw new u(a.status,o(i,a,y));return r?.reassigned??0}async function x(t,n,r=10,i){let{data:a,error:s,response:c}=await e({path:{assistant_id:t,id:n},query:{limit:r,before:i},throwOnError:!1});if(l(c,s,`Failed to load schedule runs.`),!c.ok)throw new u(c.status,o(s,c,`Failed to load schedule runs.`));return{runs:a?.runs??[],nextCursor:a?.nextCursor??null}}async function S(e,t){let{data:n,error:r,response:i}=await f({path:{assistant_id:e},query:{from:t.from,to:t.to},throwOnError:!1});if(l(i,r,`Failed to load schedule usage.`),!i.ok)throw new u(i.status,o(r,i,`Failed to load schedule usage.`));return n?.summaries??[]}async function C(e,n,r){let{error:i,response:a}=await t({path:{assistant_id:e,id:n},body:{enabled:r},throwOnError:!1});if(l(a,i,`Failed to toggle schedule.`),!a.ok)throw new u(a.status,o(i,a,`Failed to toggle schedule.`))}async function w(e,t){let{error:n,response:i}=await r({path:{assistant_id:e,id:t},throwOnError:!1});if(l(i,n,`Failed to delete schedule.`),!i.ok&&i.status!==204)throw new u(i.status,o(n,i,`Failed to delete schedule.`))}async function T(e,t){let{error:n,response:r}=await d({path:{assistant_id:e,id:t},throwOnError:!1});if(l(r,n,`Failed to cancel schedule.`),!r.ok)throw new u(r.status,o(n,r,`Failed to cancel schedule.`))}async function E(e,t){let{error:n,response:r}=await a({path:{assistant_id:e,id:t},throwOnError:!1});if(l(r,n,`Failed to run schedule.`),!r.ok)throw new u(r.status,o(n,r,`Failed to run schedule.`))}export{S as a,C as c,g as d,x as i,v as l,_ as n,b as o,w as r,E as s,T as t,h as u};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ax as t,Bd as n,Cf as r,Dx as i,Ef as a,Ex as o,Fx as s,Gb as c,Gx as l,Ib as u,Ix as d,Jd as f,K as p,Kp as m,Ld as h,Lx as g,Md as _,Of as v,Ox as y,Qf as b,Qn as x,Rd as S,Sc as C,Sf as w,Tf as T,Uv as E,Ux as D,Wx as O,X as k,Xd as ee,Xo as A,Y as j,Ya as M,Yd as te,Yx as ne,Z as re,Zd as ie,Zf as ae,bc as oe,et as N,f as se,gx as P,iS as F,kd as I,ld as ce,q as le,qd as ue,qf as de,tS as L,tr as fe,u as pe,wf as me,wx as R,xc as he,yx as z,zd as ge,zx as _e}from"./app-n7D5Q-HS.js";import{I as B,Jn as ve,N as ye,Zn as V,er as be,j as H,qn as xe}from"./vendor-DUzxlXbu.js";import{f as Se,h as Ce,t as we,x as Te}from"./react-B9IgSVeK.js";import{Ci as Ee,Hi as De,Jn as U,Ki as Oe,Ot as ke,Qi as Ae,Rt as je,Wi as W,aa as Me,fi as Ne,ht as Pe,k as Fe}from"./icons-DxrLl-Dj.js";import{t as Ie}from"./detail-card-BkqRteiy.js";import{a as Le,c as Re,d as ze,i as Be,l as Ve,n as He,o as Ue,r as We,s as Ge,t as Ke,u as qe}from"./schedules-DzyEr3no.js";import{a as Je,r as Ye,t as Xe}from"./usage-window-za0Cf2tq.js";var G=e(Te(),1),Ze={frequency:`daily`,minute:0,hour24:9,weekdays:[1],dayOfMonth:1},Qe=[{value:0,letter:`S`,short:`Sun`,full:`Sunday`},{value:1,letter:`M`,short:`Mon`,full:`Monday`},{value:2,letter:`T`,short:`Tue`,full:`Tuesday`},{value:3,letter:`W`,short:`Wed`,full:`Wednesday`},{value:4,letter:`T`,short:`Thu`,full:`Thursday`},{value:5,letter:`F`,short:`Fri`,full:`Friday`},{value:6,letter:`S`,short:`Sat`,full:`Saturday`}],$e=[1,2,3,4,5];function K(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function et(e){let t=Array.from(new Set(e.map(e=>K(e,0,6)).filter(e=>Number.isInteger(e)))).sort((e,t)=>e-t);return t.length>0?t:[1]}function tt(e){let t=K(e.minute,0,59),n=K(e.hour24,0,23);switch(e.frequency){case`hourly`:return`${t} * * * *`;case`daily`:return`${t} ${n} * * *`;case`weekly`:return`${t} ${n} * * ${et(e.weekdays).join(`,`)}`;case`monthly`:return e.dayOfMonth===`last`?`${t} ${n} L * *`:`${t} ${n} ${K(e.dayOfMonth,1,28)} * *`}}function nt(e,t){let n=K(e,0,23),r=K(t,0,59),i=n<12?`AM`:`PM`;return`${n%12==0?12:n%12}:${String(r).padStart(2,`0`)} ${i}`}function rt(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return`${e}${t[(n-20)%10]??t[n]??t[0]}`}function it(e){let t=et(e),n=new Set(t);if(t.length===7)return`every day`;if(t.length===5&&$e.every(e=>n.has(e)))return`every weekday`;if(t.length===2&&n.has(0)&&n.has(6))return`every weekend`;if(t.length===1)return`every ${Qe[t[0]]?.full??`day`}`;let r=t.map(e=>Qe[e]?.short??``),i=r.pop();return`every ${r.join(`, `)} & ${i}`}function at(e){let t=nt(e.hour24,e.minute);switch(e.frequency){case`hourly`:{let t=K(e.minute,0,59);return`Runs every hour at :${String(t).padStart(2,`0`)}`}case`daily`:return`Runs every day at ${t}`;case`weekly`:return`Runs ${it(e.weekdays)} at ${t}`;case`monthly`:return e.dayOfMonth===`last`?`Runs on the last day of every month at ${t}`:`Runs on the ${rt(K(e.dayOfMonth,1,28))} of every month at ${t}`}}var q=we(),ot=Array.from({length:12},(e,t)=>{let n=t+1;return{value:String(n),label:String(n)}}),st=Array.from({length:12},(e,t)=>{let n=t*5,r=String(n).padStart(2,`0`);return{value:r,label:r}});function ct(e,t){let n=e%12;return t===`PM`?n+12:n}function lt(e){try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return t&&t!==e?`${e} · ${t}`:e}catch{return e}}function ut({isOpen:e,assistantId:t,onClose:n,onCreated:r}){return(0,q.jsx)(y.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,q.jsx)(dt,{assistantId:t,onClose:n,onCreated:r}):null})}function dt({assistantId:e,onClose:t,onCreated:n}){let{t:r}=H(`settings`),i=M(),[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``),[f,p]=(0,G.useState)(`simple`),[m,h]=(0,G.useState)(Ze),[_,v]=(0,G.useState)(``),[b,x]=(0,G.useState)(!1),[S,C]=(0,G.useState)(null),w=a.trim(),T=s.trim(),E=l.trim(),D=_.trim(),O=(0,G.useMemo)(()=>f===`simple`?tt(m):D,[f,m,D]),k=(0,G.useMemo)(()=>f===`simple`?at(m):D||r(`createScheduleModal.cronContinuePrompt`),[f,m,D,r]),ee=(0,G.useMemo)(()=>lt(i),[i]),A=w.length>0&&T.length>0&&E.length>0&&O.length>0&&!b;return(0,q.jsxs)(y.Content,{size:`md`,children:[(0,q.jsxs)(y.Header,{children:[(0,q.jsx)(y.Title,{children:r(`createScheduleModal.title`)}),(0,q.jsx)(y.Description,{children:r(`createScheduleModal.description`)})]}),(0,q.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),A){x(!0),C(null);try{await He(e,{name:w,description:T,expression:O,message:E,timezone:i}),x(!1),n()}catch(e){C(e instanceof Error?e.message:r(`createScheduleModal.createFailed`)),x(!1)}}},children:[(0,q.jsx)(y.Body,{children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,q.jsx)(d,{label:r(`createScheduleModal.nameLabel`),placeholder:r(`createScheduleModal.namePlaceholder`),value:a,onChange:e=>o(e.target.value),required:!0,autoFocus:!0,fullWidth:!0}),(0,q.jsx)(g,{label:r(`createScheduleModal.descriptionLabel`),placeholder:r(`createScheduleModal.descriptionPlaceholder`),value:s,onChange:e=>c(e.target.value),required:!0,fullWidth:!0,rows:2}),(0,q.jsx)(gt,{label:r(`createScheduleModal.repeatLabel`),children:f===`simple`?(0,q.jsx)(ft,{cadence:m,onChange:h}):(0,q.jsx)(ht,{value:_,onChange:v,onUseSimple:()=>p(`simple`)})}),(0,q.jsx)(vt,{summary:k,mono:f===`advanced`&&D.length>0,timezoneLabel:ee}),f===`simple`?(0,q.jsx)(`button`,{type:`button`,onClick:()=>{v(e=>e||tt(m)),p(`advanced`)},className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:r(`createScheduleModal.advancedCron`)}):null,(0,q.jsx)(g,{label:r(`createScheduleModal.messageLabel`),placeholder:r(`createScheduleModal.messagePlaceholder`),value:l,onChange:e=>u(e.target.value),required:!0,fullWidth:!0,rows:4}),S?(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:S}):null]})}),(0,q.jsxs)(y.Footer,{children:[(0,q.jsx)(L,{variant:`outlined`,onClick:t,type:`button`,children:r(`createScheduleModal.cancel`)}),(0,q.jsx)(L,{variant:`primary`,type:`submit`,disabled:!A,children:r(b?`createScheduleModal.creating`:`createScheduleModal.create`)})]})]})]})}function ft({cadence:e,onChange:n}){let{t:r}=H(`settings`),i=[{value:`hourly`,label:r(`createScheduleModal.frequencyHourly`)},{value:`daily`,label:r(`createScheduleModal.frequencyDaily`)},{value:`weekly`,label:r(`createScheduleModal.frequencyWeekly`)},{value:`monthly`,label:r(`createScheduleModal.frequencyMonthly`)}],a=[...Array.from({length:28},(e,t)=>{let n=t+1;return{value:String(n),label:rt(n)}}),{value:`last`,label:r(`createScheduleModal.lastDay`)}];return(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsx)(t,{items:i,value:e.frequency,onChange:t=>n({...e,frequency:t}),ariaLabel:r(`createScheduleModal.frequencyAriaLabel`)}),e.frequency===`hourly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.atMinute`),children:(0,q.jsx)(R,{options:st,value:String(e.minute).padStart(2,`0`),onChange:t=>n({...e,minute:Number(t)}),"aria-label":r(`createScheduleModal.minuteAriaLabel`),className:`w-24`})}):null,e.frequency===`weekly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.onTheseDays`),children:(0,q.jsx)(mt,{value:e.weekdays,onChange:t=>n({...e,weekdays:t})})}):null,e.frequency===`monthly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.onDay`),children:(0,q.jsx)(R,{options:a,value:e.dayOfMonth===`last`?`last`:String(e.dayOfMonth),onChange:t=>n({...e,dayOfMonth:t===`last`?`last`:Number(t)}),"aria-label":r(`createScheduleModal.dayOfMonthAriaLabel`),className:`w-32`})}):null,e.frequency===`hourly`?null:(0,q.jsx)(_t,{label:r(`createScheduleModal.atTime`),children:(0,q.jsx)(pt,{hour24:e.hour24,minute:e.minute,onChange:(t,r)=>n({...e,hour24:t,minute:r})})})]})}function pt({hour24:e,minute:n,onChange:r}){let{t:i}=H(`settings`),a=e<12?`AM`:`PM`,o=e%12==0?12:e%12,s=[{value:`AM`,label:i(`createScheduleModal.periodAm`)},{value:`PM`,label:i(`createScheduleModal.periodPm`)}];return(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(R,{options:ot,value:String(o),onChange:e=>r(ct(Number(e),a),n),"aria-label":i(`createScheduleModal.hourAriaLabel`),className:`w-[72px]`}),(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`:`}),(0,q.jsx)(R,{options:st,value:String(n).padStart(2,`0`),onChange:t=>r(e,Number(t)),"aria-label":i(`createScheduleModal.minuteAriaLabel`),className:`w-[72px]`}),(0,q.jsx)(`div`,{className:`w-[112px]`,children:(0,q.jsx)(t,{items:s,value:a,onChange:e=>r(ct(o,e),n),ariaLabel:i(`createScheduleModal.periodAriaLabel`)})})]})}function mt({value:e,onChange:t}){let n=new Set(e),r=e=>{let r=new Set(n);r.has(e)?r.size>1&&r.delete(e):r.add(e),t([...r].sort((e,t)=>e-t))};return(0,q.jsx)(`div`,{className:`flex gap-1.5`,children:Qe.map(e=>{let t=n.has(e.value);return(0,q.jsx)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-pressed":t,"aria-label":e.full,title:e.full,className:F(`flex h-9 w-9 items-center justify-center rounded-md border text-body-medium-default transition-colors`,t?`border-[var(--border-active)] bg-[var(--surface-active)] text-[var(--content-emphasised)]`:`border-[var(--field-border)] text-[var(--content-tertiary)] hover:border-[var(--border-active)] hover:text-[var(--content-default)]`),children:e.letter},e.value)})})}function ht({value:e,onChange:t,onUseSimple:n}){let{t:r}=H(`settings`);return(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(d,{placeholder:`0 9 * * *`,value:e,onChange:e=>t(e.target.value),fullWidth:!0,className:`font-mono`,"aria-label":r(`createScheduleModal.cronAriaLabel`),helperText:r(`createScheduleModal.cronHelper`)}),(0,q.jsx)(`button`,{type:`button`,onClick:n,className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:r(`createScheduleModal.backToSimple`)})]})}function gt({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:e}),t]})}function _t({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,q.jsx)(`span`,{className:`min-w-[88px] text-body-small-default text-[var(--content-tertiary)]`,children:e}),t]})}function vt({summary:e,mono:t,timezoneLabel:n}){let{t:r}=H(`settings`);return(0,q.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3.5 py-3`,children:[(0,q.jsx)(Ee,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:F(`text-body-medium-default text-[var(--content-default)]`,t&&`break-all font-mono`),children:e}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`createScheduleModal.timezoneNote`,{timezone:n})})]})]})}function yt(e,t,n){let r=!!e&&n?.enabled!==!1,{data:i}=V({..._({path:{assistant_id:e}}),enabled:r,staleTime:6e4}),{data:a}=V({...I({path:{assistant_id:e}}),enabled:r,staleTime:6e4}),o=i?.callSites.find(e=>e.id===t)?.defaultProfile??null;return o==null?{key:null,label:null}:{key:o,label:(a?Je(a):{})[o]?.displayName??o}}function bt(e,t,n){let{t:r}=H(`settings`),a=yt(e,`mainAgent`),[o,s]=(0,G.useState)(!1),l=(0,G.useMemo)(()=>a.key?t.filter(e=>pe(e)&&e.inferenceProfile!==a.key).length:0,[a.key,t]),u=a.label,d=ve({mutationFn:t=>Ue(e,null,t),onSuccess:e=>{s(!1),n(),i.success(e===0?r(`scheduleProfileRebase.alreadyOnProfileToast`,{profile:u}):r(`scheduleProfileRebase.movedToast`,{count:e,profile:u}))},onError:e=>{c(e,{context:`schedules_rebase_inference_profile`}),i.error(r(`scheduleProfileRebase.moveFailedToast`))}});return{defaultProfileLabel:u,offDefaultCount:l,canRebase:l>0,requestRebase:()=>s(!0),dialogProps:{open:o&&a.key!=null,profileLabel:u,offDefaultCount:l,isPending:d.isPending,onConfirm:()=>{a.key&&d.mutate(a.key)},onCancel:()=>s(!1)}}}function xt({open:e,profileLabel:t,offDefaultCount:n,isPending:r,onConfirm:i,onCancel:a}){let{t:s}=H(`settings`);return(0,q.jsx)(o,{open:e,title:s(`scheduleProfileRebase.dialogTitle`,{profile:t}),message:s(`scheduleProfileRebase.dialogMessage`,{count:n,profile:t}),confirmLabel:s(`scheduleProfileRebase.moveSchedules`),isPending:r,onConfirm:i,onCancel:a})}function St(e=m(),t=Date.now()){return Ye(Xe,e,t)}function J(e){return e?new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0}):`—`}function Ct(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}var wt=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function Y(e){return e==null||!Number.isFinite(e)?`—`:wt.format(e)}function Tt(e){return`${e.toLocaleString()} ${e===1?`run`:`runs`}`}function Et(e,t=B){let n=Math.round(e/6e4);return n>=60&&n%60==0?t(`scheduleFormatters.everyHours`,{count:n/60}):t(`scheduleFormatters.everyMinutes`,{count:n})}function Dt(e){if(!e)return;let t=new Set,n=[];for(let r of e)for(let e of r.runs)t.has(e.id)||(t.add(e.id),n.push(e));return n}function Ot(e){return!!e.conversationId&&e.conversationExists===!0&&e.conversationArchivedAt==null}function kt(e){return Ot(e)?e.conversationId??null:null}function X(e){return typeof e==`string`&&e.length>0}function At(e){return e.status===`pending`||e.status===`superseded`}function jt(e){return e.status!==`skipped`&&e.status!==`missed`&&!At(e)}var Mt={heartbeat:`system-heartbeat`,consolidation:`system-consolidation`,retrospective:`system-memory-retrospective`};function Nt(e,t,n=B){let r=e.effectiveTimezone||e.timezone||t||null;if(e.cronExpression)return r?`Cron: ${e.cronExpression} (${r})`:`Cron: ${e.cronExpression}`;let i=Et(e.intervalMs,n);return e.activeHoursStart!=null&&e.activeHoursEnd!=null&&(i+=r?` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00 ${r})`:` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00)`),i}function Pt(e,t=B){return Et(e.intervalMs,t)}function Ft(e=B){return e(`scheduleFormatters.retrospectiveSubtitle`)}function It(e,t){return pe(e)?e.status===`firing`?!1:e.nextRunAt==null||!e.enabled&&e.nextRunAt<=t:!0}function Lt(e,t){let n=[],r=[],i=[];for(let a of e)a.isOneShot?It(a,t)?i.push(a):r.push(a):n.push(a);return n.sort((e,t)=>e.enabled===t.enabled?(e.nextRunAt??1/0)-(t.nextRunAt??1/0):e.enabled?-1:1),r.sort((e,t)=>(e.nextRunAt??1/0)-(t.nextRunAt??1/0)),i.sort((e,t)=>{let n=e.lastRunAt??e.nextRunAt??0;return(t.lastRunAt??t.nextRunAt??0)-n}),{recurring:n,upcomingOneTime:r,pastOneTime:i}}function Rt(e,t,n=!0){return{queryKey:[{_id:`schedulesUsagesummaryGet`,path:{assistant_id:e??``},_tz:t}],queryFn:()=>e?Le(e,St(t)):Promise.resolve([]),enabled:n,staleTime:1e4}}function zt(e){return{scheduleId:e,runCount:0,totalEstimatedCostUsd:0,eventCount:0}}function Bt(e,t,n){let r=(t??[]).filter(e=>{let t=e.startedAt??e.createdAt;return jt(e)&&t>=n.from&&t<=n.to});return{scheduleId:e,runCount:r.length,totalEstimatedCostUsd:r.reduce((e,t)=>{let n=t.estimatedCostUsd;return typeof n==`number`&&Number.isFinite(n)?e+n:e},0),eventCount:0}}function Vt({status:e}){let{t}=H(`settings`);return(0,q.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full`,style:{backgroundColor:e===`ok`||e===`completed`?`var(--system-positive-strong)`:e===`error`||e===`failed`?`var(--system-negative-strong)`:`var(--content-tertiary)`},"aria-label":e??t(`scheduleSharedUi.unknownStatus`)})}function Ht({scheduleName:e,usage:t,onOpenUsage:n}){let{t:r}=H(`settings`);if(t.status===`loading`)return(0,q.jsxs)(`div`,{"aria-label":r(`scheduleSharedUi.loadingUsage`),className:`flex w-[156px] shrink-0 items-center justify-end gap-3`,children:[(0,q.jsx)(z,{as:`span`,className:`h-5 w-16`}),(0,q.jsx)(z,{as:`span`,className:`h-5 w-16`})]});let i=t.status===`error`,a=i?`--`:Y(t.summary.totalEstimatedCostUsd),o=i?`--`:Tt(t.summary.runCount),s=t.status===`ready`&&!(t.summary.totalEstimatedCostUsd>0),c=t.status===`ready`&&t.summary.runCount===0,l=s?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`,u=c?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`;return(0,q.jsxs)(`div`,{className:`flex w-[156px] shrink-0 items-center justify-end gap-3 text-right text-body-small-default`,children:[n?(0,q.jsx)(`button`,{type:`button`,onClick:n,"aria-label":r(`scheduleSharedUi.viewUsageFor`,{name:e}),className:`min-w-[64px] cursor-pointer rounded px-1 py-0.5 text-right transition-colors hover:bg-[var(--surface-hover)] ${l}`,children:a}):(0,q.jsx)(`span`,{"aria-label":r(`scheduleSharedUi.costFor`,{name:e,cost:a}),className:`block min-w-[64px] px-1 py-0.5 ${l}`,children:a}),(0,q.jsx)(`span`,{"aria-label":r(`scheduleSharedUi.runsFor`,{name:e,runs:o}),className:`block min-w-[64px] px-1 py-0.5 ${u}`,children:o})]})}function Ut({name:e,subtitle:t,enabled:n,nextRunAt:r,lastRunAt:i,usage:a,helperText:o,statusLabel:s,statusTone:c=`neutral`,onClick:l}){let{t:u}=H(`settings`);return(0,q.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md px-2 py-3 transition-colors hover:bg-[var(--surface-hover)] [&+&]:border-t [&+&]:border-[var(--border-base)]`,children:(0,q.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":u(`systemTasksSection.openAriaLabel`,{name:e}),className:`flex min-w-0 flex-1 cursor-pointer flex-wrap items-center gap-3 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e})}),(0,q.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t}),o?(0,q.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-secondary)]`,children:o}):null,(0,q.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-body-small-default text-[var(--content-tertiary)]`,children:[r?(0,q.jsx)(`span`,{children:u(`systemTasksSection.nextRun`,{time:J(r)})}):null,i?(0,q.jsx)(`span`,{children:u(`systemTasksSection.lastRun`,{time:J(i)})}):null]})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-3`,children:[(0,q.jsx)(Ht,{scheduleName:e,usage:a}),s?(0,q.jsx)(_e,{tone:c,children:s}):(0,q.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:n?`var(--system-positive-strong)`:`var(--content-disabled)`},"aria-label":u(n?`systemTasksSection.enabled`:`systemTasksSection.disabled`)}),(0,q.jsx)(W,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})})}function Wt({heartbeatConfig:e,consolidationConfig:t,retrospectiveConfig:n,heartbeatUsage:r,consolidationUsage:i,retrospectiveUsage:a,isLoading:o,hasError:s,onRetry:c,onSelectHeartbeat:l,onSelectConsolidation:u,onSelectRetrospective:d}){let{t:f}=H(`settings`),p=e!=null,m=t?.available===!0,h=n?.available===!0,g=p||m||h;if(!o&&!s&&!g)return null;let _=[...p?[r]:[],...m?[i]:[],...h?[a]:[]].filter(e=>e.status===`ready`),v=_.reduce((e,t)=>e+(t.summary.totalEstimatedCostUsd??0),0),y=o?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):s&&!g?(0,q.jsx)(D,{tone:`error`,children:(0,q.jsx)(ye,{ns:`settings`,i18nKey:`systemTasksSection.loadError`,components:{retryButton:(0,q.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`})}})}):(0,q.jsxs)(`div`,{children:[p?(0,q.jsx)(Ut,{name:f(`systemTasksSection.heartbeatName`),subtitle:Nt(e),enabled:e.enabled,nextRunAt:e.nextRunAt,lastRunAt:e.lastRunAt,usage:r,onClick:l}):null,m?(0,q.jsx)(Ut,{name:f(`systemTasksSection.consolidationName`),subtitle:Pt(t),enabled:t.enabled,helperText:t.enabled?void 0:f(`systemTasksSection.consolidationPausedHelper`),nextRunAt:t.nextRunAt,lastRunAt:t.lastRunAt,usage:i,statusLabel:t.enabled?void 0:f(`systemTasksSection.paused`),statusTone:`warning`,onClick:u}):null,h?(0,q.jsx)(Ut,{name:f(`systemTasksSection.retrospectiveName`),subtitle:Ft(),enabled:n.enabled,helperText:n.enabled?void 0:f(`systemTasksSection.retrospectivePausedHelper`),nextRunAt:n.nextRunAt,lastRunAt:n.lastRunAt,usage:a,statusLabel:n.enabled?void 0:f(`systemTasksSection.paused`),statusTone:`warning`,onClick:d}):null,s?(0,q.jsx)(`div`,{className:`pt-3 first:pt-0`,children:(0,q.jsx)(D,{tone:`error`,children:(0,q.jsx)(ye,{ns:`settings`,i18nKey:`systemTasksSection.partialLoadError`,components:{retryButton:(0,q.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`})}})})}):null]});return(0,q.jsx)(Ie,{children:(0,q.jsx)(P.Root,{type:`multiple`,children:(0,q.jsxs)(P.Item,{value:`system-jobs`,children:[(0,q.jsxs)(P.Trigger,{className:`group justify-between gap-3`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-left`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:f(`systemTasksSection.title`)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:f(`systemTasksSection.subtitle`)})]}),(0,q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[_.length>0?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:f(`systemTasksSection.cost7d`,{cost:Y(v)})}):null,(0,q.jsx)(Oe,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]})]}),(0,q.jsx)(P.Content,{children:(0,q.jsx)(`div`,{className:`mt-3`,children:y})})]})})})}var Gt={disabled:`heartbeat is disabled`,outside_active_hours:`outside active hours`,overlap:`previous run was still active`,pre_first_user_message:`waiting for the first conversation`,max_consecutive_runs:`consecutive-run cap reached`,max_daily_runs:`daily run cap reached`,quiesced:`assistant was shutting down`};function Kt(e){return e.status===`missed`?`Missed while the assistant was offline`:`skipReason`in e&&e.skipReason?`Skipped — ${Gt[e.skipReason]??e.skipReason}`:null}function qt(e,t){return{id:e.id,jobId:t,status:e.status,startedAt:e.startedAt??e.scheduledFor,finishedAt:e.finishedAt,durationMs:e.durationMs,output:Kt(e),error:e.error,conversationId:e.conversationId,conversationExists:e.conversationExists,conversationArchivedAt:e.conversationArchivedAt,estimatedCostUsd:e.estimatedCostUsd,createdAt:e.createdAt,...`title`in e?{title:e.title}:{}}}function Jt(e){return e.runs.filter(e=>!At(e)).map(e=>qt(e,`heartbeat`))}function Yt(e){return e.runs.map(e=>qt(e,`consolidation`))}function Xt(e){return e.runs.map(e=>qt(e,`retrospective`))}var Z=1e4;function Zt(e,t,n,r,i){return e?{status:`loading`}:t?{status:`error`}:{status:`ready`,summary:Bt(n,r,i)}}function Qt(e,t){let r=be(),a={path:{assistant_id:e??``}},{data:o,isLoading:s,isError:l,refetch:u}=V({...ue(a),enabled:!!e,staleTime:Z}),{data:d,isLoading:p,isError:m,refetch:g}=V({...h(a),enabled:!!e,staleTime:Z}),{data:_,isLoading:v,isError:y,refetch:x}=V({...w(a),enabled:!!e,staleTime:Z}),S={path:{assistant_id:e??``},query:{limit:100}},{data:C,isLoading:E,isError:D,refetch:O}=V({...ie(S),select:Jt,enabled:!!e&&o!=null,staleTime:Z}),{data:k,isLoading:A,isError:j,refetch:M}=V({...n(S),select:Yt,enabled:!!e&&d?.available===!0,staleTime:Z}),{data:te,isLoading:ne,isError:re,refetch:oe}=V({...T(S),select:Xt,enabled:!!e&&_?.available===!0,staleTime:Z}),N=(0,G.useMemo)(()=>St(t),[t]),se=(0,G.useMemo)(()=>Zt(E,D,Mt.heartbeat,C,N),[C,D,E,N]),P=(0,G.useMemo)(()=>Zt(A,j,Mt.consolidation,k,N),[k,j,A,N]),F=(0,G.useMemo)(()=>Zt(ne,re,Mt.retrospective,te,N),[te,re,ne,N]),I=t=>{if(!e)return;let i={heartbeat:{config:ue(a).queryKey,runs:ie(S).queryKey,infinite:ee(a)},consolidation:{config:h(a).queryKey,runs:n(S).queryKey,infinite:ge(a)},retrospective:{config:w(a).queryKey,runs:T(S).queryKey,infinite:me(a)}}[t];r.invalidateQueries({queryKey:i.config}),r.invalidateQueries({queryKey:i.runs}),r.invalidateQueries({queryKey:i.infinite})},ce=b({onSuccess:e=>{e.ran?i.success(B(`settings:useSystemTasks.heartbeatStarted`)):i.info(B(`settings:useSystemTasks.heartbeatSkipped`))},onError:e=>{c(e,{context:`heartbeat_run_now`}),i.error(B(`settings:useSystemTasks.heartbeatRunFailed`))},onSettled:()=>I(`heartbeat`)}),le=de({onSuccess:e=>{e.ran?i.success(B(`settings:useSystemTasks.consolidationQueued`)):i.info(B(`settings:useSystemTasks.consolidationAlreadyQueued`))},onError:e=>{c(e,{context:`consolidation_run_now`}),i.error(B(`settings:useSystemTasks.consolidationRunFailed`))},onSettled:()=>I(`consolidation`)}),L=ae({onSuccess:e=>{f(r,a,e),i.success(e.enabled?B(`settings:useSystemTasks.heartbeatEnabled`):B(`settings:useSystemTasks.heartbeatDisabled`))},onError:e=>{c(e,{context:`heartbeat_toggle`}),i.error(B(`settings:useSystemTasks.heartbeatToggleFailed`))}});return{heartbeatConfig:o,consolidationConfig:d,retrospectiveConfig:_,heartbeatUsage:se,consolidationUsage:P,retrospectiveUsage:F,isLoading:s||p||v,hasError:l||m||y,isHeartbeatRunning:ce.isPending,isConsolidationRunning:le.isPending,isHeartbeatLoading:s,isHeartbeatError:l,isConsolidationLoading:p,isConsolidationError:m,isRetrospectiveLoading:v,isRetrospectiveError:y,refetchHeartbeat:u,refetchConsolidation:g,refetchRetrospective:x,runHeartbeatNow:()=>{e&&ce.mutate({path:{assistant_id:e}})},runConsolidationNow:()=>{e&&le.mutate({path:{assistant_id:e}})},toggleHeartbeat:t=>{e&&L.mutate({body:{enabled:t},path:{assistant_id:e}})},refetchAll:()=>{u(),g(),x(),O(),M(),oe()}}}function $t({id:e,title:t,subtitle:n,accessory:r,children:i,className:a}){let o=!!(t||n||r);return(0,q.jsx)(O,{asChild:!0,className:F(`rounded-lg`,a),children:(0,q.jsxs)(`section`,{id:e,children:[o&&(0,q.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[t&&(0,q.jsx)(l,{variant:`title-small`,as:`h2`,className:`text-[var(--content-emphasised)]`,children:t}),n&&(0,q.jsx)(l,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]}),r&&(0,q.jsx)(`div`,{className:`shrink-0`,children:r})]}),i!=null&&(0,q.jsx)(`div`,{className:o?`mt-3`:``,children:i})]})})}function en(e){return/^plugin:([^/]+)\//.exec(e??``)?.[1]??null}var tn={user_disabled:`scheduleDisarmReason.userDisabled`,plugin_removed:`scheduleDisarmReason.pluginRemoved`,plugin_disabled:`scheduleDisarmReason.pluginDisabled`,declaration_removed:`scheduleDisarmReason.declarationRemoved`,declaration_disabled:`scheduleDisarmReason.declarationDisabled`};function nn(e){return e.enabled||!e.disarmReason?null:tn[e.disarmReason]??null}function rn(e,t){return t?.[e]?.displayName??e}function an({assistantId:e,pinnedProfile:t,defaultCallSite:n=`mainAgent`,fallbackLabel:r,respectCallSiteOverride:i=!1}){let{t:a}=H(`settings`),o=r??a(`modelProfileRow.defaultMainAgent`),s=(e,t)=>{if(e==null)return;if(e.provider!=null||e.model!=null)return a(`modelProfileRow.customCallSiteModel`);let n=e.profile?.trim();return n?a(`modelProfileRow.override`,{name:rn(n,t)}):void 0},c=t==null,{data:l}=V({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),u=(0,G.useMemo)(()=>l?Je(l):{},[l]),{label:d}=yt(e,n,{enabled:c}),f=c&&i?s(l?.llm?.callSites?.[n],u):void 0,p=t==null?f??(d==null?o:a(`modelProfileRow.defaultNamed`,{name:d})):rn(t,u);return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-[var(--content-secondary)]`,children:a(`modelProfileRow.label`)}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-right`,title:p,children:p})]})}function on(e,t,n){let r=E(e?.profiles??{},e?.profileOrder??[]);return[{value:null,label:`Default`},...k(r,[t],n).map(e=>{let t=p(e,r,n);return{value:e.name,label:le(e),...t?{issue:t}:{},...t===`undispatchable`?{reason:j(e)}:{}}})]}function sn(e,t){let{data:n}=V({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),r=re();return(0,G.useMemo)(()=>on(n?.llm,t,{requireOwnProviderAndModel:r}),[n?.llm,t,r])}function cn({assistantId:e,value:t,onChange:n,disabled:r=!1,isSaving:i=!1,className:a,includeDefaultOption:o=!0,placeholder:s,variant:c,menuAlign:l}){let{t:u}=H(`settings`);return(0,q.jsx)(R,{value:t,onChange:n,onSelectNone:()=>n(null),options:sn(e,t).filter(e=>o||e.value!=null).map(e=>({...e.issue===`undispatchable`?{icon:(0,q.jsx)(De,{className:`h-3.5 w-3.5 text-[var(--system-mid-strong)]`}),...e.reason?{tooltip:e.reason}:{}}:{},value:e.value,label:e.label})),disabled:r||i,placeholder:s,className:a,variant:c,menuAlign:l,"aria-label":u(`modelProfileSelect.ariaLabel`)})}function Q({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-body-medium-lighter text-[var(--content-secondary)]`,children:e}),(0,q.jsx)(`span`,{className:`min-w-0 text-right text-body-medium-lighter text-[var(--content-default)]`,children:t})]})}function ln({schedule:e,assistantId:t,isPast:n}){let{t:r}=H(`schedules`),a=be(),o=v({path:{assistant_id:t}}),s=ve({mutationFn:n=>Ve(t,e.id,{inferenceProfile:n}),onMutate:async t=>{await a.cancelQueries({queryKey:o});let n=a.getQueryData(o)?.find(t=>t.id===e.id)?.inferenceProfile;return a.setQueryData(o,n=>n?.map(n=>n.id===e.id?{...n,inferenceProfile:t}:n)),{previousProfile:n}},onError:(t,n,s)=>{let l=s?.previousProfile;l!==void 0&&a.setQueryData(o,t=>t?.map(t=>t.id===e.id?{...t,inferenceProfile:l}:t)),c(t,{context:`schedule_update_inference_profile`}),i.error(r(`scheduleDetail.modelChangeFailed`))},onSettled:()=>a.invalidateQueries({queryKey:o})});return e.mode===`workflow`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Q,{label:r(`scheduleDetail.modelProfile`),value:r(`scheduleDetail.notUsedForWorkflow`)}),(0,q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`scheduleDetail.modelProfileWorkflowNote`)})]}):n?(0,q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:(0,q.jsx)(an,{assistantId:t,pinnedProfile:e.inferenceProfile})}):(0,q.jsx)(Q,{label:r(`scheduleDetail.modelProfile`),value:(0,q.jsx)(cn,{assistantId:t,value:e.inferenceProfile,onChange:t=>{t&&t!==e.inferenceProfile&&s.mutate(t)},includeDefaultOption:!1,placeholder:r(`scheduleDetail.chooseModel`),isSaving:s.isPending,variant:`ghost`,menuAlign:`end`,className:`-my-1 -mr-2`})})}function un({icon:e,value:t,label:n}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] p-3`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-[var(--surface-sunken)] text-[var(--content-secondary)]`,children:e}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`truncate text-body-large-default text-[var(--content-default)]`,children:t}),(0,q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]})}function dn({usage:e}){let{t}=H(`schedules`);return e.status===`loading`?(0,q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:Array.from({length:2},(e,t)=>(0,q.jsx)(z,{className:`h-[60px] rounded-lg`},t))}):e.status===`error`?null:(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:[(0,q.jsx)(un,{icon:(0,q.jsx)(Ne,{className:`h-4 w-4`}),value:Y(e.summary.totalEstimatedCostUsd),label:t(`scheduleDetail.costLabel`,{days:7})}),(0,q.jsx)(un,{icon:(0,q.jsx)(ke,{className:`h-4 w-4`}),value:Tt(e.summary.runCount),label:t(`scheduleDetail.runsLabel`,{days:7})})]})}function fn(e){return e.exists&&e.archivedAt==null}function pn({run:e,index:t,isExpanded:n,disableDirectOpen:r,onOpenConversation:i,onToggleDetails:a}){let{t:o}=H(`schedules`),s=kt(e),c=e.conversations??(s?[{id:s,title:null,exists:!0,archivedAt:null}]:[]),l=X(e.output),u=X(e.error),d=!r&&c.length===1&&fn(c[0])?c[0].id:null,f=!d&&(c.length>0||l||u),p=`schedule-run-details-${t}`,m=!!d||f,h=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Vt,{status:e.status}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:J(e.startedAt)}),(0,q.jsxs)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[Ct(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd)]}),e.status===`error`&&e.error?(0,q.jsxs)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[e.error.slice(0,120),e.error.length>120?`…`:``]}):null]}),m?(0,q.jsx)(W,{className:F(`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform`,f&&n?`rotate-90`:``)}):null]}),g=f&&n?(0,q.jsx)(`div`,{id:p,className:`px-2 pb-3`,children:(0,q.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[c.length>0?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.conversations`)}),(0,q.jsx)(`div`,{className:`space-y-1`,children:c.map(e=>fn(e)?(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(e.id),className:`block w-full truncate text-left text-body-small-default text-[var(--content-default)] hover:underline`,children:X(e.title)?e.title:o(`scheduleDetail.conversation`)},e.id):(0,q.jsxs)(`span`,{className:`block truncate text-body-small-default text-[var(--content-tertiary)] italic`,children:[X(e.title)?e.title:o(`scheduleDetail.conversation`),` `,e.exists?o(`scheduleDetail.conversationArchived`):o(`scheduleDetail.conversationUnavailable`)]},e.id))})]}):null,l?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.output`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.error`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null;return d?(0,q.jsx)(`div`,{children:(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(d),"aria-label":o(`scheduleDetail.openRunConversationAria`,{time:J(e.startedAt)}),className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:h})}):f?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),"aria-label":o(`scheduleDetail.toggleRunDetailsAria`,{time:J(e.startedAt)}),"aria-expanded":n,"aria-controls":p,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:h}),g]}):(0,q.jsx)(`div`,{className:`flex items-center gap-3 px-2 py-3`,children:h})}function mn({runs:e,isLoading:t,disableDirectOpen:n,onOpenConversation:r}){let{t:i}=H(`schedules`),[a,o]=(0,G.useState)(null);return t?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,q.jsx)(`p`,{className:`py-2 text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:i(`scheduleDetail.noRunsYet`)}):(0,q.jsx)(`div`,{className:`-mx-2 divide-y divide-[var(--border-base)]`,children:e.map((e,t)=>(0,q.jsx)(pn,{run:e,index:t,isExpanded:a===e.id,disableDirectOpen:n,onOpenConversation:r,onToggleDetails:e=>o(t=>t===e?null:e)},e.id))})}function hn({schedule:e,assistantId:t,usage:n,isPast:r=!1,onClose:s,onDeleted:l}){let{t:d}=H(`schedules`),f=Se(),{data:p,isLoading:m}=V({queryKey:a({path:{assistant_id:t,id:e.id}}),queryFn:()=>Be(t,e.id),staleTime:1e4}),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(!1),[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(!1),E=en(e.sourceKey),D=nn(e),O=e.isOneShot&&!r&&E===null&&e.status!==`firing`,k=E!==null&&!e.enabled,ee=async()=>{g(!0);try{await Ge(t,e.id)}catch(e){c(e,{context:`schedule_run_now`}),i.error(d(`scheduleDetail.runFailed`))}finally{g(!1)}},A=async()=>{b(!0);try{await We(t,e.id),l()}catch(e){c(e,{context:`schedule_delete`}),i.error(d(`scheduleDetail.deleteFailed`)),b(!1),v(!1)}},j=async()=>{T(!0);try{await Ke(t,e.id),l()}catch(e){c(e,{context:`schedule_cancel`}),i.error(d(`scheduleDetail.cancelOneTimeFailed`)),T(!1),C(!1)}};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)] md:rounded-[var(--radius-xl)] md:border md:border-[var(--border-base)]`,children:[(0,q.jsx)(x,{title:e.name,headerActions:E?void 0:(0,q.jsx)(L,{variant:`dangerOutline`,iconOnly:(0,q.jsx)(Fe,{}),"aria-label":d(`scheduleDetail.delete`),tooltip:d(`scheduleDetail.delete`),onClick:()=>v(!0)}),closeLabel:d(`scheduleDetail.closeAria`),closeTooltip:d(`scheduleDetail.close`),onClose:s}),(0,q.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[e.description?(0,q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.description}):null,(0,q.jsx)($t,{title:d(`scheduleDetail.details`),children:(0,q.jsxs)(`div`,{className:`space-y-2`,children:[e.cadenceDescription?(0,q.jsx)(Q,{label:d(`scheduleDetail.cadence`),value:e.cadenceDescription}):null,(0,q.jsx)(Q,{label:d(`scheduleDetail.mode`),value:e.mode}),(0,q.jsx)(ln,{schedule:e,assistantId:t,isPast:r}),(0,q.jsx)(Q,{label:d(`scheduleDetail.status`),value:e.enabled?d(`scheduleDetail.enabled`):d(`scheduleDetail.disabled`)}),(0,q.jsx)(Q,{label:d(`scheduleDetail.nextRun`),value:J(e.nextRunAt)}),e.lastRunAt?(0,q.jsx)(Q,{label:d(`scheduleDetail.lastRun`),value:(0,q.jsxs)(`span`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(Vt,{status:e.lastStatus}),J(e.lastRunAt)]})}):null]})}),(0,q.jsx)(dn,{usage:n}),(0,q.jsx)($t,{title:d(`scheduleDetail.recentRuns`),children:(0,q.jsx)(mn,{runs:p?.runs,isLoading:m,disableDirectOpen:e.mode===`script`,onOpenConversation:e=>oe(f,e)})})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-[var(--border-hover)] p-[var(--app-spacing-lg)]`,children:[E?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:D?d(`scheduleDetail.managedByPluginPaused`,{plugin:E,reason:d(D)}):d(`scheduleDetail.managedByPlugin`,{plugin:E})}):(0,q.jsx)(`span`,{}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(L,{variant:`outlined`,leftIcon:(0,q.jsx)(Ae,{className:`h-3.5 w-3.5`}),onClick:()=>f(u.settings.usageForSchedule(e.id)),children:d(`scheduleDetail.viewUsage`)}),O?(0,q.jsx)(L,{variant:`dangerOutline`,onClick:()=>C(!0),children:d(`scheduleDetail.cancelOneTime`)}):null,e.mode===`script`?(0,q.jsxs)(q.Fragment,{children:[k?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:d(`scheduleDetail.turnOnToRun`)}):null,(0,q.jsx)(L,{variant:`primary`,leftIcon:h?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):void 0,onClick:()=>void ee(),disabled:h||k,children:d(h?`scheduleDetail.running`:`scheduleDetail.runNow`)})]}):null]})]})]}),(0,q.jsx)(o,{open:_,title:d(`scheduleDetail.delete`),message:d(`scheduleDetail.deleteConfirmMessage`,{name:e.name}),confirmLabel:d(`scheduleDetail.confirmDelete`),cancelLabel:d(`scheduleDetail.cancel`),destructive:!0,isPending:y,onConfirm:()=>void A(),onCancel:()=>v(!1)}),(0,q.jsx)(o,{open:S,title:d(`scheduleDetail.cancelOneTime`),message:d(`scheduleDetail.cancelOneTimeConfirmMessage`,{name:e.name}),confirmLabel:d(`scheduleDetail.confirmCancelOneTime`),cancelLabel:d(`scheduleDetail.cancel`),destructive:!0,isPending:w,onConfirm:()=>void j(),onCancel:()=>C(!1)})]})}function gn({icon:e,title:t,description:n,actions:r}){return(0,q.jsxs)(`div`,{className:`flex h-full min-h-[400px] flex-col items-center justify-center gap-4 px-4 py-24 text-center`,children:[(0,q.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,q.jsx)(e,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:t}),(0,q.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[var(--content-tertiary)]`,children:n}),r?(0,q.jsx)(`div`,{className:`flex flex-col items-center gap-3`,children:r}):null]})}function _n(e){if(e.status===`loading`)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{as:`span`,className:`h-4 w-12`}),(0,q.jsx)(z,{as:`span`,className:`h-4 w-10`})]});if(e.status===`error`)return(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`—`});let{summary:t}=e;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:Y(t.totalEstimatedCostUsd)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:Tt(t.runCount)})]})}function vn({name:e,badge:t,metaParts:n,usage:r,enabled:i,selected:a,onClick:o,onToggle:c,toggleAriaLabel:l}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md px-2 py-3 transition-colors [&+&]:border-t [&+&]:border-[var(--border-base)] ${a?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`}`,children:[c?(0,q.jsx)(s,{checked:i,onChange:c,"aria-label":l}):null,(0,q.jsxs)(`button`,{type:`button`,onClick:o,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-4 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e}),t]}),n.length>0?(0,q.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-small-default text-[var(--content-tertiary)]`,children:n.map((e,t)=>(0,q.jsxs)(G.Fragment,{children:[t>0?(0,q.jsx)(fe,{}):null,(0,q.jsx)(`span`,{className:`truncate`,children:e})]},t))}):null]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4`,children:[_n(r),(0,q.jsx)(W,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})]})}function yn({schedule:e,usage:t,selected:n,onClick:r,onToggle:i}){let{t:a}=H(`schedules`),o=e.isOneShot?``:e.cadenceDescription.trim(),s=e.lastRunAt??e.nextRunAt,c=nn(e),l=[c?a(c):``,o,s?J(s):``].filter(Boolean),u=en(e.sourceKey);return(0,q.jsx)(vn,{name:e.name,badge:u?(0,q.jsx)(_e,{tone:`info`,children:u}):void 0,metaParts:l,usage:t,enabled:e.enabled,selected:n,onClick:r,onToggle:i,toggleAriaLabel:i?a(`scheduleRow.toggleAria`,{name:e.name}):void 0})}function bn({recurring:e,oneTime:t,pastOneTime:n,usageForSchedule:r,isLoading:i,isError:a,refetch:o,onToggle:s,onSelectSchedule:c,selectedScheduleId:l,onStartNewChat:u,onCreateSchedule:d,pastOpen:f,onPastOpenChange:p,onRebaseProfiles:m,defaultProfileLabel:h,systemTasksSlot:g}){let{t:_}=H(`schedules`),v=e=>(0,q.jsx)(yn,{schedule:e,usage:r(e.id),selected:e.id===l,onClick:()=>c(e.id),onToggle:t=>s(e.id,t)},e.id),y=e=>(0,q.jsx)(yn,{schedule:e,usage:r(e.id),selected:e.id===l,onClick:()=>c(e.id)},e.id),b=n.length>0?(0,q.jsx)(P.Root,{type:`single`,collapsible:!0,className:`mt-3`,value:f?`past`:``,onValueChange:e=>p(e===`past`),children:(0,q.jsxs)(P.Item,{value:`past`,children:[(0,q.jsxs)(P.Trigger,{className:`group gap-[var(--app-spacing-xs)] px-2 text-label-small-default text-[var(--content-tertiary)]`,children:[(0,q.jsx)(W,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,q.jsx)(`span`,{children:_(`schedulesPanel.pastToggle`,{count:n.length})})]}),(0,q.jsx)(P.Content,{children:(0,q.jsx)(`div`,{className:`pt-1`,children:n.map(y)})})]})}):null;return(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[i?(0,q.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:2},(e,t)=>(0,q.jsx)(z,{className:`h-12 rounded-md`},t))}):a&&e.length===0?(0,q.jsx)(D,{tone:`error`,actions:(0,q.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer underline hover:no-underline`,children:_(`schedulesPanel.retry`)}),children:_(`schedulesPanel.loadFailed`)}):e.length===0&&t.length===0&&n.length===0?(0,q.jsx)(gn,{icon:Me,title:_(`schedulesPanel.emptyTitle`),description:_(`schedulesPanel.emptyDescription`),actions:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(L,{variant:`primary`,size:`regular`,onClick:u,children:_(`schedulesPanel.newConversation`)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:_(`schedulesPanel.emptyActionsSeparator`)}),(0,q.jsx)(L,{variant:`outlined`,size:`regular`,onClick:d,children:_(`schedulesPanel.createSchedule`)})]})}):(0,q.jsxs)(`div`,{children:[m&&h?(0,q.jsx)(`div`,{className:`mb-1 flex min-w-0 justify-end`,children:(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:m,className:`max-w-full truncate`,children:_(`schedulesPanel.useProfileForAll`,{profile:h})})}):null,e.map(v),t.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`mt-3 px-2 text-label-small-default text-[var(--content-tertiary)]`,children:_(`schedulesPanel.oneTimeHeading`)}),t.map(y)]}):null,b]}),g?(0,q.jsx)(`div`,{className:`mt-[var(--app-spacing-lg)]`,children:g}):null]})}function xn({runs:e,isLoading:t,emptyMessage:n,hasMore:r=!1,isLoadingMore:i=!1,onLoadMore:a}){let{t:o}=H(`settings`),s=Se(),[c,l]=(0,G.useState)(null),u=n??o(`recentRunsCard.emptyDefault`),d=r&&a?(0,q.jsx)(`div`,{className:`flex justify-center pt-3`,children:(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:a,disabled:i,leftIcon:i?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):void 0,children:o(i?`recentRunsCard.loadingMore`:`recentRunsCard.loadMore`)})}):null;return(0,q.jsx)($t,{title:o(`recentRunsCard.title`),children:t?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`py-4 text-center text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:u}),d]}):(0,q.jsxs)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:[e.map((e,t)=>{let n=kt(e),r=X(e.output),i=X(e.error),a=e.status===`skipped`||e.status===`missed`,u=!n&&!a&&(r||i),d=c===e.id,f=`schedule-run-details-${t}`;return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(ne,{label:(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,q.jsx)(Vt,{status:e.status}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block truncate text-body-medium-lighter text-[var(--content-default)]`,children:X(e.title)?e.title:J(e.startedAt)}),(0,q.jsxs)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[X(e.title)?`${J(e.startedAt)} · `:``,a?(0,q.jsx)(q.Fragment,{children:r?e.output:e.status===`missed`?o(`recentRunsCard.missed`):o(`recentRunsCard.skipped`)}):(0,q.jsxs)(q.Fragment,{children:[Ct(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd)]}),e.status===`error`&&e.error&&(0,q.jsxs)(`span`,{className:`ml-2 text-[var(--system-negative-strong)]`,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]})]}),n||u?(0,q.jsx)(W,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform ${d?`rotate-90`:``}`}):null]}),onSelect:n?()=>oe(s,n):u?()=>l(d?null:e.id):void 0,"aria-label":o(`recentRunsCard.runAtAria`,{time:J(e.startedAt)}),"aria-expanded":u?d:void 0,"aria-controls":u?f:void 0,className:`h-auto py-2.5 gap-3 -mx-2 px-2`}),u&&d?(0,q.jsx)(`div`,{id:f,className:`px-2 pb-3`,children:(0,q.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[r?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`recentRunsCard.output`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,i?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`recentRunsCard.error`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null]},e.id)}),d]})})}var Sn={heartbeat:`heartbeatAgent`,consolidation:`memoryV2Consolidation`,retrospective:`memoryRetrospective`};function $({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-[var(--content-secondary)]`,children:e}),(0,q.jsx)(`span`,{className:`flex min-w-0 items-center justify-end gap-2 text-right text-[var(--content-default)]`,children:t})]})}function Cn({kind:e,assistantId:t,systemTasks:n,canOpenMemorySettings:i,onClose:a}){let{t:o}=H(`schedules`),c=Se(),{heartbeatConfig:l,consolidationConfig:d,retrospectiveConfig:f}=n,p=l?.effectiveTimezone||l?.timezone||null,m,h,g,_,v,y,b;e===`heartbeat`?(m=o(`systemTaskDetail.nameHeartbeat`),h=l?Nt(l,p):``,g=l?.enabled??!1,_=l?.nextRunAt??null,v=l?.lastRunAt??null,y=n.isHeartbeatRunning,b=n.runHeartbeatNow):e===`consolidation`?(m=o(`systemTaskDetail.nameConsolidation`),h=d?Pt(d):``,g=d?.enabled??!1,_=d?.nextRunAt??null,v=d?.lastRunAt??null,y=n.isConsolidationRunning,b=n.runConsolidationNow):(m=o(`systemTaskDetail.nameRetrospective`),h=Ft(),g=f?.enabled??!1,_=f?.nextRunAt??null,v=f?.lastRunAt??null,y=!1,b=void 0);let C=e!==`heartbeat`,w=e===`retrospective`,T=C&&!g,E=y||T,O=o(C?g?`systemTaskDetail.statusManagedOn`:`systemTaskDetail.statusPaused`:g?`scheduleDetail.enabled`:`scheduleDetail.disabled`),k=w&&f?.available===!0,ee=o(k?`systemTaskDetail.pausedRetrospectiveSwitchedOff`:w?`systemTaskDetail.pausedRetrospective`:`systemTaskDetail.pausedConsolidation`),A=C&&g&&i,j={path:{assistant_id:t},query:{limit:25}},M=e===`heartbeat`?te(j):e===`consolidation`?S(j):r(j),{data:ne,isLoading:re,fetchNextPage:ie,hasNextPage:ae,isFetchingNextPage:oe}=xe({queryKey:M.queryKey,queryFn:M.queryFn,initialPageParam:{path:j.path,query:{}},getNextPageParam:e=>e.nextCursor??void 0,staleTime:1e4}),N=Dt(ne?.pages.map(t=>({runs:t.runs.filter(e=>!At(e)).map(t=>qt(t,e))}))),se=N?.find(e=>jt(e)&&e.status!==`running`),P=v??se?.finishedAt??se?.startedAt??null;return(0,q.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)] md:rounded-[var(--radius-xl)] md:border md:border-[var(--border-base)]`,children:[(0,q.jsx)(x,{title:m,closeLabel:o(`scheduleDetail.closeAria`),closeTooltip:o(`scheduleDetail.close`),onClose:a}),(0,q.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)($t,{title:o(`scheduleDetail.details`),children:(0,q.jsxs)(`div`,{className:`space-y-2 text-body-medium-lighter`,children:[(0,q.jsx)($,{label:o(`scheduleDetail.status`),value:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`truncate`,children:O}),C?null:(0,q.jsx)(s,{size:`sm`,checked:g,onChange:n.toggleHeartbeat,"aria-label":o(`scheduleDetail.toggleAria`,{name:m})})]})}),(0,q.jsx)(an,{assistantId:t,defaultCallSite:Sn[e],fallbackLabel:o(`systemTaskDetail.fallbackModelProfile`),respectCallSiteOverride:!0}),h?(0,q.jsx)($,{label:o(`systemTaskDetail.repeats`),value:(0,q.jsx)(`span`,{className:`truncate`,children:h})}):null,e===`heartbeat`&&p?(0,q.jsx)($,{label:o(`scheduleDetail.timezone`),value:(0,q.jsx)(`span`,{className:`truncate`,children:p})}):null,w?null:(0,q.jsx)($,{label:o(`scheduleDetail.nextRun`),value:(0,q.jsx)(`span`,{className:`truncate`,children:J(_)})}),(0,q.jsx)($,{label:o(`scheduleDetail.lastRun`),value:(0,q.jsx)(`span`,{className:`truncate`,children:J(P)})})]})}),T?(0,q.jsx)(D,{tone:`warning`,className:`mt-4`,actions:i?(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:()=>c(`${u.settings.developer}?tab=memory`),children:o(k?`systemTaskDetail.openMemorySettings`:`systemTaskDetail.turnOnMemory`)}):void 0,children:ee}):null]}),(0,q.jsx)(xn,{runs:N,isLoading:re,hasMore:ae,isLoadingMore:oe,onLoadMore:()=>void ie()})]}),A||b?(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-[var(--border-hover)] p-[var(--app-spacing-lg)]`,children:[A?(0,q.jsx)(L,{variant:`outlined`,leftIcon:(0,q.jsx)(Pe,{className:`h-3.5 w-3.5`}),onClick:()=>c(`${u.settings.developer}?tab=memory`),children:o(`systemTaskDetail.memorySettings`)}):null,b?(0,q.jsx)(L,{variant:`primary`,leftIcon:y?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):(0,q.jsx)(je,{className:`h-3.5 w-3.5`}),onClick:b,disabled:E,children:o(y?`scheduleDetail.running`:`scheduleDetail.runNow`)}):null]}):null]})}function wn(e){let t=M(),[n]=(0,G.useState)(()=>Date.now()),{data:r,isLoading:a,isError:o,refetch:s}=V(se(e)),{data:l,isLoading:u,isError:d}=V(Rt(e,t,!0)),{recurring:f,oneTime:p,pastOneTime:m}=(0,G.useMemo)(()=>{let e=Lt(r??[],n);return{recurring:e.recurring,oneTime:e.upcomingOneTime,pastOneTime:e.pastOneTime}},[n,r]),h=(0,G.useMemo)(()=>new Map((l??[]).map(e=>[e.scheduleId,e])),[l]);return{recurring:f,oneTime:p,pastOneTime:m,usageForSchedule:(0,G.useCallback)(e=>u?{status:`loading`}:d?{status:`error`}:{status:`ready`,summary:h.get(e)??zt(e)},[d,u,h]),handleToggle:(0,G.useCallback)(async(t,n)=>{if(e)try{await Re(e,t,n),s()}catch(e){c(e,{context:`schedule_toggle`}),i.error(B(`schedules:scheduleDetail.toggleFailed`))}},[e,s]),isLoading:a,isError:o,refetch:(0,G.useCallback)(()=>{s()},[s])}}function Tn(){let e=Se(),{scheduleId:t}=Ce(),n=N(),r=C(),i=M(),a=wn(n),o=Qt(n,i),s=A(`memoryOptOut`),c=ce.use.settingsDeveloperNav(),l=s&&c===!0,[d,f]=(0,G.useState)(!1),p=t??null,[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),v=(0,G.useCallback)(t=>{e(t?u.schedules.detail(t):u.schedules.root)},[e]),y=p?a.recurring.find(e=>e.id===p)??a.oneTime.find(e=>e.id===p)??a.pastOneTime.find(e=>e.id===p)??null:null;(0,G.useEffect)(()=>{p&&!a.isLoading&&!a.isError&&!y&&v(null)},[p,y,a.isLoading,a.isError,v]);let b=m===`heartbeat`?o.heartbeatConfig!=null:m===`consolidation`?o.consolidationConfig?.available===!0:m===`retrospective`?o.retrospectiveConfig?.available===!0:!1;(0,G.useEffect)(()=>{m&&!o.isLoading&&!b&&h(null)},[m,b,o.isLoading]);let x=(0,G.useCallback)(e=>{h(null),v(e)},[v]),S=(0,G.useCallback)(e=>{p&&v(null),h(e)},[v,p]),w=(0,G.useCallback)(()=>{he(e)},[e]),T=bt(n,(0,G.useMemo)(()=>[...a.recurring,...a.oneTime,...a.pastOneTime],[a.recurring,a.oneTime,a.pastOneTime]),a.refetch),E=(y?(0,q.jsx)(hn,{schedule:y,assistantId:n,usage:a.usageForSchedule(y.id),isPast:a.pastOneTime.some(e=>e.id===y.id),onClose:()=>v(null),onDeleted:()=>{v(null),a.refetch()}}):null)??(m&&b?(0,q.jsx)(Cn,{kind:m,assistantId:n,systemTasks:o,canOpenMemorySettings:l,onClose:()=>h(null)}):null),D=(0,q.jsx)(bn,{recurring:a.recurring,oneTime:a.oneTime,pastOneTime:a.pastOneTime,usageForSchedule:a.usageForSchedule,isLoading:a.isLoading,isError:a.isError,refetch:a.refetch,onToggle:a.handleToggle,onSelectSchedule:x,selectedScheduleId:p,onStartNewChat:w,onCreateSchedule:()=>f(!0),pastOpen:g,onPastOpenChange:_,onRebaseProfiles:T.canRebase?T.requestRebase:void 0,defaultProfileLabel:T.defaultProfileLabel??void 0,systemTasksSlot:(0,q.jsx)(Wt,{heartbeatConfig:o.heartbeatConfig,consolidationConfig:o.consolidationConfig,retrospectiveConfig:o.retrospectiveConfig,heartbeatUsage:o.heartbeatUsage,consolidationUsage:o.consolidationUsage,retrospectiveUsage:o.retrospectiveUsage,isLoading:o.isLoading,hasError:o.hasError,onRetry:o.refetchAll,onSelectHeartbeat:()=>S(`heartbeat`),onSelectConsolidation:()=>S(`consolidation`),onSelectRetrospective:()=>S(`retrospective`)})}),O=(0,q.jsx)(xt,{...T.dialogProps});return E&&r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ze,{children:E}),O]}):(0,q.jsxs)(q.Fragment,{children:[E&&!r?(0,q.jsx)(qe,{storageKey:`schedulesDetailDrawerWidth`,detailKey:p??m??void 0,section:D,detail:E}):D,(0,q.jsx)(ut,{isOpen:d,assistantId:n,onClose:()=>f(!1),onCreated:()=>{f(!1),a.refetch()}}),O]})}export{Tn as SchedulesPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ax as t,Bd as n,Cf as r,Dx as i,Ef as a,Ex as o,Fx as s,Gb as c,Gx as l,Ib as u,Ix as d,Jd as f,K as p,Kp as m,Ld as h,Lx as g,Md as _,Of as v,Ox as y,Qf as b,Qn as x,Rd as S,Sc as C,Sf as w,Tf as T,Uv as E,Ux as D,Wx as O,X as k,Xd as ee,Xo as A,Y as j,Ya as M,Yd as te,Yx as ne,Z as re,Zd as ie,Zf as ae,bc as oe,et as N,f as se,gx as P,iS as F,kd as I,ld as ce,q as le,qd as ue,qf as de,tS as L,tr as fe,u as pe,wf as me,wx as R,xc as he,yx as z,zd as ge,zx as _e}from"./app-1VZKPehC.js";import{I as B,Jn as ve,N as ye,Zn as V,er as be,j as H,qn as xe}from"./vendor-Dc7Mo5cU.js";import{f as Se,h as Ce,t as we,x as Te}from"./react-B9IgSVeK.js";import{Ci as Ee,Hi as De,Jn as U,Ki as Oe,Ot as ke,Qi as Ae,Rt as je,Wi as W,aa as Me,fi as Ne,ht as Pe,k as Fe}from"./icons-DxrLl-Dj.js";import{t as Ie}from"./detail-card-N-3EizQA.js";import{a as Le,c as Re,d as ze,i as Be,l as Ve,n as He,o as Ue,r as We,s as Ge,t as Ke,u as qe}from"./schedules-C04f-6Zm.js";import{a as Je,r as Ye,t as Xe}from"./usage-window-za0Cf2tq.js";var G=e(Te(),1),Ze={frequency:`daily`,minute:0,hour24:9,weekdays:[1],dayOfMonth:1},Qe=[{value:0,letter:`S`,short:`Sun`,full:`Sunday`},{value:1,letter:`M`,short:`Mon`,full:`Monday`},{value:2,letter:`T`,short:`Tue`,full:`Tuesday`},{value:3,letter:`W`,short:`Wed`,full:`Wednesday`},{value:4,letter:`T`,short:`Thu`,full:`Thursday`},{value:5,letter:`F`,short:`Fri`,full:`Friday`},{value:6,letter:`S`,short:`Sat`,full:`Saturday`}],$e=[1,2,3,4,5];function K(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function et(e){let t=Array.from(new Set(e.map(e=>K(e,0,6)).filter(e=>Number.isInteger(e)))).sort((e,t)=>e-t);return t.length>0?t:[1]}function tt(e){let t=K(e.minute,0,59),n=K(e.hour24,0,23);switch(e.frequency){case`hourly`:return`${t} * * * *`;case`daily`:return`${t} ${n} * * *`;case`weekly`:return`${t} ${n} * * ${et(e.weekdays).join(`,`)}`;case`monthly`:return e.dayOfMonth===`last`?`${t} ${n} L * *`:`${t} ${n} ${K(e.dayOfMonth,1,28)} * *`}}function nt(e,t){let n=K(e,0,23),r=K(t,0,59),i=n<12?`AM`:`PM`;return`${n%12==0?12:n%12}:${String(r).padStart(2,`0`)} ${i}`}function rt(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return`${e}${t[(n-20)%10]??t[n]??t[0]}`}function it(e){let t=et(e),n=new Set(t);if(t.length===7)return`every day`;if(t.length===5&&$e.every(e=>n.has(e)))return`every weekday`;if(t.length===2&&n.has(0)&&n.has(6))return`every weekend`;if(t.length===1)return`every ${Qe[t[0]]?.full??`day`}`;let r=t.map(e=>Qe[e]?.short??``),i=r.pop();return`every ${r.join(`, `)} & ${i}`}function at(e){let t=nt(e.hour24,e.minute);switch(e.frequency){case`hourly`:{let t=K(e.minute,0,59);return`Runs every hour at :${String(t).padStart(2,`0`)}`}case`daily`:return`Runs every day at ${t}`;case`weekly`:return`Runs ${it(e.weekdays)} at ${t}`;case`monthly`:return e.dayOfMonth===`last`?`Runs on the last day of every month at ${t}`:`Runs on the ${rt(K(e.dayOfMonth,1,28))} of every month at ${t}`}}var q=we(),ot=Array.from({length:12},(e,t)=>{let n=t+1;return{value:String(n),label:String(n)}}),st=Array.from({length:12},(e,t)=>{let n=t*5,r=String(n).padStart(2,`0`);return{value:r,label:r}});function ct(e,t){let n=e%12;return t===`PM`?n+12:n}function lt(e){try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return t&&t!==e?`${e} · ${t}`:e}catch{return e}}function ut({isOpen:e,assistantId:t,onClose:n,onCreated:r}){return(0,q.jsx)(y.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,q.jsx)(dt,{assistantId:t,onClose:n,onCreated:r}):null})}function dt({assistantId:e,onClose:t,onCreated:n}){let{t:r}=H(`settings`),i=M(),[a,o]=(0,G.useState)(``),[s,c]=(0,G.useState)(``),[l,u]=(0,G.useState)(``),[f,p]=(0,G.useState)(`simple`),[m,h]=(0,G.useState)(Ze),[_,v]=(0,G.useState)(``),[b,x]=(0,G.useState)(!1),[S,C]=(0,G.useState)(null),w=a.trim(),T=s.trim(),E=l.trim(),D=_.trim(),O=(0,G.useMemo)(()=>f===`simple`?tt(m):D,[f,m,D]),k=(0,G.useMemo)(()=>f===`simple`?at(m):D||r(`createScheduleModal.cronContinuePrompt`),[f,m,D,r]),ee=(0,G.useMemo)(()=>lt(i),[i]),A=w.length>0&&T.length>0&&E.length>0&&O.length>0&&!b;return(0,q.jsxs)(y.Content,{size:`md`,children:[(0,q.jsxs)(y.Header,{children:[(0,q.jsx)(y.Title,{children:r(`createScheduleModal.title`)}),(0,q.jsx)(y.Description,{children:r(`createScheduleModal.description`)})]}),(0,q.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),A){x(!0),C(null);try{await He(e,{name:w,description:T,expression:O,message:E,timezone:i}),x(!1),n()}catch(e){C(e instanceof Error?e.message:r(`createScheduleModal.createFailed`)),x(!1)}}},children:[(0,q.jsx)(y.Body,{children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,q.jsx)(d,{label:r(`createScheduleModal.nameLabel`),placeholder:r(`createScheduleModal.namePlaceholder`),value:a,onChange:e=>o(e.target.value),required:!0,autoFocus:!0,fullWidth:!0}),(0,q.jsx)(g,{label:r(`createScheduleModal.descriptionLabel`),placeholder:r(`createScheduleModal.descriptionPlaceholder`),value:s,onChange:e=>c(e.target.value),required:!0,fullWidth:!0,rows:2}),(0,q.jsx)(gt,{label:r(`createScheduleModal.repeatLabel`),children:f===`simple`?(0,q.jsx)(ft,{cadence:m,onChange:h}):(0,q.jsx)(ht,{value:_,onChange:v,onUseSimple:()=>p(`simple`)})}),(0,q.jsx)(vt,{summary:k,mono:f===`advanced`&&D.length>0,timezoneLabel:ee}),f===`simple`?(0,q.jsx)(`button`,{type:`button`,onClick:()=>{v(e=>e||tt(m)),p(`advanced`)},className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:r(`createScheduleModal.advancedCron`)}):null,(0,q.jsx)(g,{label:r(`createScheduleModal.messageLabel`),placeholder:r(`createScheduleModal.messagePlaceholder`),value:l,onChange:e=>u(e.target.value),required:!0,fullWidth:!0,rows:4}),S?(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:S}):null]})}),(0,q.jsxs)(y.Footer,{children:[(0,q.jsx)(L,{variant:`outlined`,onClick:t,type:`button`,children:r(`createScheduleModal.cancel`)}),(0,q.jsx)(L,{variant:`primary`,type:`submit`,disabled:!A,children:r(b?`createScheduleModal.creating`:`createScheduleModal.create`)})]})]})]})}function ft({cadence:e,onChange:n}){let{t:r}=H(`settings`),i=[{value:`hourly`,label:r(`createScheduleModal.frequencyHourly`)},{value:`daily`,label:r(`createScheduleModal.frequencyDaily`)},{value:`weekly`,label:r(`createScheduleModal.frequencyWeekly`)},{value:`monthly`,label:r(`createScheduleModal.frequencyMonthly`)}],a=[...Array.from({length:28},(e,t)=>{let n=t+1;return{value:String(n),label:rt(n)}}),{value:`last`,label:r(`createScheduleModal.lastDay`)}];return(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsx)(t,{items:i,value:e.frequency,onChange:t=>n({...e,frequency:t}),ariaLabel:r(`createScheduleModal.frequencyAriaLabel`)}),e.frequency===`hourly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.atMinute`),children:(0,q.jsx)(R,{options:st,value:String(e.minute).padStart(2,`0`),onChange:t=>n({...e,minute:Number(t)}),"aria-label":r(`createScheduleModal.minuteAriaLabel`),className:`w-24`})}):null,e.frequency===`weekly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.onTheseDays`),children:(0,q.jsx)(mt,{value:e.weekdays,onChange:t=>n({...e,weekdays:t})})}):null,e.frequency===`monthly`?(0,q.jsx)(_t,{label:r(`createScheduleModal.onDay`),children:(0,q.jsx)(R,{options:a,value:e.dayOfMonth===`last`?`last`:String(e.dayOfMonth),onChange:t=>n({...e,dayOfMonth:t===`last`?`last`:Number(t)}),"aria-label":r(`createScheduleModal.dayOfMonthAriaLabel`),className:`w-32`})}):null,e.frequency===`hourly`?null:(0,q.jsx)(_t,{label:r(`createScheduleModal.atTime`),children:(0,q.jsx)(pt,{hour24:e.hour24,minute:e.minute,onChange:(t,r)=>n({...e,hour24:t,minute:r})})})]})}function pt({hour24:e,minute:n,onChange:r}){let{t:i}=H(`settings`),a=e<12?`AM`:`PM`,o=e%12==0?12:e%12,s=[{value:`AM`,label:i(`createScheduleModal.periodAm`)},{value:`PM`,label:i(`createScheduleModal.periodPm`)}];return(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(R,{options:ot,value:String(o),onChange:e=>r(ct(Number(e),a),n),"aria-label":i(`createScheduleModal.hourAriaLabel`),className:`w-[72px]`}),(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`:`}),(0,q.jsx)(R,{options:st,value:String(n).padStart(2,`0`),onChange:t=>r(e,Number(t)),"aria-label":i(`createScheduleModal.minuteAriaLabel`),className:`w-[72px]`}),(0,q.jsx)(`div`,{className:`w-[112px]`,children:(0,q.jsx)(t,{items:s,value:a,onChange:e=>r(ct(o,e),n),ariaLabel:i(`createScheduleModal.periodAriaLabel`)})})]})}function mt({value:e,onChange:t}){let n=new Set(e),r=e=>{let r=new Set(n);r.has(e)?r.size>1&&r.delete(e):r.add(e),t([...r].sort((e,t)=>e-t))};return(0,q.jsx)(`div`,{className:`flex gap-1.5`,children:Qe.map(e=>{let t=n.has(e.value);return(0,q.jsx)(`button`,{type:`button`,onClick:()=>r(e.value),"aria-pressed":t,"aria-label":e.full,title:e.full,className:F(`flex h-9 w-9 items-center justify-center rounded-md border text-body-medium-default transition-colors`,t?`border-[var(--border-active)] bg-[var(--surface-active)] text-[var(--content-emphasised)]`:`border-[var(--field-border)] text-[var(--content-tertiary)] hover:border-[var(--border-active)] hover:text-[var(--content-default)]`),children:e.letter},e.value)})})}function ht({value:e,onChange:t,onUseSimple:n}){let{t:r}=H(`settings`);return(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(d,{placeholder:`0 9 * * *`,value:e,onChange:e=>t(e.target.value),fullWidth:!0,className:`font-mono`,"aria-label":r(`createScheduleModal.cronAriaLabel`),helperText:r(`createScheduleModal.cronHelper`)}),(0,q.jsx)(`button`,{type:`button`,onClick:n,className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:r(`createScheduleModal.backToSimple`)})]})}function gt({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:e}),t]})}function _t({label:e,children:t}){return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,q.jsx)(`span`,{className:`min-w-[88px] text-body-small-default text-[var(--content-tertiary)]`,children:e}),t]})}function vt({summary:e,mono:t,timezoneLabel:n}){let{t:r}=H(`settings`);return(0,q.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3.5 py-3`,children:[(0,q.jsx)(Ee,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`p`,{className:F(`text-body-medium-default text-[var(--content-default)]`,t&&`break-all font-mono`),children:e}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`createScheduleModal.timezoneNote`,{timezone:n})})]})]})}function yt(e,t,n){let r=!!e&&n?.enabled!==!1,{data:i}=V({..._({path:{assistant_id:e}}),enabled:r,staleTime:6e4}),{data:a}=V({...I({path:{assistant_id:e}}),enabled:r,staleTime:6e4}),o=i?.callSites.find(e=>e.id===t)?.defaultProfile??null;return o==null?{key:null,label:null}:{key:o,label:(a?Je(a):{})[o]?.displayName??o}}function bt(e,t,n){let{t:r}=H(`settings`),a=yt(e,`mainAgent`),[o,s]=(0,G.useState)(!1),l=(0,G.useMemo)(()=>a.key?t.filter(e=>pe(e)&&e.inferenceProfile!==a.key).length:0,[a.key,t]),u=a.label,d=ve({mutationFn:t=>Ue(e,null,t),onSuccess:e=>{s(!1),n(),i.success(e===0?r(`scheduleProfileRebase.alreadyOnProfileToast`,{profile:u}):r(`scheduleProfileRebase.movedToast`,{count:e,profile:u}))},onError:e=>{c(e,{context:`schedules_rebase_inference_profile`}),i.error(r(`scheduleProfileRebase.moveFailedToast`))}});return{defaultProfileLabel:u,offDefaultCount:l,canRebase:l>0,requestRebase:()=>s(!0),dialogProps:{open:o&&a.key!=null,profileLabel:u,offDefaultCount:l,isPending:d.isPending,onConfirm:()=>{a.key&&d.mutate(a.key)},onCancel:()=>s(!1)}}}function xt({open:e,profileLabel:t,offDefaultCount:n,isPending:r,onConfirm:i,onCancel:a}){let{t:s}=H(`settings`);return(0,q.jsx)(o,{open:e,title:s(`scheduleProfileRebase.dialogTitle`,{profile:t}),message:s(`scheduleProfileRebase.dialogMessage`,{count:n,profile:t}),confirmLabel:s(`scheduleProfileRebase.moveSchedules`),isPending:r,onConfirm:i,onCancel:a})}function St(e=m(),t=Date.now()){return Ye(Xe,e,t)}function J(e){return e?new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0}):`—`}function Ct(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}var wt=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function Y(e){return e==null||!Number.isFinite(e)?`—`:wt.format(e)}function Tt(e){return`${e.toLocaleString()} ${e===1?`run`:`runs`}`}function Et(e,t=B){let n=Math.round(e/6e4);return n>=60&&n%60==0?t(`scheduleFormatters.everyHours`,{count:n/60}):t(`scheduleFormatters.everyMinutes`,{count:n})}function Dt(e){if(!e)return;let t=new Set,n=[];for(let r of e)for(let e of r.runs)t.has(e.id)||(t.add(e.id),n.push(e));return n}function Ot(e){return!!e.conversationId&&e.conversationExists===!0&&e.conversationArchivedAt==null}function kt(e){return Ot(e)?e.conversationId??null:null}function X(e){return typeof e==`string`&&e.length>0}function At(e){return e.status===`pending`||e.status===`superseded`}function jt(e){return e.status!==`skipped`&&e.status!==`missed`&&!At(e)}var Mt={heartbeat:`system-heartbeat`,consolidation:`system-consolidation`,retrospective:`system-memory-retrospective`};function Nt(e,t,n=B){let r=e.effectiveTimezone||e.timezone||t||null;if(e.cronExpression)return r?`Cron: ${e.cronExpression} (${r})`:`Cron: ${e.cronExpression}`;let i=Et(e.intervalMs,n);return e.activeHoursStart!=null&&e.activeHoursEnd!=null&&(i+=r?` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00 ${r})`:` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00)`),i}function Pt(e,t=B){return Et(e.intervalMs,t)}function Ft(e=B){return e(`scheduleFormatters.retrospectiveSubtitle`)}function It(e,t){return pe(e)?e.status===`firing`?!1:e.nextRunAt==null||!e.enabled&&e.nextRunAt<=t:!0}function Lt(e,t){let n=[],r=[],i=[];for(let a of e)a.isOneShot?It(a,t)?i.push(a):r.push(a):n.push(a);return n.sort((e,t)=>e.enabled===t.enabled?(e.nextRunAt??1/0)-(t.nextRunAt??1/0):e.enabled?-1:1),r.sort((e,t)=>(e.nextRunAt??1/0)-(t.nextRunAt??1/0)),i.sort((e,t)=>{let n=e.lastRunAt??e.nextRunAt??0;return(t.lastRunAt??t.nextRunAt??0)-n}),{recurring:n,upcomingOneTime:r,pastOneTime:i}}function Rt(e,t,n=!0){return{queryKey:[{_id:`schedulesUsagesummaryGet`,path:{assistant_id:e??``},_tz:t}],queryFn:()=>e?Le(e,St(t)):Promise.resolve([]),enabled:n,staleTime:1e4}}function zt(e){return{scheduleId:e,runCount:0,totalEstimatedCostUsd:0,eventCount:0}}function Bt(e,t,n){let r=(t??[]).filter(e=>{let t=e.startedAt??e.createdAt;return jt(e)&&t>=n.from&&t<=n.to});return{scheduleId:e,runCount:r.length,totalEstimatedCostUsd:r.reduce((e,t)=>{let n=t.estimatedCostUsd;return typeof n==`number`&&Number.isFinite(n)?e+n:e},0),eventCount:0}}function Vt({status:e}){let{t}=H(`settings`);return(0,q.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full`,style:{backgroundColor:e===`ok`||e===`completed`?`var(--system-positive-strong)`:e===`error`||e===`failed`?`var(--system-negative-strong)`:`var(--content-tertiary)`},"aria-label":e??t(`scheduleSharedUi.unknownStatus`)})}function Ht({scheduleName:e,usage:t,onOpenUsage:n}){let{t:r}=H(`settings`);if(t.status===`loading`)return(0,q.jsxs)(`div`,{"aria-label":r(`scheduleSharedUi.loadingUsage`),className:`flex w-[156px] shrink-0 items-center justify-end gap-3`,children:[(0,q.jsx)(z,{as:`span`,className:`h-5 w-16`}),(0,q.jsx)(z,{as:`span`,className:`h-5 w-16`})]});let i=t.status===`error`,a=i?`--`:Y(t.summary.totalEstimatedCostUsd),o=i?`--`:Tt(t.summary.runCount),s=t.status===`ready`&&!(t.summary.totalEstimatedCostUsd>0),c=t.status===`ready`&&t.summary.runCount===0,l=s?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`,u=c?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`;return(0,q.jsxs)(`div`,{className:`flex w-[156px] shrink-0 items-center justify-end gap-3 text-right text-body-small-default`,children:[n?(0,q.jsx)(`button`,{type:`button`,onClick:n,"aria-label":r(`scheduleSharedUi.viewUsageFor`,{name:e}),className:`min-w-[64px] cursor-pointer rounded px-1 py-0.5 text-right transition-colors hover:bg-[var(--surface-hover)] ${l}`,children:a}):(0,q.jsx)(`span`,{"aria-label":r(`scheduleSharedUi.costFor`,{name:e,cost:a}),className:`block min-w-[64px] px-1 py-0.5 ${l}`,children:a}),(0,q.jsx)(`span`,{"aria-label":r(`scheduleSharedUi.runsFor`,{name:e,runs:o}),className:`block min-w-[64px] px-1 py-0.5 ${u}`,children:o})]})}function Ut({name:e,subtitle:t,enabled:n,nextRunAt:r,lastRunAt:i,usage:a,helperText:o,statusLabel:s,statusTone:c=`neutral`,onClick:l}){let{t:u}=H(`settings`);return(0,q.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md px-2 py-3 transition-colors hover:bg-[var(--surface-hover)] [&+&]:border-t [&+&]:border-[var(--border-base)]`,children:(0,q.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":u(`systemTasksSection.openAriaLabel`,{name:e}),className:`flex min-w-0 flex-1 cursor-pointer flex-wrap items-center gap-3 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e})}),(0,q.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t}),o?(0,q.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-secondary)]`,children:o}):null,(0,q.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-body-small-default text-[var(--content-tertiary)]`,children:[r?(0,q.jsx)(`span`,{children:u(`systemTasksSection.nextRun`,{time:J(r)})}):null,i?(0,q.jsx)(`span`,{children:u(`systemTasksSection.lastRun`,{time:J(i)})}):null]})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-3`,children:[(0,q.jsx)(Ht,{scheduleName:e,usage:a}),s?(0,q.jsx)(_e,{tone:c,children:s}):(0,q.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:n?`var(--system-positive-strong)`:`var(--content-disabled)`},"aria-label":u(n?`systemTasksSection.enabled`:`systemTasksSection.disabled`)}),(0,q.jsx)(W,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})})}function Wt({heartbeatConfig:e,consolidationConfig:t,retrospectiveConfig:n,heartbeatUsage:r,consolidationUsage:i,retrospectiveUsage:a,isLoading:o,hasError:s,onRetry:c,onSelectHeartbeat:l,onSelectConsolidation:u,onSelectRetrospective:d}){let{t:f}=H(`settings`),p=e!=null,m=t?.available===!0,h=n?.available===!0,g=p||m||h;if(!o&&!s&&!g)return null;let _=[...p?[r]:[],...m?[i]:[],...h?[a]:[]].filter(e=>e.status===`ready`),v=_.reduce((e,t)=>e+(t.summary.totalEstimatedCostUsd??0),0),y=o?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):s&&!g?(0,q.jsx)(D,{tone:`error`,children:(0,q.jsx)(ye,{ns:`settings`,i18nKey:`systemTasksSection.loadError`,components:{retryButton:(0,q.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`})}})}):(0,q.jsxs)(`div`,{children:[p?(0,q.jsx)(Ut,{name:f(`systemTasksSection.heartbeatName`),subtitle:Nt(e),enabled:e.enabled,nextRunAt:e.nextRunAt,lastRunAt:e.lastRunAt,usage:r,onClick:l}):null,m?(0,q.jsx)(Ut,{name:f(`systemTasksSection.consolidationName`),subtitle:Pt(t),enabled:t.enabled,helperText:t.enabled?void 0:f(`systemTasksSection.consolidationPausedHelper`),nextRunAt:t.nextRunAt,lastRunAt:t.lastRunAt,usage:i,statusLabel:t.enabled?void 0:f(`systemTasksSection.paused`),statusTone:`warning`,onClick:u}):null,h?(0,q.jsx)(Ut,{name:f(`systemTasksSection.retrospectiveName`),subtitle:Ft(),enabled:n.enabled,helperText:n.enabled?void 0:f(`systemTasksSection.retrospectivePausedHelper`),nextRunAt:n.nextRunAt,lastRunAt:n.lastRunAt,usage:a,statusLabel:n.enabled?void 0:f(`systemTasksSection.paused`),statusTone:`warning`,onClick:d}):null,s?(0,q.jsx)(`div`,{className:`pt-3 first:pt-0`,children:(0,q.jsx)(D,{tone:`error`,children:(0,q.jsx)(ye,{ns:`settings`,i18nKey:`systemTasksSection.partialLoadError`,components:{retryButton:(0,q.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`})}})})}):null]});return(0,q.jsx)(Ie,{children:(0,q.jsx)(P.Root,{type:`multiple`,children:(0,q.jsxs)(P.Item,{value:`system-jobs`,children:[(0,q.jsxs)(P.Trigger,{className:`group justify-between gap-3`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-left`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:f(`systemTasksSection.title`)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:f(`systemTasksSection.subtitle`)})]}),(0,q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[_.length>0?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:f(`systemTasksSection.cost7d`,{cost:Y(v)})}):null,(0,q.jsx)(Oe,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]})]}),(0,q.jsx)(P.Content,{children:(0,q.jsx)(`div`,{className:`mt-3`,children:y})})]})})})}var Gt={disabled:`heartbeat is disabled`,outside_active_hours:`outside active hours`,overlap:`previous run was still active`,pre_first_user_message:`waiting for the first conversation`,max_consecutive_runs:`consecutive-run cap reached`,max_daily_runs:`daily run cap reached`,quiesced:`assistant was shutting down`};function Kt(e){return e.status===`missed`?`Missed while the assistant was offline`:`skipReason`in e&&e.skipReason?`Skipped — ${Gt[e.skipReason]??e.skipReason}`:null}function qt(e,t){return{id:e.id,jobId:t,status:e.status,startedAt:e.startedAt??e.scheduledFor,finishedAt:e.finishedAt,durationMs:e.durationMs,output:Kt(e),error:e.error,conversationId:e.conversationId,conversationExists:e.conversationExists,conversationArchivedAt:e.conversationArchivedAt,estimatedCostUsd:e.estimatedCostUsd,createdAt:e.createdAt,...`title`in e?{title:e.title}:{}}}function Jt(e){return e.runs.filter(e=>!At(e)).map(e=>qt(e,`heartbeat`))}function Yt(e){return e.runs.map(e=>qt(e,`consolidation`))}function Xt(e){return e.runs.map(e=>qt(e,`retrospective`))}var Z=1e4;function Zt(e,t,n,r,i){return e?{status:`loading`}:t?{status:`error`}:{status:`ready`,summary:Bt(n,r,i)}}function Qt(e,t){let r=be(),a={path:{assistant_id:e??``}},{data:o,isLoading:s,isError:l,refetch:u}=V({...ue(a),enabled:!!e,staleTime:Z}),{data:d,isLoading:p,isError:m,refetch:g}=V({...h(a),enabled:!!e,staleTime:Z}),{data:_,isLoading:v,isError:y,refetch:x}=V({...w(a),enabled:!!e,staleTime:Z}),S={path:{assistant_id:e??``},query:{limit:100}},{data:C,isLoading:E,isError:D,refetch:O}=V({...ie(S),select:Jt,enabled:!!e&&o!=null,staleTime:Z}),{data:k,isLoading:A,isError:j,refetch:M}=V({...n(S),select:Yt,enabled:!!e&&d?.available===!0,staleTime:Z}),{data:te,isLoading:ne,isError:re,refetch:oe}=V({...T(S),select:Xt,enabled:!!e&&_?.available===!0,staleTime:Z}),N=(0,G.useMemo)(()=>St(t),[t]),se=(0,G.useMemo)(()=>Zt(E,D,Mt.heartbeat,C,N),[C,D,E,N]),P=(0,G.useMemo)(()=>Zt(A,j,Mt.consolidation,k,N),[k,j,A,N]),F=(0,G.useMemo)(()=>Zt(ne,re,Mt.retrospective,te,N),[te,re,ne,N]),I=t=>{if(!e)return;let i={heartbeat:{config:ue(a).queryKey,runs:ie(S).queryKey,infinite:ee(a)},consolidation:{config:h(a).queryKey,runs:n(S).queryKey,infinite:ge(a)},retrospective:{config:w(a).queryKey,runs:T(S).queryKey,infinite:me(a)}}[t];r.invalidateQueries({queryKey:i.config}),r.invalidateQueries({queryKey:i.runs}),r.invalidateQueries({queryKey:i.infinite})},ce=b({onSuccess:e=>{e.ran?i.success(B(`settings:useSystemTasks.heartbeatStarted`)):i.info(B(`settings:useSystemTasks.heartbeatSkipped`))},onError:e=>{c(e,{context:`heartbeat_run_now`}),i.error(B(`settings:useSystemTasks.heartbeatRunFailed`))},onSettled:()=>I(`heartbeat`)}),le=de({onSuccess:e=>{e.ran?i.success(B(`settings:useSystemTasks.consolidationQueued`)):i.info(B(`settings:useSystemTasks.consolidationAlreadyQueued`))},onError:e=>{c(e,{context:`consolidation_run_now`}),i.error(B(`settings:useSystemTasks.consolidationRunFailed`))},onSettled:()=>I(`consolidation`)}),L=ae({onSuccess:e=>{f(r,a,e),i.success(e.enabled?B(`settings:useSystemTasks.heartbeatEnabled`):B(`settings:useSystemTasks.heartbeatDisabled`))},onError:e=>{c(e,{context:`heartbeat_toggle`}),i.error(B(`settings:useSystemTasks.heartbeatToggleFailed`))}});return{heartbeatConfig:o,consolidationConfig:d,retrospectiveConfig:_,heartbeatUsage:se,consolidationUsage:P,retrospectiveUsage:F,isLoading:s||p||v,hasError:l||m||y,isHeartbeatRunning:ce.isPending,isConsolidationRunning:le.isPending,isHeartbeatLoading:s,isHeartbeatError:l,isConsolidationLoading:p,isConsolidationError:m,isRetrospectiveLoading:v,isRetrospectiveError:y,refetchHeartbeat:u,refetchConsolidation:g,refetchRetrospective:x,runHeartbeatNow:()=>{e&&ce.mutate({path:{assistant_id:e}})},runConsolidationNow:()=>{e&&le.mutate({path:{assistant_id:e}})},toggleHeartbeat:t=>{e&&L.mutate({body:{enabled:t},path:{assistant_id:e}})},refetchAll:()=>{u(),g(),x(),O(),M(),oe()}}}function $t({id:e,title:t,subtitle:n,accessory:r,children:i,className:a}){let o=!!(t||n||r);return(0,q.jsx)(O,{asChild:!0,className:F(`rounded-lg`,a),children:(0,q.jsxs)(`section`,{id:e,children:[o&&(0,q.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[t&&(0,q.jsx)(l,{variant:`title-small`,as:`h2`,className:`text-[var(--content-emphasised)]`,children:t}),n&&(0,q.jsx)(l,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:n})]}),r&&(0,q.jsx)(`div`,{className:`shrink-0`,children:r})]}),i!=null&&(0,q.jsx)(`div`,{className:o?`mt-3`:``,children:i})]})})}function en(e){return/^plugin:([^/]+)\//.exec(e??``)?.[1]??null}var tn={user_disabled:`scheduleDisarmReason.userDisabled`,plugin_removed:`scheduleDisarmReason.pluginRemoved`,plugin_disabled:`scheduleDisarmReason.pluginDisabled`,declaration_removed:`scheduleDisarmReason.declarationRemoved`,declaration_disabled:`scheduleDisarmReason.declarationDisabled`};function nn(e){return e.enabled||!e.disarmReason?null:tn[e.disarmReason]??null}function rn(e,t){return t?.[e]?.displayName??e}function an({assistantId:e,pinnedProfile:t,defaultCallSite:n=`mainAgent`,fallbackLabel:r,respectCallSiteOverride:i=!1}){let{t:a}=H(`settings`),o=r??a(`modelProfileRow.defaultMainAgent`),s=(e,t)=>{if(e==null)return;if(e.provider!=null||e.model!=null)return a(`modelProfileRow.customCallSiteModel`);let n=e.profile?.trim();return n?a(`modelProfileRow.override`,{name:rn(n,t)}):void 0},c=t==null,{data:l}=V({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),u=(0,G.useMemo)(()=>l?Je(l):{},[l]),{label:d}=yt(e,n,{enabled:c}),f=c&&i?s(l?.llm?.callSites?.[n],u):void 0,p=t==null?f??(d==null?o:a(`modelProfileRow.defaultNamed`,{name:d})):rn(t,u);return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-[var(--content-secondary)]`,children:a(`modelProfileRow.label`)}),(0,q.jsx)(`span`,{className:`min-w-0 truncate text-right`,title:p,children:p})]})}function on(e,t,n){let r=E(e?.profiles??{},e?.profileOrder??[]);return[{value:null,label:`Default`},...k(r,[t],n).map(e=>{let t=p(e,r,n);return{value:e.name,label:le(e),...t?{issue:t}:{},...t===`undispatchable`?{reason:j(e)}:{}}})]}function sn(e,t){let{data:n}=V({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),r=re();return(0,G.useMemo)(()=>on(n?.llm,t,{requireOwnProviderAndModel:r}),[n?.llm,t,r])}function cn({assistantId:e,value:t,onChange:n,disabled:r=!1,isSaving:i=!1,className:a,includeDefaultOption:o=!0,placeholder:s,variant:c,menuAlign:l}){let{t:u}=H(`settings`);return(0,q.jsx)(R,{value:t,onChange:n,onSelectNone:()=>n(null),options:sn(e,t).filter(e=>o||e.value!=null).map(e=>({...e.issue===`undispatchable`?{icon:(0,q.jsx)(De,{className:`h-3.5 w-3.5 text-[var(--system-mid-strong)]`}),...e.reason?{tooltip:e.reason}:{}}:{},value:e.value,label:e.label})),disabled:r||i,placeholder:s,className:a,variant:c,menuAlign:l,"aria-label":u(`modelProfileSelect.ariaLabel`)})}function Q({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-body-medium-lighter text-[var(--content-secondary)]`,children:e}),(0,q.jsx)(`span`,{className:`min-w-0 text-right text-body-medium-lighter text-[var(--content-default)]`,children:t})]})}function ln({schedule:e,assistantId:t,isPast:n}){let{t:r}=H(`schedules`),a=be(),o=v({path:{assistant_id:t}}),s=ve({mutationFn:n=>Ve(t,e.id,{inferenceProfile:n}),onMutate:async t=>{await a.cancelQueries({queryKey:o});let n=a.getQueryData(o)?.find(t=>t.id===e.id)?.inferenceProfile;return a.setQueryData(o,n=>n?.map(n=>n.id===e.id?{...n,inferenceProfile:t}:n)),{previousProfile:n}},onError:(t,n,s)=>{let l=s?.previousProfile;l!==void 0&&a.setQueryData(o,t=>t?.map(t=>t.id===e.id?{...t,inferenceProfile:l}:t)),c(t,{context:`schedule_update_inference_profile`}),i.error(r(`scheduleDetail.modelChangeFailed`))},onSettled:()=>a.invalidateQueries({queryKey:o})});return e.mode===`workflow`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Q,{label:r(`scheduleDetail.modelProfile`),value:r(`scheduleDetail.notUsedForWorkflow`)}),(0,q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:r(`scheduleDetail.modelProfileWorkflowNote`)})]}):n?(0,q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:(0,q.jsx)(an,{assistantId:t,pinnedProfile:e.inferenceProfile})}):(0,q.jsx)(Q,{label:r(`scheduleDetail.modelProfile`),value:(0,q.jsx)(cn,{assistantId:t,value:e.inferenceProfile,onChange:t=>{t&&t!==e.inferenceProfile&&s.mutate(t)},includeDefaultOption:!1,placeholder:r(`scheduleDetail.chooseModel`),isSaving:s.isPending,variant:`ghost`,menuAlign:`end`,className:`-my-1 -mr-2`})})}function un({icon:e,value:t,label:n}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] p-3`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-[var(--surface-sunken)] text-[var(--content-secondary)]`,children:e}),(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`truncate text-body-large-default text-[var(--content-default)]`,children:t}),(0,q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]})}function dn({usage:e}){let{t}=H(`schedules`);return e.status===`loading`?(0,q.jsx)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:Array.from({length:2},(e,t)=>(0,q.jsx)(z,{className:`h-[60px] rounded-lg`},t))}):e.status===`error`?null:(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:[(0,q.jsx)(un,{icon:(0,q.jsx)(Ne,{className:`h-4 w-4`}),value:Y(e.summary.totalEstimatedCostUsd),label:t(`scheduleDetail.costLabel`,{days:7})}),(0,q.jsx)(un,{icon:(0,q.jsx)(ke,{className:`h-4 w-4`}),value:Tt(e.summary.runCount),label:t(`scheduleDetail.runsLabel`,{days:7})})]})}function fn(e){return e.exists&&e.archivedAt==null}function pn({run:e,index:t,isExpanded:n,disableDirectOpen:r,onOpenConversation:i,onToggleDetails:a}){let{t:o}=H(`schedules`),s=kt(e),c=e.conversations??(s?[{id:s,title:null,exists:!0,archivedAt:null}]:[]),l=X(e.output),u=X(e.error),d=!r&&c.length===1&&fn(c[0])?c[0].id:null,f=!d&&(c.length>0||l||u),p=`schedule-run-details-${t}`,m=!!d||f,h=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Vt,{status:e.status}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:J(e.startedAt)}),(0,q.jsxs)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[Ct(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd)]}),e.status===`error`&&e.error?(0,q.jsxs)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[e.error.slice(0,120),e.error.length>120?`…`:``]}):null]}),m?(0,q.jsx)(W,{className:F(`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform`,f&&n?`rotate-90`:``)}):null]}),g=f&&n?(0,q.jsx)(`div`,{id:p,className:`px-2 pb-3`,children:(0,q.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[c.length>0?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.conversations`)}),(0,q.jsx)(`div`,{className:`space-y-1`,children:c.map(e=>fn(e)?(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(e.id),className:`block w-full truncate text-left text-body-small-default text-[var(--content-default)] hover:underline`,children:X(e.title)?e.title:o(`scheduleDetail.conversation`)},e.id):(0,q.jsxs)(`span`,{className:`block truncate text-body-small-default text-[var(--content-tertiary)] italic`,children:[X(e.title)?e.title:o(`scheduleDetail.conversation`),` `,e.exists?o(`scheduleDetail.conversationArchived`):o(`scheduleDetail.conversationUnavailable`)]},e.id))})]}):null,l?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.output`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`scheduleDetail.error`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null;return d?(0,q.jsx)(`div`,{children:(0,q.jsx)(`button`,{type:`button`,onClick:()=>i(d),"aria-label":o(`scheduleDetail.openRunConversationAria`,{time:J(e.startedAt)}),className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:h})}):f?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),"aria-label":o(`scheduleDetail.toggleRunDetailsAria`,{time:J(e.startedAt)}),"aria-expanded":n,"aria-controls":p,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:h}),g]}):(0,q.jsx)(`div`,{className:`flex items-center gap-3 px-2 py-3`,children:h})}function mn({runs:e,isLoading:t,disableDirectOpen:n,onOpenConversation:r}){let{t:i}=H(`schedules`),[a,o]=(0,G.useState)(null);return t?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,q.jsx)(`p`,{className:`py-2 text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:i(`scheduleDetail.noRunsYet`)}):(0,q.jsx)(`div`,{className:`-mx-2 divide-y divide-[var(--border-base)]`,children:e.map((e,t)=>(0,q.jsx)(pn,{run:e,index:t,isExpanded:a===e.id,disableDirectOpen:n,onOpenConversation:r,onToggleDetails:e=>o(t=>t===e?null:e)},e.id))})}function hn({schedule:e,assistantId:t,usage:n,isPast:r=!1,onClose:s,onDeleted:l}){let{t:d}=H(`schedules`),f=Se(),{data:p,isLoading:m}=V({queryKey:a({path:{assistant_id:t,id:e.id}}),queryFn:()=>Be(t,e.id),staleTime:1e4}),[h,g]=(0,G.useState)(!1),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(!1),[S,C]=(0,G.useState)(!1),[w,T]=(0,G.useState)(!1),E=en(e.sourceKey),D=nn(e),O=e.isOneShot&&!r&&E===null&&e.status!==`firing`,k=E!==null&&!e.enabled,ee=async()=>{g(!0);try{await Ge(t,e.id)}catch(e){c(e,{context:`schedule_run_now`}),i.error(d(`scheduleDetail.runFailed`))}finally{g(!1)}},A=async()=>{b(!0);try{await We(t,e.id),l()}catch(e){c(e,{context:`schedule_delete`}),i.error(d(`scheduleDetail.deleteFailed`)),b(!1),v(!1)}},j=async()=>{T(!0);try{await Ke(t,e.id),l()}catch(e){c(e,{context:`schedule_cancel`}),i.error(d(`scheduleDetail.cancelOneTimeFailed`)),T(!1),C(!1)}};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)] md:rounded-[var(--radius-xl)] md:border md:border-[var(--border-base)]`,children:[(0,q.jsx)(x,{title:e.name,headerActions:E?void 0:(0,q.jsx)(L,{variant:`dangerOutline`,iconOnly:(0,q.jsx)(Fe,{}),"aria-label":d(`scheduleDetail.delete`),tooltip:d(`scheduleDetail.delete`),onClick:()=>v(!0)}),closeLabel:d(`scheduleDetail.closeAria`),closeTooltip:d(`scheduleDetail.close`),onClose:s}),(0,q.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[e.description?(0,q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.description}):null,(0,q.jsx)($t,{title:d(`scheduleDetail.details`),children:(0,q.jsxs)(`div`,{className:`space-y-2`,children:[e.cadenceDescription?(0,q.jsx)(Q,{label:d(`scheduleDetail.cadence`),value:e.cadenceDescription}):null,(0,q.jsx)(Q,{label:d(`scheduleDetail.mode`),value:e.mode}),(0,q.jsx)(ln,{schedule:e,assistantId:t,isPast:r}),(0,q.jsx)(Q,{label:d(`scheduleDetail.status`),value:e.enabled?d(`scheduleDetail.enabled`):d(`scheduleDetail.disabled`)}),(0,q.jsx)(Q,{label:d(`scheduleDetail.nextRun`),value:J(e.nextRunAt)}),e.lastRunAt?(0,q.jsx)(Q,{label:d(`scheduleDetail.lastRun`),value:(0,q.jsxs)(`span`,{className:`flex items-center justify-end gap-2`,children:[(0,q.jsx)(Vt,{status:e.lastStatus}),J(e.lastRunAt)]})}):null]})}),(0,q.jsx)(dn,{usage:n}),(0,q.jsx)($t,{title:d(`scheduleDetail.recentRuns`),children:(0,q.jsx)(mn,{runs:p?.runs,isLoading:m,disableDirectOpen:e.mode===`script`,onOpenConversation:e=>oe(f,e)})})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-[var(--border-hover)] p-[var(--app-spacing-lg)]`,children:[E?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:D?d(`scheduleDetail.managedByPluginPaused`,{plugin:E,reason:d(D)}):d(`scheduleDetail.managedByPlugin`,{plugin:E})}):(0,q.jsx)(`span`,{}),(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(L,{variant:`outlined`,leftIcon:(0,q.jsx)(Ae,{className:`h-3.5 w-3.5`}),onClick:()=>f(u.settings.usageForSchedule(e.id)),children:d(`scheduleDetail.viewUsage`)}),O?(0,q.jsx)(L,{variant:`dangerOutline`,onClick:()=>C(!0),children:d(`scheduleDetail.cancelOneTime`)}):null,e.mode===`script`?(0,q.jsxs)(q.Fragment,{children:[k?(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:d(`scheduleDetail.turnOnToRun`)}):null,(0,q.jsx)(L,{variant:`primary`,leftIcon:h?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):void 0,onClick:()=>void ee(),disabled:h||k,children:d(h?`scheduleDetail.running`:`scheduleDetail.runNow`)})]}):null]})]})]}),(0,q.jsx)(o,{open:_,title:d(`scheduleDetail.delete`),message:d(`scheduleDetail.deleteConfirmMessage`,{name:e.name}),confirmLabel:d(`scheduleDetail.confirmDelete`),cancelLabel:d(`scheduleDetail.cancel`),destructive:!0,isPending:y,onConfirm:()=>void A(),onCancel:()=>v(!1)}),(0,q.jsx)(o,{open:S,title:d(`scheduleDetail.cancelOneTime`),message:d(`scheduleDetail.cancelOneTimeConfirmMessage`,{name:e.name}),confirmLabel:d(`scheduleDetail.confirmCancelOneTime`),cancelLabel:d(`scheduleDetail.cancel`),destructive:!0,isPending:w,onConfirm:()=>void j(),onCancel:()=>C(!1)})]})}function gn({icon:e,title:t,description:n,actions:r}){return(0,q.jsxs)(`div`,{className:`flex h-full min-h-[400px] flex-col items-center justify-center gap-4 px-4 py-24 text-center`,children:[(0,q.jsx)(`div`,{className:`flex h-16 w-16 items-center justify-center rounded-xl bg-[var(--surface-base)]`,children:(0,q.jsx)(e,{size:32,className:`text-[var(--content-tertiary)]`})}),(0,q.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:t}),(0,q.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[var(--content-tertiary)]`,children:n}),r?(0,q.jsx)(`div`,{className:`flex flex-col items-center gap-3`,children:r}):null]})}function _n(e){if(e.status===`loading`)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(z,{as:`span`,className:`h-4 w-12`}),(0,q.jsx)(z,{as:`span`,className:`h-4 w-10`})]});if(e.status===`error`)return(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`—`});let{summary:t}=e;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:Y(t.totalEstimatedCostUsd)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:Tt(t.runCount)})]})}function vn({name:e,badge:t,metaParts:n,usage:r,enabled:i,selected:a,onClick:o,onToggle:c,toggleAriaLabel:l}){return(0,q.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md px-2 py-3 transition-colors [&+&]:border-t [&+&]:border-[var(--border-base)] ${a?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`}`,children:[c?(0,q.jsx)(s,{checked:i,onChange:c,"aria-label":l}):null,(0,q.jsxs)(`button`,{type:`button`,onClick:o,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-4 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e}),t]}),n.length>0?(0,q.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-small-default text-[var(--content-tertiary)]`,children:n.map((e,t)=>(0,q.jsxs)(G.Fragment,{children:[t>0?(0,q.jsx)(fe,{}):null,(0,q.jsx)(`span`,{className:`truncate`,children:e})]},t))}):null]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4`,children:[_n(r),(0,q.jsx)(W,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})]})}function yn({schedule:e,usage:t,selected:n,onClick:r,onToggle:i}){let{t:a}=H(`schedules`),o=e.isOneShot?``:e.cadenceDescription.trim(),s=e.lastRunAt??e.nextRunAt,c=nn(e),l=[c?a(c):``,o,s?J(s):``].filter(Boolean),u=en(e.sourceKey);return(0,q.jsx)(vn,{name:e.name,badge:u?(0,q.jsx)(_e,{tone:`info`,children:u}):void 0,metaParts:l,usage:t,enabled:e.enabled,selected:n,onClick:r,onToggle:i,toggleAriaLabel:i?a(`scheduleRow.toggleAria`,{name:e.name}):void 0})}function bn({recurring:e,oneTime:t,pastOneTime:n,usageForSchedule:r,isLoading:i,isError:a,refetch:o,onToggle:s,onSelectSchedule:c,selectedScheduleId:l,onStartNewChat:u,onCreateSchedule:d,pastOpen:f,onPastOpenChange:p,onRebaseProfiles:m,defaultProfileLabel:h,systemTasksSlot:g}){let{t:_}=H(`schedules`),v=e=>(0,q.jsx)(yn,{schedule:e,usage:r(e.id),selected:e.id===l,onClick:()=>c(e.id),onToggle:t=>s(e.id,t)},e.id),y=e=>(0,q.jsx)(yn,{schedule:e,usage:r(e.id),selected:e.id===l,onClick:()=>c(e.id)},e.id),b=n.length>0?(0,q.jsx)(P.Root,{type:`single`,collapsible:!0,className:`mt-3`,value:f?`past`:``,onValueChange:e=>p(e===`past`),children:(0,q.jsxs)(P.Item,{value:`past`,children:[(0,q.jsxs)(P.Trigger,{className:`group gap-[var(--app-spacing-xs)] px-2 text-label-small-default text-[var(--content-tertiary)]`,children:[(0,q.jsx)(W,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,q.jsx)(`span`,{children:_(`schedulesPanel.pastToggle`,{count:n.length})})]}),(0,q.jsx)(P.Content,{children:(0,q.jsx)(`div`,{className:`pt-1`,children:n.map(y)})})]})}):null;return(0,q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[i?(0,q.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:2},(e,t)=>(0,q.jsx)(z,{className:`h-12 rounded-md`},t))}):a&&e.length===0?(0,q.jsx)(D,{tone:`error`,actions:(0,q.jsx)(`button`,{type:`button`,onClick:o,className:`cursor-pointer underline hover:no-underline`,children:_(`schedulesPanel.retry`)}),children:_(`schedulesPanel.loadFailed`)}):e.length===0&&t.length===0&&n.length===0?(0,q.jsx)(gn,{icon:Me,title:_(`schedulesPanel.emptyTitle`),description:_(`schedulesPanel.emptyDescription`),actions:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(L,{variant:`primary`,size:`regular`,onClick:u,children:_(`schedulesPanel.newConversation`)}),(0,q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:_(`schedulesPanel.emptyActionsSeparator`)}),(0,q.jsx)(L,{variant:`outlined`,size:`regular`,onClick:d,children:_(`schedulesPanel.createSchedule`)})]})}):(0,q.jsxs)(`div`,{children:[m&&h?(0,q.jsx)(`div`,{className:`mb-1 flex min-w-0 justify-end`,children:(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:m,className:`max-w-full truncate`,children:_(`schedulesPanel.useProfileForAll`,{profile:h})})}):null,e.map(v),t.length>0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`mt-3 px-2 text-label-small-default text-[var(--content-tertiary)]`,children:_(`schedulesPanel.oneTimeHeading`)}),t.map(y)]}):null,b]}),g?(0,q.jsx)(`div`,{className:`mt-[var(--app-spacing-lg)]`,children:g}):null]})}function xn({runs:e,isLoading:t,emptyMessage:n,hasMore:r=!1,isLoadingMore:i=!1,onLoadMore:a}){let{t:o}=H(`settings`),s=Se(),[c,l]=(0,G.useState)(null),u=n??o(`recentRunsCard.emptyDefault`),d=r&&a?(0,q.jsx)(`div`,{className:`flex justify-center pt-3`,children:(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:a,disabled:i,leftIcon:i?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):void 0,children:o(i?`recentRunsCard.loadingMore`:`recentRunsCard.loadMore`)})}):null;return(0,q.jsx)($t,{title:o(`recentRunsCard.title`),children:t?(0,q.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,q.jsx)(U,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`py-4 text-center text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:u}),d]}):(0,q.jsxs)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:[e.map((e,t)=>{let n=kt(e),r=X(e.output),i=X(e.error),a=e.status===`skipped`||e.status===`missed`,u=!n&&!a&&(r||i),d=c===e.id,f=`schedule-run-details-${t}`;return(0,q.jsxs)(`div`,{children:[(0,q.jsx)(ne,{label:(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,q.jsx)(Vt,{status:e.status}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:`block truncate text-body-medium-lighter text-[var(--content-default)]`,children:X(e.title)?e.title:J(e.startedAt)}),(0,q.jsxs)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[X(e.title)?`${J(e.startedAt)} · `:``,a?(0,q.jsx)(q.Fragment,{children:r?e.output:e.status===`missed`?o(`recentRunsCard.missed`):o(`recentRunsCard.skipped`)}):(0,q.jsxs)(q.Fragment,{children:[Ct(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd)]}),e.status===`error`&&e.error&&(0,q.jsxs)(`span`,{className:`ml-2 text-[var(--system-negative-strong)]`,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]})]}),n||u?(0,q.jsx)(W,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform ${d?`rotate-90`:``}`}):null]}),onSelect:n?()=>oe(s,n):u?()=>l(d?null:e.id):void 0,"aria-label":o(`recentRunsCard.runAtAria`,{time:J(e.startedAt)}),"aria-expanded":u?d:void 0,"aria-controls":u?f:void 0,className:`h-auto py-2.5 gap-3 -mx-2 px-2`}),u&&d?(0,q.jsx)(`div`,{id:f,className:`px-2 pb-3`,children:(0,q.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[r?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`recentRunsCard.output`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,i?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:o(`recentRunsCard.error`)}),(0,q.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null]},e.id)}),d]})})}var Sn={heartbeat:`heartbeatAgent`,consolidation:`memoryV2Consolidation`,retrospective:`memoryRetrospective`};function $({label:e,value:t}){return(0,q.jsxs)(`div`,{className:`flex min-h-6 items-center justify-between gap-4`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-[var(--content-secondary)]`,children:e}),(0,q.jsx)(`span`,{className:`flex min-w-0 items-center justify-end gap-2 text-right text-[var(--content-default)]`,children:t})]})}function Cn({kind:e,assistantId:t,systemTasks:n,canOpenMemorySettings:i,onClose:a}){let{t:o}=H(`schedules`),c=Se(),{heartbeatConfig:l,consolidationConfig:d,retrospectiveConfig:f}=n,p=l?.effectiveTimezone||l?.timezone||null,m,h,g,_,v,y,b;e===`heartbeat`?(m=o(`systemTaskDetail.nameHeartbeat`),h=l?Nt(l,p):``,g=l?.enabled??!1,_=l?.nextRunAt??null,v=l?.lastRunAt??null,y=n.isHeartbeatRunning,b=n.runHeartbeatNow):e===`consolidation`?(m=o(`systemTaskDetail.nameConsolidation`),h=d?Pt(d):``,g=d?.enabled??!1,_=d?.nextRunAt??null,v=d?.lastRunAt??null,y=n.isConsolidationRunning,b=n.runConsolidationNow):(m=o(`systemTaskDetail.nameRetrospective`),h=Ft(),g=f?.enabled??!1,_=f?.nextRunAt??null,v=f?.lastRunAt??null,y=!1,b=void 0);let C=e!==`heartbeat`,w=e===`retrospective`,T=C&&!g,E=y||T,O=o(C?g?`systemTaskDetail.statusManagedOn`:`systemTaskDetail.statusPaused`:g?`scheduleDetail.enabled`:`scheduleDetail.disabled`),k=w&&f?.available===!0,ee=o(k?`systemTaskDetail.pausedRetrospectiveSwitchedOff`:w?`systemTaskDetail.pausedRetrospective`:`systemTaskDetail.pausedConsolidation`),A=C&&g&&i,j={path:{assistant_id:t},query:{limit:25}},M=e===`heartbeat`?te(j):e===`consolidation`?S(j):r(j),{data:ne,isLoading:re,fetchNextPage:ie,hasNextPage:ae,isFetchingNextPage:oe}=xe({queryKey:M.queryKey,queryFn:M.queryFn,initialPageParam:{path:j.path,query:{}},getNextPageParam:e=>e.nextCursor??void 0,staleTime:1e4}),N=Dt(ne?.pages.map(t=>({runs:t.runs.filter(e=>!At(e)).map(t=>qt(t,e))}))),se=N?.find(e=>jt(e)&&e.status!==`running`),P=v??se?.finishedAt??se?.startedAt??null;return(0,q.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)] md:rounded-[var(--radius-xl)] md:border md:border-[var(--border-base)]`,children:[(0,q.jsx)(x,{title:m,closeLabel:o(`scheduleDetail.closeAria`),closeTooltip:o(`scheduleDetail.close`),onClose:a}),(0,q.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)($t,{title:o(`scheduleDetail.details`),children:(0,q.jsxs)(`div`,{className:`space-y-2 text-body-medium-lighter`,children:[(0,q.jsx)($,{label:o(`scheduleDetail.status`),value:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`truncate`,children:O}),C?null:(0,q.jsx)(s,{size:`sm`,checked:g,onChange:n.toggleHeartbeat,"aria-label":o(`scheduleDetail.toggleAria`,{name:m})})]})}),(0,q.jsx)(an,{assistantId:t,defaultCallSite:Sn[e],fallbackLabel:o(`systemTaskDetail.fallbackModelProfile`),respectCallSiteOverride:!0}),h?(0,q.jsx)($,{label:o(`systemTaskDetail.repeats`),value:(0,q.jsx)(`span`,{className:`truncate`,children:h})}):null,e===`heartbeat`&&p?(0,q.jsx)($,{label:o(`scheduleDetail.timezone`),value:(0,q.jsx)(`span`,{className:`truncate`,children:p})}):null,w?null:(0,q.jsx)($,{label:o(`scheduleDetail.nextRun`),value:(0,q.jsx)(`span`,{className:`truncate`,children:J(_)})}),(0,q.jsx)($,{label:o(`scheduleDetail.lastRun`),value:(0,q.jsx)(`span`,{className:`truncate`,children:J(P)})})]})}),T?(0,q.jsx)(D,{tone:`warning`,className:`mt-4`,actions:i?(0,q.jsx)(L,{variant:`outlined`,size:`compact`,onClick:()=>c(`${u.settings.developer}?tab=memory`),children:o(k?`systemTaskDetail.openMemorySettings`:`systemTaskDetail.turnOnMemory`)}):void 0,children:ee}):null]}),(0,q.jsx)(xn,{runs:N,isLoading:re,hasMore:ae,isLoadingMore:oe,onLoadMore:()=>void ie()})]}),A||b?(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-[var(--border-hover)] p-[var(--app-spacing-lg)]`,children:[A?(0,q.jsx)(L,{variant:`outlined`,leftIcon:(0,q.jsx)(Pe,{className:`h-3.5 w-3.5`}),onClick:()=>c(`${u.settings.developer}?tab=memory`),children:o(`systemTaskDetail.memorySettings`)}):null,b?(0,q.jsx)(L,{variant:`primary`,leftIcon:y?(0,q.jsx)(U,{className:`h-3.5 w-3.5 animate-spin`}):(0,q.jsx)(je,{className:`h-3.5 w-3.5`}),onClick:b,disabled:E,children:o(y?`scheduleDetail.running`:`scheduleDetail.runNow`)}):null]}):null]})}function wn(e){let t=M(),[n]=(0,G.useState)(()=>Date.now()),{data:r,isLoading:a,isError:o,refetch:s}=V(se(e)),{data:l,isLoading:u,isError:d}=V(Rt(e,t,!0)),{recurring:f,oneTime:p,pastOneTime:m}=(0,G.useMemo)(()=>{let e=Lt(r??[],n);return{recurring:e.recurring,oneTime:e.upcomingOneTime,pastOneTime:e.pastOneTime}},[n,r]),h=(0,G.useMemo)(()=>new Map((l??[]).map(e=>[e.scheduleId,e])),[l]);return{recurring:f,oneTime:p,pastOneTime:m,usageForSchedule:(0,G.useCallback)(e=>u?{status:`loading`}:d?{status:`error`}:{status:`ready`,summary:h.get(e)??zt(e)},[d,u,h]),handleToggle:(0,G.useCallback)(async(t,n)=>{if(e)try{await Re(e,t,n),s()}catch(e){c(e,{context:`schedule_toggle`}),i.error(B(`schedules:scheduleDetail.toggleFailed`))}},[e,s]),isLoading:a,isError:o,refetch:(0,G.useCallback)(()=>{s()},[s])}}function Tn(){let e=Se(),{scheduleId:t}=Ce(),n=N(),r=C(),i=M(),a=wn(n),o=Qt(n,i),s=A(`memoryOptOut`),c=ce.use.settingsDeveloperNav(),l=s&&c===!0,[d,f]=(0,G.useState)(!1),p=t??null,[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),v=(0,G.useCallback)(t=>{e(t?u.schedules.detail(t):u.schedules.root)},[e]),y=p?a.recurring.find(e=>e.id===p)??a.oneTime.find(e=>e.id===p)??a.pastOneTime.find(e=>e.id===p)??null:null;(0,G.useEffect)(()=>{p&&!a.isLoading&&!a.isError&&!y&&v(null)},[p,y,a.isLoading,a.isError,v]);let b=m===`heartbeat`?o.heartbeatConfig!=null:m===`consolidation`?o.consolidationConfig?.available===!0:m===`retrospective`?o.retrospectiveConfig?.available===!0:!1;(0,G.useEffect)(()=>{m&&!o.isLoading&&!b&&h(null)},[m,b,o.isLoading]);let x=(0,G.useCallback)(e=>{h(null),v(e)},[v]),S=(0,G.useCallback)(e=>{p&&v(null),h(e)},[v,p]),w=(0,G.useCallback)(()=>{he(e)},[e]),T=bt(n,(0,G.useMemo)(()=>[...a.recurring,...a.oneTime,...a.pastOneTime],[a.recurring,a.oneTime,a.pastOneTime]),a.refetch),E=(y?(0,q.jsx)(hn,{schedule:y,assistantId:n,usage:a.usageForSchedule(y.id),isPast:a.pastOneTime.some(e=>e.id===y.id),onClose:()=>v(null),onDeleted:()=>{v(null),a.refetch()}}):null)??(m&&b?(0,q.jsx)(Cn,{kind:m,assistantId:n,systemTasks:o,canOpenMemorySettings:l,onClose:()=>h(null)}):null),D=(0,q.jsx)(bn,{recurring:a.recurring,oneTime:a.oneTime,pastOneTime:a.pastOneTime,usageForSchedule:a.usageForSchedule,isLoading:a.isLoading,isError:a.isError,refetch:a.refetch,onToggle:a.handleToggle,onSelectSchedule:x,selectedScheduleId:p,onStartNewChat:w,onCreateSchedule:()=>f(!0),pastOpen:g,onPastOpenChange:_,onRebaseProfiles:T.canRebase?T.requestRebase:void 0,defaultProfileLabel:T.defaultProfileLabel??void 0,systemTasksSlot:(0,q.jsx)(Wt,{heartbeatConfig:o.heartbeatConfig,consolidationConfig:o.consolidationConfig,retrospectiveConfig:o.retrospectiveConfig,heartbeatUsage:o.heartbeatUsage,consolidationUsage:o.consolidationUsage,retrospectiveUsage:o.retrospectiveUsage,isLoading:o.isLoading,hasError:o.hasError,onRetry:o.refetchAll,onSelectHeartbeat:()=>S(`heartbeat`),onSelectConsolidation:()=>S(`consolidation`),onSelectRetrospective:()=>S(`retrospective`)})}),O=(0,q.jsx)(xt,{...T.dialogProps});return E&&r?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(ze,{children:E}),O]}):(0,q.jsxs)(q.Fragment,{children:[E&&!r?(0,q.jsx)(qe,{storageKey:`schedulesDetailDrawerWidth`,detailKey:p??m??void 0,section:D,detail:E}):D,(0,q.jsx)(ut,{isOpen:d,assistantId:n,onClose:()=>f(!1),onCreated:()=>{f(!1),a.refetch()}}),O]})}export{Tn as SchedulesPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ib as t}from"./app-n7D5Q-HS.js";import{f as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(t.settings.general,{replace:!0})},[e]),null}export{a as SecurityRedirectPage};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ib as t}from"./app-1VZKPehC.js";import{f as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(t.settings.general,{replace:!0})},[e]),null}export{a as SecurityRedirectPage};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ab as t,Ap as n,Ba as r,Cb as i,Ex as a,Fh as o,Gh as s,Gy as c,Ib as l,Ix as u,Jx as d,Jy as f,Lb as p,Lu as m,Ly as h,Ox as g,Rt as _,Sm as v,Sy as y,Tb as b,Tu as x,Ux as S,Va as ee,Wy as C,Xr as w,Xx as T,_y as te,bs as ne,by as E,cx as re,ds as ie,dx as ae,fs as oe,gb as se,jh as ce,kb as D,lh as le,lx as ue,os as de,pb as fe,qn as O,qr as pe,sb as k,ss as me,sx as he,tS as A,tb as ge,th as j,vy as _e,yb as ve,za as M,zy as ye}from"./app-n7D5Q-HS.js";import{er as be,j as N}from"./vendor-DUzxlXbu.js";import{_ as xe,f as Se,t as Ce,x as P}from"./react-B9IgSVeK.js";import{It as we,Sr as Te,er as F,gi as Ee,or as De,qi as I}from"./icons-DxrLl-Dj.js";import{t as L}from"./ellipsis-vertical-DWDUOGRm.js";import{t as Oe}from"./radio-card-nav-CZkUYNJ9.js";import{a as ke,i as Ae,n as je,o as R,r as z,t as Me}from"./self-hosted-servers-C9NSM8gD.js";import{t as Ne}from"./format-countdown-Dceq8qd-.js";var B=e(P(),1),Pe=l.remotePair.slice(`${l.assistant}/`.length);async function Fe(e,t){let n=t?D(e.url,t):null,r=t&&n!==null?`${Pe}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${l.assistant}`);if(!j()){i();return}(r===null?await je(e.url):await z(e.url,r))||i()}function Ie(e){return ke(C()?s():window.location.origin)===e.url}var V=Ce();function Le({traits:e,imageUrl:t,size:n=48,fallback:r,className:i,decorative:a=!1,onImageError:o}){let{t:s}=N(),c=w();if(e){if(!c)return r;if(v(c,e.bodyShape,e.eyeStyle,e.color)){let t=(0,V.jsx)(O,{components:c,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:n,className:i});return a?(0,V.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,V.jsx)(`img`,{src:t,alt:a?``:s(`chooserAvatarChip.alt`),width:n,height:n,className:`rounded-full object-cover ${i??``}`.trim(),style:{width:n,height:n,flexShrink:0},onError:o}):r}function Re(e){let t;try{t=re(e)}catch{return{ok:!1,reason:`unparseable`}}if(he(t))return{ok:!1,reason:`service-website`};let n=ke(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:ue(e).deviceCode}}function ze({open:e,onClose:n,onAdded:r}){let{t:i}=N(`onboarding`),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!1),[l,d]=(0,B.useState)(null);(0,B.useEffect)(()=>{e&&(o(``),c(!1),d(null))},[e]);let f=()=>{s||n()},p=async()=>{if(!a.trim()||s)return;let e=Re(a);if(!e.ok){d(t(e.reason,a));return}c(!0),d(null);try{let t=await R.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}d(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),d(i(`addRemoteOriginDialog.addFailed`))}c(!1)};return(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||f()},children:(0,V.jsxs)(g.Content,{size:`md`,children:[(0,V.jsxs)(g.Header,{icon:Te,children:[(0,V.jsx)(g.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,V.jsx)(g.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,V.jsx)(g.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,V.jsx)(u,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>o(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),l&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:l})]})}),(0,V.jsxs)(g.Footer,{children:[(0,V.jsx)(A,{variant:`ghost`,onClick:f,disabled:s,children:i(`actions.cancel`)}),(0,V.jsx)(A,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||s,children:i(s?`actions.adding`:`actions.add`)})]})]})})}var H=e=>new Promise(t=>setTimeout(t,e)),U=30,Be=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Ve({open:e,initialAddress:n,guidanceKind:r,onClose:i,onImported:a}){let{t:o}=N(`onboarding`),[s,l]=(0,B.useState)(``),[d,p]=(0,B.useState)(``),[m,h]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[b,x]=(0,B.useState)(null),[ee,C]=(0,B.useState)(0),[w,T]=(0,B.useState)(!1),[te,ne]=(0,B.useState)(null),E=(0,B.useRef)(null),re=(0,B.useRef)({abandoned:!1}),ie=()=>{let e=E.current;E.current=null,e&&y(e)};(0,B.useEffect)(()=>{if(!e)return;l(n??``),p(``),h(!1),v(null),x(null),T(!1),ne(null);let t={abandoned:!1};return re.current=t,()=>{t.abandoned=!0,ie()}},[e,n]),(0,B.useEffect)(()=>{if(!b)return;let e=setInterval(()=>C(Date.parse(b.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[b]);let ae=async()=>{let e=s.trim();if(!e||m)return;h(!0),v(null);let t=d.trim()||void 0,n=re.current;try{let r=await k(e);if(n.abandoned){r.ok&&y(r.handle);return}if(!r.ok){v(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),h(!1);return}E.current=r.handle,r.userCode&&(x({userCode:r.userCode,expiresAt:r.expiresAt}),C(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,s=r.expiresAt,l=r.intervalSeconds,u=0;for(;;){let e=await f(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&c(e);if(t&&!Be(s)){if(u+=1,u===1&&T(!0),await H(Math.min(l*u,U)*1e3),n.abandoned)return;continue}ie(),x(null),T(!1),v({kind:`message`,text:t?o(`connectAssistantDialog.retryExpired`):e.error});break}if(u>0&&(u=0,T(!1)),e.status===`imported`){if(E.current=null,e.accessOnly){x(null),ne(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==s&&(x(t=>t&&{...t,expiresAt:e.expiresAt}),C(Date.parse(e.expiresAt)-Date.now())),s=e.expiresAt,l=e.intervalSeconds,await H(l*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),ie(),x(null),T(!1),v({kind:`message`,text:o(`connectAssistantDialog.submitError`)})}h(!1)};return te==null?(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(g.Content,{size:`md`,children:[(0,V.jsxs)(g.Header,{icon:F,children:[(0,V.jsx)(g.Title,{children:o(`connectAssistantDialog.title`)}),(0,V.jsx)(g.Description,{children:o(`connectAssistantDialog.instruction`)})]}),(0,V.jsx)(g.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,V.jsx)(S,{tone:`info`,children:o(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),b?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:b.userCode}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:o(`connectAssistantDialog.approveOnHost`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,V.jsx)(`span`,{className:w?`text-[color:var(--system-warning-strong)]`:void 0,children:o(w?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,V.jsx)(`span`,{children:o(`connectAssistantDialog.expiresIn`,{time:Ne(ee)})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:o(`connectAssistantDialog.addressLabel`)}),(0,V.jsx)(u,{id:`connect-assistant-address`,type:`text`,value:s,onChange:e=>l(e.target.value),placeholder:o(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:o(`connectAssistantDialog.nameLabel`)}),(0,V.jsx)(u,{id:`connect-assistant-name`,type:`text`,value:d,onChange:e=>p(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),_&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:_.kind===`rejected-address`?t(_.rejection,_.address):_.text})]})}),(0,V.jsxs)(g.Footer,{children:[(0,V.jsx)(A,{variant:`ghost`,onClick:i,children:o(`actions.cancel`)}),!b&&(0,V.jsx)(A,{variant:`primary`,onClick:()=>void ae(),disabled:!s.trim()||m,children:o(m?`actions.connecting`:`actions.connect`)})]})]})}):(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(g.Content,{size:`sm`,children:[(0,V.jsx)(g.Header,{icon:F,children:(0,V.jsx)(g.Title,{children:o(`connectAssistantDialog.importedTitle`)})}),(0,V.jsx)(g.Body,{children:(0,V.jsx)(S,{tone:`warning`,children:o(`connectAssistantDialog.importedBody`)})}),(0,V.jsx)(g.Footer,{children:(0,V.jsx)(A,{variant:`primary`,onClick:()=>a(te),children:o(`actions.continue`)})})]})})}function He({open:e,assistantName:t,isPending:n,errorMessage:r,onCancel:i,onRepair:o,onRetire:s}){let{t:c}=N(`onboarding`),[l,u]=(0,B.useState)(`menu`);(0,B.useEffect)(()=>{e&&u(`menu`)},[e]);let d=r?(0,V.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:r}):null;return l===`confirm-repair`?(0,V.jsx)(a,{open:e,title:c(`connectRecoveryDialog.repairTitle`),message:(0,V.jsxs)(V.Fragment,{children:[c(`connectRecoveryDialog.repairBody`),d]}),confirmLabel:c(`connectRecoveryDialog.repairConfirm`),isPending:n,onConfirm:o,onCancel:()=>u(`menu`)}):l===`confirm-retire`?(0,V.jsx)(M,{open:e,isPending:n,extraMessage:d,onConfirm:s,onCancel:()=>u(`menu`)}):(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{!e&&!n&&i()},children:(0,V.jsxs)(g.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),n||i()},children:[(0,V.jsx)(g.Header,{children:(0,V.jsx)(g.Title,{children:c(`connectRecoveryDialog.authFailedTitle`)})}),(0,V.jsxs)(g.Body,{children:[(0,V.jsx)(g.Description,{children:c(`connectRecoveryDialog.authFailedBody`,{name:t})}),d,(0,V.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,V.jsx)(A,{variant:`primary`,fullWidth:!0,disabled:n,onClick:()=>u(`confirm-repair`),children:c(`connectRecoveryDialog.wakeAndRepair`)}),(0,V.jsx)(A,{variant:`dangerOutline`,fullWidth:!0,disabled:n,onClick:()=>u(`confirm-retire`),children:c(`connectRecoveryDialog.retire`)}),(0,V.jsx)(A,{variant:`outlined`,fullWidth:!0,disabled:n,onClick:i,children:c(`actions.cancel`)})]})]})]})})}function Ue(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function W(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function G(e,t){let n=e.isPaired?ae(e.runtimeUrl):e.isLocal?ye()?`On this computer`:W(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${_(e.hatchedAt)}`:n}function We(e){return new URL(e.url).hostname}function Ge(e){return e.name??We(e)}function K(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=N(`onboarding`),t=Se(),a=be(),[s,c]=xe(),u=s.get(`fromLogin`)===`1`,d=s.get(`noAutoSkip`)===`1`,f=p(),g=ye(),_=n(),v=_e.use.assistants(),y=o.use.currentOrganizationId(),S=R.use.origins(),C=R.use.hydrated(),w=le(),{loading:T,error:re,login:ae,cancel:oe}=ne(),[D,ue]=(0,B.useState)(null),O=D===null?null:{url:D,name:`Vellum Cloud`},k=O!==null,he=e=>e.isPaired||e.isLocal&&g||_,j=v.filter(te),M=j.filter(he),Ce=M.length>0||S.length>0||O!==null,P=fe(),De=!_&&P,[I,L]=(0,B.useState)(null),[z,Ne]=(0,B.useState)(!1),[Pe,Le]=(0,B.useState)(!1),[Re,H]=(0,B.useState)(null),[U,Be]=(0,B.useState)(null),[W,G]=(0,B.useState)(!1),[We,J]=(0,B.useState)(null),[Y,X]=(0,B.useState)(null),[Ze,Qe]=(0,B.useState)(!1),[$e,Z]=(0,B.useState)(null),[et,tt]=(0,B.useState)(!1),[Q,nt]=(0,B.useState)(null),[rt,it]=(0,B.useState)(!1),[at,ot]=(0,B.useState)(null),st=x.use.open(),ct=x.use.initialAddress(),lt=x.use.guidanceKind(),ut=x.use.deepLinkDrainSettled(),dt=(0,B.useRef)(!1);(0,B.useEffect)(()=>{m()},[]),(0,B.useEffect)(()=>{Me(),R.getState().hydrate()},[]),(0,B.useEffect)(()=>{if(!w)return;let e=!1;return Ae().then(t=>{e||ue(t)}),()=>{e=!0}},[w]);let ft=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(ft.current)return;ft.current=!0;let e=s.get(`register`);if(e===null)return;let t=()=>c(Ke,{replace:!0}),n=ke(e);if(n===null){t();return}R.getState().addOrigin({url:n,name:s.get(`name`)??void 0}).then(e=>{e.ok?t():ft.current=!1}).catch(()=>{ft.current=!1})},[s,c]),(0,B.useEffect)(()=>{if(I===q&&k||I!=null&&S.some(e=>K(e)===I))return;if(M.length===0){let e=S[0],t=e?K(e):k?q:null;I!==t&&L(t);return}if(I!=null&&M.some(e=>e.id===I))return;let e=ce(y);L(M.find(t=>t.id===e)?.id??M[0].id)},[I,M,y,S,k]);let $=async e=>{Ne(!0),H(null);try{await me(e),t(l.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&fe()&&(se(t)||b(t)||t instanceof E)&&h(e.id)?Be(e):e.isPaired&&se(t)?H(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):H(`Failed to connect. Please try again.`),Ne(!1)}},pt=()=>{Be(null),G(!1),J(null),Le(!1)},mt=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await ve(U.id,{repairGuardian:!0});if(e.ok){i(),pt(),$(U);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}G(!1)}},ht=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await ee(a,U.id);if(e.ok){pt(),t(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}G(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await de(a,Y.id);e.ok?(dt.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await ge(Y.id);if(e.ok){let e=_e.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),ie(a,Y.id),dt.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await R.getState().removeOrigin(Q.url),R.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):(dt.current=!0,nt(null)),it(!1))},bt=e=>{x.getState().closeConnectDialog(),$(_e.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Fe(e,t??void 0)};(0,B.useEffect)(()=>{u||d||dt.current||g&&C&&(S.length>0||f&&!ut||z||Pe||st||j.length!==0&&j.length===1&&M.length===1&&(Le(!0),$(M[0])))},[j.length,M.length,ut,g,S.length,C]);let St=()=>{if(I===q){je(null).then(e=>{!e&&D!==null&&window.location.assign(D)});return}let e=S.find(e=>K(e)===I);if(e){Ie(e)?t(l.assistant,{replace:!0}):Fe(e);return}let n=j.find(e=>e.id===I);n&&$(n)},Ct=()=>{t(g?l.welcome:l.assistant)},wt=re??Re;return Pe&&!wt&&!U?(0,V.jsx)(qe,{}):(0,V.jsxs)(pe,{avatarWave:`beside`,children:[(0,V.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${f?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,V.jsxs)(`div`,{className:`flex w-full flex-col items-center ${f?``:`flex-1 justify-center`}`,children:[(0,V.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,V.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:Oe,className:`flex w-full flex-col ${f?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[j.map(t=>{let n=he(t);return(0,V.jsx)(Ye,{assistant:t,selected:I===t.id,locked:!n,tabStop:I==null?M[0]?.id===t.id:I===t.id,onSelect:()=>{n&&L(t.id)},loginLabel:e(T?`actions.cancel`:`actions.loginToUse`),loginDisabled:z,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?T?oe:()=>void ae():void 0,onRemove:t.isPlatformHosted&&De||t.isPaired&&P?()=>X(t):void 0},t.id)}),S.map((e,t)=>{let n=K(e),r=Ie(e);return(0,V.jsx)(Xe,{origin:e,selected:I===n,current:r,tabStop:I==null?M.length===0&&t===0:I===n,onSelect:()=>L(n),onRemove:r&&w?void 0:()=>nt(e)},e.url)}),O&&(0,V.jsx)(Xe,{origin:O,icon:(0,V.jsx)(Ee,{className:`h-5 w-5`}),selected:I===q,current:!1,tabStop:I==null?M.length===0&&S.length===0:I===q,onSelect:()=>L(q)}),g&&(0,V.jsx)(Je,{icon:(0,V.jsx)(we,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:z||T,onClick:()=>void t(`${l.onboarding.hosting}?from=select-assistant`)}),P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(F,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:z||T,onClick:()=>x.getState().openConnectDialog()}),!P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(Te,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:z||T,onClick:()=>tt(!0)})]}),Ce&&(0,V.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,V.jsx)(A,{variant:`primary`,size:`regular`,fullWidth:!0,className:f?void 0:`h-11 text-base`,onClick:St,disabled:!I||z,children:e(z?`actions.connecting`:`actions.continue`)})}),(0,V.jsx)(`div`,{className:Ce?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,V.jsx)(A,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:z||T,children:e(`actions.back`)})})]})}),(0,V.jsx)(ze,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,V.jsx)(Ve,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>x.getState().closeConnectDialog(),onImported:bt}),(0,V.jsx)(He,{open:U!=null,assistantName:U?Ue(U):``,isPending:W,errorMessage:We??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,V.jsx)(r,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?Ue(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,V.jsx)(r,{open:Q!=null,kind:`origin`,assistantName:Q?Ge(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=N(`onboarding`);return(0,V.jsx)(pe,{avatarWave:`beside`,children:(0,V.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=p();return(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,V.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:t}){let{t:n}=N(`onboarding`);return(0,V.jsxs)(T.Root,{children:[(0,V.jsx)(T.Trigger,{asChild:!0,children:(0,V.jsx)(A,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,V.jsx)(L,{}),"aria-label":n(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,V.jsx)(T.Content,{align:`end`,sideOffset:4,children:(0,V.jsx)(T.Item,{onSelect:t,className:d.anchored,children:n(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:s,removeMenu:c}){let l=p();return(0,V.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,l?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,V.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,V.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${l?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s,c&&(i?c:(0,V.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:c})),!i&&(0,V.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,V.jsx)(I,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:t,locked:n,tabStop:r,onSelect:i,loginLabel:a,loginDisabled:o,onLogin:s,onRemove:c}){let{t:l}=N(`onboarding`),u=Ue(e),{traits:d,imageUrl:f,onImageError:p}=oe(e);return(0,V.jsx)(X,{icon:(0,V.jsx)(Le,{traits:d,imageUrl:f,fallback:e.isPaired?(0,V.jsx)(F,{className:`h-5 w-5`}):e.isLocal?(0,V.jsx)(De,{className:`h-5 w-5`}):(0,V.jsx)(Ee,{className:`h-5 w-5`}),decorative:!0,onImageError:p}),title:u,subtitle:G(e,l),selected:t,locked:n,tabStop:r,onSelect:i,action:n&&s?(0,V.jsx)(A,{variant:`primary`,size:`regular`,onClick:s,disabled:o,children:a}):void 0,removeMenu:c&&(0,V.jsx)(Y,{label:u,onRemove:c})})}function Xe({origin:e,icon:t,selected:n,current:r,tabStop:i,onSelect:a,onRemove:o}){let{t:s}=N(`onboarding`),c=Ge(e);return(0,V.jsx)(X,{icon:t??(0,V.jsx)(Te,{className:`h-5 w-5`}),title:c,subtitle:s(r?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:We(e)}),selected:n,tabStop:i,onSelect:a,removeMenu:o&&(0,V.jsx)(Y,{label:c,onRemove:o})})}export{J as SelectAssistantScreen};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ab as t,Ap as n,Ba as r,Cb as i,Ex as a,Fh as o,Gh as s,Gy as c,Ib as l,Ix as u,Jx as d,Jy as f,Lb as p,Lu as m,Ly as h,Ox as g,Rt as _,Sm as v,Sy as y,Tb as b,Tu as x,Ux as S,Va as ee,Wy as C,Xr as w,Xx as T,_y as te,bs as ne,by as E,cx as re,ds as ie,dx as ae,fs as oe,gb as se,jh as ce,kb as D,lh as le,lx as ue,os as de,pb as fe,qn as O,qr as pe,sb as k,ss as me,sx as he,tS as A,tb as ge,th as j,vy as _e,yb as ve,za as M,zy as ye}from"./app-1VZKPehC.js";import{er as be,j as N}from"./vendor-Dc7Mo5cU.js";import{_ as xe,f as Se,t as Ce,x as P}from"./react-B9IgSVeK.js";import{It as we,Sr as Te,er as F,gi as Ee,or as De,qi as I}from"./icons-DxrLl-Dj.js";import{t as L}from"./ellipsis-vertical-DWDUOGRm.js";import{t as Oe}from"./radio-card-nav-CZkUYNJ9.js";import{a as ke,i as Ae,n as je,o as R,r as z,t as Me}from"./self-hosted-servers-NoIpSFa0.js";import{t as Ne}from"./format-countdown-Dceq8qd-.js";var B=e(P(),1),Pe=l.remotePair.slice(`${l.assistant}/`.length);async function Fe(e,t){let n=t?D(e.url,t):null,r=t&&n!==null?`${Pe}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${l.assistant}`);if(!j()){i();return}(r===null?await je(e.url):await z(e.url,r))||i()}function Ie(e){return ke(C()?s():window.location.origin)===e.url}var V=Ce();function Le({traits:e,imageUrl:t,size:n=48,fallback:r,className:i,decorative:a=!1,onImageError:o}){let{t:s}=N(),c=w();if(e){if(!c)return r;if(v(c,e.bodyShape,e.eyeStyle,e.color)){let t=(0,V.jsx)(O,{components:c,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:n,className:i});return a?(0,V.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,V.jsx)(`img`,{src:t,alt:a?``:s(`chooserAvatarChip.alt`),width:n,height:n,className:`rounded-full object-cover ${i??``}`.trim(),style:{width:n,height:n,flexShrink:0},onError:o}):r}function Re(e){let t;try{t=re(e)}catch{return{ok:!1,reason:`unparseable`}}if(he(t))return{ok:!1,reason:`service-website`};let n=ke(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:ue(e).deviceCode}}function ze({open:e,onClose:n,onAdded:r}){let{t:i}=N(`onboarding`),[a,o]=(0,B.useState)(``),[s,c]=(0,B.useState)(!1),[l,d]=(0,B.useState)(null);(0,B.useEffect)(()=>{e&&(o(``),c(!1),d(null))},[e]);let f=()=>{s||n()},p=async()=>{if(!a.trim()||s)return;let e=Re(a);if(!e.ok){d(t(e.reason,a));return}c(!0),d(null);try{let t=await R.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}d(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),d(i(`addRemoteOriginDialog.addFailed`))}c(!1)};return(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||f()},children:(0,V.jsxs)(g.Content,{size:`md`,children:[(0,V.jsxs)(g.Header,{icon:Te,children:[(0,V.jsx)(g.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,V.jsx)(g.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,V.jsx)(g.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,V.jsx)(u,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>o(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),l&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:l})]})}),(0,V.jsxs)(g.Footer,{children:[(0,V.jsx)(A,{variant:`ghost`,onClick:f,disabled:s,children:i(`actions.cancel`)}),(0,V.jsx)(A,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||s,children:i(s?`actions.adding`:`actions.add`)})]})]})})}var H=e=>new Promise(t=>setTimeout(t,e)),U=30,Be=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Ve({open:e,initialAddress:n,guidanceKind:r,onClose:i,onImported:a}){let{t:o}=N(`onboarding`),[s,l]=(0,B.useState)(``),[d,p]=(0,B.useState)(``),[m,h]=(0,B.useState)(!1),[_,v]=(0,B.useState)(null),[b,x]=(0,B.useState)(null),[ee,C]=(0,B.useState)(0),[w,T]=(0,B.useState)(!1),[te,ne]=(0,B.useState)(null),E=(0,B.useRef)(null),re=(0,B.useRef)({abandoned:!1}),ie=()=>{let e=E.current;E.current=null,e&&y(e)};(0,B.useEffect)(()=>{if(!e)return;l(n??``),p(``),h(!1),v(null),x(null),T(!1),ne(null);let t={abandoned:!1};return re.current=t,()=>{t.abandoned=!0,ie()}},[e,n]),(0,B.useEffect)(()=>{if(!b)return;let e=setInterval(()=>C(Date.parse(b.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[b]);let ae=async()=>{let e=s.trim();if(!e||m)return;h(!0),v(null);let t=d.trim()||void 0,n=re.current;try{let r=await k(e);if(n.abandoned){r.ok&&y(r.handle);return}if(!r.ok){v(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),h(!1);return}E.current=r.handle,r.userCode&&(x({userCode:r.userCode,expiresAt:r.expiresAt}),C(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,s=r.expiresAt,l=r.intervalSeconds,u=0;for(;;){let e=await f(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&c(e);if(t&&!Be(s)){if(u+=1,u===1&&T(!0),await H(Math.min(l*u,U)*1e3),n.abandoned)return;continue}ie(),x(null),T(!1),v({kind:`message`,text:t?o(`connectAssistantDialog.retryExpired`):e.error});break}if(u>0&&(u=0,T(!1)),e.status===`imported`){if(E.current=null,e.accessOnly){x(null),ne(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==s&&(x(t=>t&&{...t,expiresAt:e.expiresAt}),C(Date.parse(e.expiresAt)-Date.now())),s=e.expiresAt,l=e.intervalSeconds,await H(l*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),ie(),x(null),T(!1),v({kind:`message`,text:o(`connectAssistantDialog.submitError`)})}h(!1)};return te==null?(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(g.Content,{size:`md`,children:[(0,V.jsxs)(g.Header,{icon:F,children:[(0,V.jsx)(g.Title,{children:o(`connectAssistantDialog.title`)}),(0,V.jsx)(g.Description,{children:o(`connectAssistantDialog.instruction`)})]}),(0,V.jsx)(g.Body,{children:(0,V.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,V.jsx)(S,{tone:`info`,children:o(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),b?(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:b.userCode}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:o(`connectAssistantDialog.approveOnHost`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,V.jsx)(`span`,{className:w?`text-[color:var(--system-warning-strong)]`:void 0,children:o(w?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,V.jsx)(`span`,{children:o(`connectAssistantDialog.expiresIn`,{time:Ne(ee)})})]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:o(`connectAssistantDialog.addressLabel`)}),(0,V.jsx)(u,{id:`connect-assistant-address`,type:`text`,value:s,onChange:e=>l(e.target.value),placeholder:o(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:o(`connectAssistantDialog.nameLabel`)}),(0,V.jsx)(u,{id:`connect-assistant-name`,type:`text`,value:d,onChange:e=>p(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),_&&(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:_.kind===`rejected-address`?t(_.rejection,_.address):_.text})]})}),(0,V.jsxs)(g.Footer,{children:[(0,V.jsx)(A,{variant:`ghost`,onClick:i,children:o(`actions.cancel`)}),!b&&(0,V.jsx)(A,{variant:`primary`,onClick:()=>void ae(),disabled:!s.trim()||m,children:o(m?`actions.connecting`:`actions.connect`)})]})]})}):(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(g.Content,{size:`sm`,children:[(0,V.jsx)(g.Header,{icon:F,children:(0,V.jsx)(g.Title,{children:o(`connectAssistantDialog.importedTitle`)})}),(0,V.jsx)(g.Body,{children:(0,V.jsx)(S,{tone:`warning`,children:o(`connectAssistantDialog.importedBody`)})}),(0,V.jsx)(g.Footer,{children:(0,V.jsx)(A,{variant:`primary`,onClick:()=>a(te),children:o(`actions.continue`)})})]})})}function He({open:e,assistantName:t,isPending:n,errorMessage:r,onCancel:i,onRepair:o,onRetire:s}){let{t:c}=N(`onboarding`),[l,u]=(0,B.useState)(`menu`);(0,B.useEffect)(()=>{e&&u(`menu`)},[e]);let d=r?(0,V.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:r}):null;return l===`confirm-repair`?(0,V.jsx)(a,{open:e,title:c(`connectRecoveryDialog.repairTitle`),message:(0,V.jsxs)(V.Fragment,{children:[c(`connectRecoveryDialog.repairBody`),d]}),confirmLabel:c(`connectRecoveryDialog.repairConfirm`),isPending:n,onConfirm:o,onCancel:()=>u(`menu`)}):l===`confirm-retire`?(0,V.jsx)(M,{open:e,isPending:n,extraMessage:d,onConfirm:s,onCancel:()=>u(`menu`)}):(0,V.jsx)(g.Root,{open:e,onOpenChange:e=>{!e&&!n&&i()},children:(0,V.jsxs)(g.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),n||i()},children:[(0,V.jsx)(g.Header,{children:(0,V.jsx)(g.Title,{children:c(`connectRecoveryDialog.authFailedTitle`)})}),(0,V.jsxs)(g.Body,{children:[(0,V.jsx)(g.Description,{children:c(`connectRecoveryDialog.authFailedBody`,{name:t})}),d,(0,V.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,V.jsx)(A,{variant:`primary`,fullWidth:!0,disabled:n,onClick:()=>u(`confirm-repair`),children:c(`connectRecoveryDialog.wakeAndRepair`)}),(0,V.jsx)(A,{variant:`dangerOutline`,fullWidth:!0,disabled:n,onClick:()=>u(`confirm-retire`),children:c(`connectRecoveryDialog.retire`)}),(0,V.jsx)(A,{variant:`outlined`,fullWidth:!0,disabled:n,onClick:i,children:c(`actions.cancel`)})]})]})]})})}function Ue(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function W(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function G(e,t){let n=e.isPaired?ae(e.runtimeUrl):e.isLocal?ye()?`On this computer`:W(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${_(e.hatchedAt)}`:n}function We(e){return new URL(e.url).hostname}function Ge(e){return e.name??We(e)}function K(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=N(`onboarding`),t=Se(),a=be(),[s,c]=xe(),u=s.get(`fromLogin`)===`1`,d=s.get(`noAutoSkip`)===`1`,f=p(),g=ye(),_=n(),v=_e.use.assistants(),y=o.use.currentOrganizationId(),S=R.use.origins(),C=R.use.hydrated(),w=le(),{loading:T,error:re,login:ae,cancel:oe}=ne(),[D,ue]=(0,B.useState)(null),O=D===null?null:{url:D,name:`Vellum Cloud`},k=O!==null,he=e=>e.isPaired||e.isLocal&&g||_,j=v.filter(te),M=j.filter(he),Ce=M.length>0||S.length>0||O!==null,P=fe(),De=!_&&P,[I,L]=(0,B.useState)(null),[z,Ne]=(0,B.useState)(!1),[Pe,Le]=(0,B.useState)(!1),[Re,H]=(0,B.useState)(null),[U,Be]=(0,B.useState)(null),[W,G]=(0,B.useState)(!1),[We,J]=(0,B.useState)(null),[Y,X]=(0,B.useState)(null),[Ze,Qe]=(0,B.useState)(!1),[$e,Z]=(0,B.useState)(null),[et,tt]=(0,B.useState)(!1),[Q,nt]=(0,B.useState)(null),[rt,it]=(0,B.useState)(!1),[at,ot]=(0,B.useState)(null),st=x.use.open(),ct=x.use.initialAddress(),lt=x.use.guidanceKind(),ut=x.use.deepLinkDrainSettled(),dt=(0,B.useRef)(!1);(0,B.useEffect)(()=>{m()},[]),(0,B.useEffect)(()=>{Me(),R.getState().hydrate()},[]),(0,B.useEffect)(()=>{if(!w)return;let e=!1;return Ae().then(t=>{e||ue(t)}),()=>{e=!0}},[w]);let ft=(0,B.useRef)(!1);(0,B.useEffect)(()=>{if(ft.current)return;ft.current=!0;let e=s.get(`register`);if(e===null)return;let t=()=>c(Ke,{replace:!0}),n=ke(e);if(n===null){t();return}R.getState().addOrigin({url:n,name:s.get(`name`)??void 0}).then(e=>{e.ok?t():ft.current=!1}).catch(()=>{ft.current=!1})},[s,c]),(0,B.useEffect)(()=>{if(I===q&&k||I!=null&&S.some(e=>K(e)===I))return;if(M.length===0){let e=S[0],t=e?K(e):k?q:null;I!==t&&L(t);return}if(I!=null&&M.some(e=>e.id===I))return;let e=ce(y);L(M.find(t=>t.id===e)?.id??M[0].id)},[I,M,y,S,k]);let $=async e=>{Ne(!0),H(null);try{await me(e),t(l.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&fe()&&(se(t)||b(t)||t instanceof E)&&h(e.id)?Be(e):e.isPaired&&se(t)?H(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):H(`Failed to connect. Please try again.`),Ne(!1)}},pt=()=>{Be(null),G(!1),J(null),Le(!1)},mt=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await ve(U.id,{repairGuardian:!0});if(e.ok){i(),pt(),$(U);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}G(!1)}},ht=async()=>{if(!(!U||W)){G(!0),J(null);try{let e=await ee(a,U.id);if(e.ok){pt(),t(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}G(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await de(a,Y.id);e.ok?(dt.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await ge(Y.id);if(e.ok){let e=_e.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),ie(a,Y.id),dt.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await R.getState().removeOrigin(Q.url),R.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):(dt.current=!0,nt(null)),it(!1))},bt=e=>{x.getState().closeConnectDialog(),$(_e.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Fe(e,t??void 0)};(0,B.useEffect)(()=>{u||d||dt.current||g&&C&&(S.length>0||f&&!ut||z||Pe||st||j.length!==0&&j.length===1&&M.length===1&&(Le(!0),$(M[0])))},[j.length,M.length,ut,g,S.length,C]);let St=()=>{if(I===q){je(null).then(e=>{!e&&D!==null&&window.location.assign(D)});return}let e=S.find(e=>K(e)===I);if(e){Ie(e)?t(l.assistant,{replace:!0}):Fe(e);return}let n=j.find(e=>e.id===I);n&&$(n)},Ct=()=>{t(g?l.welcome:l.assistant)},wt=re??Re;return Pe&&!wt&&!U?(0,V.jsx)(qe,{}):(0,V.jsxs)(pe,{avatarWave:`beside`,children:[(0,V.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${f?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,V.jsxs)(`div`,{className:`flex w-full flex-col items-center ${f?``:`flex-1 justify-center`}`,children:[(0,V.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,V.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,V.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:Oe,className:`flex w-full flex-col ${f?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[j.map(t=>{let n=he(t);return(0,V.jsx)(Ye,{assistant:t,selected:I===t.id,locked:!n,tabStop:I==null?M[0]?.id===t.id:I===t.id,onSelect:()=>{n&&L(t.id)},loginLabel:e(T?`actions.cancel`:`actions.loginToUse`),loginDisabled:z,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?T?oe:()=>void ae():void 0,onRemove:t.isPlatformHosted&&De||t.isPaired&&P?()=>X(t):void 0},t.id)}),S.map((e,t)=>{let n=K(e),r=Ie(e);return(0,V.jsx)(Xe,{origin:e,selected:I===n,current:r,tabStop:I==null?M.length===0&&t===0:I===n,onSelect:()=>L(n),onRemove:r&&w?void 0:()=>nt(e)},e.url)}),O&&(0,V.jsx)(Xe,{origin:O,icon:(0,V.jsx)(Ee,{className:`h-5 w-5`}),selected:I===q,current:!1,tabStop:I==null?M.length===0&&S.length===0:I===q,onSelect:()=>L(q)}),g&&(0,V.jsx)(Je,{icon:(0,V.jsx)(we,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:z||T,onClick:()=>void t(`${l.onboarding.hosting}?from=select-assistant`)}),P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(F,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:z||T,onClick:()=>x.getState().openConnectDialog()}),!P&&(0,V.jsx)(Je,{icon:(0,V.jsx)(Te,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:z||T,onClick:()=>tt(!0)})]}),Ce&&(0,V.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,V.jsx)(A,{variant:`primary`,size:`regular`,fullWidth:!0,className:f?void 0:`h-11 text-base`,onClick:St,disabled:!I||z,children:e(z?`actions.connecting`:`actions.continue`)})}),(0,V.jsx)(`div`,{className:Ce?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,V.jsx)(A,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:z||T,children:e(`actions.back`)})})]})}),(0,V.jsx)(ze,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,V.jsx)(Ve,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>x.getState().closeConnectDialog(),onImported:bt}),(0,V.jsx)(He,{open:U!=null,assistantName:U?Ue(U):``,isPending:W,errorMessage:We??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,V.jsx)(r,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?Ue(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,V.jsx)(r,{open:Q!=null,kind:`origin`,assistantName:Q?Ge(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=N(`onboarding`);return(0,V.jsx)(pe,{avatarWave:`beside`,children:(0,V.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,V.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=p();return(0,V.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,V.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:t}){let{t:n}=N(`onboarding`);return(0,V.jsxs)(T.Root,{children:[(0,V.jsx)(T.Trigger,{asChild:!0,children:(0,V.jsx)(A,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,V.jsx)(L,{}),"aria-label":n(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,V.jsx)(T.Content,{align:`end`,sideOffset:4,children:(0,V.jsx)(T.Item,{onSelect:t,className:d.anchored,children:n(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:s,removeMenu:c}){let l=p();return(0,V.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,l?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,V.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,V.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${l?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s,c&&(i?c:(0,V.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:c})),!i&&(0,V.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,V.jsx)(I,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:t,locked:n,tabStop:r,onSelect:i,loginLabel:a,loginDisabled:o,onLogin:s,onRemove:c}){let{t:l}=N(`onboarding`),u=Ue(e),{traits:d,imageUrl:f,onImageError:p}=oe(e);return(0,V.jsx)(X,{icon:(0,V.jsx)(Le,{traits:d,imageUrl:f,fallback:e.isPaired?(0,V.jsx)(F,{className:`h-5 w-5`}):e.isLocal?(0,V.jsx)(De,{className:`h-5 w-5`}):(0,V.jsx)(Ee,{className:`h-5 w-5`}),decorative:!0,onImageError:p}),title:u,subtitle:G(e,l),selected:t,locked:n,tabStop:r,onSelect:i,action:n&&s?(0,V.jsx)(A,{variant:`primary`,size:`regular`,onClick:s,disabled:o,children:a}):void 0,removeMenu:c&&(0,V.jsx)(Y,{label:u,onRemove:c})})}function Xe({origin:e,icon:t,selected:n,current:r,tabStop:i,onSelect:a,onRemove:o}){let{t:s}=N(`onboarding`),c=Ge(e);return(0,V.jsx)(X,{icon:t??(0,V.jsx)(Te,{className:`h-5 w-5`}),title:c,subtitle:s(r?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:We(e)}),selected:n,tabStop:i,onSelect:a,removeMenu:o&&(0,V.jsx)(Y,{label:c,onRemove:o})})}export{J as SelectAssistantScreen};
@@ -1 +1 @@
1
- import{Ah as e,Pv as t,ax as n,fx as r,th as i}from"./app-n7D5Q-HS.js";import{Q as a,k as o}from"./vendor-DUzxlXbu.js";var s=`vellum:remembered-origins`;function c(e){let t=e.trim();if(t===``)return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}`}function l(e,t){let n=[],r=new Set,i=t??new Date().toISOString();for(let t of e){if(typeof t!=`object`||!t)continue;let{url:e,name:a,addedAt:o}=t;if(typeof e!=`string`)continue;let s=c(e);s===null||r.has(s)||(r.add(s),n.push({url:s,...typeof a==`string`&&a!==``?{name:a}:{},addedAt:typeof o==`string`?o:i}))}return n}function u(e){let t=JSON.parse(e);return Array.isArray(t)?l(t):null}var d=t({key:s,scope:`device`,parse:u,serialize:JSON.stringify,fallback:[]}),f={load:async()=>d.load(),save:async e=>{d.save(e)},watch:e=>n(s,e)},p=f,m=null,h=0,g=Promise.resolve(),_=`vellum:remembered-origins:mutate`;async function v(e){let t=typeof navigator>`u`?void 0:navigator.locks;return t?await t.request(_,e):e()}function y(e){let t=()=>v(e),n=g.then(t,t);return g=n.catch(()=>void 0),n}var b=null,x=!1;function S(e){return y(async()=>{try{let t=await p.load();if(e!==h)return;T.getState().hydrated?T.setState({origins:t}):m===null?T.getState().hydrate():x=!0}catch{}})}function C(){b?.();let e=h;b=p.watch?.(()=>void S(e))??null}function w(e){p=e,h+=1,m=null,x=!1,T.setState({hydrated:!1}),C(),T.getState().hydrate()}var T=a()((e,t)=>({origins:[],hydrated:!1,hydrate:()=>(m??=(async()=>{let t=h;await Promise.resolve();try{let n=await p.load();t===h&&(e({origins:n,hydrated:!0}),x&&(x=!1,S(t)))}catch{t===h&&(m=null)}})(),m),addOrigin:async({url:n,name:r})=>{let i=c(n);return i===null?{ok:!1}:y(async()=>{if(await t().hydrate(),!t().hydrated)return{ok:!1};let n=p,a=h,o;try{o=await n.load()}catch{return{ok:!1}}if(a!==h)return{ok:!1};let s=r?.trim(),c=o.find(e=>e.url===i),l=c??{url:i,addedAt:new Date().toISOString()},u=s?{...l,name:s}:l,d=c?o.map(e=>e.url===i?u:e):[...o,u];try{await n.save(d)}catch{return{ok:!1}}return a===h?(e({origins:d}),{ok:!0,origin:u}):{ok:!1}})},removeOrigin:async n=>{let r=c(n);r!==null&&await y(async()=>{if(await t().hydrate(),!t().hydrated)return;let n=p,i=h,a;try{a=await n.load()}catch{return}if(i!==h)return;let o=a.filter(e=>e.url!==r);if(o.length!==a.length)try{await n.save(o)}catch{return}i===h&&e({origins:o})})}}));C();var E=r(T),D=o(`SelfHostedServers`),O=`1970-01-01T00:00:00.000Z`;async function k(){try{return await D.list()}catch(e){return console.debug(`[self-hosted-servers] bridge unavailable:`,e),null}}var A=`vellum:remembered-origins:native-migrated`;function j(){try{return window.localStorage.getItem(A)===`true`}catch{return!0}}function M(){try{window.localStorage.setItem(A,`true`)}catch{}}async function N(e){if(j())return e;let t=[];try{t=await f.load()}catch{t=[]}let n=new Set(e.map(e=>e.url)),r=t.filter(e=>!n.has(e.url)),i=[];for(let t of r){try{await D.add({url:t.url,...t.name?{name:t.name}:{}})}catch(t){return console.debug(`[self-hosted-servers] migration add failed:`,t),[...e,...i]}i.push(t)}return M(),[...e,...i]}function P(){return{load:async()=>{let e=await k();return e===null?f.load():N(l(e.servers,O))},save:async e=>{let t=await k();if(t===null){await f.save(e);return}let n=new Map(l(t.servers,O).map(e=>[e.url,e.name])),r=new Set(e.map(e=>e.url));for(let e of n.keys())r.has(e)||await D.remove({url:e});for(let t of e)(!n.has(t.url)||t.name&&t.name!==n.get(t.url))&&await D.add({url:t.url,...t.name?{name:t.name}:{}})},watch:f.watch}}var F=!1;function I(){F||!i()||(F=!0,w(P()))}async function L(t,n){if(!i())return!1;await e();try{return await n(),!0}catch(e){return console.debug(`[self-hosted-servers] ${t} unavailable:`,e),!1}}async function R(e){return L(`switchTo`,()=>D.switchTo(e===null?{}:{url:e}))}async function z(e,t){return L(`switchToPath`,()=>D.switchToPath({...e===null?{}:{url:e},path:t}))}async function B(){if(!i())return null;let e=await k();return e===null||!e.activeUrl?null:e.bakedUrl?c(e.bakedUrl):null}export{c as a,B as i,R as n,E as o,z as r,I as t};
1
+ import{Ah as e,Pv as t,ax as n,fx as r,th as i}from"./app-1VZKPehC.js";import{Q as a,k as o}from"./vendor-Dc7Mo5cU.js";var s=`vellum:remembered-origins`;function c(e){let t=e.trim();if(t===``)return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}`}function l(e,t){let n=[],r=new Set,i=t??new Date().toISOString();for(let t of e){if(typeof t!=`object`||!t)continue;let{url:e,name:a,addedAt:o}=t;if(typeof e!=`string`)continue;let s=c(e);s===null||r.has(s)||(r.add(s),n.push({url:s,...typeof a==`string`&&a!==``?{name:a}:{},addedAt:typeof o==`string`?o:i}))}return n}function u(e){let t=JSON.parse(e);return Array.isArray(t)?l(t):null}var d=t({key:s,scope:`device`,parse:u,serialize:JSON.stringify,fallback:[]}),f={load:async()=>d.load(),save:async e=>{d.save(e)},watch:e=>n(s,e)},p=f,m=null,h=0,g=Promise.resolve(),_=`vellum:remembered-origins:mutate`;async function v(e){let t=typeof navigator>`u`?void 0:navigator.locks;return t?await t.request(_,e):e()}function y(e){let t=()=>v(e),n=g.then(t,t);return g=n.catch(()=>void 0),n}var b=null,x=!1;function S(e){return y(async()=>{try{let t=await p.load();if(e!==h)return;T.getState().hydrated?T.setState({origins:t}):m===null?T.getState().hydrate():x=!0}catch{}})}function C(){b?.();let e=h;b=p.watch?.(()=>void S(e))??null}function w(e){p=e,h+=1,m=null,x=!1,T.setState({hydrated:!1}),C(),T.getState().hydrate()}var T=a()((e,t)=>({origins:[],hydrated:!1,hydrate:()=>(m??=(async()=>{let t=h;await Promise.resolve();try{let n=await p.load();t===h&&(e({origins:n,hydrated:!0}),x&&(x=!1,S(t)))}catch{t===h&&(m=null)}})(),m),addOrigin:async({url:n,name:r})=>{let i=c(n);return i===null?{ok:!1}:y(async()=>{if(await t().hydrate(),!t().hydrated)return{ok:!1};let n=p,a=h,o;try{o=await n.load()}catch{return{ok:!1}}if(a!==h)return{ok:!1};let s=r?.trim(),c=o.find(e=>e.url===i),l=c??{url:i,addedAt:new Date().toISOString()},u=s?{...l,name:s}:l,d=c?o.map(e=>e.url===i?u:e):[...o,u];try{await n.save(d)}catch{return{ok:!1}}return a===h?(e({origins:d}),{ok:!0,origin:u}):{ok:!1}})},removeOrigin:async n=>{let r=c(n);r!==null&&await y(async()=>{if(await t().hydrate(),!t().hydrated)return;let n=p,i=h,a;try{a=await n.load()}catch{return}if(i!==h)return;let o=a.filter(e=>e.url!==r);if(o.length!==a.length)try{await n.save(o)}catch{return}i===h&&e({origins:o})})}}));C();var E=r(T),D=o(`SelfHostedServers`),O=`1970-01-01T00:00:00.000Z`;async function k(){try{return await D.list()}catch(e){return console.debug(`[self-hosted-servers] bridge unavailable:`,e),null}}var A=`vellum:remembered-origins:native-migrated`;function j(){try{return window.localStorage.getItem(A)===`true`}catch{return!0}}function M(){try{window.localStorage.setItem(A,`true`)}catch{}}async function N(e){if(j())return e;let t=[];try{t=await f.load()}catch{t=[]}let n=new Set(e.map(e=>e.url)),r=t.filter(e=>!n.has(e.url)),i=[];for(let t of r){try{await D.add({url:t.url,...t.name?{name:t.name}:{}})}catch(t){return console.debug(`[self-hosted-servers] migration add failed:`,t),[...e,...i]}i.push(t)}return M(),[...e,...i]}function P(){return{load:async()=>{let e=await k();return e===null?f.load():N(l(e.servers,O))},save:async e=>{let t=await k();if(t===null){await f.save(e);return}let n=new Map(l(t.servers,O).map(e=>[e.url,e.name])),r=new Set(e.map(e=>e.url));for(let e of n.keys())r.has(e)||await D.remove({url:e});for(let t of e)(!n.has(t.url)||t.name&&t.name!==n.get(t.url))&&await D.add({url:t.url,...t.name?{name:t.name}:{}})},watch:f.watch}}var F=!1;function I(){F||!i()||(F=!0,w(P()))}async function L(t,n){if(!i())return!1;await e();try{return await n(),!0}catch(e){return console.debug(`[self-hosted-servers] ${t} unavailable:`,e),!1}}async function R(e){return L(`switchTo`,()=>D.switchTo(e===null?{}:{url:e}))}async function z(e,t){return L(`switchToPath`,()=>D.switchToPath({...e===null?{}:{url:e},path:t}))}async function B(){if(!i())return null;let e=await k();return e===null||!e.activeUrl?null:e.bakedUrl?c(e.bakedUrl):null}export{c as a,B as i,R as n,E as o,z as r,I as t};
@@ -1 +1 @@
1
- import{tS as e}from"./app-n7D5Q-HS.js";import{j as t}from"./vendor-DUzxlXbu.js";import{t as n}from"./react-B9IgSVeK.js";import{Xr as r,dr as i}from"./icons-DxrLl-Dj.js";import{t as a}from"./detail-card-BkqRteiy.js";var o=n();function s({id:e,title:t,subtitle:n,children:r}){return(0,o.jsx)(a,{id:e,title:t,subtitle:n,children:(0,o.jsx)(`div`,{className:`mt-4`,children:r})})}function c({onClick:n,disabled:r}){let{t:i}=t();return(0,o.jsx)(e,{onClick:n,disabled:r,children:i(`serviceFormControls.save`)})}function l({onClick:n,filled:r=!1}){let{t:i}=t();return(0,o.jsx)(e,{variant:r?`danger`:`dangerGhost`,onClick:n,children:i(`serviceFormControls.reset`)})}function u({guide:e}){return(0,o.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,o.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{children:e.description}),(0,o.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,o.jsx)(r,{className:`h-3 w-3`})]})]})]})}export{s as i,l as n,c as r,u as t};
1
+ import{tS as e}from"./app-1VZKPehC.js";import{j as t}from"./vendor-Dc7Mo5cU.js";import{t as n}from"./react-B9IgSVeK.js";import{Xr as r,dr as i}from"./icons-DxrLl-Dj.js";import{t as a}from"./detail-card-N-3EizQA.js";var o=n();function s({id:e,title:t,subtitle:n,children:r}){return(0,o.jsx)(a,{id:e,title:t,subtitle:n,children:(0,o.jsx)(`div`,{className:`mt-4`,children:r})})}function c({onClick:n,disabled:r}){let{t:i}=t();return(0,o.jsx)(e,{onClick:n,disabled:r,children:i(`serviceFormControls.save`)})}function l({onClick:n,filled:r=!1}){let{t:i}=t();return(0,o.jsx)(e,{variant:r?`danger`:`dangerGhost`,onClick:n,children:i(`serviceFormControls.reset`)})}function u({guide:e}){return(0,o.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,o.jsx)(i,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{children:e.description}),(0,o.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,o.jsx)(r,{className:`h-3 w-3`})]})]})]})}export{s as i,l as n,c as r,u as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Fx as t}from"./app-n7D5Q-HS.js";import{t as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=n();function o({label:e,helperText:n,checked:r,onChange:o,variant:s=`toggle-leading`}){let c=(0,i.useId)(),l=(0,a.jsx)(t,{checked:r,onChange:o,id:c}),u=(0,a.jsxs)(`label`,{htmlFor:c,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,a.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,a.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:n})]});return s===`toggle-trailing`?(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[u,l]}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[l,u]})}export{o as t};
1
+ import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Fx as t}from"./app-1VZKPehC.js";import{t as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1),a=n();function o({label:e,helperText:n,checked:r,onChange:o,variant:s=`toggle-leading`}){let c=(0,i.useId)(),l=(0,a.jsx)(t,{checked:r,onChange:o,id:c}),u=(0,a.jsxs)(`label`,{htmlFor:c,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,a.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,a.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:n})]});return s===`toggle-trailing`?(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[u,l]}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[l,u]})}export{o as t};