@vellumai/web 0.11.4-staging.1 → 0.11.4-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/assets/{BundleConfirmPage-BbdN3tFL.js → BundleConfirmPage-Blq6GhVG.js} +1 -1
- package/dist/assets/{Trans-Ch_EPHgV.js → Trans-CPcWO-v6.js} +1 -1
- package/dist/assets/{about-page-B-1ST2gv.js → about-page-CTTTxSzr.js} +1 -1
- package/dist/assets/{access-DgWVDTc-.js → access-wabdRUmQ.js} +1 -1
- package/dist/assets/{account-page-Bjw-Whl-.js → account-page-DINYg3Rl.js} +1 -1
- package/dist/assets/{account-shell-7DXx2oD4.js → account-shell-DQFZ4C79.js} +1 -1
- package/dist/assets/{acp-run-actions-D3BHB3kZ.js → acp-run-actions-CkYR2vBH.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-CMV1hamc.js → acp-run-detail-panel-Dt_Dcegh.js} +4 -4
- package/dist/assets/{acp-run-store-DpbMRWeI.js → acp-run-store-k9Syb04D.js} +1 -1
- package/dist/assets/activity-steps-panel-B9N9npP8.js +1 -0
- package/dist/assets/{add-credential-modal-CAorWf5a.js → add-credential-modal-Bn2SkYV8.js} +1 -1
- package/dist/assets/{add-credits-modal-NK9YUVin.js → add-credits-modal-lFCQGz49.js} +1 -1
- package/dist/assets/ai-page-DuZ_jor4.js +1 -0
- package/dist/assets/{api-xbjYCkk-.js → api-C72Ea0va.js} +1 -1
- package/dist/assets/{api-asaDrkTi.js → api-Dppu0jIX.js} +1 -1
- package/dist/assets/{api-key-screen-BLsynLtR.js → api-key-screen-CbIBGdOH.js} +1 -1
- package/dist/assets/{app-card-oG9LxSg9.js → app-card-BrtrF2PU.js} +1 -1
- package/dist/assets/{assistant-status-panel-CdJKE_VM.js → assistant-status-panel-DUB7x8Cv.js} +1 -1
- package/dist/assets/{auth-store-BDMYc7te.js → auth-store-B9pHhreb.js} +2 -2
- package/dist/assets/{avatar-random-cVA-5Ukx.js → avatar-random-Ux7JUtwk.js} +1 -1
- package/dist/assets/{background-task-actions-Cf2kEaWh.js → background-task-actions-D3TOUuY8.js} +1 -1
- package/dist/assets/{background-task-detail-panel-DWGWcjjS.js → background-task-detail-panel-nHViOVhW.js} +1 -1
- package/dist/assets/{background-task-store-eQZGVUDr.js → background-task-store-r1LOGfBn.js} +1 -1
- package/dist/assets/{billing-page-scyDxDPK.js → billing-page-BtPUFL3X.js} +3 -3
- package/dist/assets/{bookmarks-page-JMPRm3As.js → bookmarks-page-BA7-0dXF.js} +1 -1
- package/dist/assets/{browser-CZ10MkOr.js → browser-DwONNRIj.js} +2 -2
- package/dist/assets/{build-state-DdpPjDMZ.js → build-state-bnyw3m5Y.js} +1 -1
- package/dist/assets/channels-page-route-Da6XgpGs.js +9 -0
- package/dist/assets/{chat-sgiUoK1u.js → chat-BfpNzA77.js} +1 -1
- package/dist/assets/chat-DRdXDFUk.js +3 -0
- package/dist/assets/{chat-avatar-B1G491hG.js → chat-avatar-RM6-aunH.js} +1 -1
- package/dist/assets/chat-markdown-message-DWQZLyLI.js +1 -0
- package/dist/assets/{checkout-continuation-ChMQkpyi.js → checkout-continuation-B34WX6T6.js} +1 -1
- package/dist/assets/{checkout-page-Cpk90EXc.js → checkout-page-ZxCMmuwz.js} +1 -1
- package/dist/assets/checkout-return-target-CpckAKDY.js +1 -0
- package/dist/assets/{client-perf-C4GkD7vz.js → client-perf-Daz5cYUH.js} +1 -1
- package/dist/assets/command-palette-C6h4Ip2u.js +1 -0
- package/dist/assets/{command-palette-window-page-BP9A8L2v.js → command-palette-window-page-BKbM5K6f.js} +1 -1
- package/dist/assets/{companion-surface-page-B0hbyF1T.js → companion-surface-page-BbU9Hj0z.js} +1 -1
- package/dist/assets/{composer-settings-BMKJP4Ik.js → composer-settings-DYfbHO-e.js} +1 -1
- package/dist/assets/{connect-page-DKFPwsN0.js → connect-page-DxRMNc2U.js} +1 -1
- package/dist/assets/{consent-controls-hAYNW2he.js → consent-controls-Dz0ScMsh.js} +1 -1
- package/dist/assets/contacts-page-route-C-7wKpdG.js +1 -0
- package/dist/assets/{conversation-cache-DY3GhyFA.js → conversation-cache-ztu3M4pz.js} +1 -1
- package/dist/assets/{conversation-list-fetchers-CVKv5BpN.js → conversation-list-fetchers-eA7yZMEu.js} +1 -1
- package/dist/assets/{conversation-navigation-Bw3eQBGU.js → conversation-navigation-tCTlvwgs.js} +1 -1
- package/dist/assets/{conversation-queries-7BVaya69.js → conversation-queries-DkkuIyRB.js} +1 -1
- package/dist/assets/{credential-entry-page-BxNWgyvZ.js → credential-entry-page-DqEK_3ve.js} +1 -1
- package/dist/assets/credentials-page-Nx8MKxw7.js +1 -0
- package/dist/assets/{csv-preview-Ba7nV5mb.js → csv-preview-DfyT2oPn.js} +1 -1
- package/dist/assets/{daily-reset-time-i6mZWgVc.js → daily-reset-time-B28vdbVK.js} +1 -1
- package/dist/assets/debug-page-F58Vngs5.js +4 -0
- package/dist/assets/{deploy-dialogs-CG-65xs0.js → deploy-dialogs-Dr5UW72X.js} +1 -1
- package/dist/assets/{deploy-store-eps_MrT7.js → deploy-store-BAIpED5W.js} +1 -1
- package/dist/assets/{detail-card-CC0br9gQ.js → detail-card-BvBqhvvy.js} +1 -1
- package/dist/assets/{detail-drawer-BpdqER__.js → detail-drawer-zQohjzAF.js} +1 -1
- package/dist/assets/{detail-shell-Bmyv2wPh.js → detail-shell-6omiDynS.js} +1 -1
- package/dist/assets/developer-page-BgkajhCF.js +1 -0
- package/dist/assets/{diagnostics-CeLo0IQo.js → diagnostics-B6s70M5A.js} +1 -1
- package/dist/assets/{doctor-handoff-store-D1gIUvVD.js → doctor-handoff-store-DbvChP6h.js} +1 -1
- package/dist/assets/{document-viewer-container-Bywwxt6G.js → document-viewer-container-CiSaZjGT.js} +2 -2
- package/dist/assets/{document-viewer-page-qJKfO2Qb.js → document-viewer-page-B41ybONf.js} +1 -1
- package/dist/assets/{emails-page-B0--yw62.js → emails-page-zqESuC5i.js} +1 -1
- package/dist/assets/{esm-CoB42w1C.js → esm-BAZfwa77.js} +2 -2
- package/dist/assets/{esm-DyAueRRL.js → esm-BpO8b4iY.js} +2 -2
- package/dist/assets/esm-C-oF6bck.js +2 -0
- package/dist/assets/{esm-BbX6z_Bm.js → esm-CuIRAuen.js} +2 -2
- package/dist/assets/{esm-_vI9--3B.js → esm-CyDcfaYH.js} +2 -2
- package/dist/assets/{esm-BKg0nbmu.js → esm-D7eT5n3U.js} +2 -2
- package/dist/assets/{esm-B4xcxzQN.js → esm-tXi8GsTV.js} +2 -2
- package/dist/assets/eye-bbox-BR5NO1BX.js +1 -0
- package/dist/assets/file-editor-B2BJsOt0.js +1 -0
- package/dist/assets/file-markdown-EG3aJEi8.js +2 -0
- package/dist/assets/first-run-scope-mN3YhjgX.js +1 -0
- package/dist/assets/{funnel-events-BddkbWqn.js → funnel-events-CH_O9aTg.js} +1 -1
- package/dist/assets/general-page-C6eGuDih.js +1 -0
- package/dist/assets/{haptics-DafZDCxm.js → haptics-BhuZvnto.js} +2 -2
- package/dist/assets/{hatching-screen-BKfkDhPr.js → hatching-screen-Ceyfxgc-.js} +1 -1
- package/dist/assets/{home-page-route-B6vQYv0r.js → home-page-route-DdXLgyeu.js} +1 -1
- package/dist/assets/{home-tool-permission-card-IF0-aLrT.js → home-tool-permission-card-NAxzVd1l.js} +1 -1
- package/dist/assets/{hosting-screen-BJ5SfJoU.js → hosting-screen-D05jZjLX.js} +1 -1
- package/dist/assets/{i18n-zb2mgr1B.js → i18n-BR-AyG5b.js} +2 -2
- package/dist/assets/identity-page-route-BlKLitBM.js +7 -0
- package/dist/assets/{index-xicEUutS.js → index-CKyw1JVb.js} +3 -3
- package/dist/assets/index-DJ5ObIDJ.css +2 -0
- package/dist/assets/{ingest-B9D2Cyin.js → ingest-BwYkhorN.js} +1 -1
- package/dist/assets/inspect-page-m1poii66.js +9 -0
- package/dist/assets/integrations-page-Duhjka1l.js +1 -0
- package/dist/assets/{intelligence-layout-BESJ3-1s.js → intelligence-layout-ld1yOf08.js} +1 -1
- package/dist/assets/{invalidate-memory-queries-CS15Vuec.js → invalidate-memory-queries-YJf2XJ5P.js} +1 -1
- package/dist/assets/{invalidate-plugin-queries-DvUskShG.js → invalidate-plugin-queries-CySCFK8G.js} +1 -1
- package/dist/assets/latest-assistant-text-CDrxmzc0.js +24 -0
- package/dist/assets/{library-detail-page-BBfYWKvm.js → library-detail-page-v5CrGIps.js} +1 -1
- package/dist/assets/{library-page-BgbT6zej.js → library-page-BUnsZHzU.js} +1 -1
- package/dist/assets/{local-runtime-upgrade-SQQhJhOk.js → local-runtime-upgrade-Bwp6_dxW.js} +1 -1
- package/dist/assets/{login-flow-CTw5lXLx.js → login-flow-imrf1-ub.js} +1 -1
- package/dist/assets/{login-page-D2GAHcR7.js → login-page-C8owPhpB.js} +1 -1
- package/dist/assets/{logout-page-Cukoglve.js → logout-page-DfY78j6S.js} +1 -1
- package/dist/assets/{logs-layout-B4KDB9Sb.js → logs-layout-Dox-b2zq.js} +1 -1
- package/dist/assets/{media-preview-DjetaJpN.js → media-preview-6mD4wHKW.js} +1 -1
- package/dist/assets/{memory-page-route-Bnyvrbhn.js → memory-page-route-Cen_nGPc.js} +1 -1
- package/dist/assets/{memory-router-playground-page-8M60K9iJ.js → memory-router-playground-page-BvNM2MJO.js} +1 -1
- package/dist/assets/{message-files-panel-Cwlkr5w4.js → message-files-panel-CECqngl9.js} +1 -1
- package/dist/assets/{messages-D0PQ2X1S.js → messages-ctx0P03F.js} +1 -1
- package/dist/assets/{metric-card-SnROKwaj.js → metric-card-CRmU_rxS.js} +1 -1
- package/dist/assets/{multi-activity-group-CenHDhpe.js → multi-activity-group-DuW4ziR3.js} +1 -1
- package/dist/assets/native-anchor-BE-YHt8Q.js +1 -0
- package/dist/assets/native-deep-link-DliAfHU5.js +2 -0
- package/dist/assets/{native-file-DWbiI8L-.js → native-file-B9kJgftd.js} +2 -2
- package/dist/assets/{navigation-resolver-jn3fW9IN.js → navigation-resolver-CDeIpFuD.js} +1 -1
- package/dist/assets/{not-found-CRrNNxgD.js → not-found-mMT3d6dm.js} +1 -1
- package/dist/assets/{notifications-D7I0R0Np.js → notifications-Dx3P9a9Q.js} +1 -1
- package/dist/assets/{notifications-page-D6Llk4Q-.js → notifications-page-COU3Z3YY.js} +1 -1
- package/dist/assets/{oauth-complete-page-E47i6-KO.js → oauth-complete-page-D5uYsl41.js} +1 -1
- package/dist/assets/{oauth-connection-utils-BnF9kIoa.js → oauth-connection-utils-SS0qmAK4.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-Be9bz47B.js → oauth-popup-complete-page-BLw62jns.js} +1 -1
- package/dist/assets/open-workspace-file-DFo0Oq0o.js +2 -0
- package/dist/assets/{operational-status-DswnmGh5.js → operational-status-BsKLhv9Z.js} +1 -1
- package/dist/assets/{page-shell-CUz7vDVT.js → page-shell-DD_mHkHn.js} +1 -1
- package/dist/assets/{pairing-page-B93qLwkU.js → pairing-page-CI_qOlWo.js} +1 -1
- package/dist/assets/{pdf-file-preview-aTyWAALx.js → pdf-file-preview-5NsoLZLI.js} +1 -1
- package/dist/assets/{pdf-preview-CFuSHh-t.js → pdf-preview-DEWKJD0r.js} +2 -2
- package/dist/assets/{personality-page-Do1Q8mUB.js → personality-page-CI8jnXQp.js} +1 -1
- package/dist/assets/{plans-page-CxRb_Kby.js → plans-page-BlxaE-cv.js} +1 -1
- package/dist/assets/{platform-detection-BIfuAgU8.js → platform-detection-D4gxJctC.js} +1 -1
- package/dist/assets/{platform-login-notice-CaNQOYUj.js → platform-login-notice-CM-AbOQ7.js} +1 -1
- package/dist/assets/{platform-loopback-page-205CvkDI.js → platform-loopback-page-BLNuk6f2.js} +1 -1
- package/dist/assets/{preview-error-CdFTgKSI.js → preview-error-B-1p750d.js} +1 -1
- package/dist/assets/{privacy-page-Beg9rE7-.js → privacy-page-0K-bsvKl.js} +1 -1
- package/dist/assets/{privacy-screen-EFJ-aTdl.js → privacy-screen-DgDOXFfw.js} +1 -1
- package/dist/assets/profile-pickers-DBCSE_FG.js +1 -0
- package/dist/assets/{provider-callback-page-BKDWiQis.js → provider-callback-page-BN9NQV7v.js} +1 -1
- package/dist/assets/{provider-signup-page-CsCS7GAV.js → provider-signup-page-CTwmzSoF.js} +1 -1
- package/dist/assets/{provisioning-targets-CSwI177z.js → provisioning-targets-CFe7Jgy1.js} +1 -1
- package/dist/assets/{push-registration-CVotM2hK.js → push-registration-CIhXf1CF.js} +2 -2
- package/dist/assets/{remove-from-device-dialog-BGul1xBz.js → remove-from-device-dialog-DSScuMVd.js} +1 -1
- package/dist/assets/{research-mock-page-DDwmtrZR.js → research-mock-page-bhSrGrBh.js} +1 -1
- package/dist/assets/research-onboarding-route-CKyfP6oo.js +50 -0
- package/dist/assets/{research-results-view-DDjp2hBc.js → research-results-view-7psD5IrG.js} +1 -1
- package/dist/assets/{retire-confirm-dialog-Cz64ywTF.js → retire-confirm-dialog-BD1rkM8j.js} +1 -1
- package/dist/assets/{review-terms-screen-Bros6R87.js → review-terms-screen-XIGeusDw.js} +1 -1
- package/dist/assets/routes-lLsbgbrj.js +24 -0
- package/dist/assets/{runtime-upgrade-banner-WHzYN73y.js → runtime-upgrade-banner-BeO8tW05.js} +2 -2
- package/dist/assets/{sandbox-bridge-ajRoXgYL.js → sandbox-bridge-BismgxxG.js} +1 -1
- package/dist/assets/{schedules-DjkLl0OP.js → schedules-DVJx5NG9.js} +1 -1
- package/dist/assets/schedules-page-DRr8EB5D.js +1 -0
- package/dist/assets/{select-assistant-screen-CALuntMj.js → select-assistant-screen-Cbta9HDV.js} +1 -1
- package/dist/assets/{self-hosted-servers-CsywZANM.js → self-hosted-servers-omz1yNrQ.js} +1 -1
- package/dist/assets/{setting-row-JYdvkVjj.js → setting-row-BgrWOMW9.js} +1 -1
- package/dist/assets/settings-DKVDS49I.js +1 -0
- package/dist/assets/{settings-divider-gaQk2Yl5.js → settings-divider-HtBTQzlA.js} +1 -1
- package/dist/assets/{settings-layout-vTkMzpIY.js → settings-layout-BdUaFkyr.js} +1 -1
- package/dist/assets/{settings-navigation-Dp0sDZAh.js → settings-navigation-vp8wtiyE.js} +1 -1
- package/dist/assets/{share-feedback-modal-DiQP_cCZ.js → share-feedback-modal-D9fAEU5y.js} +2 -2
- package/dist/assets/{sidebar-tree-CSPhTnBf.js → sidebar-tree-9BVzkS4K.js} +1 -1
- package/dist/assets/{signup-page-B2mbu3qd.js → signup-page-lzOszv4S.js} +1 -1
- package/dist/assets/{site-favicon-dST102dp.js → site-favicon-BvIzxzVw.js} +1 -1
- package/dist/assets/{skill-detail-page-BZO12fh5.js → skill-detail-page-BdSINra9.js} +2 -2
- package/dist/assets/skill-detail-panel-88oHOdSH.js +1 -0
- package/dist/assets/{skills-DdBQ-tNs.js → skills-HuNDpwX2.js} +1 -1
- package/dist/assets/{sounds-page-sGA-Nc8o.js → sounds-page-CeZjxvIu.js} +1 -1
- package/dist/assets/{src-DjIqxQVd.js → src-njXJqrpo.js} +3 -3
- package/dist/assets/{start-screen-DeVoGKX1.js → start-screen-B1dP4bbA.js} +1 -1
- package/dist/assets/status-badge-pill-BuiIFTz-.js +1 -0
- package/dist/assets/stt-language-picker-modal-BK_1xcYe.js +1 -0
- package/dist/assets/subagent-detail-panel-CkxNHVOv.js +4 -0
- package/dist/assets/{subagent-store-ChHk8ZsH.js → subagent-store-B0Ftpguk.js} +1 -1
- package/dist/assets/{superpowers-page-Dk3g_Of2.js → superpowers-page-B_1_d4LI.js} +1 -1
- package/dist/assets/{system-events-page-XYxGo8gh.js → system-events-page-BBVNKwBJ.js} +1 -1
- package/dist/assets/{telegram-setup-wizard-DgdjP2o8.js → telegram-setup-wizard-D_Vwl3_I.js} +1 -1
- package/dist/assets/{text-preview-BJRoXOON.js → text-preview-BIeJHE0-.js} +1 -1
- package/dist/assets/{theme-stage-page-DPIsJBUJ.js → theme-stage-page-gWlI1Nzt.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Cjd5FCBm.js → tiptap-document-editor-BunsgiVU.js} +1 -1
- package/dist/assets/toggle-ibKLySIy.js +1 -0
- package/dist/assets/{tool-detail-panel-CeDWOdH-.js → tool-detail-panel-DhzIzJ1Y.js} +2 -2
- package/dist/assets/{upgrade-cancel-page-D24RCdAz.js → upgrade-cancel-page-BiXIXlae.js} +1 -1
- package/dist/assets/{upgrade-success-page-A6d7PRGt.js → upgrade-success-page-C3ptzfvo.js} +1 -1
- package/dist/assets/{use-assistant-capability-CYKqSbfq.js → use-assistant-capability-B55Ji4gD.js} +1 -1
- package/dist/assets/use-assistant-identity-details-0JMOrf_F.js +1 -0
- package/dist/assets/{use-attachment-preview-DvVweDZY.js → use-attachment-preview-jmFGN8h6.js} +2 -2
- package/dist/assets/{use-attachment-squares-ELH7PQrT.js → use-attachment-squares-BSKsILdv.js} +1 -1
- package/dist/assets/{use-bookmarks-B4g9FKC7.js → use-bookmarks-gJWrPT2g.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-CkeQGnJ0.js → use-checkout-dismiss-refresh-vVysV2xK.js} +1 -1
- package/dist/assets/{use-command-palette-sections-D0RCkx0m.js → use-command-palette-sections-BFV15eUp.js} +1 -1
- package/dist/assets/{use-copy-to-clipboard-oZUc3_ey.js → use-copy-to-clipboard-BeG7f_tZ.js} +1 -1
- package/dist/assets/{use-edge-swipe-Bde-t-dW.js → use-edge-swipe-BxVxJfNS.js} +1 -1
- package/dist/assets/use-edge-swipe-back-DpMHlX97.js +2 -0
- package/dist/assets/{use-edit-app-BZv0JIfX.js → use-edit-app-BlsO9Zav.js} +1 -1
- package/dist/assets/use-element-size-DeouS2c2.js +1 -0
- package/dist/assets/use-invite-link-dialog-TjRVy1GF.js +1 -0
- package/dist/assets/{use-is-org-ready-CWNhmJ2b.js → use-is-org-ready-DyYOTCvQ.js} +1 -1
- package/dist/assets/{use-onboarding-login-Zjbfg9rl.js → use-onboarding-login-DMUDDVUi.js} +1 -1
- package/dist/assets/{use-platform-assistant-id-Bafo85js.js → use-platform-assistant-id-BE6AIost.js} +1 -1
- package/dist/assets/{use-platform-gate-DzpdjzIz.js → use-platform-gate-zft2-meL.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-pEcvMXUl.js → use-return-to-short-circuit-LcamIc_k.js} +1 -1
- package/dist/assets/use-side-list-room-C1msxm__.js +1 -0
- package/dist/assets/{use-skill-actions-CeeCY9Uf.js → use-skill-actions-oBpczwnY.js} +1 -1
- package/dist/assets/use-sticky-profiles-D6xRVCOS.js +1 -0
- package/dist/assets/use-stt-language-selection-D7DxP7Eo.js +1 -0
- package/dist/assets/{use-subagent-card-data-BIb6t3HE.js → use-subagent-card-data-DOp8Etmj.js} +1 -1
- package/dist/assets/use-touch-mobile-CXJ4hTiW.js +1 -0
- package/dist/assets/{use-transcript-message-by-id-DUV4woMl.js → use-transcript-message-by-id-D5hHvanI.js} +1 -1
- package/dist/assets/{use-transcript-messages-BLtVYqAv.js → use-transcript-messages-BL55GFRr.js} +1 -1
- package/dist/assets/{use-voice-sample-preview-BY_J5WVl.js → use-voice-sample-preview-CLWX7j-h.js} +1 -1
- package/dist/assets/{useTranslation-Dn8TOHE6.js → useTranslation-DxUSOwQs.js} +1 -1
- package/dist/assets/{viewer-store-D3KM2E2N.js → viewer-store-DWY4BtGj.js} +1 -1
- package/dist/assets/voice-page-C3q84Y4H.js +1 -0
- package/dist/assets/{voice-providers-note-BLOdThkh.js → voice-providers-note-CuMBTzti.js} +1 -1
- package/dist/assets/{web-D8nAsA9l.js → web-S8v4qZ8W.js} +1 -1
- package/dist/assets/{web-5yJbtoui.js → web-zM0OZM8V.js} +1 -1
- package/dist/assets/{welcome-screen-U_A3pIDj.js → welcome-screen-Cy46Bw63.js} +1 -1
- package/dist/assets/workflow-detail-panel-CM1Jep4m.js +1 -0
- package/dist/assets/{workflow-store-Dgz97WCS.js → workflow-store-Bpg1fqWU.js} +1 -1
- package/dist/assets/workspace-page-eCfV4q3_.js +1 -0
- package/dist/assets/{workspace-tree-query-C6kx2Bkh.js → workspace-tree-query-BfWSVQB5.js} +1 -1
- package/dist/index.html +109 -108
- package/package.json +1 -1
- package/dist/assets/activity-steps-panel-DEgGLFtM.js +0 -1
- package/dist/assets/ai-page--36Riirz.js +0 -1
- package/dist/assets/channels-page-route-CoHtlp77.js +0 -9
- package/dist/assets/chat-5s_HqBzL.js +0 -3
- package/dist/assets/chat-markdown-message-Btoc6C1G.js +0 -1
- package/dist/assets/checkout-return-target-CYf9SBig.js +0 -1
- package/dist/assets/command-palette-D79Jq26W.js +0 -1
- package/dist/assets/contacts-page-route-9Y1S_HAN.js +0 -1
- package/dist/assets/credentials-page-BVg_keF0.js +0 -1
- package/dist/assets/debug-page-4N-Zj-ts.js +0 -4
- package/dist/assets/developer-page-CQS354Wk.js +0 -1
- package/dist/assets/esm-b7JWOeNl.js +0 -2
- package/dist/assets/file-editor-CSWBRXC5.js +0 -1
- package/dist/assets/file-markdown-CyzsCI8p.js +0 -2
- package/dist/assets/first-run-scope-Cc45jqTq.js +0 -1
- package/dist/assets/general-page-C3gmPYF3.js +0 -1
- package/dist/assets/identity-page-route-D7kzw3D3.js +0 -7
- package/dist/assets/index-BPNYOrwT.css +0 -2
- package/dist/assets/inspect-page-EDi2BOrZ.js +0 -9
- package/dist/assets/integrations-page-DC4dbZvc.js +0 -1
- package/dist/assets/latest-assistant-text-Bhqw0WEB.js +0 -24
- package/dist/assets/mobile-sidebar-drawer-CA_YsRi_.js +0 -1
- package/dist/assets/native-anchor-txt0veYo.js +0 -1
- package/dist/assets/native-deep-link-EZIezcy9.js +0 -1
- package/dist/assets/open-workspace-file-D2FXjNVn.js +0 -2
- package/dist/assets/profile-pickers-CKLILvRc.js +0 -1
- package/dist/assets/research-onboarding-route-BviJKsoz.js +0 -50
- package/dist/assets/routes-Q2DdFIGG.js +0 -24
- package/dist/assets/schedules-page-Bodkcg3J.js +0 -1
- package/dist/assets/settings-DGaRub9k.js +0 -1
- package/dist/assets/skill-detail-panel-CEepQHmY.js +0 -1
- package/dist/assets/status-badge-pill-DxtUb8z3.js +0 -1
- package/dist/assets/stt-language-picker-modal-CihIASi8.js +0 -1
- package/dist/assets/subagent-detail-panel-C9Y7dfKo.js +0 -4
- package/dist/assets/toggle-C-v4x7_A.js +0 -1
- package/dist/assets/use-assistant-identity-details-BVjzLgp6.js +0 -1
- package/dist/assets/use-edge-swipe-back-BWEVQPEJ.js +0 -2
- package/dist/assets/use-element-size-G76uplCp.js +0 -1
- package/dist/assets/use-invite-link-dialog-DgDcqWMz.js +0 -1
- package/dist/assets/use-sticky-profiles-BN2tBekP.js +0 -1
- package/dist/assets/use-touch-mobile-JVxY9M-0.js +0 -1
- package/dist/assets/voice-list-uy2Kwdwg.js +0 -1
- package/dist/assets/voice-page-Bi7r475U.js +0 -1
- package/dist/assets/workflow-detail-panel-fguePScg.js +0 -1
- package/dist/assets/workspace-page-Cp11wrja.js +0 -1
- /package/dist/assets/{a2a-invite-B5XOcUL6.js → a2a-invite-BNCOmr8h.js} +0 -0
- /package/dist/assets/{account-IaNiNsKu.js → account-CtIKBm9p.js} +0 -0
- /package/dist/assets/{android-consumption-only-eY-NLtwG.js → android-consumption-only-CwC2kibz.js} +0 -0
- /package/dist/assets/{animated-avatar-D9mX2duB.js → animated-avatar--_W54iT9.js} +0 -0
- /package/dist/assets/{app-info-xT5AH6o4.js → app-info-DFgKdE7W.js} +0 -0
- /package/dist/assets/{app-types-B4-pVNnY.js → app-types-BY00pXhT.js} +0 -0
- /package/dist/assets/{apple-logo-CVMvoWvp.js → apple-logo-Biu93CTa.js} +0 -0
- /package/dist/assets/{archive-redirect-page-CfCci8ho.js → archive-redirect-page-bx5xRoCl.js} +0 -0
- /package/dist/assets/{avatar-renderer-khj83dWw.js → avatar-renderer-Bja-CJEM.js} +0 -0
- /package/dist/assets/{avatar-subagent-B68bxt0O.js → avatar-subagent-C1J2pUFc.js} +0 -0
- /package/dist/assets/{avatar-tone-CQWYpANf.js → avatar-tone-CTq4cNAY.js} +0 -0
- /package/dist/assets/{billing-redirect-page-XcpsfvIl.js → billing-redirect-page-Dp-j37M1.js} +0 -0
- /package/dist/assets/{build.umd-Bg-JE3PW.js → build.umd-CKImEzO1.js} +0 -0
- /package/dist/assets/{channels-DkTY8D9c.js → channels-C4uOLymq.js} +0 -0
- /package/dist/assets/{common-XXvgM1Lv.js → common-CPxc0tHz.js} +0 -0
- /package/dist/assets/{community-page-CB9oMqgC.js → community-page-D1uzvBFw.js} +0 -0
- /package/dist/assets/{contacts-gateway-D0hHW9dI.js → contacts-gateway-Dp40T_dj.js} +0 -0
- /package/dist/assets/{contacts-Dnxb4zeF.js → contacts-pvrehYPe.js} +0 -0
- /package/dist/assets/{copy-to-clipboard-SOu7HUET.js → copy-to-clipboard-DRZUoOti.js} +0 -0
- /package/dist/assets/{credential-requests-DvnleKK2.js → credential-requests-BsmEdX7t.js} +0 -0
- /package/dist/assets/{danger-zone-redirect-page-BIYa_At7.js → danger-zone-redirect-page-DY3LtITR.js} +0 -0
- /package/dist/assets/{definitions-BLBMbDPd.js → definitions-BNyfuzue.js} +0 -0
- /package/dist/assets/{definitions-BLHO5zVb.js → definitions-DMGv-AVM.js} +0 -0
- /package/dist/assets/{devices-redirect-page-DJtEpVr7.js → devices-redirect-page-BXqfVWSd.js} +0 -0
- /package/dist/assets/{dictation-overlay-page-DLZGCPP_.js → dictation-overlay-page-DR63_PvH.js} +0 -0
- /package/dist/assets/{diff-rows-C_ARHWq3.js → diff-rows-ZG9FwscH.js} +0 -0
- /package/dist/assets/{edit-chat-session-CcwN_rea.js → edit-chat-session-B38z6oPP.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-BGlYkVas.js → emoji-catalog-data-Dqyvj5Ne.js} +0 -0
- /package/dist/assets/{environment-store-CR6vnG9G.js → environment-store-DCU3hheH.js} +0 -0
- /package/dist/assets/{esm-DgDCYysh.js → esm-Bbh10TA1.js} +0 -0
- /package/dist/assets/{esm-BYiovSCx.js → esm-C0OhtIaa.js} +0 -0
- /package/dist/assets/{format-date-Cl5z8sZt.js → format-date-mZFhGVxR.js} +0 -0
- /package/dist/assets/{format-file-size-B3w8pfkS.js → format-file-size-D7QcCVUg.js} +0 -0
- /package/dist/assets/{home-CF1B7GqE.js → home-CoA1W6RA.js} +0 -0
- /package/dist/assets/{intelligence-Dcw50PsN.js → intelligence-Bpz4mQfO.js} +0 -0
- /package/dist/assets/{keyboard-shortcuts-redirect-page-BSNa3QLh.js → keyboard-shortcuts-redirect-page-BUEUuL5W.js} +0 -0
- /package/dist/assets/{library-CCXCwc6z.js → library-CxAscKuj.js} +0 -0
- /package/dist/assets/{link-click-BhQuhukA.js → link-click-c4p6nI2M.js} +0 -0
- /package/dist/assets/{logs-nlP1em1X.js → logs-BlQUbg5S.js} +0 -0
- /package/dist/assets/{machine-sizes-Bx2eSjOW.js → machine-sizes-D5IsW7GE.js} +0 -0
- /package/dist/assets/{onboarding-C6ZFK4YA.js → onboarding-C-LQqXEa.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-CFCN1Nnk.js → onboarding-step-layout-Cksqlmsb.js} +0 -0
- /package/dist/assets/{optimistic-lifecycle-EXwQgNvb.js → optimistic-lifecycle-DIWfvuIw.js} +0 -0
- /package/dist/assets/{page-empty-state-DRbcD4aa.js → page-empty-state-Df3EP_DE.js} +0 -0
- /package/dist/assets/{password-reset-page-Cmbeaggq.js → password-reset-page-0k2eeyou.js} +0 -0
- /package/dist/assets/{pdf-BUxbm1S7.js → pdf-CpDfklza.js} +0 -0
- /package/dist/assets/{plugin-attribution-B_3pbh6m.js → plugin-attribution-TebhIznA.js} +0 -0
- /package/dist/assets/{plugin-detail-page-C0zaBBon.js → plugin-detail-page-N3j9G0yc.js} +0 -0
- /package/dist/assets/{plugins-page-BuN35WCX.js → plugins-page-BPSPELgG.js} +0 -0
- /package/dist/assets/{preview-skeleton-BLpm3j7s.js → preview-skeleton-BreSI6Ln.js} +0 -0
- /package/dist/assets/{profile-metadata-BxP0WOpJ.js → profile-metadata-DAXhAdlI.js} +0 -0
- /package/dist/assets/{provider-key-CzUfGGE_.js → provider-key-CR8jz-eM.js} +0 -0
- /package/dist/assets/{quick-input-page-DYc7eXbP.js → quick-input-page-Mw2f8F3_.js} +0 -0
- /package/dist/assets/{radio-card-nav-BOpJqAoO.js → radio-card-nav-BubfTKOh.js} +0 -0
- /package/dist/assets/{remote-web-COoOfi7K.js → remote-web-Di_UF41i.js} +0 -0
- /package/dist/assets/{schedules-DhrUSTxo.js → schedules-BaUXJBRS.js} +0 -0
- /package/dist/assets/{schedules-630osdOz.js → schedules-JL1Laub-.js} +0 -0
- /package/dist/assets/{security-redirect-page-D9_08zix.js → security-redirect-page-Ce11_hfW.js} +0 -0
- /package/dist/assets/{signup-shell-BLq9UcAD.js → signup-shell-XnqyIHQa.js} +0 -0
- /package/dist/assets/{skill-icon-BEzVeada.js → skill-icon-xO9VGnPV.js} +0 -0
- /package/dist/assets/{skills-page-CpajWLSk.js → skills-page-bnp9x1iR.js} +0 -0
- /package/dist/assets/{system-events-redirect-page-CdqIVW5m.js → system-events-redirect-page-W8knAadR.js} +0 -0
- /package/dist/assets/{terminal-B8-uO_zb.js → terminal-B4go-vP8.js} +0 -0
- /package/dist/assets/{three-dot-indicator-BFNMvd3i.js → three-dot-indicator-BhUevb3V.js} +0 -0
- /package/dist/assets/{usage-redirect-page-Bk755PQU.js → usage-redirect-page-DXcbB81p.js} +0 -0
- /package/dist/assets/{use-active-assistant-id-Cgt1z2rZ.js → use-active-assistant-id-Btl1-4sB.js} +0 -0
- /package/dist/assets/{use-local-file-info-CowxNLsG.js → use-local-file-info-Dz017Fii.js} +0 -0
- /package/dist/assets/{use-skill-detail-files-2agjQ-pp.js → use-skill-detail-files-Bzwall4_.js} +0 -0
- /package/dist/assets/{use-supports-credentials-settings-BBUFotal.js → use-supports-credentials-settings-D9oEIOk9.js} +0 -0
- /package/dist/assets/{weather-forecast-display-BMFPvW83.js → weather-forecast-display-BRi0CN73.js} +0 -0
- /package/dist/assets/{web-DT7CHk3X.js → web-Bc0yxcTg.js} +0 -0
- /package/dist/assets/{web-CnTPI_xz.js → web-DUcCWo6-.js} +0 -0
- /package/dist/assets/{web-CpFPB7iN.js → web-DnUU5XRV.js} +0 -0
- /package/dist/assets/{web-DfzBW3mJ.js → web-DoWs0tX8.js} +0 -0
- /package/dist/assets/{web-BXqKHeFH.js → web-DprnafKw.js} +0 -0
- /package/dist/assets/{web-fHk-S0Kt.js → web-bVuMezJ9.js} +0 -0
- /package/dist/assets/{web-D2fHQj5v.js → web-xXRFVuHp.js} +0 -0
- /package/dist/assets/{workspace-CCzLdd4F.js → workspace-B3DIYRpz.js} +0 -0
- /package/dist/assets/{xterm-CfcAttTO.js → xterm-5SK_xX72.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-CmOTEB5O.js → xterm-addon-fit-Bov_2YwK.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{d as r,n as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{c as a,g as o,n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./typography-BeUa5Fd-.js";import{t as f}from"./createLucideIcon-C_IfoPaZ.js";import{t as p}from"./arrow-right-BWL8Hl6K.js";import{t as m}from"./check-CNBoUiyR.js";import{t as h}from"./circle-alert-DEIiXMF-.js";import{t as g}from"./circle-check-BG2g8udA.js";import{t as _}from"./coins-B6rJlYQ0.js";import{t as v}from"./cpu-BO_MyzHO.js";import{t as y}from"./hard-drive-BxeWK7dU.js";import{t as b}from"./info-Bjcv3rf9.js";import{t as x}from"./loader-circle-oY5laABh.js";import{t as S}from"./mail-B0iH8Wii.js";import{t as C}from"./triangle-alert-C5SOfs-q.js";import{t as w}from"./notice-C9v3KOP3.js";import{t as T}from"./modal-Bt1DPFgW.js";import{n as E}from"./toast-BrKo5b4d.js";import{t as ee}from"./confirm-dialog-DNaRfy4W.js";import{t as D}from"./select-B86W_Hs8.js";import{n as O}from"./resolved-assistants-store-BuqctGKE.js";import{Z as k,d as te,f as A,p as j,tt as ne,u as M}from"./auth-store-BDMYc7te.js";import{F as re,L as ie,p as ae}from"./platform-detection-BIfuAgU8.js";import{d as N}from"./routes-C293MsBG.js";import{n as P}from"./use-assistant-avatar--hNHYiPK.js";import{r as oe}from"./use-is-org-ready-CWNhmJ2b.js";import{n as se,r as F}from"./browser-CZ10MkOr.js";import{C as ce,O as le,Ot as ue,c as de,ct as fe,dt as pe,ft as me,l as he,lt as ge,nt as _e,ot as I,pt as L,r as ve,rt as R,ut as ye,y as be}from"./react-query.gen-CqLxrlpP.js";import{t as xe}from"./avatar-bundled-components-OjPlNcdB.js";import{r as z}from"./use-avatar-accent-var-DzqC3Diq.js";import{t as B}from"./misc-wmny7PlA.js";import{n as V,t as Se}from"./avatar-tone-CQWYpANf.js";import{n as H}from"./use-bundled-avatar-components-B4YxFEiT.js";import{t as Ce}from"./chat-avatar-B1G491hG.js";import{t as we}from"./avatar-renderer-khj83dWw.js";import{t as Te}from"./android-consumption-only-eY-NLtwG.js";import{c as Ee,i as De,l as Oe,n as U,r as ke,t as Ae}from"./machine-sizes-Bx2eSjOW.js";import{a as je,i as Me,n as Ne,r as Pe,t as Fe}from"./provisioning-targets-CSwI177z.js";import{t as Ie}from"./environment-store-CR6vnG9G.js";var W=f(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),G=u();function Le({children:e,redirectToBilling:t=!1}){return ae()?t?(0,G.jsx)(i,{replace:!0,to:N.settings.usageBilling}):(0,G.jsx)(w,{tone:`info`,children:Te}):e}var K=e(t(),1);function Re({icon:e}){return(0,G.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,G.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var ze={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function Be({title:e,subtitle:t}){return(0,G.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,G.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:ze,children:e}),t&&(0,G.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Ve=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],q=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function J({variant:e=`full`}){let t=H();return t?(0,G.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?q:Ve).map((e,n)=>(0,G.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,G.jsx)(we,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var He={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Ue={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},We={upgrade:He,downgrade:Ue,change:Ue};function Y(e=`upgrade`){return We[e]}function X(e,t=!0){let{data:n}=c({...ve(),enabled:t&&e==null}),{data:r}=c({...le({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Z({assistantId:e,direction:t}){let i=r(),a=X(e,oe())?.name||`your assistant`;return(0,G.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,G.jsx)(J,{variant:`full`}),(0,G.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,G.jsx)(Be,{title:`You're all set!`,subtitle:Y(t).completeSubtitle}),(0,G.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,G.jsxs)(n,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&k(e),i(N.assistant,{replace:!0})},children:[`Return to `,a]})})]})]})}function Ge(e=!0,t){let n=X(t,e),r=t??n?.id,{data:i,isError:a,isFetching:o,dataUpdatedAt:s,errorUpdatedAt:l}=c({...de({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:a,domainsFetching:o,domainsUpdatedAt:s,domainsErrorUpdatedAt:l}}var Ke=1e3,qe=1e4,Je=2500,Ye=2e3,Xe=1e4,Ze=[`machine_size`,`subdomain`,`non_field_errors`],Qe={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},$e={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function et(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:$e[t.error])??Qe[t.error];if(e)return e}for(let e of Ze){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var tt=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,nt=`text-[11px] font-medium text-[var(--content-secondary)]`;function rt({onExit:e,machineBusy:t=!1,assistantId:r}){let i=s(),a=Ie.use.emailRootDomain(),{assistant:o,assistantId:c,domains:u}=Ge(!0,r),d=u?.results[0],[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(`hi`),[g,_]=(0,K.useState)(!1);(0,K.useEffect)(()=>{if(!g){if(d){p(d.subdomain),_(!0);return}!o?.handle||f||(p(o.handle),_(!0))}},[o?.handle,d,g,f]);let[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),S=l(fe()),C=!!d||b,E=S.isPending||b;return(0,K.useEffect)(()=>{if(!b)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[b,e]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(T.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,G.jsx)(J,{variant:`top`}),(0,G.jsx)(Be,{title:`Assistant Email`,subtitle:`Set up an email for your assistant.`}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:nt,children:`Prefix`}),(0,G.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:E||C,readOnly:C,placeholder:`hi`,className:`${tt} w-24`})]}),(0,G.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:nt,children:`Handle (public)`}),(0,G.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:E||C,readOnly:C,autoFocus:!0,placeholder:`my-assistant`,"aria-invalid":!!v,className:`${tt} w-full min-w-0`})]}),(0,G.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,a]})]}),v&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),C&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`This domain has been set and cannot be changed.`})]}),t&&!C&&(0,G.jsx)(w,{tone:`neutral`,children:`Your assistant is restarting — you can set the domain in a moment.`}),!C&&(0,G.jsx)(w,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,G.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:`You won't be able to change the handle once set.`})}),b?(0,G.jsx)(w,{tone:`success`,children:`Domain set — redirecting…`}):null]}),(0,G.jsx)(T.Footer,{className:`items-center pt-6`,children:C?(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:`Continue`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:E,onClick:()=>{E||S.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:`Skip`}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||E||t,onClick:()=>{E||t||!f||S.mutate({body:{subdomain:f,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),x(!0),i.invalidateQueries({queryKey:be()}),i.invalidateQueries({queryKey:he({path:{assistant_id:c??``}})}),i.invalidateQueries({queryKey:pe()})},onError:e=>{y(et(e,`Couldn't register that subdomain. Try a different one.`))}})},children:`Next`})]})})]})}function it({onGoToBilling:e,direction:t}){return(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,G.jsx)(Re,{icon:h}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(d,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,G.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Y(t).fetchErrorBody})]}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:`Go to billing`})]})}function Q(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function $(e){return`${Q(e)}/mo`}function at(e){return`${Q(e)}/month`}function ot(e){return`${e>0?`+`:`−`}${Q(Math.abs(e))}/mo`}function st(e){return`${e} GB storage`}function ct(e){return`${Q(e*100)} of bundled credits`}function lt(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:De[n.machineSize],to:De[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:De[n.machineSize],to:De[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:`Credits`,from:i.from,to:i.to}),a}var ut=60,dt=ut*2;function ft({imageUrl:e,animateIn:t=!0}){return(0,G.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,G.jsx)(`img`,{src:e,alt:``,decoding:`async`,draggable:!1,className:`absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2 object-cover object-center`,style:{filter:`blur(${ut}px)`,width:`calc(100% + ${dt*2}px)`,height:`calc(100% + ${dt*2}px)`}}),(0,G.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function pt(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function mt(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function ht(e){let t=oe(),{data:n}=c({..._e(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function gt(e,t){return t==null?0:mt(e,t)?.credits_usd??pt(t)}function _t(e){let t=ht(e!=null);if(e==null||t==null)return null;let n;if(e.kind===`package`){let r=t.packages.find(t=>t.key===e.packageKey);n=r?.credits_usd??mt(t,r?.credit_tier)?.credits_usd}else n=mt(t,e.creditTier)?.credits_usd;return n==null?null:{fromUsd:0,toUsd:n}}function vt(e){let t=ht(e!=null);if(e==null)return null;let n=gt(t,e.fromTier),r=gt(t,e.toTier);return n==null||r==null?null:{fromUsd:n,toUsd:r}}function yt(e){let t=O.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:i,customImageUrl:a,isLoading:o}=P(n),s=(0,K.useMemo)(()=>A(),[j()]),c=s!=null&&te(s)?s:null,l=n!=null&&!o,u=c!=null&&(n==null||n===c.assistantId),d=u&&!(l&&(r!=null||i!=null||a!=null))?c:null,f=d?d.components:r,p=d?d.traits:i,m=d?null:a,h=l||u,g=z(f,p)??(m?null:(f??xe).colors?.[0]?.hex??null);return{tintHex:h&&g?V(g):Se,backdropImageUrl:h?m:null,ready:h,avatar:{components:f,traits:p,customImageUrl:m}}}function bt(e,t){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(0);return(0,K.useEffect)(()=>{i.current=performance.now()},[]),(0,K.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var xt=`--takeover-surface`,St=`var(${xt},${Se})`,Ct=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,wt=240,Tt=1.414,Et=[{minHeight:680,size:wt},{minHeight:600,size:184}],Dt=132;function Ot(e){for(let t of Et)if(e>=t.minHeight)return t.size;return Dt}function kt(){let[e,t]=(0,K.useState)(()=>Ot(typeof window>`u`?1/0:window.innerHeight));return(0,K.useEffect)(()=>{let e=()=>t(Ot(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var At={machine:v,storage:y,credits:_},jt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function Mt(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function Nt({assistantId:e,mode:t,downsizing:n=!1}){let{avatar:r,ready:i}=yt(e),a=H(),o=kt(),s=t===`working`||t===`settling`;return(0,G.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${jt[i?t:`idle`]}${n?` is-downsizing`:``}`,style:{"--provision-avatar-size":`${o}px`,"--provision-avatar-growth":Tt},children:[(0,G.jsxs)(`div`,{className:`provision-avatar-stage`,children:[(0,G.jsx)(`div`,{"data-testid":`provision-avatar-placeholder`,className:`provision-avatar-placeholder${i?` is-resolved`:``}`}),(0,G.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,G.jsx)(`div`,{className:`provision-avatar-current`,children:(0,G.jsx)(`div`,{className:`provision-avatar-strain`,children:i&&(0,G.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,G.jsx)(Ce,{components:r.components??a,traits:r.traits,customImageUrl:r.customImageUrl,size:o,isAssistantBusy:s})})})})})]}),(0,G.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function Pt({status:e,caption:t}){return(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,G.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:ze,children:e}),t&&(0,G.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Ft({icon:e,label:t,from:n,to:r,done:i=!1,pending:a=!1,testId:o}){let s=null;return i?s=`Complete`:a&&(s=`Pending`),(0,G.jsxs)(`div`,{"data-testid":o,className:`flex min-w-0 flex-auto items-center gap-2 rounded-lg px-2 py-1.5${a?` opacity-70`:``}`,style:{backgroundColor:Ct},children:[(0,G.jsx)(`span`,{className:`hidden h-6 w-6 shrink-0 items-center justify-center min-[420px]:flex`,children:(0,G.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-left wrap-anywhere`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,G.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,G.jsx)(p,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{children:r}),i?(0,G.jsx)(m,{"data-testid":`chip-check`,className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}):a&&(0,G.jsx)(x,{"data-testid":`chip-spinner`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--content-tertiary)] motion-reduce:animate-none`,"aria-hidden":`true`})]}),s&&(0,G.jsx)(`span`,{className:`sr-only`,children:s})]})]})]})}function It({label:e}){return(0,G.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:Ct},children:e})}function Lt({children:e,wide:t=!1,testId:n}){return(0,G.jsx)(`div`,{"data-testid":n,className:`flex w-full ${t?`max-w-2xl`:`max-w-sm`} items-stretch justify-center gap-2`,children:e})}function Rt(e,t){return e===`credits`?!0:t?.[e]===!0}function zt({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let c=_t(e),l=vt(t),u=c??l,d=lt({targets:n,fromSnapshot:r,machineFloor:i,credits:u==null?null:{from:$(u.fromUsd*100),to:$(u.toUsd*100)}}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||Rt(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,K.useState)(p),h=p===m?``:`${p} complete`;return f.length===0?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Lt,{testId:`resource-chips`,wide:f.length>=3,children:f.map(e=>{let t=o||Rt(e.key,a);return(0,G.jsx)(Ft,{testId:`chip-${e.key}`,icon:At[e.key],label:e.label,from:e.from,to:e.to,done:t,pending:!t},e.key)})}),(0,G.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function Bt({intent:e}){if(e.kind===`package`)return(0,G.jsx)(Lt,{children:(0,G.jsx)(It,{label:`${e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)} package`})});let t=[e.machineTier,e.storageTier,e.creditTier].filter(e=>e!=null).length;return(0,G.jsxs)(Lt,{wide:t>=3,children:[e.machineTier!=null&&(0,G.jsx)(Ft,{icon:v,label:`Machine`,to:U[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,G.jsx)(Ft,{icon:y,label:`Storage`,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&(0,G.jsx)(It,{label:`${e.creditTier.replace(`credits_`,``)} credits`})]})}function Vt({state:e,direction:t,softWaiting:r,intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,celebrating:u,onCelebrationEnd:d,assistantId:f,escapeAvailable:p,onEscape:m,onPhaseChange:h,kickError:g,confirm:_,dwellMs:v=Je,phaseMinMs:y=900}){let b=Y(t),x=(0,K.useRef)(d);(0,K.useEffect)(()=>{x.current=d},[d]);let S=bt(e,y),C=S===`DONE`||S===`NOT_APPLICABLE`,w=S===`RESIZING`?`WAITING`:S,T=(0,K.useRef)(h);(0,K.useEffect)(()=>{T.current=h},[h]),(0,K.useEffect)(()=>{T.current?.(S)},[S]);let{tintHex:E,backdropImageUrl:ee}=yt(f),D=u&&C;return(0,K.useEffect)(()=>{if(!D)return;let e=setTimeout(()=>x.current(),v);return()=>clearTimeout(e)},[D,v]),(0,G.jsxs)(`div`,{"data-theme":`dark`,className:`provision-surface-settle relative flex h-full min-h-[420px] w-full flex-col items-center [justify-content:safe_center] gap-10 px-6 py-10 text-center`,style:{[xt]:E,backgroundColor:St},children:[ee&&(0,G.jsx)(ft,{imageUrl:ee}),(0,G.jsx)(Nt,{assistantId:f,mode:Mt(S,r),downsizing:t===`downgrade`}),(0,G.jsx)(`div`,{className:`relative z-10 flex min-h-[144px] w-full flex-col items-center gap-8 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:te()},w)]});function O(e=`Continue in the background`){return p?(0,G.jsx)(n,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:m,children:e}):null}function k({allDone:e=!1,creditsOnly:t=!1}={}){return(0,G.jsx)(zt,{intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,allDone:e,creditsOnly:t})}function te(){if(S===`CONFIRMING`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.confirmingStatus,caption:`This might take a couple seconds.`}),i&&(0,G.jsx)(Bt,{intent:i}),O()]});if(S===`WAITING`||S===`RESIZING`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.waitingStatus,caption:r?`Still working — this can take a minute or two.`:`This might take a couple seconds.`}),k(),O()]});if(S===`DONE`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:`All done!`}),k({allDone:!0})]});if(S===`NOT_APPLICABLE`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:`Your plan is ready`}),k({allDone:!0,creditsOnly:!0})]});if(S===`STALLED`){let e=g!=null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:e?b.snagStatus:`This is taking longer than expected`,caption:e?et(g,b.snagCaption,t):`This may take a couple of minutes.`}),k(),e?O(`Retry in the background`):O()]})}return S===`CONFIRM_TIMEOUT`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.confirmTimeoutStatus,caption:b.confirmTimeoutCaption}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,G.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:_.onGoToBilling,children:`Go to billing`}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:_.onRetry,children:`Try again`})]})]}):null}}function Ht(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!je(n,i);if(je(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Ut=2e3,Wt=1e3,Gt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Kt={assistantId:null,machine:null,storage:null};function qt({open:e,canLowerResources:t=!1,verdictRecheckMs:n=Xe}){let r=s(),i=oe(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(0),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,ee]=(0,K.useState)(Kt),[D,O]=(0,K.useState)(null),[k,te]=(0,K.useState)(!1),A=(0,K.useRef)(!1),j=(0,K.useRef)(!1),M=(0,K.useRef)(0),[re,ie]=(0,K.useState)(!1),[ae,N]=(0,K.useState)(null),[P,se]=(0,K.useState)(null),[F,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(()=>Date.now()),[he,_e]=(0,K.useState)(!0);(0,K.useEffect)(()=>{e||(d(!1),p(0),h(null),_(null),y(null),ie(!1),N(null),se(null),ue(null),_e(!0),x(null),C(null),T(null),ee(Kt),O(null),te(!1),A.current=!1,j.current=!1,M.current+=1)},[e]),(0,K.useEffect)(()=>{e&&(h(Date.now()),r.invalidateQueries({queryKey:L()}),r.invalidateQueries({queryKey:pe()}))},[e,r]);let I=g!=null,R=c({...me(),refetchInterval:e=>e.state.data?.plan_id===`pro`||u?!1:Ke,refetchIntervalInBackground:!1,enabled:e&&i&&!I}),be=(m!=null&&R.dataUpdatedAt>=m?R.data?.plan_id:null)??null;(0,K.useEffect)(()=>{if(!e||I||be!==`pro`)return;let t=Date.now();_(t),fe(t)},[e,I,be]),(0,K.useEffect)(()=>{if(!e||I)return;let t=setTimeout(()=>d(!0),qe);return()=>clearTimeout(t)},[e,I,f]);let xe=(0,K.useCallback)(()=>{d(!1),p(e=>e+1),ne.getState().fetchOrganizations(),r.invalidateQueries({queryKey:L()})},[r]),z=(0,K.useCallback)(()=>{let e=Date.now();y(e),fe(e)},[]),{mutate:B}=l(ge()),V=(0,K.useCallback)(e=>{let t=M.current;B({},{onSuccess:n=>{t===M.current&&(O(null),Ne(n)?j.current?O({error:n.reason??`no_active_pro`}):(j.current=!0,te(!0),e===`escape`&&z()):(x(n.state),e===`escape`&&z()))},onError:e=>{t===M.current&&O(e)}})},[B,z]);(0,K.useEffect)(()=>{!e||!i||!I||A.current||(A.current=!0,V(`auto`))},[e,i,I,V]),(0,K.useEffect)(()=>{if(!k)return;let e=M.current,t=setTimeout(()=>{te(!1),e===M.current&&V(`auto`)},Ye);return()=>clearTimeout(t)},[k,V]);let Se=(0,K.useCallback)(()=>V(`escape`),[V]),H=c({...ye(),enabled:e&&i&&I}),Ce=he?Ut:!1,we=c({...ve(),enabled:e&&i&&I,refetchInterval:e=>e.state.data?.id==null?Ce:!1,retry:!1}),Te=I&&m!=null&&H.dataUpdatedAt>=m,De=Te&&!H.isPending&&!H.isFetching,U=(Te?H.data?.primary_assistant_id:null)??(H.isPending?null:we.data?.id??null),ke=c({...le({path:{id:U??`unresolved`}}),enabled:e&&i&&I&&U!=null,refetchInterval:Ce,retry:!1}),Ie=ce({path:{id:U??`unresolved`}}),W=c({...Ie,enabled:e&&i&&I&&U!=null,refetchInterval:Ce,retry:!1}),G=(0,K.useRef)(0),[Le,Re]=(0,K.useState)(0),ze=o(Ie.queryKey);(0,K.useEffect)(()=>r.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==ze)){if(t.action.type===`fetch`)G.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=G.current,r=e&&Pe(t.action.data);a.schedule(()=>{Re(n),r&&(ie(!0),N(U))})}}}),[r,ze,e,U]);let Be=Pe(W.data),Ve=ae===U,q=H.data,J=(0,K.useMemo)(()=>q?{machineSize:Ee(q.max_machine_tier),storageGib:q.selected_storage_gib??null}:null,[q]),He=q!=null&&q.max_machine_tier==null?Ae:null,Ue=q?q.domain_setup_available&&q.primary_assistant_id!=null:void 0,We=ke.data,Y=(0,K.useMemo)(()=>We?{machineSize:We.machine_size??null,storageGib:We.provisioned_storage_gib??null}:null,[We]),X=F===U,Z=(0,K.useMemo)(()=>{let e=Fe(J,Y),t=J?.machineSize??He;if(t==null)return e;let n=Y?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(X?P?.machineSize:null)??n,i=Oe(t)<Oe(r);return{...e,machine:i?Oe(n)<=Oe(t):Oe(n)>=Oe(t)}},[J,Y,P,X,He]),Ge=je(J,Y),Je=w===U;(0,K.useEffect)(()=>{e&&(Ge?(C(e=>e!=null&&Je?e:Date.now()),T(U)):(C(null),T(null)))},[e,Ge,U,Je]);let Ze=E.assistantId===U;(0,K.useEffect)(()=>{if(!e)return;let t=G.current;ee(e=>{let n=e.assistantId===U?e:Kt,r=Z.machine?n.machine??t:null,i=Z.storage?n.storage??t:null;return e.assistantId===U&&e.machine===r&&e.storage===i?e:{assistantId:U,machine:r,storage:i}})},[e,Z,U]);let Qe=(0,K.useMemo)(()=>{let e=Me(W.data),t=e=>e!=null&&Ze&&Le>e;return{machine:Z.machine&&!e.machine&&t(E.machine),storage:Z.storage&&!e.storage&&t(E.storage)}},[Z,E,Ze,Le,W.data]);(0,K.useEffect)(()=>{!e||!Y||P!=null&&X||(se(Y),ue(U))},[e,Y,U,P,X]);let $e=v??g,et=$e==null?null:Math.max(0,de-$e),tt=!t,{state:nt,softWaiting:rt}=Ht({planId:I?`pro`:be,targets:J,actuals:Y,initialActuals:X?P:null,resizeOperationInFlight:Be,sawOperation:re&&Ve,msSinceWatchStart:et,confirmExpired:u,serverVerdict:b,statusObservedSinceTargetsMet:S!=null&&Je&&W.dataUpdatedAt>S,targetsProveNoop:tt}),it=Gt.includes(nt),Q=e&&I&&!it;(0,K.useEffect)(()=>{_e(Q)},[Q]),(0,K.useEffect)(()=>{if(!e||!I||it)return;let t=setInterval(()=>fe(Date.now()),Wt);return()=>clearInterval(t)},[e,I,it]);let $=!tt&&(b===`started`||b===`in_progress`)&&!(re&&Ve);return(0,K.useEffect)(()=>{if(!e||!I||it||!$)return;let t=setInterval(()=>V(`auto`),n);return()=>clearInterval(t)},[e,I,it,$,n,V]),{state:nt,softWaiting:rt,targets:J,actualsSnapshot:P,machineFloor:He,landed:Qe,assistantId:U,domainStepAvailable:Ue,onboardingSettled:De,confirmError:!I&&R.isError,targetsError:I&&H.isError&&(!q||!Te),escapeEligible:et!=null&&et>=6e4,retryConfirm:xe,kickProvisioning:Se,kickError:D}}var Jt=200,Yt=380;function Xt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Zt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Qt=e=>e===`DONE`||e===`NOT_APPLICABLE`,$t={machineSize:null,storageGib:null};function en({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:i=`checkout`,resizeContext:a}){let o=i===`resize`,c=s(),[l,u]=(0,K.useState)(`provisioning`),[d,f]=(0,K.useState)(`idle`),p=(0,K.useRef)([]),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),S=o?a?.direction:void 0,C=Y(S),w=qt({open:e,canLowerResources:o?a?.canLowerResources===!0:!1}),D=(0,K.useRef)(!1);(0,K.useEffect)(()=>{if(e){D.current=!0,h(o?null:ie()),y(e=>e??Date.now());return}p.current.forEach(clearTimeout),p.current=[],u(`provisioning`),f(`idle`),_(null),y(null),x(!1),D.current&&(D.current=!1,M())},[e,o]),(0,K.useEffect)(()=>()=>{p.current.forEach(clearTimeout)},[]),(0,K.useEffect)(()=>{l===`complete`&&re()},[l]);let O=Zt(w.state),k=Qt(g??w.state),{targets:te,assistantId:A,domainStepAvailable:j,onboardingSettled:ne}=w,ae=o?a?.fromSnapshot:void 0,N=w.actualsSnapshot,P={machineSize:ae?.machineSize??N?.machineSize??null,storageGib:ae?.storageGib??N?.storageGib??null},{tintHex:oe,backdropImageUrl:se}=yt(A),F=o&&j===!0,{domains:ce,domainsError:le,domainsFetching:ue,domainsUpdatedAt:de,domainsErrorUpdatedAt:fe}=Ge(e&&F,A),pe=(ce?.results.length??0)>0,me=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!e){me.current=null;return}!F||A==null||me.current!==A&&(me.current=A,c.invalidateQueries({queryKey:he({path:{assistant_id:A}})}))},[e,F,A,c]);let ge=!ue&&(v!=null&&de>=v||v!=null&&!!le&&fe>=v),[_e,I]=(0,K.useState)(!1),L=ne&&(!F||ge);(0,K.useEffect)(()=>{if(!e){I(!1);return}L&&I(!0)},[e,L]);let ve=(0,K.useCallback)(()=>{let e=o?j===!0&&!pe?`domain`:`complete`:j===!1?`complete`:`domain`;if(Xt()){u(e);return}f(`covering`),p.current.push(setTimeout(()=>{u(e),f(`revealing`),p.current.push(setTimeout(()=>f(`idle`),Yt))},Jt))},[j,o,pe]),R=(0,K.useCallback)(()=>{x(!0)},[]),ye=(0,K.useCallback)(()=>{w.kickProvisioning(),E.info(w.kickError==null?C.backgroundExitToast:C.backgroundRetryToast),x(!1),t()},[w,t,C]),be=(0,K.useCallback)(()=>{x(!1)},[]),xe=l===`provisioning`&&(w.confirmError||w.targetsError),z=l===`provisioning`&&!xe,B=z&&!k,V=`transition-[background-color] duration-300 ease-out${z?` bg-black p-0`:``}`,Se=z?`[animation:fadeIn_0.45s_ease-out_both]`:d===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(T.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(T.Content,{size:`md`,hideCloseButton:l!==`complete`,dismissOnOverlayClick:!B,onEscapeKeyDown:B?e=>e.preventDefault():void 0,onInteractOutside:B?e=>e.preventDefault():void 0,"data-theme":z?`dark`:void 0,overlayClassName:V,className:z?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[xt]:oe},children:[(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${Se}`,children:H()},l),d!==`idle`&&(0,G.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${d===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:St},children:se&&(0,G.jsx)(ft,{imageUrl:se,animateIn:!1})})]})}),(0,G.jsx)(ee,{open:b&&O,title:`Continue in the background?`,message:C.backgroundConfirmMessage,confirmLabel:`Continue`,cancelLabel:`Keep waiting`,onConfirm:ye,onCancel:be})]});function H(){return l===`provisioning`?w.confirmError||w.targetsError?(0,G.jsx)(it,{onGoToBilling:t,direction:S}):(0,G.jsx)(Vt,{state:w.state,direction:S,softWaiting:w.softWaiting,intent:m,creditsChange:o?a?.credits:void 0,targets:te??$t,fromSnapshot:P,machineFloor:w.machineFloor,landed:w.landed,celebrating:_e,onCelebrationEnd:ve,assistantId:A,escapeAvailable:O&&w.escapeEligible,onEscape:R,onPhaseChange:_,kickError:w.kickError,confirm:{onRetry:w.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):l===`domain`?(0,G.jsx)(rt,{machineBusy:O,assistantId:A,onExit:()=>u(`complete`)}):(0,G.jsx)(Z,{assistantId:A,direction:S})}}function tn(e){return e!=null&&!e.customized}function nn(e){return tn(e)?e.name:`Custom`}var rn=[`mighty`,`super`,`ultra`],an=[`free`,...rn];function on(e){return an.indexOf(e)}function sn(e,t){if(e===null)return`upgrade`;let n=on(e),r=on(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function cn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>rn.indexOf(e.key)-rn.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var ln={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function un({tier:e,size:t=40}){let n=ln[e]??ln.free,r=H();return(0,G.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,G.jsx)(we,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,G.jsx)(`div`,{style:{width:t,height:t}})})}var dn={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function fn(e){return dn[e]}function pn(e){return`Downgrade to ${e}`}var mn=`Small`;function hn(e){return e?.machine_size?De[e.machine_size]??e.machine_size:mn}function gn(e){let t=e.credits_usd??0,n=fn(e.key)?.extraFeatures??[];return[{icon:W,label:`${hn(e)} Machine`},{icon:y,label:`${e.storage_gib} GB Storage`},{icon:_,label:`${Q(t*100)} in credits included`},...n.map(e=>({icon:S,label:e}))]}function _n(){return[{icon:W,label:`${mn} Machine`},{icon:y,label:`4 GB Storage`},{icon:_,label:`Pay as you go credits`}]}function vn(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=ke[e?.machine_size??`small`];return[`${hn(e)} machine${i?` (${i})`:``}`,st(r),ct(n),...t]}var yn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function bn(e,t){let n=[`${e.machineTier?U[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:mn} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=mt(t,e.creditTier)?.credits_usd??pt(e.creditTier);n.push(r==null?`Credit bundle`:`${r} credits/mo`)}return n}function xn(e,t){let n=new Set([yn.machine]);return e.storageGib!=null&&n.add(yn.storage),e.creditTier!=null&&n.add(yn.credits),[...bn(e,t),...t.included_features.filter(e=>!n.has(e))]}var Sn=`billing-portal-return-snapshot`;function Cn(e){try{sessionStorage.removeItem(Sn),sessionStorage.setItem(Sn,JSON.stringify(e))}catch{}}function wn(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Sn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Tn(){try{sessionStorage.removeItem(Sn)}catch{}}function En(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Dn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function On(e){return e?e.cancel_at??e.current_period_end??null:null}function kn(e){let t=s();return(0,K.useEffect)(()=>F(()=>{t.invalidateQueries(me())}),[t]),ue({onSuccess:t=>{e&&Cn(e),se(t.portal_url)},onError:()=>{E.error(`Couldn't open the billing portal. Please try again.`,{id:`billing-portal-session-error`})}})}function An(e){return e.disabled===!0}function jn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let c=(0,K.useMemo)(()=>e.map(e=>{let t=U[e.tier]??e.label,n=o==null?`+${$(e.price_cents)}`:e.price_cents===o?`(${$(e.price_cents)}, current)`:ot(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:An(e)}}),[e,o]),l=(0,K.useMemo)(()=>t.map(e=>{let t=s==null?`+${$(e.price_cents)}`:e.price_cents===s?`(${$(e.price_cents)}, current)`:ot(e.price_cents-s);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:An(e)}}),[t,s]);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,G.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,G.jsx)(b,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,G.jsx)(D,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:c})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,G.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,G.jsx)(b,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,G.jsx)(D,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:l})]})]})}var Mn=new Set([`active`,`trialing`,`past_due`]);function Nn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&Mn.has(e.status)}var Pn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function Fn(e,t){if(e&&typeof e==`object`){for(let t of Pn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function In(e,t){let n=e.filter(e=>!An(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Ln(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Rn(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function zn(){let e=s(),t=l(I());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:L()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:pe()})]),r}catch(e){return E.error(Fn(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}function Bn({className:e,"data-testid":t,children:n}){return(0,G.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:B(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var Vn=32;function Hn(){let{ready:e,avatar:t}=yt();return(0,G.jsx)(Bn,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,G.jsx)(Ce,{components:t.components,traits:t.traits,customImageUrl:t.customImageUrl,size:Vn}):null})}var Un=`Billed monthly · prorated difference charged today`,Wn=`Billed monthly · prorated difference charged today or credited next invoice`,Gn=`Billed monthly · prorated credit on your next invoice`,Kn=`Your machine downsizes now and your storage stays. No refund.`,qn=`Continue`,Jn=`The plan includes`,Yn=`Your plan will include`;function Xn(e,t,n){let r=n?fn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:pn(t),subtitle:``,priceCaption:Gn,checklistHeading:Yn,note:Kn,confirmLabel:pn(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:Wn,checklistHeading:Jn,note:``,confirmLabel:qn,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:Un,checklistHeading:Jn,note:``,confirmLabel:qn,destructive:!1}}}function Zn({open:e,relation:t,packageName:r,targetPackage:i,pending:a,onCancel:o,onConfirm:s}){let c=(0,K.useRef)(null),l=(0,K.useId)(),u=Xn(t,r,i?.key??null),f=i?{price:$(i.total_price_cents),highlights:vn(i,fn(i.key)?.extraFeatures??[])}:null,p=u.subtitle,m=u.note?{"aria-describedby":l}:p?{}:{"aria-describedby":void 0};return(0,G.jsx)(T.Root,{open:e,onOpenChange:e=>{!e&&!a&&o()},children:(0,G.jsxs)(T.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),c.current?.focus()},...m,children:[(0,G.jsxs)(T.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[u.destructive?(0,G.jsx)(Bn,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(C,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,G.jsx)(Hn,{}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(T.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:u.title}),p?(0,G.jsx)(T.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:p}):null]})]}),f?(0,G.jsxs)(T.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,G.jsx)(d,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:f.price}),(0,G.jsx)(d,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:u.priceCaption})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:u.checklistHeading}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.highlights.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(g,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,u.note?(0,G.jsx)(d,{id:l,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:u.note}):null,(0,G.jsxs)(T.Footer,{className:`flex-col gap-4 p-0`,children:[(0,G.jsx)(n,{fullWidth:!0,variant:u.destructive?`danger`:`primary`,onClick:s,disabled:a,"data-testid":`confirm-package-switch-button`,children:u.confirmLabel}),(0,G.jsx)(n,{ref:c,fullWidth:!0,variant:`ghost`,onClick:o,disabled:a,children:`Cancel`})]})]})})}function Qn(){let e=s();(0,K.useEffect)(()=>F(()=>{e.invalidateQueries({queryKey:L()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:pe()})}),[e])}export{sn as A,Le as B,pn as C,tn as D,rn as E,$ as F,at as I,st as L,ct as M,ot as N,cn as O,Q as P,Ge as R,gn as S,un as T,W as V,kn as _,Fn as a,_n as b,Ln as c,An as d,En as f,wn as g,On as h,Mn as i,en as j,nn as k,In as l,Dn as m,Zn as n,Nn as o,Tn as p,zn as r,Rn as s,Qn as t,jn as u,xn as v,fn as w,hn as x,bn as y,X as z};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{d as r,n as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{c as a,g as o,n as s}from"./QueryClientProvider-CMu7CkQU.js";import{t as c}from"./useQuery-Bz-fbQ-m.js";import{t as l}from"./useMutation-CXGTrp4W.js";import{t as u}from"./jsx-runtime-D3ZM-ToX.js";import{t as d}from"./typography-BeUa5Fd-.js";import{t as f}from"./createLucideIcon-C_IfoPaZ.js";import{t as p}from"./arrow-right-BWL8Hl6K.js";import{t as m}from"./check-CNBoUiyR.js";import{t as h}from"./circle-alert-DEIiXMF-.js";import{t as g}from"./circle-check-BG2g8udA.js";import{t as _}from"./coins-B6rJlYQ0.js";import{t as v}from"./cpu-BO_MyzHO.js";import{t as y}from"./hard-drive-BxeWK7dU.js";import{t as b}from"./info-Bjcv3rf9.js";import{t as x}from"./loader-circle-oY5laABh.js";import{t as S}from"./mail-B0iH8Wii.js";import{t as C}from"./triangle-alert-C5SOfs-q.js";import{t as w}from"./notice-C9v3KOP3.js";import{t as T}from"./modal-Bt1DPFgW.js";import{n as E}from"./toast-BrKo5b4d.js";import{t as ee}from"./confirm-dialog-DNaRfy4W.js";import{t as D}from"./select-B86W_Hs8.js";import{n as O}from"./resolved-assistants-store-BuqctGKE.js";import{Z as k,d as te,f as A,p as j,tt as ne,u as M}from"./auth-store-B9pHhreb.js";import{F as re,L as ie,p as ae}from"./platform-detection-D4gxJctC.js";import{d as N}from"./routes-C293MsBG.js";import{n as P}from"./use-assistant-avatar--hNHYiPK.js";import{r as oe}from"./use-is-org-ready-DyYOTCvQ.js";import{n as se,r as F}from"./browser-DwONNRIj.js";import{C as ce,O as le,Ot as ue,c as de,ct as fe,dt as pe,ft as me,l as he,lt as ge,nt as _e,ot as I,pt as L,r as ve,rt as R,ut as ye,y as be}from"./react-query.gen-CqLxrlpP.js";import{t as xe}from"./avatar-bundled-components-OjPlNcdB.js";import{r as z}from"./use-avatar-accent-var-DzqC3Diq.js";import{t as B}from"./misc-wmny7PlA.js";import{n as V,t as Se}from"./avatar-tone-CTq4cNAY.js";import{n as H}from"./use-bundled-avatar-components-B4YxFEiT.js";import{t as Ce}from"./chat-avatar-RM6-aunH.js";import{t as we}from"./avatar-renderer-Bja-CJEM.js";import{t as Te}from"./android-consumption-only-CwC2kibz.js";import{c as Ee,i as De,l as Oe,n as U,r as ke,t as Ae}from"./machine-sizes-D5IsW7GE.js";import{a as je,i as Me,n as Ne,r as Pe,t as Fe}from"./provisioning-targets-CFe7Jgy1.js";import{t as Ie}from"./environment-store-DCU3hheH.js";var W=f(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),G=u();function Le({children:e,redirectToBilling:t=!1}){return ae()?t?(0,G.jsx)(i,{replace:!0,to:N.settings.usageBilling}):(0,G.jsx)(w,{tone:`info`,children:Te}):e}var K=e(t(),1);function Re({icon:e}){return(0,G.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,G.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}var ze={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function Be({title:e,subtitle:t}){return(0,G.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,G.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:ze,children:e}),t&&(0,G.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var Ve=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1},{bodyShape:`stack`,eyeStyle:`gentle`,color:`purple`,size:110,position:`-left-[39px] top-[74%]`,rotate:0},{bodyShape:`urchin`,eyeStyle:`goofy`,color:`pink`,size:137,position:`-right-[42px] -bottom-[40px]`,rotate:180},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[37%] -bottom-[22px] -translate-x-1/2`,rotate:0}],q=[{bodyShape:`star`,eyeStyle:`curious`,color:`yellow`,size:103,position:`-left-[28px] -top-[33px]`,rotate:180},{bodyShape:`star`,eyeStyle:`curious`,color:`orange`,size:109,position:`left-[63%] -top-[62px] -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`,size:76,position:`-right-[25px] top-[60px]`,rotate:1}];function J({variant:e=`full`}){let t=H();return t?(0,G.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?q:Ve).map((e,n)=>(0,G.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,G.jsx)(we,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}var He={waitingStatus:`Upgrading your assistant…`,snagStatus:`We hit a snag upgrading your assistant`,snagCaption:`Retry in the background and we'll keep working on your upgrade.`,confirmingStatus:`Confirming your upgrade…`,confirmTimeoutStatus:`Still confirming your upgrade`,confirmTimeoutCaption:`Your payment went through safely. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still upgrading. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your upgrade continues in the background.`,backgroundRetryToast:`We'll retry your upgrade in the background.`,completeSubtitle:`Enjoy the new found power.`,fetchErrorBody:`We hit a problem checking your subscription. Your upgrade may still be processing. Return to billing to refresh.`},Ue={waitingStatus:`Updating your assistant…`,snagStatus:`We hit a snag updating your assistant`,snagCaption:`Retry in the background and we'll keep working on your plan change.`,confirmingStatus:`Confirming your plan change…`,confirmTimeoutStatus:`Still confirming your plan change`,confirmTimeoutCaption:`Your plan change was submitted. This can take a minute.`,backgroundConfirmMessage:`Your assistant is still updating. Chatting won't be available until it finishes. You can keep waiting here, or continue and we'll let you know when it's ready.`,backgroundExitToast:`Your plan change continues in the background.`,backgroundRetryToast:`We'll retry your plan change in the background.`,completeSubtitle:`Your plan changes are live.`,fetchErrorBody:`We hit a problem checking your subscription. Your plan change may still be processing. Return to billing to refresh.`},We={upgrade:He,downgrade:Ue,change:Ue};function Y(e=`upgrade`){return We[e]}function X(e,t=!0){let{data:n}=c({...ve(),enabled:t&&e==null}),{data:r}=c({...le({path:{id:e??``}}),enabled:t&&e!=null});return e==null?n:r}function Z({assistantId:e,direction:t}){let i=r(),a=X(e,oe())?.name||`your assistant`;return(0,G.jsxs)(`div`,{className:`relative flex min-h-[320px] flex-col items-center justify-center overflow-hidden px-8 pb-16 [animation:onboarding-step-in_350ms_ease-out] motion-reduce:[animation:none]`,children:[(0,G.jsx)(J,{variant:`full`}),(0,G.jsxs)(`div`,{className:`relative flex w-full flex-col items-center`,children:[(0,G.jsx)(Be,{title:`You're all set!`,subtitle:Y(t).completeSubtitle}),(0,G.jsx)(`div`,{className:`mt-10 flex w-full flex-col items-center gap-10`,children:(0,G.jsxs)(n,{variant:`primary`,"data-testid":`onboarding-complete-return`,onClick:()=>{e!=null&&k(e),i(N.assistant,{replace:!0})},children:[`Return to `,a]})})]})]})}function Ge(e=!0,t){let n=X(t,e),r=t??n?.id,{data:i,isError:a,isFetching:o,dataUpdatedAt:s,errorUpdatedAt:l}=c({...de({path:{assistant_id:r??``}}),enabled:e&&!!r});return{assistant:n,assistantId:r,domains:i,domainsError:a,domainsFetching:o,domainsUpdatedAt:s,domainsErrorUpdatedAt:l}}var Ke=1e3,qe=1e4,Je=2500,Ye=2e3,Xe=1e4,Ze=[`machine_size`,`subdomain`,`non_field_errors`],Qe={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to upgrade yet. Try again in a moment.`},$e={provisioning_submission_failed:`We couldn't queue your plan change just now. Try again in a moment.`,no_provisionable_assistants:`We couldn't find an assistant to update yet. Try again in a moment.`};function et(e,t,n=`upgrade`){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=(n===`upgrade`?void 0:$e[t.error])??Qe[t.error];if(e)return e}for(let e of Ze){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var tt=`h-8 rounded-lg border border-[var(--border-element)] bg-[var(--field-bg)] px-2.5 text-[14px] text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-[border-color] duration-150 focus:border-[var(--border-active)] disabled:cursor-not-allowed disabled:opacity-60`,nt=`text-[11px] font-medium text-[var(--content-secondary)]`;function rt({onExit:e,machineBusy:t=!1,assistantId:r}){let i=s(),a=Ie.use.emailRootDomain(),{assistant:o,assistantId:c,domains:u}=Ge(!0,r),d=u?.results[0],[f,p]=(0,K.useState)(``),[m,h]=(0,K.useState)(`hi`),[g,_]=(0,K.useState)(!1);(0,K.useEffect)(()=>{if(!g){if(d){p(d.subdomain),_(!0);return}!o?.handle||f||(p(o.handle),_(!0))}},[o?.handle,d,g,f]);let[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),S=l(fe()),C=!!d||b,E=S.isPending||b;return(0,K.useEffect)(()=>{if(!b)return;let t=setTimeout(e,800);return()=>clearTimeout(t)},[b,e]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(T.Body,{className:`animate-[onboarding-step-in_350ms_ease-out] space-y-6 pb-0 motion-reduce:animate-none`,children:[(0,G.jsx)(J,{variant:`top`}),(0,G.jsx)(Be,{title:`Assistant Email`,subtitle:`Set up an email for your assistant.`}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`onboarding-email-prefix`,className:nt,children:`Prefix`}),(0,G.jsx)(`input`,{id:`onboarding-email-prefix`,value:m,onChange:e=>h(e.target.value.toLowerCase().trim()),disabled:E||C,readOnly:C,placeholder:`hi`,className:`${tt} w-24`})]}),(0,G.jsx)(`span`,{className:`flex h-8 items-center text-[var(--content-secondary)]`,children:`@`}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(`label`,{htmlFor:`onboarding-email-handle`,className:nt,children:`Handle (public)`}),(0,G.jsx)(`input`,{id:`onboarding-email-handle`,value:f,onChange:e=>{p(e.target.value.toLowerCase().trim()),v&&y(null)},disabled:E||C,readOnly:C,autoFocus:!0,placeholder:`my-assistant`,"aria-invalid":!!v,className:`${tt} w-full min-w-0`})]}),(0,G.jsxs)(`span`,{className:`flex h-8 shrink-0 items-center text-[14px] text-[var(--content-tertiary)]`,children:[`.`,a]})]}),v&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:v}),C&&(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`This domain has been set and cannot be changed.`})]}),t&&!C&&(0,G.jsx)(w,{tone:`neutral`,children:`Your assistant is restarting — you can set the domain in a moment.`}),!C&&(0,G.jsx)(w,{tone:`info`,className:`border-transparent bg-[var(--surface-active)]`,children:(0,G.jsx)(`span`,{className:`font-medium text-[var(--content-tertiary)]`,children:`You won't be able to change the handle once set.`})}),b?(0,G.jsx)(w,{tone:`success`,children:`Domain set — redirecting…`}):null]}),(0,G.jsx)(T.Footer,{className:`items-center pt-6`,children:C?(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-continue`,onClick:e,children:`Continue`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-domain-skip`,disabled:E,onClick:()=>{E||S.mutate({body:{skipped:!0}},{onSuccess:e,onError:()=>e()})},children:`Skip`}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-domain-set`,disabled:!f||E||t,onClick:()=>{E||t||!f||S.mutate({body:{subdomain:f,...m?{email_username:m}:{}}},{onSuccess:()=>{y(null),x(!0),i.invalidateQueries({queryKey:be()}),i.invalidateQueries({queryKey:he({path:{assistant_id:c??``}})}),i.invalidateQueries({queryKey:pe()})},onError:e=>{y(et(e,`Couldn't register that subdomain. Try a different one.`))}})},children:`Next`})]})})]})}function it({onGoToBilling:e,direction:t}){return(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-4 px-6 py-10 text-center`,children:[(0,G.jsx)(Re,{icon:h}),(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsx)(d,{variant:`title-small`,as:`h1`,children:`Couldn't reach billing`}),(0,G.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`text-[var(--content-secondary)]`,children:Y(t).fetchErrorBody})]}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-go-to-billing`,onClick:e,children:`Go to billing`})]})}function Q(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function $(e){return`${Q(e)}/mo`}function at(e){return`${Q(e)}/month`}function ot(e){return`${e>0?`+`:`−`}${Q(Math.abs(e))}/mo`}function st(e){return`${e} GB storage`}function ct(e){return`${Q(e*100)} of bundled credits`}function lt(e){let{targets:t,fromSnapshot:n,machineFloor:r,credits:i}=e,a=[];return t.machineSize==null?r!=null&&n.machineSize!=null&&n.machineSize!==r&&a.push({key:`machine`,label:`Machine`,from:De[n.machineSize],to:De[r]}):n.machineSize!==t.machineSize&&a.push({key:`machine`,label:`Machine`,from:n.machineSize==null?void 0:De[n.machineSize],to:De[t.machineSize]}),t.storageGib!=null&&(n.storageGib==null||t.storageGib>n.storageGib)&&a.push({key:`storage`,label:`Storage`,from:n.storageGib==null?void 0:`${n.storageGib} GB`,to:`${t.storageGib} GB`}),i!=null&&a.push({key:`credits`,label:`Credits`,from:i.from,to:i.to}),a}var ut=60,dt=ut*2;function ft({imageUrl:e,animateIn:t=!0}){return(0,G.jsxs)(`div`,{"aria-hidden":!0,"data-testid":`takeover-backdrop`,className:`pointer-events-none absolute inset-0 overflow-hidden${t?` provision-avatar-reveal`:``}`,children:[(0,G.jsx)(`img`,{src:e,alt:``,decoding:`async`,draggable:!1,className:`absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2 object-cover object-center`,style:{filter:`blur(${ut}px)`,width:`calc(100% + ${dt*2}px)`,height:`calc(100% + ${dt*2}px)`}}),(0,G.jsx)(`div`,{className:`absolute inset-0 bg-black/55`})]})}function pt(e){let t=e?.match(/^credits_(\d+)$/)?.[1];return t==null?null:Number(t)}function mt(e,t){if(t!=null)return e?.credit_tiers?.find(e=>e.tier===t)}function ht(e){let t=oe(),{data:n}=c({..._e(),enabled:t&&e});return n?.plans.find(e=>e.id===`pro`)}function gt(e,t){return t==null?0:mt(e,t)?.credits_usd??pt(t)}function _t(e){let t=ht(e!=null);if(e==null||t==null)return null;let n;if(e.kind===`package`){let r=t.packages.find(t=>t.key===e.packageKey);n=r?.credits_usd??mt(t,r?.credit_tier)?.credits_usd}else n=mt(t,e.creditTier)?.credits_usd;return n==null?null:{fromUsd:0,toUsd:n}}function vt(e){let t=ht(e!=null);if(e==null)return null;let n=gt(t,e.fromTier),r=gt(t,e.toTier);return n==null||r==null?null:{fromUsd:n,toUsd:r}}function yt(e){let t=O.use.activeAssistantId(),n=e===void 0?t:e,{components:r,traits:i,customImageUrl:a,isLoading:o}=P(n),s=(0,K.useMemo)(()=>A(),[j()]),c=s!=null&&te(s)?s:null,l=n!=null&&!o,u=c!=null&&(n==null||n===c.assistantId),d=u&&!(l&&(r!=null||i!=null||a!=null))?c:null,f=d?d.components:r,p=d?d.traits:i,m=d?null:a,h=l||u,g=z(f,p)??(m?null:(f??xe).colors?.[0]?.hex??null);return{tintHex:h&&g?V(g):Se,backdropImageUrl:h?m:null,ready:h,avatar:{components:f,traits:p,customImageUrl:m}}}function bt(e,t){let[n,r]=(0,K.useState)(e),i=(0,K.useRef)(0);return(0,K.useEffect)(()=>{i.current=performance.now()},[]),(0,K.useEffect)(()=>{if(t<=0||e===n)return;let a=t-(performance.now()-i.current);if(a<=0){i.current=performance.now(),r(e);return}let o=setTimeout(()=>{i.current=performance.now(),r(e)},a);return()=>clearTimeout(o)},[e,n,t]),t<=0?e:n}var xt=`--takeover-surface`,St=`var(${xt},${Se})`,Ct=`color-mix(in srgb, var(--content-emphasised) 10%, transparent)`,wt=240,Tt=1.414,Et=[{minHeight:680,size:wt},{minHeight:600,size:184}],Dt=132;function Ot(e){for(let t of Et)if(e>=t.minHeight)return t.size;return Dt}function kt(){let[e,t]=(0,K.useState)(()=>Ot(typeof window>`u`?1/0:window.innerHeight));return(0,K.useEffect)(()=>{let e=()=>t(Ot(window.innerHeight));return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var At={machine:v,storage:y,credits:_},jt={idle:``,working:` is-working`,settling:` is-settling`,stalled:` is-stalled`,grown:` is-evolved`};function Mt(e,t){return e===`DONE`||e===`NOT_APPLICABLE`?`grown`:e===`STALLED`?`stalled`:e===`WAITING`||e===`RESIZING`?t?`settling`:`working`:`idle`}function Nt({assistantId:e,mode:t,downsizing:n=!1}){let{avatar:r,ready:i}=yt(e),a=H(),o=kt(),s=t===`working`||t===`settling`;return(0,G.jsxs)(`div`,{"aria-hidden":!0,className:`provision-avatar-evolve relative z-10 flex flex-col items-center${jt[i?t:`idle`]}${n?` is-downsizing`:``}`,style:{"--provision-avatar-size":`${o}px`,"--provision-avatar-growth":Tt},children:[(0,G.jsxs)(`div`,{className:`provision-avatar-stage`,children:[(0,G.jsx)(`div`,{"data-testid":`provision-avatar-placeholder`,className:`provision-avatar-placeholder${i?` is-resolved`:``}`}),(0,G.jsx)(`div`,{className:`provision-avatar-layer`,children:(0,G.jsx)(`div`,{className:`provision-avatar-current`,children:(0,G.jsx)(`div`,{className:`provision-avatar-strain`,children:i&&(0,G.jsx)(`div`,{className:`provision-avatar-reveal`,children:(0,G.jsx)(Ce,{components:r.components??a,traits:r.traits,customImageUrl:r.customImageUrl,size:o,isAssistantBusy:s})})})})})]}),(0,G.jsx)(`div`,{className:`provision-avatar-shadow`})]})}function Pt({status:e,caption:t}){return(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5`,children:[(0,G.jsx)(`h1`,{className:`text-[var(--content-emphasised)]`,style:ze,children:e}),t&&(0,G.jsx)(d,{variant:`body-medium-lighter`,as:`p`,className:`max-w-sm text-[var(--content-secondary)]`,children:t})]})}function Ft({icon:e,label:t,from:n,to:r,done:i=!1,pending:a=!1,testId:o}){let s=null;return i?s=`Complete`:a&&(s=`Pending`),(0,G.jsxs)(`div`,{"data-testid":o,className:`flex min-w-0 flex-auto items-center gap-2 rounded-lg px-2 py-1.5${a?` opacity-70`:``}`,style:{backgroundColor:Ct},children:[(0,G.jsx)(`span`,{className:`hidden h-6 w-6 shrink-0 items-center justify-center min-[420px]:flex`,children:(0,G.jsx)(e,{className:`h-3.5 w-3.5 text-[var(--content-tertiary)]`,"aria-hidden":`true`})}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 text-left wrap-anywhere`,children:[(0,G.jsx)(`span`,{className:`text-[12px] font-medium leading-tight text-[var(--content-tertiary)]`,children:t}),(0,G.jsxs)(`span`,{className:`flex flex-wrap items-center gap-1.5 text-[14px] font-medium leading-[18px] text-[var(--content-emphasised)]`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:n}),(0,G.jsx)(`span`,{className:`sr-only`,children:`to`}),(0,G.jsx)(p,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":`true`})]}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{children:r}),i?(0,G.jsx)(m,{"data-testid":`chip-check`,className:`h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`,"aria-hidden":`true`}):a&&(0,G.jsx)(x,{"data-testid":`chip-spinner`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--content-tertiary)] motion-reduce:animate-none`,"aria-hidden":`true`})]}),s&&(0,G.jsx)(`span`,{className:`sr-only`,children:s})]})]})]})}function It({label:e}){return(0,G.jsx)(`span`,{className:`rounded-lg px-3 py-2 text-[14px] text-[var(--content-emphasised)]`,style:{backgroundColor:Ct},children:e})}function Lt({children:e,wide:t=!1,testId:n}){return(0,G.jsx)(`div`,{"data-testid":n,className:`flex w-full ${t?`max-w-2xl`:`max-w-sm`} items-stretch justify-center gap-2`,children:e})}function Rt(e,t){return e===`credits`?!0:t?.[e]===!0}function zt({intent:e,creditsChange:t,targets:n,fromSnapshot:r,machineFloor:i,landed:a,allDone:o=!1,creditsOnly:s=!1}){let c=_t(e),l=vt(t),u=c??l,d=lt({targets:n,fromSnapshot:r,machineFloor:i,credits:u==null?null:{from:$(u.fromUsd*100),to:$(u.toUsd*100)}}),f=s?d.filter(e=>e.key===`credits`):d,p=f.filter(e=>o||Rt(e.key,a)).map(e=>e.label).join(`, `),[m]=(0,K.useState)(p),h=p===m?``:`${p} complete`;return f.length===0?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Lt,{testId:`resource-chips`,wide:f.length>=3,children:f.map(e=>{let t=o||Rt(e.key,a);return(0,G.jsx)(Ft,{testId:`chip-${e.key}`,icon:At[e.key],label:e.label,from:e.from,to:e.to,done:t,pending:!t},e.key)})}),(0,G.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`chip-announcement`,children:h})]})}function Bt({intent:e}){if(e.kind===`package`)return(0,G.jsx)(Lt,{children:(0,G.jsx)(It,{label:`${e.packageKey.charAt(0).toUpperCase()+e.packageKey.slice(1)} package`})});let t=[e.machineTier,e.storageTier,e.creditTier].filter(e=>e!=null).length;return(0,G.jsxs)(Lt,{wide:t>=3,children:[e.machineTier!=null&&(0,G.jsx)(Ft,{icon:v,label:`Machine`,to:U[e.machineTier]??e.machineTier}),e.storageTier!=null&&(0,G.jsx)(Ft,{icon:y,label:`Storage`,to:e.storageTier.toUpperCase()}),e.creditTier!=null&&(0,G.jsx)(It,{label:`${e.creditTier.replace(`credits_`,``)} credits`})]})}function Vt({state:e,direction:t,softWaiting:r,intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,celebrating:u,onCelebrationEnd:d,assistantId:f,escapeAvailable:p,onEscape:m,onPhaseChange:h,kickError:g,confirm:_,dwellMs:v=Je,phaseMinMs:y=900}){let b=Y(t),x=(0,K.useRef)(d);(0,K.useEffect)(()=>{x.current=d},[d]);let S=bt(e,y),C=S===`DONE`||S===`NOT_APPLICABLE`,w=S===`RESIZING`?`WAITING`:S,T=(0,K.useRef)(h);(0,K.useEffect)(()=>{T.current=h},[h]),(0,K.useEffect)(()=>{T.current?.(S)},[S]);let{tintHex:E,backdropImageUrl:ee}=yt(f),D=u&&C;return(0,K.useEffect)(()=>{if(!D)return;let e=setTimeout(()=>x.current(),v);return()=>clearTimeout(e)},[D,v]),(0,G.jsxs)(`div`,{"data-theme":`dark`,className:`provision-surface-settle relative flex h-full min-h-[420px] w-full flex-col items-center [justify-content:safe_center] gap-10 px-6 py-10 text-center`,style:{[xt]:E,backgroundColor:St},children:[ee&&(0,G.jsx)(ft,{imageUrl:ee}),(0,G.jsx)(Nt,{assistantId:f,mode:Mt(S,r),downsizing:t===`downgrade`}),(0,G.jsx)(`div`,{className:`relative z-10 flex min-h-[144px] w-full flex-col items-center gap-8 [animation:onboarding-step-in_420ms_ease-out] motion-reduce:[animation:none]`,children:te()},w)]});function O(e=`Continue in the background`){return p?(0,G.jsx)(n,{variant:`ghost`,"data-testid":`provisioning-escape`,onClick:m,children:e}):null}function k({allDone:e=!1,creditsOnly:t=!1}={}){return(0,G.jsx)(zt,{intent:i,creditsChange:a,targets:o,fromSnapshot:s,machineFloor:c,landed:l,allDone:e,creditsOnly:t})}function te(){if(S===`CONFIRMING`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.confirmingStatus,caption:`This might take a couple seconds.`}),i&&(0,G.jsx)(Bt,{intent:i}),O()]});if(S===`WAITING`||S===`RESIZING`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.waitingStatus,caption:r?`Still working — this can take a minute or two.`:`This might take a couple seconds.`}),k(),O()]});if(S===`DONE`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:`All done!`}),k({allDone:!0})]});if(S===`NOT_APPLICABLE`)return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:`Your plan is ready`}),k({allDone:!0,creditsOnly:!0})]});if(S===`STALLED`){let e=g!=null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:e?b.snagStatus:`This is taking longer than expected`,caption:e?et(g,b.snagCaption,t):`This may take a couple of minutes.`}),k(),e?O(`Retry in the background`):O()]})}return S===`CONFIRM_TIMEOUT`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Pt,{status:b.confirmTimeoutStatus,caption:b.confirmTimeoutCaption}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,G.jsx)(n,{variant:`outlined`,"data-testid":`onboarding-go-to-billing`,onClick:_.onGoToBilling,children:`Go to billing`}),(0,G.jsx)(n,{variant:`primary`,"data-testid":`onboarding-retry`,onClick:_.onRetry,children:`Try again`})]})]}):null}}function Ht(e){let{planId:t,targets:n,actuals:r,initialActuals:i,resizeOperationInFlight:a,sawOperation:o,msSinceWatchStart:s,confirmExpired:c,serverVerdict:l=null,statusObservedSinceTargetsMet:u=!0,targetsProveNoop:d=!0}=e;if(t!==`pro`)return{state:c?`CONFIRM_TIMEOUT`:`CONFIRMING`,softWaiting:!1};let f=o||a,p=l===`started`||l===`in_progress`,m=o||d&&u;if(!a){let e=p?m:f||l===`already_done`||i!=null&&!je(n,i);if(je(n,r)){if(e)return{state:`DONE`,softWaiting:!1};if(!p&&(d||l===`not_applicable`))return{state:`NOT_APPLICABLE`,softWaiting:!1}}else{if(l===`already_done`)return{state:`DONE`,softWaiting:!1};if(l===`not_applicable`)return{state:`NOT_APPLICABLE`,softWaiting:!1}}}return s!=null&&s>=9e4?{state:`STALLED`,softWaiting:!1}:f||l===`started`||l===`in_progress`?{state:`RESIZING`,softWaiting:!1}:{state:`WAITING`,softWaiting:s!=null&&s>=3e4}}var Ut=2e3,Wt=1e3,Gt=[`DONE`,`NOT_APPLICABLE`,`CONFIRM_TIMEOUT`],Kt={assistantId:null,machine:null,storage:null};function qt({open:e,canLowerResources:t=!1,verdictRecheckMs:n=Xe}){let r=s(),i=oe(),[u,d]=(0,K.useState)(!1),[f,p]=(0,K.useState)(0),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(null),[S,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(null),[E,ee]=(0,K.useState)(Kt),[D,O]=(0,K.useState)(null),[k,te]=(0,K.useState)(!1),A=(0,K.useRef)(!1),j=(0,K.useRef)(!1),M=(0,K.useRef)(0),[re,ie]=(0,K.useState)(!1),[ae,N]=(0,K.useState)(null),[P,se]=(0,K.useState)(null),[F,ue]=(0,K.useState)(null),[de,fe]=(0,K.useState)(()=>Date.now()),[he,_e]=(0,K.useState)(!0);(0,K.useEffect)(()=>{e||(d(!1),p(0),h(null),_(null),y(null),ie(!1),N(null),se(null),ue(null),_e(!0),x(null),C(null),T(null),ee(Kt),O(null),te(!1),A.current=!1,j.current=!1,M.current+=1)},[e]),(0,K.useEffect)(()=>{e&&(h(Date.now()),r.invalidateQueries({queryKey:L()}),r.invalidateQueries({queryKey:pe()}))},[e,r]);let I=g!=null,R=c({...me(),refetchInterval:e=>e.state.data?.plan_id===`pro`||u?!1:Ke,refetchIntervalInBackground:!1,enabled:e&&i&&!I}),be=(m!=null&&R.dataUpdatedAt>=m?R.data?.plan_id:null)??null;(0,K.useEffect)(()=>{if(!e||I||be!==`pro`)return;let t=Date.now();_(t),fe(t)},[e,I,be]),(0,K.useEffect)(()=>{if(!e||I)return;let t=setTimeout(()=>d(!0),qe);return()=>clearTimeout(t)},[e,I,f]);let xe=(0,K.useCallback)(()=>{d(!1),p(e=>e+1),ne.getState().fetchOrganizations(),r.invalidateQueries({queryKey:L()})},[r]),z=(0,K.useCallback)(()=>{let e=Date.now();y(e),fe(e)},[]),{mutate:B}=l(ge()),V=(0,K.useCallback)(e=>{let t=M.current;B({},{onSuccess:n=>{t===M.current&&(O(null),Ne(n)?j.current?O({error:n.reason??`no_active_pro`}):(j.current=!0,te(!0),e===`escape`&&z()):(x(n.state),e===`escape`&&z()))},onError:e=>{t===M.current&&O(e)}})},[B,z]);(0,K.useEffect)(()=>{!e||!i||!I||A.current||(A.current=!0,V(`auto`))},[e,i,I,V]),(0,K.useEffect)(()=>{if(!k)return;let e=M.current,t=setTimeout(()=>{te(!1),e===M.current&&V(`auto`)},Ye);return()=>clearTimeout(t)},[k,V]);let Se=(0,K.useCallback)(()=>V(`escape`),[V]),H=c({...ye(),enabled:e&&i&&I}),Ce=he?Ut:!1,we=c({...ve(),enabled:e&&i&&I,refetchInterval:e=>e.state.data?.id==null?Ce:!1,retry:!1}),Te=I&&m!=null&&H.dataUpdatedAt>=m,De=Te&&!H.isPending&&!H.isFetching,U=(Te?H.data?.primary_assistant_id:null)??(H.isPending?null:we.data?.id??null),ke=c({...le({path:{id:U??`unresolved`}}),enabled:e&&i&&I&&U!=null,refetchInterval:Ce,retry:!1}),Ie=ce({path:{id:U??`unresolved`}}),W=c({...Ie,enabled:e&&i&&I&&U!=null,refetchInterval:Ce,retry:!1}),G=(0,K.useRef)(0),[Le,Re]=(0,K.useState)(0),ze=o(Ie.queryKey);(0,K.useEffect)(()=>r.getQueryCache().subscribe(t=>{if(!(t.type!==`updated`||t.query.queryHash!==ze)){if(t.action.type===`fetch`)G.current+=1;else if(t.action.type===`success`&&!t.action.manual){let n=G.current,r=e&&Pe(t.action.data);a.schedule(()=>{Re(n),r&&(ie(!0),N(U))})}}}),[r,ze,e,U]);let Be=Pe(W.data),Ve=ae===U,q=H.data,J=(0,K.useMemo)(()=>q?{machineSize:Ee(q.max_machine_tier),storageGib:q.selected_storage_gib??null}:null,[q]),He=q!=null&&q.max_machine_tier==null?Ae:null,Ue=q?q.domain_setup_available&&q.primary_assistant_id!=null:void 0,We=ke.data,Y=(0,K.useMemo)(()=>We?{machineSize:We.machine_size??null,storageGib:We.provisioned_storage_gib??null}:null,[We]),X=F===U,Z=(0,K.useMemo)(()=>{let e=Fe(J,Y),t=J?.machineSize??He;if(t==null)return e;let n=Y?.machineSize??null;if(n==null)return{...e,machine:!1};let r=(X?P?.machineSize:null)??n,i=Oe(t)<Oe(r);return{...e,machine:i?Oe(n)<=Oe(t):Oe(n)>=Oe(t)}},[J,Y,P,X,He]),Ge=je(J,Y),Je=w===U;(0,K.useEffect)(()=>{e&&(Ge?(C(e=>e!=null&&Je?e:Date.now()),T(U)):(C(null),T(null)))},[e,Ge,U,Je]);let Ze=E.assistantId===U;(0,K.useEffect)(()=>{if(!e)return;let t=G.current;ee(e=>{let n=e.assistantId===U?e:Kt,r=Z.machine?n.machine??t:null,i=Z.storage?n.storage??t:null;return e.assistantId===U&&e.machine===r&&e.storage===i?e:{assistantId:U,machine:r,storage:i}})},[e,Z,U]);let Qe=(0,K.useMemo)(()=>{let e=Me(W.data),t=e=>e!=null&&Ze&&Le>e;return{machine:Z.machine&&!e.machine&&t(E.machine),storage:Z.storage&&!e.storage&&t(E.storage)}},[Z,E,Ze,Le,W.data]);(0,K.useEffect)(()=>{!e||!Y||P!=null&&X||(se(Y),ue(U))},[e,Y,U,P,X]);let $e=v??g,et=$e==null?null:Math.max(0,de-$e),tt=!t,{state:nt,softWaiting:rt}=Ht({planId:I?`pro`:be,targets:J,actuals:Y,initialActuals:X?P:null,resizeOperationInFlight:Be,sawOperation:re&&Ve,msSinceWatchStart:et,confirmExpired:u,serverVerdict:b,statusObservedSinceTargetsMet:S!=null&&Je&&W.dataUpdatedAt>S,targetsProveNoop:tt}),it=Gt.includes(nt),Q=e&&I&&!it;(0,K.useEffect)(()=>{_e(Q)},[Q]),(0,K.useEffect)(()=>{if(!e||!I||it)return;let t=setInterval(()=>fe(Date.now()),Wt);return()=>clearInterval(t)},[e,I,it]);let $=!tt&&(b===`started`||b===`in_progress`)&&!(re&&Ve);return(0,K.useEffect)(()=>{if(!e||!I||it||!$)return;let t=setInterval(()=>V(`auto`),n);return()=>clearInterval(t)},[e,I,it,$,n,V]),{state:nt,softWaiting:rt,targets:J,actualsSnapshot:P,machineFloor:He,landed:Qe,assistantId:U,domainStepAvailable:Ue,onboardingSettled:De,confirmError:!I&&R.isError,targetsError:I&&H.isError&&(!q||!Te),escapeEligible:et!=null&&et>=6e4,retryConfirm:xe,kickProvisioning:Se,kickError:D}}var Jt=200,Yt=380;function Xt(){return typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0}var Zt=e=>e===`WAITING`||e===`RESIZING`||e===`STALLED`,Qt=e=>e===`DONE`||e===`NOT_APPLICABLE`,$t={machineSize:null,storageGib:null};function en({open:e,onClose:t,dwellMs:n,phaseMinMs:r,mode:i=`checkout`,resizeContext:a}){let o=i===`resize`,c=s(),[l,u]=(0,K.useState)(`provisioning`),[d,f]=(0,K.useState)(`idle`),p=(0,K.useRef)([]),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(null),[b,x]=(0,K.useState)(!1),S=o?a?.direction:void 0,C=Y(S),w=qt({open:e,canLowerResources:o?a?.canLowerResources===!0:!1}),D=(0,K.useRef)(!1);(0,K.useEffect)(()=>{if(e){D.current=!0,h(o?null:ie()),y(e=>e??Date.now());return}p.current.forEach(clearTimeout),p.current=[],u(`provisioning`),f(`idle`),_(null),y(null),x(!1),D.current&&(D.current=!1,M())},[e,o]),(0,K.useEffect)(()=>()=>{p.current.forEach(clearTimeout)},[]),(0,K.useEffect)(()=>{l===`complete`&&re()},[l]);let O=Zt(w.state),k=Qt(g??w.state),{targets:te,assistantId:A,domainStepAvailable:j,onboardingSettled:ne}=w,ae=o?a?.fromSnapshot:void 0,N=w.actualsSnapshot,P={machineSize:ae?.machineSize??N?.machineSize??null,storageGib:ae?.storageGib??N?.storageGib??null},{tintHex:oe,backdropImageUrl:se}=yt(A),F=o&&j===!0,{domains:ce,domainsError:le,domainsFetching:ue,domainsUpdatedAt:de,domainsErrorUpdatedAt:fe}=Ge(e&&F,A),pe=(ce?.results.length??0)>0,me=(0,K.useRef)(null);(0,K.useEffect)(()=>{if(!e){me.current=null;return}!F||A==null||me.current!==A&&(me.current=A,c.invalidateQueries({queryKey:he({path:{assistant_id:A}})}))},[e,F,A,c]);let ge=!ue&&(v!=null&&de>=v||v!=null&&!!le&&fe>=v),[_e,I]=(0,K.useState)(!1),L=ne&&(!F||ge);(0,K.useEffect)(()=>{if(!e){I(!1);return}L&&I(!0)},[e,L]);let ve=(0,K.useCallback)(()=>{let e=o?j===!0&&!pe?`domain`:`complete`:j===!1?`complete`:`domain`;if(Xt()){u(e);return}f(`covering`),p.current.push(setTimeout(()=>{u(e),f(`revealing`),p.current.push(setTimeout(()=>f(`idle`),Yt))},Jt))},[j,o,pe]),R=(0,K.useCallback)(()=>{x(!0)},[]),ye=(0,K.useCallback)(()=>{w.kickProvisioning(),E.info(w.kickError==null?C.backgroundExitToast:C.backgroundRetryToast),x(!1),t()},[w,t,C]),be=(0,K.useCallback)(()=>{x(!1)},[]),xe=l===`provisioning`&&(w.confirmError||w.targetsError),z=l===`provisioning`&&!xe,B=z&&!k,V=`transition-[background-color] duration-300 ease-out${z?` bg-black p-0`:``}`,Se=z?`[animation:fadeIn_0.45s_ease-out_both]`:d===`revealing`?`[animation:fadeInUp_0.42s_ease-out_0.12s_both]`:`[animation:fadeIn_0.25s_ease-out_both]`;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(T.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,G.jsxs)(T.Content,{size:`md`,hideCloseButton:l!==`complete`,dismissOnOverlayClick:!B,onEscapeKeyDown:B?e=>e.preventDefault():void 0,onInteractOutside:B?e=>e.preventDefault():void 0,"data-theme":z?`dark`:void 0,overlayClassName:V,className:z?`overflow-y-auto inset-0 max-w-none w-screen h-screen max-h-none rounded-none border-0`:`overflow-hidden`,style:{[xt]:oe},children:[(0,G.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col motion-reduce:[animation:none] ${Se}`,children:H()},l),d!==`idle`&&(0,G.jsx)(`div`,{"aria-hidden":!0,"data-testid":`takeover-exit-sheet`,className:`pointer-events-none fixed inset-0 z-50 ${d===`covering`?`[animation:fadeIn_200ms_ease-in_both]`:`[animation:fadeIn_380ms_ease-out_both_reverse]`}`,style:{backgroundColor:St},children:se&&(0,G.jsx)(ft,{imageUrl:se,animateIn:!1})})]})}),(0,G.jsx)(ee,{open:b&&O,title:`Continue in the background?`,message:C.backgroundConfirmMessage,confirmLabel:`Continue`,cancelLabel:`Keep waiting`,onConfirm:ye,onCancel:be})]});function H(){return l===`provisioning`?w.confirmError||w.targetsError?(0,G.jsx)(it,{onGoToBilling:t,direction:S}):(0,G.jsx)(Vt,{state:w.state,direction:S,softWaiting:w.softWaiting,intent:m,creditsChange:o?a?.credits:void 0,targets:te??$t,fromSnapshot:P,machineFloor:w.machineFloor,landed:w.landed,celebrating:_e,onCelebrationEnd:ve,assistantId:A,escapeAvailable:O&&w.escapeEligible,onEscape:R,onPhaseChange:_,kickError:w.kickError,confirm:{onRetry:w.retryConfirm,onGoToBilling:t},dwellMs:n,phaseMinMs:r}):l===`domain`?(0,G.jsx)(rt,{machineBusy:O,assistantId:A,onExit:()=>u(`complete`)}):(0,G.jsx)(Z,{assistantId:A,direction:S})}}function tn(e){return e!=null&&!e.customized}function nn(e){return tn(e)?e.name:`Custom`}var rn=[`mighty`,`super`,`ultra`],an=[`free`,...rn];function on(e){return an.indexOf(e)}function sn(e,t){if(e===null)return`upgrade`;let n=on(e),r=on(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function cn(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>rn.indexOf(e.key)-rn.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}var ln={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function un({tier:e,size:t=40}){let n=ln[e]??ln.free,r=H();return(0,G.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,G.jsx)(we,{components:r,bodyShapeId:n.bodyShape,colorId:n.color,size:t}):(0,G.jsx)(`div`,{style:{width:t,height:t}})})}var dn={free:{tagline:`Get to know your assistant.`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`More capacity for consistent use.`,cta:`Power Up`,priceCaption:`Billed monthly`,recommended:!0},super:{tagline:`Do more, think less about the how.`,cta:`Go Super`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Your second brain, running full speed.`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function fn(e){return dn[e]}function pn(e){return`Downgrade to ${e}`}var mn=`Small`;function hn(e){return e?.machine_size?De[e.machine_size]??e.machine_size:mn}function gn(e){let t=e.credits_usd??0,n=fn(e.key)?.extraFeatures??[];return[{icon:W,label:`${hn(e)} Machine`},{icon:y,label:`${e.storage_gib} GB Storage`},{icon:_,label:`${Q(t*100)} in credits included`},...n.map(e=>({icon:S,label:e}))]}function _n(){return[{icon:W,label:`${mn} Machine`},{icon:y,label:`4 GB Storage`},{icon:_,label:`Pay as you go credits`}]}function vn(e,t=[]){let n=e?.credits_usd??0,r=e?.storage_gib??4,i=ke[e?.machine_size??`small`];return[`${hn(e)} machine${i?` (${i})`:``}`,st(r),ct(n),...t]}var yn={machine:`Configurable machine size`,storage:`Configurable storage`,credits:`Pay-as-you-go and bundled credits`};function bn(e,t){let n=[`${e.machineTier?U[e.machineTier]??t.machine_tiers.find(t=>t.tier===e.machineTier)?.label??e.machineTier:mn} Machine`];if(e.storageGib!=null&&n.push(`${e.storageGib} GB`),e.creditTier!=null){let r=mt(t,e.creditTier)?.credits_usd??pt(e.creditTier);n.push(r==null?`Credit bundle`:`${r} credits/mo`)}return n}function xn(e,t){let n=new Set([yn.machine]);return e.storageGib!=null&&n.add(yn.storage),e.creditTier!=null&&n.add(yn.credits),[...bn(e,t),...t.included_features.filter(e=>!n.has(e))]}var Sn=`billing-portal-return-snapshot`;function Cn(e){try{sessionStorage.removeItem(Sn),sessionStorage.setItem(Sn,JSON.stringify(e))}catch{}}function wn(){if(typeof sessionStorage>`u`)return null;try{let e=sessionStorage.getItem(Sn);if(!e)return null;let t=JSON.parse(e);return typeof t.cancel_at_period_end!=`boolean`||typeof t.plan_id!=`string`?null:{cancel_at_period_end:t.cancel_at_period_end,cancel_at:t.cancel_at??null,plan_id:t.plan_id}}catch{return null}}function Tn(){try{sessionStorage.removeItem(Sn)}catch{}}function En(e){return e?{cancel_at_period_end:e.cancel_at_period_end,cancel_at:e.cancel_at??null,plan_id:e.plan_id}:null}function Dn(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`})}function On(e){return e?e.cancel_at??e.current_period_end??null:null}function kn(e){let t=s();return(0,K.useEffect)(()=>F(()=>{t.invalidateQueries(me())}),[t]),ue({onSuccess:t=>{e&&Cn(e),se(t.portal_url)},onError:()=>{E.error(`Couldn't open the billing portal. Please try again.`,{id:`billing-portal-session-error`})}})}function An(e){return e.disabled===!0}function jn({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:s}){let c=(0,K.useMemo)(()=>e.map(e=>{let t=U[e.tier]??e.label,n=o==null?`+${$(e.price_cents)}`:e.price_cents===o?`(${$(e.price_cents)}, current)`:ot(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:An(e)}}),[e,o]),l=(0,K.useMemo)(()=>t.map(e=>{let t=s==null?`+${$(e.price_cents)}`:e.price_cents===s?`(${$(e.price_cents)}, current)`:ot(e.price_cents-s);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:An(e)}}),[t,s]);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,G.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,G.jsx)(b,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,G.jsx)(D,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:c})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(d,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,G.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,G.jsx)(b,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,G.jsx)(D,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:l})]})]})}var Mn=new Set([`active`,`trialing`,`past_due`]);function Nn(e){return e.plan_id!==`base`&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&Mn.has(e.status)}var Pn=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function Fn(e,t){if(e&&typeof e==`object`){for(let t of Pn)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function In(e,t){let n=e.filter(e=>!An(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Ln(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function Rn(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}function zn(){let e=s(),t=l(I());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:L()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:pe()})]),r}catch(e){return E.error(Fn(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}function Bn({className:e,"data-testid":t,children:n}){return(0,G.jsx)(`div`,{"aria-hidden":!0,"data-testid":t,className:B(`flex size-[52px] shrink-0 items-center justify-center rounded-xl`,e),children:n})}var Vn=32;function Hn(){let{ready:e,avatar:t}=yt();return(0,G.jsx)(Bn,{"data-testid":`assistant-avatar-tile`,className:`bg-[var(--surface-active)]`,children:e?(0,G.jsx)(Ce,{components:t.components,traits:t.traits,customImageUrl:t.customImageUrl,size:Vn}):null})}var Un=`Billed monthly · prorated difference charged today`,Wn=`Billed monthly · prorated difference charged today or credited next invoice`,Gn=`Billed monthly · prorated credit on your next invoice`,Kn=`Your machine downsizes now and your storage stays. No refund.`,qn=`Continue`,Jn=`The plan includes`,Yn=`Your plan will include`;function Xn(e,t,n){let r=n?fn(n)?.tagline??``:``;switch(e){case`downgrade`:return{title:pn(t),subtitle:``,priceCaption:Gn,checklistHeading:Yn,note:Kn,confirmLabel:pn(t),destructive:!0};case`switch`:return{title:`Switch to ${t}`,subtitle:r,priceCaption:Wn,checklistHeading:Jn,note:``,confirmLabel:qn,destructive:!1};default:return{title:`Upgrade to ${t}`,subtitle:r,priceCaption:Un,checklistHeading:Jn,note:``,confirmLabel:qn,destructive:!1}}}function Zn({open:e,relation:t,packageName:r,targetPackage:i,pending:a,onCancel:o,onConfirm:s}){let c=(0,K.useRef)(null),l=(0,K.useId)(),u=Xn(t,r,i?.key??null),f=i?{price:$(i.total_price_cents),highlights:vn(i,fn(i.key)?.extraFeatures??[])}:null,p=u.subtitle,m=u.note?{"aria-describedby":l}:p?{}:{"aria-describedby":void 0};return(0,G.jsx)(T.Root,{open:e,onOpenChange:e=>{!e&&!a&&o()},children:(0,G.jsxs)(T.Content,{size:`sm`,hideCloseButton:!0,className:`gap-4 p-4 max-w-[421px]`,onOpenAutoFocus:e=>{e.preventDefault(),c.current?.focus()},...m,children:[(0,G.jsxs)(T.Header,{className:`flex-row items-center gap-3 p-0 pb-2`,children:[u.destructive?(0,G.jsx)(Bn,{"data-testid":`package-switch-warning-tile`,className:`bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(C,{className:`size-6 text-[var(--system-negative-strong)]`})}):(0,G.jsx)(Hn,{}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(T.Title,{className:`text-title-small text-[var(--content-emphasised)] [&>span]:whitespace-normal`,children:u.title}),p?(0,G.jsx)(T.Description,{className:`mt-0 text-body-medium-default text-[var(--content-tertiary)]`,children:p}):null]})]}),f?(0,G.jsxs)(T.Body,{className:`flex flex-col gap-4 p-0`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,G.jsx)(d,{as:`p`,variant:`title-large`,className:`text-[var(--content-default)]`,children:f.price}),(0,G.jsx)(d,{as:`p`,variant:`label-medium-default`,className:`leading-[15px] text-[var(--content-tertiary)]`,children:u.priceCaption})]}),(0,G.jsx)(`div`,{className:`h-px w-full bg-[var(--border-hover)]`}),(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:u.checklistHeading}),(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:f.highlights.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(g,{className:`size-4 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:e})]},e))})]}):null,u.note?(0,G.jsx)(d,{id:l,as:`p`,variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:u.note}):null,(0,G.jsxs)(T.Footer,{className:`flex-col gap-4 p-0`,children:[(0,G.jsx)(n,{fullWidth:!0,variant:u.destructive?`danger`:`primary`,onClick:s,disabled:a,"data-testid":`confirm-package-switch-button`,children:u.confirmLabel}),(0,G.jsx)(n,{ref:c,fullWidth:!0,variant:`ghost`,onClick:o,disabled:a,children:`Cancel`})]})]})})}function Qn(){let e=s();(0,K.useEffect)(()=>F(()=>{e.invalidateQueries({queryKey:L()}),e.invalidateQueries({queryKey:R()}),e.invalidateQueries({queryKey:pe()})}),[e])}export{sn as A,Le as B,pn as C,tn as D,rn as E,$ as F,at as I,st as L,ct as M,ot as N,cn as O,Q as P,Ge as R,gn as S,un as T,W as V,kn as _,Fn as a,_n as b,Ln as c,An as d,En as f,wn as g,On as h,Mn as i,en as j,nn as k,In as l,Dn as m,Zn as n,Nn as o,Tn as p,zn as r,Rn as s,Qn as t,jn as u,xn as v,fn as w,hn as x,bn as y,X as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./createLucideIcon-C_IfoPaZ.js";import{t as a}from"./calendar-DFz-eSzk.js";import{t as o}from"./globe-BQ4oUIDW.js";import{t as s}from"./layout-grid-C3zr7IEa.js";import{t as c}from"./message-square-UW8LcsnU.js";import{t as l}from"./monitor-4IGIx6Wb.js";import{t as u}from"./settings-bHOjP4mt.js";import{n as d,t as f}from"./create-selectors-C7uuHryP.js";import{Q as p,_ as m,i as h,x as g}from"./local-mode-DP-5m-kS.js";import{t as _}from"./is-electron-BSK3AUxG.js";import{n as v}from"./resolved-assistants-store-BuqctGKE.js";import{a as y,n as b}from"./api-errors-BTOPGXDV.js";import{i as x}from"./utils-1ZnEn_W1.js";import{Q as S,at as C,rt as w,ut as T}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useQuery-Bz-fbQ-m.js";import{t as i}from"./createLucideIcon-C_IfoPaZ.js";import{t as a}from"./calendar-DFz-eSzk.js";import{t as o}from"./globe-BQ4oUIDW.js";import{t as s}from"./layout-grid-C3zr7IEa.js";import{t as c}from"./message-square-UW8LcsnU.js";import{t as l}from"./monitor-4IGIx6Wb.js";import{t as u}from"./settings-bHOjP4mt.js";import{n as d,t as f}from"./create-selectors-C7uuHryP.js";import{Q as p,_ as m,i as h,x as g}from"./local-mode-DP-5m-kS.js";import{t as _}from"./is-electron-BSK3AUxG.js";import{n as v}from"./resolved-assistants-store-BuqctGKE.js";import{a as y,n as b}from"./api-errors-BTOPGXDV.js";import{i as x}from"./utils-1ZnEn_W1.js";import{Q as S,at as C,rt as w,ut as T}from"./auth-store-B9pHhreb.js";import{nt as E}from"./sdk.gen-CMy8CiG0.js";import{lr as D}from"./sdk.gen-Br55zhZN.js";import{a as ee,i as te,r as O}from"./feature-flag-catalog-svwKfQY_.js";import{t as k}from"./client-feature-flag-store-B9Bz0uyL.js";import{d as A}from"./routes-C293MsBG.js";import{i as j,r as M}from"./use-is-org-ready-DyYOTCvQ.js";import{F as N}from"./react-query.gen-CqLxrlpP.js";import{t as P}from"./haptics-BhuZvnto.js";import{s as ne}from"./chat-BfpNzA77.js";var F=i(`contact`,[[`path`,{d:`M16 2v2`,key:`scm5qe`}],[`path`,{d:`M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2`,key:`1waht3`}],[`path`,{d:`M8 2v2`,key:`pbkmx`}],[`circle`,{cx:`12`,cy:`11`,r:`3`,key:`itu57m`}],[`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`,key:`12vinp`}]]),I=i(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),L=e(t(),1);function R({sessionStatus:e,hasPlatformSession:t}){let r=n(),i=M(),a=C(e)&&!p()&&(t||!m())&&i;v.use.assistants();let o=S(),s=o&&!h().some(e=>e.assistantId===o)?o:null,{data:c}=T({enabled:a,selectedPlatformAssistantId:s});(0,L.useEffect)(()=>{w.setInputs({sessionStatus:e,hasPlatformSession:t,queryClient:r,selectedPlatformAssistantId:s,isOrgReady:i}),w.respondToInputs()},[e,t,r,s,i]),(0,L.useEffect)(()=>{c&&w.applyServerResult(c)},[c])}var z=`0.8.5`,B=5e3,V=6e4;function H(e,t=!0){return x(z)&&t?{staleTime:e,refetchInterval:!1}:{staleTime:B,refetchInterval:B}}function U(){return H(V)}function W(e){return H(1/0,e)}var G=new Set(Object.keys(O)),K=new Set(Object.keys(te));async function q(e){let t=k.getState().scopeKey,{data:n,error:r,response:i}=await E({throwOnError:!1,signal:e});if(b(i,r,`Failed to fetch client feature flags`),!i.ok||!n)throw y(r,i);return{scopeKey:t,flags:n.flags}}function J(e){let t={},n={};for(let[r,i]of Object.entries(e)){let e=ee(r);typeof i==`boolean`&&G.has(e)?t[e]=i:typeof i==`string`&&K.has(e)&&(n[e]=i)}return{boolFlags:t,stringFlags:n}}function Y(e,t=!1){let n=W(t),i=j(),a=k.use.scopeKey(),o=e&&!g(),s=o&&i===`ready`,{data:c,isError:l}=r({queryKey:N(),queryFn:({signal:e})=>q(e),enabled:s,...n,refetchOnWindowFocus:!1,refetchOnReconnect:!1});(0,L.useEffect)(()=>{if(c?.flags){let{boolFlags:e,stringFlags:t}=J(c.flags),n=k.getState();n.setFlags(e,c.scopeKey),Object.keys(t).length>0&&n.setStringFlags(t,c.scopeKey);return}e&&(!o||i===`unavailable`||l)&&k.getState().settleWithoutServerValues(a)},[a,c,e,l,o,i])}var X=f(d((e,t)=>({isOpen:!1,open:()=>e({isOpen:!0}),close:()=>e({isOpen:!1}),toggle:()=>e({isOpen:!t().isOpen})})));async function re(){if(!_())return!1;let e=window.vellum?.commandPalette?.open;return e?(await e(),!0):!1}async function ie(){_()&&await window.vellum?.commandPalette?.dismiss()}async function ae(e){_()&&await window.vellum?.commandPalette?.select(e)}var Z={query:``,queryTokens:[],results:{conversations:[],memories:[],schedules:[],contacts:[]}};function oe(e,t){return e||t.split(/\s+/).filter(e=>e.length>0)}async function Q(e,t,n){let r=n?.limit??10;try{let{data:i,response:a}=await D({path:{assistant_id:e},query:{q:t,limit:r,categories:`conversations,schedules,contacts`},throwOnError:!1,signal:n?.signal});return!a?.ok||!i?Z:{query:i.query,queryTokens:oe(i.queryTokens,i.query),results:i.results}}catch(n){return n instanceof DOMException&&n.name===`AbortError`||console.error(`[global-search] search failed`,{assistantId:e,query:t,err:n}),Z}}var se=150,ce=2,$=[];function le({itemCount:e,onSelect:t,assistantId:n,isOpen:r,onClose:i}){let a=X.use.isOpen(),o=r??a,s=X.use.open(),c=X.use.close(),[l,u]=(0,L.useState)(``),[d,f]=(0,L.useState)(0),[p,m]=(0,L.useState)(!1),[h,g]=(0,L.useState)(null),[_,v]=(0,L.useState)($),y=(0,L.useRef)(()=>0);(0,L.useLayoutEffect)(()=>{y.current=typeof e==`function`?e:()=>e});let b=(0,L.useRef)(null),x=(0,L.useRef)(null),S=(0,L.useCallback)(()=>{b.current&&=(clearTimeout(b.current),null),x.current?.abort(),x.current=null},[]),C=(0,L.useCallback)(()=>{s(),f(0)},[s]),w=(0,L.useCallback)(()=>{c(),u(``),f(0),m(!1),g(null),v($),S(),i?.()},[c,S,i]),T=(0,L.useCallback)(()=>{o?w():C()},[o,w,C]);(0,L.useEffect)(()=>{o||(u(``),f(0),m(!1),g(null),v($),S())},[o,S]);let E=(0,L.useCallback)(e=>{S();let t=e.trim();if(t.length<ce||!n){m(!1),g(null),v($);return}m(!0),b.current=setTimeout(()=>{if(!n){m(!1);return}let e=new AbortController;x.current=e,Q(n,t,{signal:e.signal}).then(t=>{x.current===e&&(g(t.results),v(t.queryTokens),m(!1))}).catch(()=>{x.current===e&&m(!1)})},se)},[S,n]),D=(0,L.useCallback)(e=>{u(e),f(0),E(e)},[E]);return(0,L.useEffect)(()=>()=>{x.current?.abort(),b.current&&clearTimeout(b.current)},[]),{isOpen:o,query:l,selectedIndex:d,isSearching:p,searchResults:h,searchTokens:_,open:C,close:w,toggle:T,setQuery:D,handleKeyDown:(0,L.useCallback)(e=>{if(e.key===`k`&&(e.metaKey||e.ctrlKey)){e.preventDefault(),w();return}let n=y.current();switch(e.key){case`ArrowDown`:e.preventDefault(),n>0&&f(e=>Math.min(e+1,n-1));break;case`ArrowUp`:e.preventDefault(),f(e=>Math.max(e-1,0));break;case`Enter`:e.preventDefault(),n>0&&t?.(d);break;case`Escape`:e.preventDefault(),w();break}},[t,d,w])}}function ue(e){return{id:`actions`,label:`Actions`,items:[{id:`action-new-conversation`,icon:I,title:`New Conversation`,shortcutHint:_()?`⌘N`:`⌘⇧O`},{id:`action-current-conversation`,icon:l,title:`Current Conversation`,shortcutHint:`⌘⇧N`},{id:`action-settings`,icon:u,title:`Settings`,shortcutHint:`⌘,`},{id:`action-library`,icon:s,title:`Library`},{id:`action-intelligence`,icon:o,title:e}]}}function de(e,t){let n=[],r=e.conversations.filter(e=>!t.has(e.id)).map(e=>({id:`search-conv-${e.id}`,icon:c,title:e.title??`Untitled`,snippet:e.excerpt||void 0}));r.length>0&&n.push({id:`search-conversations`,label:`Conversations`,items:r});let i=e.schedules.map(e=>({id:`search-schedule-${e.id}`,icon:a,title:e.name,subtitle:e.expression??e.message}));i.length>0&&n.push({id:`search-schedules`,label:`Schedules`,items:i});let o=e.contacts.map(e=>({id:`search-contact-${e.id}`,icon:F,title:e.displayName,subtitle:e.notes??void 0}));return o.length>0&&n.push({id:`search-contacts`,label:`Contacts`,items:o}),n}function fe(e){return{id:`conversations`,label:`Recent`,items:e.slice(0,5).map(e=>({id:`conv-${e.conversationId}`,icon:c,title:e.title??`Untitled`,subtitle:e.lastMessageAt?ne(e.lastMessageAt):void 0}))}}function pe(e,t){switch(e.id){case`action-new-conversation`:t.startNewConversation();break;case`action-current-conversation`:P.light(),t.navigate(A.assistant);break;case`action-settings`:P.light(),t.navigateToSettings();break;case`action-intelligence`:P.light(),t.navigate(A.identity);break;case`action-library`:P.light(),t.navigate(A.library.root);break;default:if(e.id.startsWith(`conv-`)){let n=e.id.slice(5);t.switchConversation(n)}else if(e.id.startsWith(`search-conv-`)){let n=e.id.slice(12);t.switchConversation(n)}else e.id.startsWith(`search-schedule-`)?(P.light(),t.navigate(A.schedules.detail(e.id.slice(16)))):e.id.startsWith(`search-contact-`)&&(P.light(),t.navigate(A.identity));break}}function me({assistantId:e,assistantName:t,conversations:n,activeConversationId:r,startNewConversation:i,switchConversation:a,navigate:o,navigateToSettings:s,isOpen:c,onClose:l,onItemSelect:u}){let d=(0,L.useMemo)(()=>{let e=ue(t??`Assistant`),r=fe(n);return[e,...r.items.length>0?[r]:[]]},[n,t]),f=(0,L.useMemo)(()=>new Set(n.slice(0,5).map(e=>e.conversationId)),[n]),p=(0,L.useCallback)(e=>{if(u){u(e);return}pe(e,{startNewConversation:i,switchConversation:a,navigate:o,activeConversationId:r,navigateToSettings:s})},[i,a,o,r,s,u]),m=(0,L.useRef)([]),h=(0,L.useRef)(()=>{}),g=le({itemCount:()=>m.current.reduce((e,t)=>e+t.items.length,0),onSelect:(0,L.useCallback)(e=>{let t=e;for(let e of m.current){if(t<e.items.length){let n=e.items[t];p(n),h.current();return}t-=e.items.length}},[p]),assistantId:e,isOpen:c,onClose:l});(0,L.useLayoutEffect)(()=>{h.current=g.close});let _=(0,L.useMemo)(()=>{if(!g.query.trim())return d;let e=g.query.toLowerCase().trim();return d.map(t=>({...t,items:t.items.filter(t=>t.title.toLowerCase().includes(e))})).filter(e=>e.items.length>0)},[d,g.query]),v=(0,L.useMemo)(()=>{let e=g.searchResults?de(g.searchResults,f):[];return[..._,...e]},[_,g.searchResults,f]);return(0,L.useLayoutEffect)(()=>{m.current=v}),{commandPalette:g,mergedSections:v,handleItemSelect:(0,L.useCallback)(e=>{p(e),h.current()},[p])}}export{X as a,R as c,ae as i,I as l,ie as n,Y as o,re as r,U as s,me as t,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./copy-to-clipboard-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./copy-to-clipboard-DRZUoOti.js";var r=e(t(),1),i=1500;function a({errorMessage:e}){let[t,a]=(0,r.useState)(!1),o=(0,r.useRef)(null),s=(0,r.useRef)(!0);return(0,r.useEffect)(()=>(s.current=!0,()=>{s.current=!1,o.current&&clearTimeout(o.current)}),[]),{copy:(0,r.useCallback)((t,r)=>{n(t,{errorMessage:e,onCopied:()=>{s.current&&(a(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>a(!1),i),r?.())}})},[e]),copied:t}}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./haptics-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./haptics-BhuZvnto.js";import{t as r}from"./pointer-DLKG188W.js";var i=`ease-out`,a=e(t(),1),o=.5,s=100,c=.3,l=.7,u=10,d=.5;function f(e){return Math.min(s,e*c)}function p(e){return e*o}function m(e){return e instanceof Element?e.closest(`input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-message-text]`)!==null:!1}function h(e,t,n){return!(e>p(t)||n&&e>20)}function g(e,t){return Math.abs(t)>Math.abs(e)*l}function _(e,t){return Math.abs(e)<u&&Math.abs(t)<u?`pending`:g(e,t)||e<=0?`cancel`:`confirm`}function v(e,t){return e<=t?e:t+(e-t)*d}function y(e,t){return Math.min(0,e-t)}function b(e,t){return e>=t}function x(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null}function S({enabled:e,onConfirm:t,onMove:i,onCommit:o,onCancel:s}){let c=(0,a.useRef)(null),l=(0,a.useRef)(e),u=(0,a.useRef)({onConfirm:t,onMove:i,onCommit:o,onCancel:s});(0,a.useLayoutEffect)(()=>{l.current=e,u.current={onConfirm:t,onMove:i,onCommit:o,onCancel:s}}),(0,a.useEffect)(()=>{if(!r())return;let e=()=>f(window.innerWidth),t=e=>{c.current=null,u.current.onCancel(e)},i=e=>{if(!l.current||c.current||e.touches.length!==1)return;let t=e.touches[0];t&&h(t.clientX,window.innerWidth,m(e.target))&&(c.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1})},a=r=>{let i=c.current;if(!i)return;if(r.touches.length>1){t(!1);return}let a=x(r.touches,i.touchId);if(!a)return;let o=a.clientX-i.startX,s=a.clientY-i.startY;if(!i.confirmed){let e=_(o,s);if(e===`pending`)return;if(e===`cancel`){t(!1);return}i.confirmed=!0,u.current.onConfirm?.()}let l=e();if(g(o,s)&&o<l){t(!0);return}o>=l&&!i.hasFiredHaptic&&(i.hasFiredHaptic=!0,n.light()),u.current.onMove(o,l,a.clientX)},o=n=>{let r=c.current;if(!r)return;let i=x(n.changedTouches,r.touchId),a=i?i.clientX-r.startX:0,o=e();r.confirmed&&b(a,o)?(c.current=null,u.current.onCommit(a,o)):r.confirmed?t(!0):t(!1)},s=()=>{t(c.current?.confirmed??!1)};return document.addEventListener(`touchstart`,i,{passive:!0}),document.addEventListener(`touchmove`,a,{passive:!0}),document.addEventListener(`touchend`,o,{passive:!0}),document.addEventListener(`touchcancel`,s,{passive:!0}),()=>{c.current=null,document.removeEventListener(`touchstart`,i),document.removeEventListener(`touchmove`,a),document.removeEventListener(`touchend`,o),document.removeEventListener(`touchcancel`,s)}},[])}export{i,v as n,S as r,y as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-lLsbgbrj.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-Cv2QeVDK.js","assets/api-Dppu0jIX.js","assets/local-mode-DP-5m-kS.js","assets/is-electron-BSK3AUxG.js","assets/create-selectors-C7uuHryP.js","assets/react-BFJW0bSv.js","assets/local-settings-Bx7FsNo5.js","assets/api-C72Ea0va.js","assets/sdk.gen-CMy8CiG0.js","assets/client.gen-Dy7VKLYs.js","assets/sdk.gen-Br55zhZN.js","assets/api-errors-BTOPGXDV.js","assets/use-assistant-avatar--hNHYiPK.js","assets/utils-1ZnEn_W1.js","assets/assistant-identity-store-DTP7xfNP.js","assets/semver-CzvoYi37.js","assets/QueryClientProvider-CMu7CkQU.js","assets/jsx-runtime-D3ZM-ToX.js","assets/useQuery-Bz-fbQ-m.js","assets/composer-settings-DYfbHO-e.js","assets/funnel-events-CH_O9aTg.js","assets/prefs-Bxlc7g3M.js","assets/onboarding-store-CfEbEnN0.js","assets/device-settings-DZvv4pnY.js","assets/consent-9-XXaxZ9.js","assets/ingest-BwYkhorN.js","assets/platform-detection-D4gxJctC.js","assets/native-deep-link-DliAfHU5.js","assets/domains-DUzxnQ3r.js","assets/routes-C293MsBG.js","assets/dist-D8V9YSOm.js","assets/use-bus-subscription-CBlDL_ew.js","assets/event-bus-CibPCHnD.js","assets/capture-error-Cdvvw9J5.js","assets/client-feature-flag-store-B9Bz0uyL.js","assets/feature-flag-catalog-svwKfQY_.js","assets/theme-preferences-eO-_-Yel.js","assets/typed-storage-DjhDRFKz.js","assets/button-DSjqKLvM.js","assets/dist-DHB1G-V6.js","assets/bundle-mjs-BQxDdOEo.js","assets/cn-DFWryB3N.js","assets/checkbox-DyHMOWN6.js","assets/createLucideIcon-C_IfoPaZ.js","assets/check-CNBoUiyR.js","assets/typography-BeUa5Fd-.js","assets/src-njXJqrpo.js","assets/dist-CYFZCv2b.js","assets/dist-Df8G739y.js","assets/select-B86W_Hs8.js","assets/Combination-CZCRM_nS.js","assets/chevron-down-B_6pb9kS.js","assets/field-Dq8jxCGe.js","assets/modal-Bt1DPFgW.js","assets/x-BY-Np61T.js","assets/menu-Gu_6PRrL.js","assets/chevron-right-Dx_5VMo6.js","assets/toast-BrKo5b4d.js","assets/circle-alert-DEIiXMF-.js","assets/circle-check-BG2g8udA.js","assets/info-Bjcv3rf9.js","assets/card-q0GJX1HZ.js","assets/confirm-dialog-DNaRfy4W.js","assets/loader-circle-oY5laABh.js","assets/triangle-alert-C5SOfs-q.js","assets/input-BG94bPcH.js","assets/notice-C9v3KOP3.js","assets/progress-bar-3n-2T7Oy.js","assets/skeleton-CzdJByjE.js","assets/tag-D0oiSRye.js","assets/toggle-ibKLySIy.js","assets/src-CfUWwwYf.css","assets/profile-pickers-DBCSE_FG.js","assets/identity-CgcUPHQZ.js","assets/auth-store-B9pHhreb.js","assets/remote-gateway-session-DxuSBHli.js","assets/push-registration-CIhXf1CF.js","assets/resolved-assistants-store-BuqctGKE.js","assets/operational-status-BsKLhv9Z.js","assets/react-query.gen-CqLxrlpP.js","assets/useMutation-CXGTrp4W.js","assets/infiniteQueryOptions-CqLc14_4.js","assets/queryOptions-CMSBCFOf.js","assets/use-is-org-ready-DyYOTCvQ.js","assets/use-platform-gate-zft2-meL.js","assets/diagnostics-B6s70M5A.js","assets/retire-confirm-dialog-BD1rkM8j.js","assets/navigation-resolver-CDeIpFuD.js","assets/research-onboarding-persistence-D9HRWnHA.js","assets/build-state-bnyw3m5Y.js","assets/remove-from-device-dialog-DSScuMVd.js","assets/use-command-palette-sections-BFV15eUp.js","assets/chat-BfpNzA77.js","assets/haptics-BhuZvnto.js","assets/calendar-DFz-eSzk.js","assets/globe-BQ4oUIDW.js","assets/layout-grid-C3zr7IEa.js","assets/message-square-UW8LcsnU.js","assets/monitor-4IGIx6Wb.js","assets/settings-bHOjP4mt.js","assets/use-sticky-profiles-D6xRVCOS.js","assets/react-query.gen-vkBavCkI.js","assets/i18n-BR-AyG5b.js","assets/Trans-CPcWO-v6.js","assets/useTranslation-DxUSOwQs.js","assets/shim-KJVQ35XO.js","assets/add-credential-modal-Bn2SkYV8.js","assets/use-active-assistant-id-Btl1-4sB.js","assets/key-round-BeLlbSFj.js","assets/app-card-BrtrF2PU.js","assets/viewer-store-DWY4BtGj.js","assets/workspace-path-links-ORUgKDWB.js","assets/open-workspace-file-DFo0Oq0o.js","assets/sandbox-bridge-BismgxxG.js","assets/copy-to-clipboard-DRZUoOti.js","assets/deploy-store-BAIpED5W.js","assets/native-file-B9kJgftd.js","assets/edge-swipe-arbiter-store-ChMvF7t2.js","assets/misc-wmny7PlA.js","assets/pointer-DLKG188W.js","assets/use-media-query-CtzETH7h.js","assets/external-link-D65yhWAV.js","assets/puzzle-o8S9l_NJ.js","assets/use-edit-app-BlsO9Zav.js","assets/use-is-mobile-BONxmNg6.js","assets/use-touch-mobile-CXJ4hTiW.js","assets/conversation-store-BnS0mmz7.js","assets/edit-chat-session-B38z6oPP.js","assets/chevron-up-CU46uUqC.js","assets/link-2-CA1w44Gq.js","assets/minimize-2-DZa-Yfq6.js","assets/pencil-kTdx15WT.js","assets/refresh-cw-Cvdm1xeK.js","assets/chunk-5KNZJZUH-BUqIilZr.js","assets/avatar-renderer-Bja-CJEM.js","assets/avatar-svg-compositor-B0_MqIec.js","assets/animated-avatar--_W54iT9.js","assets/use-reduced-motion-D2PbFfB8.js","assets/reduced-motion-C6t3gGc_.js","assets/chat-avatar-RM6-aunH.js","assets/sound-manager-CTd-DV3i.js","assets/proxy-Do-Khsj0.js","assets/telegram-setup-wizard-D_Vwl3_I.js","assets/use-copy-to-clipboard-BeG7f_tZ.js","assets/browser-DwONNRIj.js","assets/clipboard-copy-BL49CFI3.js","assets/detail-shell-6omiDynS.js","assets/apple-logo-Biu93CTa.js","assets/use-discord-nudge-FuXIZ_hw.js","assets/middleware-uwxeHHVb.js","assets/integration-icon-CsZDnIcJ.js","assets/public-asset-C2ociEGf.js","assets/chat-layout-slots-store-Diue1siL.js","assets/document-viewer-container-CiSaZjGT.js","assets/use-local-file-info-Dz017Fii.js","assets/circle-check-big-BRKMTxhd.js","assets/download-Bld7ch1X.js","assets/file-text-Ha6XXdS_.js","assets/message-square-text-B06iN0sm.js","assets/send-CpbQGYQ9.js","assets/trash-2-DL_3_16e.js","assets/user-Bw0w1JwI.js","assets/not-found-mMT3d6dm.js","assets/arrow-left-xVF3p2Qp.js","assets/sparkles-DB7sSiA2.js","assets/platform-login-notice-CM-AbOQ7.js","assets/use-onboarding-login-DMUDDVUi.js","assets/login-flow-imrf1-ub.js","assets/native-auth-error-CFWzetfp.js","assets/external-urls-Dz7v7Xuw.js","assets/log-in-BE4abPjq.js","assets/runtime-upgrade-banner-BeO8tW05.js","assets/local-runtime-upgrade-Bwp6_dxW.js","assets/cloud-off-CpFUHEgx.js","assets/moon-C8Wjcz8V.js","assets/wrench-Bpk2afMn.js","assets/voice-providers-note-CuMBTzti.js","assets/use-stt-language-selection-D7DxP7Eo.js","assets/use-voice-sample-preview-CLWX7j-h.js","assets/search-DbyaO8rG.js","assets/square-DD_y88hI.js","assets/volume-2-DgWyCs5f.js","assets/use-save-twilio-credentials-COzAERtv.js","assets/sdk.gen-CUWXKhFV.js","assets/use-swipe-engine-xGdF8hBv.js","assets/mail-B0iH8Wii.js","assets/message-circle-8fKbbQcs.js","assets/smartphone-PXi_KwFC.js","assets/acp-run-store-k9Syb04D.js","assets/by-tool-use-id-index-xzJzBHo0.js","assets/optimistic-lifecycle-DIWfvuIw.js","assets/messages-ctx0P03F.js","assets/prechat-CavQeV1_.js","assets/effective-timezone-BHJf6K2g.js","assets/browser-timezone-BtQlRGbC.js","assets/background-task-store-r1LOGfBn.js","assets/use-transcript-messages-BL55GFRr.js","assets/use-attachment-preview-jmFGN8h6.js","assets/file-markdown-EG3aJEi8.js","assets/pdf-preview-DEWKJD0r.js","assets/chevron-left-B7yHWg2l.js","assets/file-7EmuTJEW.js","assets/client-perf-Daz5cYUH.js","assets/acp-run-actions-CkYR2vBH.js","assets/code-CvwdlCR7.js","assets/background-task-actions-D3TOUuY8.js","assets/message-content-BrFs5fmC.js","assets/multi-activity-group-DuW4ziR3.js","assets/site-favicon-BvIzxzVw.js","assets/three-dot-indicator-BhUevb3V.js","assets/AnimatePresence-wQN1d2rQ.js","assets/brain-BkpxPjmn.js","assets/plug-CQDevvb-.js","assets/user-plus-Vg2Aibhi.js","assets/subagent-store-B0Ftpguk.js","assets/circle-x-BQYELb1V.js","assets/file-plus-D7oOJ8y7.js","assets/terminal-BDxxes3v.js","assets/use-attachment-squares-BSKsILdv.js","assets/archive-Cp86wmG1.js","assets/chat-markdown-message-DWQZLyLI.js","assets/workspace-tree-query-BfWSVQB5.js","assets/native-anchor-BE-YHt8Q.js","assets/ellipsis-Dm3PecnW.js","assets/eye-off-DFGH3cWw.js","assets/eye-DO1vbwRG.js","assets/preview-skeleton-BreSI6Ln.js","assets/surface-parse-helpers-COefGJYZ.js","assets/conversation-navigation-tCTlvwgs.js","assets/workflow-store-Bpg1fqWU.js","assets/workflow-status-AIHLnh_i.js","assets/conversation-selection-Da6kgY3F.js","assets/use-subagent-card-data-DOp8Etmj.js","assets/access-wabdRUmQ.js","assets/assistant-feature-flag-store-j3wC3wtf.js","assets/research-results-view-7psD5IrG.js","assets/research-facts-CvoMry5Y.js","assets/ban-4FBs8Anm.js","assets/home-tool-permission-card-NAxzVd1l.js","assets/format-date-mZFhGVxR.js","assets/schedules-JL1Laub-.js","assets/bell-CpYZHPGU.js","assets/clock-DSx5dIWv.js","assets/list-COQcQTOh.js","assets/rotate-ccw-RaucWIHS.js","assets/shield-check-CchXTN7c.js","assets/invalidate-memory-queries-YJf2XJ5P.js","assets/get-memory-stats-Cm70EF9d.js","assets/invalidate-plugin-queries-CySCFK8G.js","assets/onboarding-layout-D8Kv-5kM.js","assets/use-bundled-avatar-components-B4YxFEiT.js","assets/first-run-scope-mN3YhjgX.js","assets/oauth-connection-utils-SS0qmAK4.js","assets/oauth-popup-CLa9h8TF.js","assets/settings-navigation-vp8wtiyE.js","assets/hard-navigate-CpR5x8Nr.js","assets/use-supports-bookmarks-SDHU-RBu.js","assets/bug-DwW8prtd.js","assets/chart-column-DupTx7Uc.js","assets/cpu-BO_MyzHO.js","assets/mic-BuTY2uVU.js","assets/sliders-horizontal-DOPSCMHk.js","assets/users-BI74h_lc.js","assets/onboarding-navigation-BI2ZIqE9.js","assets/workspace-theme-tokens-Bod0vp12.js","assets/conversation-queries-DkkuIyRB.js","assets/conversation-list-fetchers-eA7yZMEu.js","assets/use-edge-swipe-BxVxJfNS.js","assets/use-app-theme-CODorJpK.js","assets/use-assistant-capability-B55Ji4gD.js","assets/use-avatar-accent-var-DzqC3Diq.js","assets/avatar-bundled-components-OjPlNcdB.js","assets/use-body-scroll-lock-C7SDkbNZ.js","assets/use-bookmarks-gJWrPT2g.js","assets/daily-reset-time-B28vdbVK.js","assets/use-element-size-DeouS2c2.js","assets/plugins-surface-CLpV3JV6.js","assets/android-consumption-only-CwC2kibz.js","assets/installed-plugins-query-DeGY29mj.js","assets/doctor-handoff-store-DbvChP6h.js","assets/threshold-presets-Bm9FqtVb.js","assets/shield-B-KbNxGy.js","assets/trust-rules-api-CEt20Kh9.js","assets/desktop-voice-activity-CHblqyyn.js","assets/dictation-overlay-BLLyYBjv.js","assets/notifications-Dx3P9a9Q.js","assets/esm-tXi8GsTV.js","assets/page-surface-store-LM8JrGI5.js","assets/avatar-subagent-C1J2pUFc.js","assets/avatar-tone-CTq4cNAY.js","assets/conversation-cache-ztu3M4pz.js","assets/eye-bbox-BR5NO1BX.js","assets/use-effective-timezone-CEgnEQb7.js","assets/useInfiniteQuery-Dk8q0n49.js","assets/animate-WKjTn2w_.js","assets/arrow-down-to-line-BUIhl9J1.js","assets/arrow-right-BWL8Hl6K.js","assets/arrow-up-BNWtJ6NE.js","assets/upload-Bq5fidDK.js","assets/circle-minus-CHiR1az9.js","assets/cloud-BkCUNbc7.js","assets/coins-B6rJlYQ0.js","assets/file-code-Cm27jzr0.js","assets/image-CwetkbD4.js","assets/folder-DH-nMTDt.js","assets/hard-drive-BxeWK7dU.js","assets/heart-C4jBeqJF.js","assets/inbox-BbYgNGwk.js","assets/laptop-BX8NMrC1.js","assets/lightbulb-C2QxQWpK.js","assets/link-BQJduA1e.js","assets/log-out-D4mnwX29.js","assets/paperclip-BIlwG8TK.js","assets/play-kF4y_ovX.js","assets/plus-CwK68LCA.js","assets/sun-Drx9AZm7.js","assets/workflow-Dv9IyYS0.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./preload-helper-Cv2QeVDK.js";import{c as r}from"./chunk-5KNZJZUH-BUqIilZr.js";import{i,n as a,r as o}from"./use-edge-swipe-BxVxJfNS.js";import{t as s}from"./edge-swipe-arbiter-store-ChMvF7t2.js";var c=e(t(),1),l=new Set;function u(e){if(typeof e==`function`){e().catch(()=>{});return}for(let t of Object.values(e))typeof t==`function`&&t().catch(()=>{})}function d(e){!e||l.has(e)||(l.add(e),n(async()=>{let{routeTree:e}=await import(`./routes-lLsbgbrj.js`).then(e=>e.n);return{routeTree:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318])).then(({routeTree:t})=>{let n=r(t,e);for(let e of n??[]){let t=e.route.lazy;t&&u(t)}}).catch(()=>{l.delete(e)}))}var f=.25;function p(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function m({containerRef:e,onBack:t,enabled:n,navKey:r,prefetchHref:l}){let u=(0,c.useRef)(t);(0,c.useLayoutEffect)(()=>{u.current=t},[t]);let m=(0,c.useRef)(l);(0,c.useLayoutEffect)(()=>{m.current=l},[l]);let h=(0,c.useRef)(!1),g=(0,c.useRef)(new Set),_=(0,c.useRef)(!1),v=s.use.registerBackOwner(),y=s.use.unregisterBackOwner();(0,c.useEffect)(()=>{if(n)return v(),y},[n,v,y]),(0,c.useEffect)(()=>{_.current=!1;let t=g.current;return()=>{_.current=!0;for(let e of t)clearTimeout(e);t.clear();let n=e.current;n&&p(n)}},[e]);let b=(e,t)=>{let n=setTimeout(()=>{g.current.delete(n),_.current||e()},t);g.current.add(n)},x=(e,t)=>{e.style.transform=t===0?``:`translateX(${t}px)`},S=e=>{e.style.transition=`transform 200ms ${i}`,x(e,0);let t=()=>{e.removeEventListener(`transitionend`,t),p(e)};e.addEventListener(`transitionend`,t,{once:!0}),b(()=>p(e),250)},C=e=>{e.style.transition=`transform 150ms ${i}`,x(e,window.innerWidth);let t=!1,n=()=>{if(t||_.current)return;t=!0,e.removeEventListener(`transitionend`,n);let r=-(window.innerWidth*f);e.style.transition=`none`,e.style.transform=`translateX(${r}px)`,e.style.opacity=`0`,e.offsetWidth,h.current=!0,u.current(),b(()=>{h.current&&(h.current=!1,p(e))},400)};e.addEventListener(`transitionend`,n,{once:!0}),b(n,200)};o({enabled:n,onConfirm:()=>{d(m.current);let t=e.current;t&&(t.style.transition=`none`,t.style.willChange=`transform`)},onMove:(t,n)=>{let r=e.current;r&&x(r,a(t,n))},onCommit:()=>{let t=e.current;if(!t){u.current();return}C(t)},onCancel:t=>{let n=e.current;n&&(t?S(n):p(n))}}),(0,c.useLayoutEffect)(()=>{if(!h.current)return;h.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),p(t))};t.style.transition=`transform 200ms ${i}, opacity 200ms ${i}`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let a=setTimeout(r,250);return()=>{clearTimeout(a),t.removeEventListener(`transitionend`,r),p(t)}},[r,e])}export{m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{d as r,u as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./typography-BeUa5Fd-.js";import{L as s,V as c}from"./src-DjIqxQVd.js";import{t as l}from"./createLucideIcon-C_IfoPaZ.js";import{t as u}from"./chevron-up-CU46uUqC.js";import{t as d}from"./menu-Gu_6PRrL.js";import{t as f}from"./globe-BQ4oUIDW.js";import{t as p}from"./link-2-CA1w44Gq.js";import{t as m}from"./loader-circle-oY5laABh.js";import{n as h,t as g}from"./minimize-2-DZa-Yfq6.js";import{t as _}from"./pencil-kTdx15WT.js";import{t as v}from"./refresh-cw-Cvdm1xeK.js";import{t as y}from"./x-BY-Np61T.js";import{n as b}from"./resolved-assistants-store-BuqctGKE.js";import{t as x}from"./client.gen-Dy7VKLYs.js";import{n as S}from"./event-bus-CibPCHnD.js";import{d as C}from"./routes-C293MsBG.js";import{t as w}from"./conversation-store-BnS0mmz7.js";import{i as T}from"./viewer-store-D3KM2E2N.js";import{n as E}from"./use-is-mobile-BONxmNg6.js";import{t as D}from"./misc-wmny7PlA.js";import{t as O}from"./use-touch-mobile-JVxY9M-0.js";import{r as k,t as A}from"./edit-chat-session-CcwN_rea.js";import{n as j,o as M,s as N,t as P}from"./sandbox-bridge-ajRoXgYL.js";var F=l(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),I=l(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),L=a(),R=e(t(),1),z=`flags.toggleAppsSandboxDisabled`,B=!1,V=new Set;function H(){return B}function U(e){let t=e===void 0?!B:e===!0;if(t===B)return console.info(`[vellumDebug] ${z}: already ${String(t)}.`),B;B=t,t?console.warn(`[vellumDebug] ${z} = true: app iframes render without the sandbox attribute. App HTML runs same-origin with the host and can reach its DOM, storage, and cookies. Open apps reload to pick this up. Call it again, or reload the page, to restore the sandbox.`):console.info(`[vellumDebug] ${z} = false: app iframes are sandboxed again.`);for(let e of V)e();return B}function W(e){return V.add(e),()=>{V.delete(e)}}function G(){return(0,R.useSyncExternalStore)(W,H,()=>!1)}function K({appName:e,onEdit:t,isEditing:r,onShare:i,isSharing:a,onDeploy:s,isDeploying:c,deployedUrl:l,onCopyDeployedLink:d,onToggleFullscreen:g,onClose:v}){let b=E()&&r===!0&&t!=null,x=i!=null&&s!=null,S=l!=null&&l!==``&&d!=null;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between rounded-t-xl bg-[var(--surface-lift)] px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`hidden md:flex items-center min-w-[72px]`,children:t!=null&&(r?(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(F,{}),onClick:t,tooltip:`Expand app`,"aria-label":`Expand app`}):(0,L.jsx)(n,{onClick:t,children:`Edit`}))}),(0,L.jsx)(o,{variant:`body-large-default`,className:D(`flex-1 truncate text-left md:text-center text-[var(--content-emphasised)]`,b&&`cursor-pointer`),style:{lineHeight:1.4},onClick:b?t:void 0,children:e}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-[72px] justify-end`,children:[x?(0,L.jsx)(q,{onShare:i,isSharing:a,onDeploy:s,isDeploying:c,deployedUrl:l,onCopyDeployedLink:d}):(0,L.jsxs)(L.Fragment,{children:[s!=null&&(S?(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(p,{}),onClick:d,tooltip:`Deployed: copy link`,"aria-label":`Deployed to Vercel, copy link`}):(0,L.jsx)(n,{variant:`outlined`,iconOnly:c?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(f,{}),onClick:s,disabled:c,tooltip:c?`Deploying…`:`Deploy`,"aria-label":c?`Deploying…`:`Deploy`})),i!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:a?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(I,{}),onClick:i,disabled:a,tooltip:a?`Sharing…`:`Share`,"aria-label":a?`Sharing…`:`Share`})]}),g!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(h,{}),onClick:g,tooltip:`Fullscreen`,"aria-label":`Fullscreen`}),t!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:r?(0,L.jsx)(u,{}):(0,L.jsx)(_,{}),onClick:t,tooltip:r?`Open app`:`Edit`,"aria-label":r?`Open app`:`Edit`,active:r,className:`md:hidden`}),(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(y,{}),onClick:v,tooltip:`Close`,"aria-label":`Close`})]})]})}function q({onShare:e,isSharing:t,onDeploy:r,isDeploying:i,deployedUrl:a,onCopyDeployedLink:o}){let l=O(),[u,h]=(0,R.useState)(!1),g=a!=null&&a!==``&&o!=null,_=t||i,y=_?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(I,{}),b=t?`Sharing…`:i?`Deploying…`:`Share & deploy`;return l?(0,L.jsxs)(c.Root,{open:u,onOpenChange:h,children:[(0,L.jsx)(c.Trigger,{asChild:!0,children:(0,L.jsx)(n,{variant:`outlined`,iconOnly:y,disabled:_,tooltip:b,"aria-label":b})}),(0,L.jsxs)(c.Content,{"aria-describedby":void 0,children:[(0,L.jsx)(c.Header,{className:`sr-only`,children:(0,L.jsx)(c.Title,{children:`Share & deploy`})}),(0,L.jsxs)(c.Body,{className:`pt-0`,children:[(0,L.jsx)(s,{icon:I,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Share`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{h(!1),e()}}),g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(s,{icon:p,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Deployed to Vercel`}),(0,L.jsx)(`span`,{className:`break-all text-body-small-default text-[var(--content-tertiary)]`,children:a})]}),onSelect:()=>{h(!1),o?.()}}),(0,L.jsx)(s,{icon:v,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Redeploy`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish the current version`})]}),onSelect:()=>{h(!1),r()}})]}):(0,L.jsx)(s,{icon:f,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Deploy to Vercel`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{h(!1),r()}})]})]})]}):(0,L.jsxs)(d.Root,{open:u,onOpenChange:h,children:[(0,L.jsx)(d.Trigger,{asChild:!0,children:(0,L.jsx)(n,{variant:`outlined`,iconOnly:y,disabled:_,tooltip:b,"aria-label":b})}),(0,L.jsxs)(d.Content,{align:`end`,sideOffset:4,children:[(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(I,{size:14}),onSelect:()=>e(),className:`whitespace-nowrap`,children:`Share`}),g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(p,{size:14}),shortcut:`Copy link`,onSelect:()=>o?.(),className:`whitespace-nowrap`,children:`Deployed to Vercel`}),(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(v,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Redeploy`})]}):(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(f,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Deploy to Vercel`})]})]})}var J=[`assistant:`,`conversation:`,`conversations:`,`apps:`,`documents:`,`plugins:`,`feature-flags:`];function Y(e){return J.some(t=>e.startsWith(t))}function X(e,t){if(e.length===0)return[];let n=new Set(e);return t.filter(e=>n.has(e)&&!Y(e))}function Z(e,t){let{frameId:n,assistantId:r,appId:i,enabled:a=!0,onAction:o,onOpenVellumLink:s}=t,c=(0,R.useRef)(new Map);(0,R.useEffect)(()=>{let t=c.current,l=async c=>{let l=c.data;if(!l||l.frameId!==n||c.source!==e.current?.contentWindow)return;if(l.type===`vellum_subscribe`){if(!a)return;let{subId:e,tags:n}=l;typeof e==`string`&&Array.isArray(n)&&t.set(e,new Set(n.filter(e=>typeof e==`string`)));return}if(l.type===`vellum_unsubscribe`){let{subId:e}=l;typeof e==`string`&&t.delete(e);return}if(l.type===`vellum_surface_action`){o?.(l.actionId,l.data);return}if(l.type===`vellum_open_link`){if(!navigator.userActivation?.isActive)return;s?.(l.href,l.linkText);return}if(l.type===`vellum_asset_request`){let{callId:t,path:n}=l,o=e.current,s=(e,t)=>{o?.contentWindow?.postMessage(e,`*`,t??[])};if(!a){s({type:`vellum_asset_response`,callId:t,error:`Asset proxy disabled`});return}if(!i){s({type:`vellum_asset_response`,callId:t,error:`No app context for assets`});return}if(typeof n!=`string`||n===``||n.includes(`..`)){s({type:`vellum_asset_response`,callId:t,error:`Invalid asset path`});return}try{let e=`/v1/assistants/${r}/apps/${i}/asset/${n.split(`/`).map(encodeURIComponent).join(`/`)}`,{data:a,response:o}=await x.get({url:e,parseAs:`blob`,throwOnError:!1});if(!o?.ok||!(a instanceof Blob)){s({type:`vellum_asset_response`,callId:t,error:`Asset fetch failed (${o?.status??0})`});return}let c=await a.arrayBuffer();s({type:`vellum_asset_response`,callId:t,buffer:c,contentType:a.type||`application/octet-stream`},[c])}catch(e){s({type:`vellum_asset_response`,callId:t,error:e instanceof Error?e.message:`Asset proxy error`})}return}if(!a||l.type!==`vellum_fetch_request`)return;let{callId:u,path:d,method:f,headers:p,body:m}=l,h=e.current,g=e=>{h?.contentWindow?.postMessage(e,`*`)};if(!P.test(d)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: only /v1/x/ custom routes are allowed`});return}try{let e=new URL(d,`https://placeholder`).pathname;if(!P.test(e)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: path traversal detected`});return}}catch{g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: invalid path`});return}let _=`/v1/assistants/${r}/${d.replace(/^\/v1\//,``)}`;try{let e={url:_,throwOnError:!1,headers:p&&Object.keys(p).length>0?p:void 0,body:m?JSON.parse(m):void 0},t=await(f===`POST`?x.post:f===`PUT`?x.put:f===`PATCH`?x.patch:f===`DELETE`?x.delete:x.get)(e),n=t.response,r=t.data??t.error,i=r==null?``:typeof r==`string`?r:JSON.stringify(r);g({type:`vellum_fetch_response`,callId:u,status:n?.status??0,statusText:n?.statusText??``,body:i})}catch(e){g({type:`vellum_fetch_response`,callId:u,error:e instanceof Error?e.message:`Fetch proxy error`})}};window.addEventListener(`message`,l);let u=S(`sse.event`,r=>{let i=r.message;if(!i||i.type!==`sync_changed`||!Array.isArray(i.tags))return;let a=e.current?.contentWindow;if(!a||t.size===0)return;let o=i.tags.filter(e=>typeof e==`string`);for(let[e,r]of t){let t=X([...r],o);t.length>0&&a.postMessage({type:`vellum_event`,frameId:n,subId:e,event:{type:`sync_changed`,tags:t}},`*`)}});return()=>{window.removeEventListener(`message`,l),u()}},[n,r,i,a,o,s,e])}var Q=`allow-scripts allow-popups allow-popups-to-escape-sandbox`;function $({appId:e,appName:t,html:r,assistantId:i,onClose:a,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,route:f,enableFullscreen:p=!1,onAction:m}){let h=(0,R.useRef)(null),[_,v]=(0,R.useState)(!1),y=(0,R.useCallback)(()=>v(e=>!e),[]);(0,R.useEffect)(()=>{v(!1)},[e]),(0,R.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),v(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let b=(0,R.useMemo)(()=>j(r,e,{fetch:!0,route:f}),[r,e,f]),x=G(),S=(0,R.useMemo)(()=>{let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e)|0;return`app-${e}-${t}${x?`-nosandbox`:``}`},[r,e,x]);Z(h,{frameId:e,assistantId:i,appId:e,onAction:m});let{deployedUrl:C}=N(i,e,{enabled:u!=null}),w=(0,R.useCallback)(()=>{C!=null&&M(C)},[C]);return(0,L.jsxs)(`div`,{"data-testid":`app-viewer-root`,className:D(`flex flex-col overflow-hidden bg-[var(--surface-base)]`,_?`fixed inset-0 z-[60]`:`h-full rounded-xl`),children:[!_&&(0,L.jsx)(K,{appName:t,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,deployedUrl:C,onCopyDeployedLink:w,onToggleFullscreen:p?y:void 0,onClose:a}),(0,L.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[_&&(0,L.jsx)(`div`,{className:`absolute z-10`,style:{top:`max(0.75rem, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,right:`max(0.75rem, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:(0,L.jsx)(n,{variant:`primary`,iconOnly:(0,L.jsx)(g,{}),onClick:y,tooltip:`Exit fullscreen`})}),(0,L.jsx)(`iframe`,{ref:h,srcDoc:b,sandbox:x?void 0:Q,referrerPolicy:`no-referrer`,title:t,className:`h-full w-full border-none`},S)]})]})}function ee(){let e=b.use.activeAssistantId(),t=E(),n=r(),{pathname:a}=i();return(0,R.useCallback)(r=>{if(!e)return;let i=A(e,r.appId)??crypto.randomUUID();k(e,r.appId,i);let o=T.getState();(o.activeAppId!==r.appId||!o.openedAppState)&&(o.openApp(r.appId),o.setLoadedApp(r)),w.getState().setEditingConversationId(i),t?o.minimizeApp():o.enterAppEditing();let s=C.conversation(i);a!==s&&n(s)},[e,t,n,a])}export{I as a,U as i,$ as n,Z as r,ee as t};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{d as r,u as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as a}from"./jsx-runtime-D3ZM-ToX.js";import{t as o}from"./typography-BeUa5Fd-.js";import{H as s,R as c}from"./src-njXJqrpo.js";import{t as l}from"./createLucideIcon-C_IfoPaZ.js";import{t as u}from"./chevron-up-CU46uUqC.js";import{t as d}from"./menu-Gu_6PRrL.js";import{t as f}from"./globe-BQ4oUIDW.js";import{t as p}from"./link-2-CA1w44Gq.js";import{t as m}from"./loader-circle-oY5laABh.js";import{n as h,t as g}from"./minimize-2-DZa-Yfq6.js";import{t as _}from"./pencil-kTdx15WT.js";import{t as v}from"./refresh-cw-Cvdm1xeK.js";import{t as y}from"./x-BY-Np61T.js";import{n as b}from"./resolved-assistants-store-BuqctGKE.js";import{t as x}from"./client.gen-Dy7VKLYs.js";import{n as S}from"./event-bus-CibPCHnD.js";import{d as C}from"./routes-C293MsBG.js";import{t as w}from"./conversation-store-BnS0mmz7.js";import{i as T}from"./viewer-store-DWY4BtGj.js";import{n as E}from"./use-is-mobile-BONxmNg6.js";import{t as D}from"./misc-wmny7PlA.js";import{t as O}from"./use-touch-mobile-CXJ4hTiW.js";import{r as k,t as A}from"./edit-chat-session-B38z6oPP.js";import{n as j,o as M,s as N,t as P}from"./sandbox-bridge-BismgxxG.js";var F=l(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),I=l(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),L=a(),R=e(t(),1),z=`flags.toggleAppsSandboxDisabled`,B=!1,V=new Set;function H(){return B}function U(e){let t=e===void 0?!B:e===!0;if(t===B)return console.info(`[vellumDebug] ${z}: already ${String(t)}.`),B;B=t,t?console.warn(`[vellumDebug] ${z} = true: app iframes render without the sandbox attribute. App HTML runs same-origin with the host and can reach its DOM, storage, and cookies. Open apps reload to pick this up. Call it again, or reload the page, to restore the sandbox.`):console.info(`[vellumDebug] ${z} = false: app iframes are sandboxed again.`);for(let e of V)e();return B}function W(e){return V.add(e),()=>{V.delete(e)}}function G(){return(0,R.useSyncExternalStore)(W,H,()=>!1)}function K({appName:e,onEdit:t,isEditing:r,onShare:i,isSharing:a,onDeploy:s,isDeploying:c,deployedUrl:l,onCopyDeployedLink:d,onToggleFullscreen:g,onClose:v}){let b=E()&&r===!0&&t!=null,x=i!=null&&s!=null,S=l!=null&&l!==``&&d!=null;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between rounded-t-xl bg-[var(--surface-lift)] px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`hidden md:flex items-center min-w-[72px]`,children:t!=null&&(r?(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(F,{}),onClick:t,tooltip:`Expand app`,"aria-label":`Expand app`}):(0,L.jsx)(n,{onClick:t,children:`Edit`}))}),(0,L.jsx)(o,{variant:`body-large-default`,className:D(`flex-1 truncate text-left md:text-center text-[var(--content-emphasised)]`,b&&`cursor-pointer`),style:{lineHeight:1.4},onClick:b?t:void 0,children:e}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-[72px] justify-end`,children:[x?(0,L.jsx)(q,{onShare:i,isSharing:a,onDeploy:s,isDeploying:c,deployedUrl:l,onCopyDeployedLink:d}):(0,L.jsxs)(L.Fragment,{children:[s!=null&&(S?(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(p,{}),onClick:d,tooltip:`Deployed: copy link`,"aria-label":`Deployed to Vercel, copy link`}):(0,L.jsx)(n,{variant:`outlined`,iconOnly:c?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(f,{}),onClick:s,disabled:c,tooltip:c?`Deploying…`:`Deploy`,"aria-label":c?`Deploying…`:`Deploy`})),i!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:a?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(I,{}),onClick:i,disabled:a,tooltip:a?`Sharing…`:`Share`,"aria-label":a?`Sharing…`:`Share`})]}),g!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(h,{}),onClick:g,tooltip:`Fullscreen`,"aria-label":`Fullscreen`}),t!=null&&(0,L.jsx)(n,{variant:`outlined`,iconOnly:r?(0,L.jsx)(u,{}):(0,L.jsx)(_,{}),onClick:t,tooltip:r?`Open app`:`Edit`,"aria-label":r?`Open app`:`Edit`,active:r,className:`md:hidden`}),(0,L.jsx)(n,{variant:`outlined`,iconOnly:(0,L.jsx)(y,{}),onClick:v,tooltip:`Close`,"aria-label":`Close`})]})]})}function q({onShare:e,isSharing:t,onDeploy:r,isDeploying:i,deployedUrl:a,onCopyDeployedLink:o}){let l=O(),[u,h]=(0,R.useState)(!1),g=a!=null&&a!==``&&o!=null,_=t||i,y=_?(0,L.jsx)(m,{className:`animate-spin`}):(0,L.jsx)(I,{}),b=t?`Sharing…`:i?`Deploying…`:`Share & deploy`;return l?(0,L.jsxs)(s.Root,{open:u,onOpenChange:h,children:[(0,L.jsx)(s.Trigger,{asChild:!0,children:(0,L.jsx)(n,{variant:`outlined`,iconOnly:y,disabled:_,tooltip:b,"aria-label":b})}),(0,L.jsxs)(s.Content,{"aria-describedby":void 0,children:[(0,L.jsx)(s.Header,{className:`sr-only`,children:(0,L.jsx)(s.Title,{children:`Share & deploy`})}),(0,L.jsxs)(s.Body,{className:`pt-0`,children:[(0,L.jsx)(c,{icon:I,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Share`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Export as .vellum file`})]}),onSelect:()=>{h(!1),e()}}),g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(c,{icon:p,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Deployed to Vercel`}),(0,L.jsx)(`span`,{className:`break-all text-body-small-default text-[var(--content-tertiary)]`,children:a})]}),onSelect:()=>{h(!1),o?.()}}),(0,L.jsx)(c,{icon:v,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Redeploy`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish the current version`})]}),onSelect:()=>{h(!1),r()}})]}):(0,L.jsx)(c,{icon:f,label:(0,L.jsxs)(`span`,{className:`flex flex-col gap-0.5 overflow-visible whitespace-normal`,children:[(0,L.jsx)(`span`,{children:`Deploy to Vercel`}),(0,L.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Publish as a static page`})]}),onSelect:()=>{h(!1),r()}})]})]})]}):(0,L.jsxs)(d.Root,{open:u,onOpenChange:h,children:[(0,L.jsx)(d.Trigger,{asChild:!0,children:(0,L.jsx)(n,{variant:`outlined`,iconOnly:y,disabled:_,tooltip:b,"aria-label":b})}),(0,L.jsxs)(d.Content,{align:`end`,sideOffset:4,children:[(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(I,{size:14}),onSelect:()=>e(),className:`whitespace-nowrap`,children:`Share`}),g?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(p,{size:14}),shortcut:`Copy link`,onSelect:()=>o?.(),className:`whitespace-nowrap`,children:`Deployed to Vercel`}),(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(v,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Redeploy`})]}):(0,L.jsx)(d.Item,{leftIcon:(0,L.jsx)(f,{size:14}),onSelect:()=>r(),className:`whitespace-nowrap`,children:`Deploy to Vercel`})]})]})}var J=[`assistant:`,`conversation:`,`conversations:`,`apps:`,`documents:`,`plugins:`,`feature-flags:`];function Y(e){return J.some(t=>e.startsWith(t))}function X(e,t){if(e.length===0)return[];let n=new Set(e);return t.filter(e=>n.has(e)&&!Y(e))}function Z(e,t){let{frameId:n,assistantId:r,appId:i,enabled:a=!0,onAction:o,onOpenVellumLink:s}=t,c=(0,R.useRef)(new Map);(0,R.useEffect)(()=>{let t=c.current,l=async c=>{let l=c.data;if(!l||l.frameId!==n||c.source!==e.current?.contentWindow)return;if(l.type===`vellum_subscribe`){if(!a)return;let{subId:e,tags:n}=l;typeof e==`string`&&Array.isArray(n)&&t.set(e,new Set(n.filter(e=>typeof e==`string`)));return}if(l.type===`vellum_unsubscribe`){let{subId:e}=l;typeof e==`string`&&t.delete(e);return}if(l.type===`vellum_surface_action`){o?.(l.actionId,l.data);return}if(l.type===`vellum_open_link`){if(!navigator.userActivation?.isActive)return;s?.(l.href,l.linkText);return}if(l.type===`vellum_asset_request`){let{callId:t,path:n}=l,o=e.current,s=(e,t)=>{o?.contentWindow?.postMessage(e,`*`,t??[])};if(!a){s({type:`vellum_asset_response`,callId:t,error:`Asset proxy disabled`});return}if(!i){s({type:`vellum_asset_response`,callId:t,error:`No app context for assets`});return}if(typeof n!=`string`||n===``||n.includes(`..`)){s({type:`vellum_asset_response`,callId:t,error:`Invalid asset path`});return}try{let e=`/v1/assistants/${r}/apps/${i}/asset/${n.split(`/`).map(encodeURIComponent).join(`/`)}`,{data:a,response:o}=await x.get({url:e,parseAs:`blob`,throwOnError:!1});if(!o?.ok||!(a instanceof Blob)){s({type:`vellum_asset_response`,callId:t,error:`Asset fetch failed (${o?.status??0})`});return}let c=await a.arrayBuffer();s({type:`vellum_asset_response`,callId:t,buffer:c,contentType:a.type||`application/octet-stream`},[c])}catch(e){s({type:`vellum_asset_response`,callId:t,error:e instanceof Error?e.message:`Asset proxy error`})}return}if(!a||l.type!==`vellum_fetch_request`)return;let{callId:u,path:d,method:f,headers:p,body:m}=l,h=e.current,g=e=>{h?.contentWindow?.postMessage(e,`*`)};if(!P.test(d)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: only /v1/x/ custom routes are allowed`});return}try{let e=new URL(d,`https://placeholder`).pathname;if(!P.test(e)){g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: path traversal detected`});return}}catch{g({type:`vellum_fetch_response`,callId:u,error:`Request blocked: invalid path`});return}let _=`/v1/assistants/${r}/${d.replace(/^\/v1\//,``)}`;try{let e={url:_,throwOnError:!1,headers:p&&Object.keys(p).length>0?p:void 0,body:m?JSON.parse(m):void 0},t=await(f===`POST`?x.post:f===`PUT`?x.put:f===`PATCH`?x.patch:f===`DELETE`?x.delete:x.get)(e),n=t.response,r=t.data??t.error,i=r==null?``:typeof r==`string`?r:JSON.stringify(r);g({type:`vellum_fetch_response`,callId:u,status:n?.status??0,statusText:n?.statusText??``,body:i})}catch(e){g({type:`vellum_fetch_response`,callId:u,error:e instanceof Error?e.message:`Fetch proxy error`})}};window.addEventListener(`message`,l);let u=S(`sse.event`,r=>{let i=r.message;if(!i||i.type!==`sync_changed`||!Array.isArray(i.tags))return;let a=e.current?.contentWindow;if(!a||t.size===0)return;let o=i.tags.filter(e=>typeof e==`string`);for(let[e,r]of t){let t=X([...r],o);t.length>0&&a.postMessage({type:`vellum_event`,frameId:n,subId:e,event:{type:`sync_changed`,tags:t}},`*`)}});return()=>{window.removeEventListener(`message`,l),u()}},[n,r,i,a,o,s,e])}var Q=`allow-scripts allow-popups allow-popups-to-escape-sandbox`;function $({appId:e,appName:t,html:r,assistantId:i,onClose:a,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,route:f,enableFullscreen:p=!1,onAction:m}){let h=(0,R.useRef)(null),[_,v]=(0,R.useState)(!1),y=(0,R.useCallback)(()=>v(e=>!e),[]);(0,R.useEffect)(()=>{v(!1)},[e]),(0,R.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&!e.defaultPrevented&&(e.preventDefault(),v(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let b=(0,R.useMemo)(()=>j(r,e,{fetch:!0,route:f}),[r,e,f]),x=G(),S=(0,R.useMemo)(()=>{let t=0;for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e)|0;return`app-${e}-${t}${x?`-nosandbox`:``}`},[r,e,x]);Z(h,{frameId:e,assistantId:i,appId:e,onAction:m});let{deployedUrl:C}=N(i,e,{enabled:u!=null}),w=(0,R.useCallback)(()=>{C!=null&&M(C)},[C]);return(0,L.jsxs)(`div`,{"data-testid":`app-viewer-root`,className:D(`flex flex-col overflow-hidden bg-[var(--surface-base)]`,_?`fixed inset-0 z-[60]`:`h-full rounded-xl`),children:[!_&&(0,L.jsx)(K,{appName:t,onEdit:o,isEditing:s,onShare:c,isSharing:l,onDeploy:u,isDeploying:d,deployedUrl:C,onCopyDeployedLink:w,onToggleFullscreen:p?y:void 0,onClose:a}),(0,L.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[_&&(0,L.jsx)(`div`,{className:`absolute z-10`,style:{top:`max(0.75rem, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,right:`max(0.75rem, var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:(0,L.jsx)(n,{variant:`primary`,iconOnly:(0,L.jsx)(g,{}),onClick:y,tooltip:`Exit fullscreen`})}),(0,L.jsx)(`iframe`,{ref:h,srcDoc:b,sandbox:x?void 0:Q,referrerPolicy:`no-referrer`,title:t,className:`h-full w-full border-none`},S)]})]})}function ee(){let e=b.use.activeAssistantId(),t=E(),n=r(),{pathname:a}=i();return(0,R.useCallback)(r=>{if(!e)return;let i=A(e,r.appId)??crypto.randomUUID();k(e,r.appId,i);let o=T.getState();(o.activeAppId!==r.appId||!o.openedAppState)&&(o.openApp(r.appId),o.setLoadedApp(r)),w.getState().setEditingConversationId(i),t?o.minimizeApp():o.enterAppEditing();let s=C.conversation(i);a!==s&&n(s)},[e,t,n,a])}export{I as a,U as i,$ as n,Z as r,ee as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";var n=e(t(),1),r={w:1280,h:800};function i(){return typeof window>`u`?r:{w:window.innerWidth,h:window.innerHeight}}var a=r,o=new Set;function s(){for(let e of o)e()}function c(e){return o.size===0&&window.addEventListener(`resize`,s),o.add(e),()=>{o.delete(e),o.size===0&&window.removeEventListener(`resize`,s)}}function l(){let e=i();return(e.w!==a.w||e.h!==a.h)&&(a=e),a}function u(){return r}var d=()=>()=>{};function f(e=!0){return(0,n.useSyncExternalStore)(e?c:d,l,u)}function p(){let[e,t]=(0,n.useState)(null),[r,a]=(0,n.useState)(()=>i());return(0,n.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();a(e=>e.w===t.width&&e.h===t.height?e:{w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:r}}export{f as n,p as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{n as r}from"./QueryClientProvider-CMu7CkQU.js";import{t as i}from"./useQuery-Bz-fbQ-m.js";import{t as a}from"./useMutation-CXGTrp4W.js";import{t as o}from"./jsx-runtime-D3ZM-ToX.js";import{t as s}from"./typography-BeUa5Fd-.js";import{et as c}from"./src-njXJqrpo.js";import{_ as l,c as u,g as d,i as f,n as p,r as m,s as h,t as g}from"./use-save-twilio-credentials-COzAERtv.js";import{t as _}from"./check-CNBoUiyR.js";import{t as v}from"./link-2-CA1w44Gq.js";import{t as y}from"./loader-circle-oY5laABh.js";import{t as b}from"./modal-Bt1DPFgW.js";import{t as x}from"./input-BG94bPcH.js";import{n as S}from"./toast-BrKo5b4d.js";import{i as C,n as w,t as T}from"./api-errors-BTOPGXDV.js";import{i as E}from"./utils-1ZnEn_W1.js";import{$t as ee,an as D,rn as O}from"./sdk.gen-Br55zhZN.js";import{$ as k,Q as A,X as j,Z as M,c as N,l as P,w as F}from"./react-query.gen-vkBavCkI.js";import{n as I}from"./sdk.gen-CUWXKhFV.js";import{t as L}from"./copy-to-clipboard-DRZUoOti.js";import{t as R}from"./a2a-invite-BNCOmr8h.js";var z=e(t(),1),B=o(),V=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],H=`trusted_contacts`,U=new Set([`platform`,`a2a`]),W=new Set([`vellum`,`whatsapp`,`discord`]);function G(e){return W.has(e)}var K={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function q(e){return{no_one:`No one can message ${e} on this channel: every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function J(e){return t=>{S.error(t instanceof Error?t.message:e)}}function Y(e){return typeof e==`string`&&V.includes(e)}function X(e){return U.has(e)}function Z(e){return(e?.policies??[]).filter(e=>!X(e.channelType)&&!G(e.channelType)).map(e=>({...e,policy:Y(e.policy)?e.policy:`trusted_contacts`}))}async function Q(e,t,n,r){if(X(t))throw new T(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await I({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(w(o,a,`Failed to save channel policy.`),!o.ok)throw new T(o.status,C(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new T(500,`Gateway returned no policy in response.`);return i.policy}var te=`0.10.0`;function $(){return E(te)}function ne(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function re({open:e,assistantId:t,onClose:r}){let[i,o]=(0,z.useState)(!1),l=(0,z.useRef)(null),u=(0,z.useRef)(!1),d=a({...j({path:{assistant_id:t}})}),f=(0,z.useRef)(d.mutate);(0,z.useLayoutEffect)(()=>{f.current=d.mutate});let p=(0,z.useRef)(d.reset);(0,z.useLayoutEffect)(()=>{p.current=d.reset}),(0,z.useEffect)(()=>{e&&!u.current&&f.current({path:{assistant_id:t}}),u.current=e},[e,t]),(0,z.useEffect)(()=>()=>{l.current&&clearTimeout(l.current)},[]);let m=(0,z.useCallback)(()=>{p.current(),o(!1),l.current&&=(clearTimeout(l.current),null),r()},[r]),h=(0,z.useCallback)(e=>{L(e,{errorMessage:`Couldn't copy the invite link.`,onCopied:()=>{o(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>o(!1),2e3)}})},[]),g=d.isSuccess&&d.data.token?R({senderAssistantId:t,token:d.data.token}):``;return(0,B.jsx)(b.Root,{open:e,onOpenChange:e=>{e||m()},children:(0,B.jsxs)(b.Content,{size:`sm`,children:[(0,B.jsx)(b.Header,{children:(0,B.jsx)(b.Title,{children:`Share Connection Link`})}),(0,B.jsx)(b.Body,{children:d.isPending?(0,B.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,B.jsx)(y,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):d.isError?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,B.jsx)(n,{variant:`outlined`,onClick:()=>d.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):d.isSuccess?(0,B.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,B.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(x,{type:`text`,readOnly:!0,value:g,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,B.jsx)(`button`,{type:`button`,onClick:()=>h(g),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,B.jsx)(_,{className:`h-4 w-4`}):(0,B.jsx)(c,{className:`h-4 w-4`})})]}),d.data.expiresAt!=null&&(0,B.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:ne(d.data.expiresAt)})]}):null}),(0,B.jsx)(b.Footer,{children:(0,B.jsx)(n,{variant:`outlined`,onClick:m,children:`Done`})})]})})}function ie({onClick:e}){return(0,B.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,B.jsx)(v,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function ae(e){let t=r(),n=$(),o=(0,z.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,z.useMemo)(()=>l(o),[o]),c=i({...d(o),enabled:n,select:Z}),f=(0,z.useMemo)(()=>{let e={};for(let t of c.data??[])u(t.channelType)&&(e[t.channelType]=t.policy);return e},[c.data]),p=a({mutationFn:({channelKey:t,policy:n})=>Q(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:s}),onError:J(`Failed to save channel policy`)}),m=(0,z.useCallback)((e,t)=>{p.mutate({channelKey:e,policy:t})},[p]);return n?{policies:f,savingKey:p.isPending?p.variables?.channelKey??null:null,isLoading:c.isPending,isError:c.isError,onChange:m}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var oe={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},se={slack:`Slack is set up but not working. Can you finish it off?`,telegram:`Telegram is set up but not working. Can you finish it off?`,phone:`My phone number is set up but not working. Can you finish it off?`},ce=15e3;function le({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,z.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,z.useMemo)(()=>P(o),[o]),c=i({...N(o),enabled:!!e,refetchInterval:ce,select:e=>e.snapshots}),l=(0,z.useMemo)(()=>ue(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=i({...M(o),enabled:u,select:e=>e.threadMode}),h=ae(e),_=(0,z.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),v=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await ee(n):t===`telegram`?await O(n):t===`phone`&&await D(n)},onSettled:(t,r,i)=>{_(),i===`slack`&&f(n,e)}}),y=p({assistantId:e}),b=m({assistantId:e}),x=g({assistantId:e}),S=a({...k(),onSuccess:()=>{n.invalidateQueries({queryKey:A(o)})}}),C=y.mutate,w=(0,z.useCallback)(e=>{C(e)},[C]),T=b.mutate,E=(0,z.useCallback)((e,t)=>{T({botToken:e,appToken:t})},[T]),j=S.mutate,F=(0,z.useCallback)(t=>{j({path:{assistant_id:e},body:{threadMode:t}})},[j,e]),I=x.mutateAsync,L=(0,z.useCallback)(async(e,t)=>{await I({accountSid:e,authToken:t})},[I]),R=(0,z.useCallback)((e,n=!1)=>{t&&t(n?se[e]:oe[e])},[t]),B=v.mutate,V=(0,z.useCallback)(e=>{B(e)},[B]);return{channels:l,pendingChannelKey:v.isPending?v.variables??null:null,slackThreadMode:d.data,slackThreadModePending:S.isPending,channelPolicies:h.policies,policySavingKey:h.savingKey,policiesLoading:h.isLoading,policiesError:h.isError,onChannelPolicyChange:h.onChange,onSetup:t?R:void 0,onDisconnect:V,onSaveTelegramToken:w,telegramSaveStatus:y.status,telegramSaveError:y.error?.message??null,onSaveSlackConfig:E,slackSaveStatus:b.status,slackSaveError:b.error?.message??null,onSlackThreadModeChange:F,onSaveTwilioCredentials:L}}function ue(e){let t=new Map;for(let n of e)t.set(n.channel,n);return h.map(e=>{let n=t.get(e);return{key:e,status:de(n),address:n?.channelHandle??void 0}})}function de(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function fe(e){let t=r(),[n,i]=(0,z.useState)(!1);return{isOpen:n,open:(0,z.useCallback)(()=>{i(!0)},[]),close:(0,z.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:F({path:{assistant_id:e}})})},[t,e])}}export{$ as a,J as c,K as d,q as f,re as i,H as l,le as n,Q as o,ie as r,Z as s,fe as t,V as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,i as t,it as n,n as r,nt as i,tt as a}from"./auth-store-
|
|
1
|
+
import{$ as e,i as t,it as n,n as r,nt as i,tt as a}from"./auth-store-B9pHhreb.js";var o=5e3;function s(e,t,n){return!n||e!=null?`ready`:t===`error`?`unavailable`:`resolving`}function c(){return s(i(),a.use.status(),t())}function l(){return s(e(),a.getState().status,n(r.getState().platformSession))}function u(){return c()===`ready`}export{c as i,l as n,u as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Cdvvw9J5.js";import{t as n}from"./react-BFJW0bSv.js";import{u as r}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as i}from"./is-electron-BSK3AUxG.js";import{o as a}from"./i18n-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Cdvvw9J5.js";import{t as n}from"./react-BFJW0bSv.js";import{u as r}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as i}from"./is-electron-BSK3AUxG.js";import{o as a}from"./i18n-BR-AyG5b.js";import{D as o}from"./platform-detection-D4gxJctC.js";import{d as s}from"./routes-C293MsBG.js";import{i as c}from"./navigation-resolver-CDeIpFuD.js";import{t as l}from"./build-state-bnyw3m5Y.js";import{n as u}from"./login-flow-imrf1-ub.js";import{i as d,r as f,t as p}from"./native-auth-error-CFWzetfp.js";var m=e(n(),1);function h(e){let n=r(),[h,g]=(0,m.useState)(!1),[_,v]=(0,m.useState)(null),y=(0,m.useRef)(0);return{loading:h,error:_,login:async()=>{let r=e??c(l({sessionSettled:!0,isAuthenticated:!0}),n.pathname),i=++y.current;v(null),g(!0);try{await o(u,`${s.account.providerCallback}?returnTo=${encodeURIComponent(r)}`,{returnTo:r})}catch(e){if(i!==y.current)return;t(e,{context:`onboarding_login`,tags:{authError:f(e)??`unclassified`}}),v(a(`account:${d(e)}`,{community:p})),g(!1)}},cancel:()=>{y.current++,g(!1),v(null),i()&&window.vellum?.auth?.cancelOAuth()}}}export{h as t};
|
package/dist/assets/{use-platform-assistant-id-Bafo85js.js → use-platform-assistant-id-BE6AIost.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{J as n}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{J as n}from"./auth-store-B9pHhreb.js";var r=e(t(),1);function i(e,t){let[i,a]=(0,r.useState)({platformAssistantId:null,isLoading:!1,error:null});return(0,r.useEffect)(()=>{if(!t||!e){a({platformAssistantId:null,isLoading:!1,error:null});return}let r=!0;return a({platformAssistantId:null,isLoading:!0,error:null}),n(e).then(e=>{r&&a({platformAssistantId:e,isLoading:!1,error:null})}).catch(e=>{r&&a({platformAssistantId:null,isLoading:!1,error:e instanceof Error?e:Error(String(e))})}),()=>{r=!1}},[e,t]),i}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{_ as n,b as r}from"./local-mode-DP-5m-kS.js";import{_t as i,i as a,o}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{_ as n,b as r}from"./local-mode-DP-5m-kS.js";import{_t as i,i as a,o}from"./auth-store-B9pHhreb.js";var s=e(t(),1);function c(){let e=i.use.assistantState();return!!(e.kind===`self_hosted`||e.kind===`active`&&e.isLocal)}function l(){let e=i.use.assistantState();return e.kind===`active`&&!e.isLocal}function u(){let e=i.use.assistantState();return e.kind===`loading`||e.kind===`initializing`||e.kind===`cleaning_up`}function d(e={}){let t=p(e);return t===`pending`?`disabled`:t}function f(e={}){let t=p(e),n=m(t===`pending`,e.settleTimeoutMs??5e3);return t===`pending`&&n?`disabled`:t}function p(e){let t=a(),i=o(),s=r(),l=c(),u=i?`disabled`:`pending`;return e.platformHostedOnly?l?`gated`:t?`full`:u:n()&&s?`gated`:t?`full`:u}function m(e,t){let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!e){r(!1);return}let n=setTimeout(()=>r(!0),t);return()=>{clearTimeout(n)}},[e,t]),n}export{f as a,d as i,c as n,u as r,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{h as n,n as r}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./loader-circle-oY5laABh.js";import"./i18n-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{h as n,n as r}from"./chunk-5KNZJZUH-BUqIilZr.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./loader-circle-oY5laABh.js";import"./i18n-BR-AyG5b.js";import{t as o}from"./useTranslation-DxUSOwQs.js";import{a as s,s as c}from"./auth-store-B9pHhreb.js";import{z as l}from"./platform-detection-D4gxJctC.js";import{d as u}from"./routes-C293MsBG.js";import{a as d}from"./use-platform-gate-zft2-meL.js";import{t as f}from"./hard-navigate-CpR5x8Nr.js";import{a as p,o as m}from"./login-flow-imrf1-ub.js";var h=i();function g(){let{t:e}=o(`account`);return(0,h.jsx)(a,{className:`h-6 w-6 animate-spin text-[var(--content-tertiary)]`,"aria-label":e(`authWaitSpinner.loading`)})}var _=e(t(),1);function v({to:e}){let t=p(e);return(0,_.useEffect)(()=>{t&&f(e)},[t,e]),t?null:(0,h.jsx)(r,{to:e,replace:!0})}function y(){let[e]=n(),t=s(),r=c(),i=d(),a=e.get(`returnTo`),o=l(a,u.assistant);if(!a)return{kind:`proceed`,returnTo:null};if(r)return{kind:`wait`};if(!t)return{kind:`proceed`,returnTo:o};if(m(o)){if(i===`pending`)return{kind:`wait`};if(i===`disabled`)return{kind:`proceed`,returnTo:o}}return{kind:`redirect`,node:(0,h.jsx)(v,{to:o})}}export{g as n,y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-DSjqKLvM.js";import{t as r}from"./jsx-runtime-D3ZM-ToX.js";import"./src-njXJqrpo.js";import{r as i,t as a}from"./use-swipe-engine-xGdF8hBv.js";import{t as o}from"./x-BY-Np61T.js";import{t as s}from"./haptics-BhuZvnto.js";import{t as c}from"./use-body-scroll-lock-C7SDkbNZ.js";import{n as l,t as u}from"./use-element-size-DeouS2c2.js";var d=e(t(),1),f=80;function p({enabled:e,onSwipeLeft:t,onSwipeRight:n,commitThresholdPx:r=f}){return a({enabled:e,axis:`horizontal`,commitThresholdPx:r,touchOnly:!0,onCommit:(0,d.useCallback)(e=>{e<=-r?(s.light(),t?.()):e>=r&&(s.light(),n?.())},[r,t,n])})}var m=r(),h=[`a[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function g({open:e,onClose:t,children:r,title:i}){let a=(0,d.useRef)(null),s=(0,d.useRef)(null),l=(0,d.useRef)(t);(0,d.useEffect)(()=>{l.current=t});let{dragOffset:u,isDragging:f,onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y}=p({enabled:e,onSwipeLeft:t});return c(e),(0,d.useEffect)(()=>{if(!e)return;s.current?.focus();let t=e=>{if(e.key===`Escape`&&!e.defaultPrevented){e.preventDefault(),l.current();return}if(e.key!==`Tab`||!a.current)return;let t=a.current.querySelectorAll(h),n=t[0],r=t[t.length-1];if(!n||!r){e.preventDefault();return}let i=document.activeElement,o=a.current.contains(i);e.shiftKey?(!o||i===n)&&(e.preventDefault(),r.focus()):(!o||i===r)&&(e.preventDefault(),n.focus())};return document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`keydown`,t)}},[e]),e?(0,m.jsxs)(`div`,{ref:a,className:`fixed inset-0`,style:{zIndex:40},role:`dialog`,"aria-modal":`true`,"aria-label":i,children:[(0,m.jsx)(`button`,{type:`button`,"aria-label":`Close sidebar`,className:`absolute inset-0 h-full w-full cursor-default`,style:{background:`rgba(0, 0, 0, 0.4)`,zIndex:40},onClick:t}),(0,m.jsxs)(`aside`,{className:`relative flex h-full w-[80vw] max-w-xs flex-col shadow-xl`,style:{background:`var(--surface-lift)`,borderRight:`1px solid var(--border-base)`,zIndex:50,paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,transform:`translateX(${u}px)`,transition:f?`none`:`transform 200ms ease-out`,touchAction:`pan-y`},onTouchStart:g,onTouchMove:_,onTouchEnd:v,onTouchCancel:y,children:[(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b px-4 py-3`,style:{borderColor:`var(--border-base)`},children:[(0,m.jsx)(`span`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:i}),(0,m.jsx)(n,{ref:s,type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,m.jsx)(o,{"aria-hidden":!0}),onClick:t,"aria-label":`Close`,tintColor:`var(--content-tertiary)`})]}),(0,m.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:r})]})]}):null}function _({onClick:e}){return(0,m.jsx)(n,{type:`button`,variant:`ghost`,iconOnly:(0,m.jsx)(i,{"aria-hidden":!0}),onClick:e,"aria-label":`Open sidebar`,tintColor:`var(--content-secondary)`})}var v=640;function y(){let{ref:e,size:t}=u(),n=t.w<=0,r=l(n),i=(n?r.w:t.w)>=v,[a,o]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{i&&o(!1)},[i]),{paneRef:e,hasRoomForList:i,drawerOpen:a,openDrawer:(0,d.useCallback)(()=>o(!0),[]),closeDrawer:(0,d.useCallback)(()=>o(!1),[])}}export{g as n,_ as r,y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-q0GJX1HZ.js";import"./src-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./QueryClientProvider-CMu7CkQU.js";import{t as r}from"./useMutation-CXGTrp4W.js";import{t as i}from"./jsx-runtime-D3ZM-ToX.js";import{t as a}from"./card-q0GJX1HZ.js";import"./src-njXJqrpo.js";import{t as o}from"./createLucideIcon-C_IfoPaZ.js";import{t as s}from"./brain-BkpxPjmn.js";import{t as c}from"./globe-BQ4oUIDW.js";import{t as l}from"./puzzle-o8S9l_NJ.js";import{t as u}from"./terminal-BDxxes3v.js";import{t as d}from"./user-Bw0w1JwI.js";import{t as f}from"./tag-D0oiSRye.js";import{o as p}from"./i18n-BR-AyG5b.js";import{t as m}from"./useTranslation-DxUSOwQs.js";import{i as h,n as g,t as _}from"./api-errors-BTOPGXDV.js";import{xr as v}from"./sdk.gen-Br55zhZN.js";import{_n as y}from"./react-query.gen-vkBavCkI.js";import{t as b}from"./skills-HuNDpwX2.js";var x=o(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]),S=e(t(),1),C=i(),w={vellum:x,clawhub:c,skillssh:u,custom:d,"assistant-memory":s};function T(e,t){switch(e){case`vellum`:return`Vellum`;case`clawhub`:return`Clawhub`;case`skillssh`:return`skills.sh`;case`custom`:return t(`skillOriginBadge.custom`);case`assistant-memory`:return t(`skillOriginBadge.assistantMemory`)}}function E({origin:e}){let{t}=m(`intelligence`),n=e in w?{label:T(e,t),icon:w[e]}:{label:e.replace(/-/g,` `),icon:l};return(0,C.jsx)(f,{tone:`neutral`,leftIcon:(0,S.createElement)(n.icon),className:`capitalize`,children:n.label})}function D(e){return e.kind===`installed`||e.kind===`bundled`}function O(e){return e.kind===`catalog`}function k({icon:e,iconColor:t=`var(--content-tertiary)`,title:n,subtitle:r,children:i}){return(0,C.jsx)(a.Root,{children:(0,C.jsxs)(a.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,C.jsx)(e,{className:`mb-3 h-8 w-8`,style:{color:t},"aria-hidden":!0}),(0,C.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,C.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r}),i]})})}async function A(e,t,n){let{data:r,error:i,response:a}=await v({path:{assistant_id:e},body:n?{slug:t,version:n}:{slug:t},throwOnError:!1}),o=p(`installSkill.failureMessage`,{ns:`intelligence`});if(g(a,i,o),!a.ok)throw new _(a.status,h(i,a,o));return r??{ok:!0}}function j(e,{onRemoved:t}={}){let i=n(),[a,o]=(0,S.useState)(null),[s,c]=(0,S.useState)(null),[l,u]=(0,S.useState)(null),d=(0,S.useCallback)(()=>{b(i,e)},[e,i]),f=r({mutationFn:t=>A(e,t),onMutate:e=>o(e),onSettled:()=>{o(null),d()}}),p=y({onMutate:e=>c(e.path.id),onSuccess:()=>{t?.()},onSettled:()=>{c(null),d()}}),m=(0,S.useCallback)(e=>{f.mutate(e.slug??e.id)},[f]),h=(0,S.useCallback)(e=>{u(e)},[]),g=(0,S.useCallback)(()=>{l&&(p.mutate({path:{assistant_id:e,id:l.id}}),u(null))},[e,l,p]),_=(0,S.useCallback)(()=>{u(null)},[]);return{handleInstall:m,handleRemove:h,isInstallingSkill:(0,S.useCallback)(e=>a===(e.slug??e.id),[a]),isRemovingSkill:(0,S.useCallback)(e=>s===e.id,[s]),skillPendingRemoval:l,confirmRemove:g,cancelRemove:_}}export{E as a,D as i,k as n,x as o,O as r,j as t};
|