@vellumai/web 0.12.2-staging.4 → 0.12.2-staging.6
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/dist/assets/{a2a-invite-C-d__v0P.js → a2a-invite-BOdHy8O9.js} +1 -1
- package/dist/assets/{about-page-BMTVVfA2.js → about-page-COxmu2oQ.js} +1 -1
- package/dist/assets/{account-page-Bu04CQvW.js → account-page-CYNbvuWs.js} +1 -1
- package/dist/assets/{account-shell-0TviHaBf.js → account-shell-CbiWTAQP.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-w4reCx6D.js → acp-run-detail-panel-B5vKfWQN.js} +3 -3
- package/dist/assets/activation-list-route-BOb-rtBa.js +1 -0
- package/dist/assets/{activity-redirect-page-Cgmmb8Rc.js → activity-redirect-page-BWj7yOid.js} +1 -1
- package/dist/assets/{activity-steps-panel-C26DS_qd.js → activity-steps-panel-DmC1H7g8.js} +1 -1
- package/dist/assets/{add-credits-modal-IIKnKS9l.js → add-credits-modal-B0DI6Rs_.js} +1 -1
- package/dist/assets/add-credits-modal-Clg9vuy6.js +1 -0
- package/dist/assets/ai-page-CUKc_nmb.js +1 -0
- package/dist/assets/{android-billing-handoff-BVx_2Qs0.js → android-billing-handoff-CpzR7JDr.js} +1 -1
- package/dist/assets/{api-key-screen-xui6n8NR.js → api-key-screen-fY9JjhTe.js} +1 -1
- package/dist/assets/app-Tg6YU_tZ.js +392 -0
- package/dist/assets/{app-info-4gR8gnBC.js → app-info-B8Mqmeak.js} +1 -1
- package/dist/assets/archive-redirect-page-De-Keegk.js +1 -0
- package/dist/assets/{assistant-status-panel-B-woG0mJ.js → assistant-status-panel-BALzwsAc.js} +1 -1
- package/dist/assets/auth-store-D-6LI7o_.js +1 -0
- package/dist/assets/{auth-welcome-screen-BsYIoTpq.js → auth-welcome-screen-D2mxoZEG.js} +1 -1
- package/dist/assets/avatar-bundled-components-Bo-wVBBE.js +1 -0
- package/dist/assets/avatar-random-ZUs-wFAP.js +2 -0
- package/dist/assets/{await-org-header-settled-euao9G4w.js → await-org-header-settled-CYxBtSPa.js} +1 -1
- package/dist/assets/background-task-detail-panel-D4CYPLDN.js +1 -0
- package/dist/assets/billing-page-CqDMGSHe.js +3 -0
- package/dist/assets/{billing-redirect-page-A8_L7A4l.js → billing-redirect-page-nGTPWHMN.js} +1 -1
- package/dist/assets/{bookmarks-page-Db3QFcDm.js → bookmarks-page-CGd4Okx8.js} +1 -1
- package/dist/assets/{bundle-confirm-page-Cnb49ExR.js → bundle-confirm-page-BuQ9wfYw.js} +1 -1
- package/dist/assets/channel-transcript-panel-Ca2IqSxd.js +1 -0
- package/dist/assets/channels-page-route-BrkM9cD0.js +1 -0
- package/dist/assets/chat-info-panel-CFHg5G5C.js +1 -0
- package/dist/assets/checkout-continuation-ATko7N-k.js +1 -0
- package/dist/assets/{checkout-page-B6HAgaEv.js → checkout-page-CVp2T6mP.js} +1 -1
- package/dist/assets/checkout-return-target-BM6j8E5w.js +1 -0
- package/dist/assets/{command-palette-BIYpDozl.js → command-palette-BuaJlwlj.js} +1 -1
- package/dist/assets/command-palette-DkTYuZU8.js +1 -0
- package/dist/assets/{command-palette-window-page-BMC7dzK0.js → command-palette-window-page-UeoQHE-2.js} +1 -1
- package/dist/assets/common-Bj2G8_g5.js +1 -0
- package/dist/assets/{community-page-BxDoLG0_.js → community-page-rNFPZE2f.js} +1 -1
- package/dist/assets/{companion-accent-pu5Xu8Z6.js → companion-accent-C3xBrXHO.js} +1 -1
- package/dist/assets/{companion-dock-zones-page-BEfMdIVO.js → companion-dock-zones-page-plFxxNVK.js} +1 -1
- package/dist/assets/{companion-layout-Ye64fIzN.js → companion-layout-Cu_j-nKV.js} +1 -1
- package/dist/assets/{companion-popover-Bs6A6445.js → companion-popover-STvrRaku.js} +1 -1
- package/dist/assets/{companion-popover-page-7jpYeiIN.js → companion-popover-page-Dvft1iSc.js} +1 -1
- package/dist/assets/companion-surface-page-DHxOTQOL.js +1 -0
- package/dist/assets/{companion-watch-frame-page-Bk0N7E-g.js → companion-watch-frame-page-DLTwthiI.js} +1 -1
- package/dist/assets/{connect-page-Bf8bYBAk.js → connect-page-BtvEUJj6.js} +1 -1
- package/dist/assets/{consent-controls-N6cnmytV.js → consent-controls-CjyXQ2Ju.js} +1 -1
- package/dist/assets/contacts-gateway-CZ3fJfK5.js +1 -0
- package/dist/assets/contacts-page-route-CNXEHOrf.js +1 -0
- package/dist/assets/{credential-entry-page-2ek7NaCu.js → credential-entry-page-CvXfQZPl.js} +1 -1
- package/dist/assets/credentials-page-DsxuB0Ui.js +1 -0
- package/dist/assets/{csv-preview-BB-EmIxC.js → csv-preview-TFV8b1Dq.js} +1 -1
- package/dist/assets/danger-zone-redirect-page-C23hsdDS.js +1 -0
- package/dist/assets/debug-page-6PKrAjce.js +4 -0
- package/dist/assets/deploy-dialogs-BXYdSkVL.js +1 -0
- package/dist/assets/{deploy-dialogs-BSCor8jx.js → deploy-dialogs-C0gFbHA2.js} +1 -1
- package/dist/assets/{desktop-preview-content-BIp4Vpgt.js → desktop-preview-content-Cc9hlQ4Q.js} +2 -2
- package/dist/assets/{desktop-status-CHoj8auj.js → desktop-status-CPR10G_B.js} +1 -1
- package/dist/assets/{desktop-viewer-86gYrlm2.js → desktop-viewer-Cm09cFMg.js} +2 -2
- package/dist/assets/{detail-card-CGafPdBQ.js → detail-card-pT0agbKq.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-BqhRaB6y.js → detail-panel-stop-button-DWoO-nJN.js} +1 -1
- package/dist/assets/{detail-primitives-DIBzx3XJ.js → detail-primitives-ue4wzzCx.js} +1 -1
- package/dist/assets/developer-page-DcZbWcLH.js +1 -0
- package/dist/assets/devices-redirect-page-Bxu6ZvQb.js +1 -0
- package/dist/assets/{dictation-overlay-page-C9yEcxKh.js → dictation-overlay-page-CG8S4p0x.js} +1 -1
- package/dist/assets/document-load-B8iTfjYL.js +1 -0
- package/dist/assets/{document-load-CZeb0od7.js → document-load-DShQChFM.js} +1 -1
- package/dist/assets/document-viewer-page-BStfu3jJ.js +1 -0
- package/dist/assets/emails-page-BlP1KP70.js +1 -0
- package/dist/assets/{environment-store-7mW8BRRm.js → environment-store-rH-YdiqT.js} +1 -1
- package/dist/assets/{file-diff-view-B9dRfPbB.js → file-diff-view-CO2QJdSQ.js} +1 -1
- package/dist/assets/{file-editor-DtbuATs6.js → file-editor-EZsnOrB1.js} +1 -1
- package/dist/assets/general-page-DjmqGNEh.js +2 -0
- package/dist/assets/hatching-screen-Vx631ARz.js +1 -0
- package/dist/assets/{hosting-screen-D8bCW4Uz.js → hosting-screen-nVYKldkt.js} +1 -1
- package/dist/assets/identity-page-route-B4R5hI3l.js +7 -0
- package/dist/assets/{inspect-page-C2T5Wpgw.js → inspect-page-CYYIbGHx.js} +5 -5
- package/dist/assets/integrations-page-BjXxWGKz.js +1 -0
- package/dist/assets/{intelligence-layout-jyahyAWu.js → intelligence-layout-BUGM35jP.js} +1 -1
- package/dist/assets/intelligence-layout-slots-store-nrEU1pdD.js +1 -0
- package/dist/assets/keyboard-shortcuts-redirect-page-UFsztRh3.js +1 -0
- package/dist/assets/{latest-assistant-text-HB3-JTrf.js → latest-assistant-text-CaZrfk6l.js} +3 -3
- package/dist/assets/{library-detail-page-DTptYQAF.js → library-detail-page-BcqVyl-x.js} +1 -1
- package/dist/assets/library-page-CK7LA8to.js +1 -0
- package/dist/assets/local-mode-B63ogN2h.js +1 -0
- package/dist/assets/login-page-Cw14hc03.js +1 -0
- package/dist/assets/logout-page-DpNGL-t4.js +1 -0
- package/dist/assets/{logs-layout-C4SjgNAl.js → logs-layout-BqrW_P--.js} +1 -1
- package/dist/assets/{markdown-preview-CBu26q1U.js → markdown-preview-DsAfiAyB.js} +1 -1
- package/dist/assets/{media-preview-CrddXQMc.js → media-preview-DvdWd4rA.js} +1 -1
- package/dist/assets/memory-page-route-B98b_k6V.js +2 -0
- package/dist/assets/{memory-router-playground-page-CP0Eurny.js → memory-router-playground-page-BmST7_Kw.js} +1 -1
- package/dist/assets/{message-files-panel-CDzpeEx4.js → message-files-panel-B4KcGaTu.js} +1 -1
- package/dist/assets/{metric-card-Dkx47Ug0.js → metric-card-BLErTI6M.js} +1 -1
- package/dist/assets/native-attachment-pickers-DXW2YF-J.js +1 -0
- package/dist/assets/native-file-DIYnpRix.js +1 -0
- package/dist/assets/{notifications-page-1r0ehmHL.js → notifications-page-wjJIxJdC.js} +1 -1
- package/dist/assets/{oauth-complete-page-D8yKCOVn.js → oauth-complete-page-DMvGhbPg.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-DzPqlG80.js → oauth-popup-complete-page-BjtYXKTi.js} +1 -1
- package/dist/assets/paired-platform-identity-DyA-oZ1a.js +1 -0
- package/dist/assets/{pairing-page-DhmG1Tkg.js → pairing-page-BfrUX_YA.js} +1 -1
- package/dist/assets/password-reset-page-DyCdaLlT.js +1 -0
- package/dist/assets/{pdf-file-preview-ElX646lL.js → pdf-file-preview-Cv30v3e_.js} +1 -1
- package/dist/assets/{personality-page-BqW5uuDF.js → personality-page-CUwdmzId.js} +1 -1
- package/dist/assets/{personality-page-DXW5MuRz.js → personality-page-D03UdQms.js} +1 -1
- package/dist/assets/personality-sliders-BZ5p3Svp.js +1 -0
- package/dist/assets/plans-page-Bt7rWPBi.js +1 -0
- package/dist/assets/{platform-loopback-page--ynU4rVO.js → platform-loopback-page-C3a-am1y.js} +1 -1
- package/dist/assets/{plugin-detail-page-lbmmlIpx.js → plugin-detail-page-D52frrTx.js} +1 -1
- package/dist/assets/{plugins-page-BM44sOv4.js → plugins-page-RrhNT7og.js} +1 -1
- package/dist/assets/plugins-surface-f4dAI31U.js +1 -0
- package/dist/assets/{preview-error-B6mdXJ98.js → preview-error-BlHGLqgj.js} +1 -1
- package/dist/assets/privacy-page-CKEUMx1C.js +1 -0
- package/dist/assets/{privacy-screen-CW2gbeYL.js → privacy-screen-Bkjr2dIv.js} +1 -1
- package/dist/assets/{provider-callback-page-PVHvQXqC.js → provider-callback-page-DGAy5DvE.js} +1 -1
- package/dist/assets/{provider-key-fvCko3IH.js → provider-key-CHOBBf9E.js} +1 -1
- package/dist/assets/{provider-signup-page-D6kN0d9F.js → provider-signup-page-BG1mhVYr.js} +1 -1
- package/dist/assets/{quick-input-page-DMs0592w.js → quick-input-page-CCDzeBSI.js} +1 -1
- package/dist/assets/referral-modal-BTG7IbD5.js +1 -0
- package/dist/assets/{referral-modal-C5ePy9XT.js → referral-modal-BWGbrPeD.js} +1 -1
- package/dist/assets/{research-mock-page-D3X9Fw83.js → research-mock-page-CHfDwifi.js} +1 -1
- package/dist/assets/research-onboarding-route-DvnsATHR.js +50 -0
- package/dist/assets/{review-terms-screen-CU9h0Gz5.js → review-terms-screen-C2vdbHvu.js} +1 -1
- package/dist/assets/routes-64wTPHX3.js +1 -0
- package/dist/assets/schedules-AMG6VEfS.js +1 -0
- package/dist/assets/schedules-page-DQ0p71wD.js +1 -0
- package/dist/assets/security-redirect-page-C8sxzPnV.js +1 -0
- package/dist/assets/select-assistant-screen-B57uDK4U.js +1 -0
- package/dist/assets/{self-hosted-servers-sqp6RgAQ.js → self-hosted-servers-CsZVedz3.js} +1 -1
- package/dist/assets/{service-form-controls-C5nQsTzh.js → service-form-controls-DTfO4j3O.js} +1 -1
- package/dist/assets/{setting-row-Dqextrfj.js → setting-row-B9yebbEq.js} +1 -1
- package/dist/assets/{settings-divider-D-IFmB_l.js → settings-divider-BkQcvD1N.js} +1 -1
- package/dist/assets/{settings-layout-Bh7MaZ4H.js → settings-layout-D6972VFH.js} +1 -1
- package/dist/assets/share-feedback-modal-CYWA8ArT.js +1 -0
- package/dist/assets/share-feedback-modal-DwmVNIDD.js +2 -0
- package/dist/assets/{sidebar-tree-BgVhUiEU.js → sidebar-tree-C-XVAOgc.js} +1 -1
- package/dist/assets/{signup-page-CzQJSqzn.js → signup-page-DdiJpBz3.js} +1 -1
- package/dist/assets/{signup-shell-C1cGo11n.js → signup-shell-_mEn5UNl.js} +1 -1
- package/dist/assets/{skill-detail-page-BN8Rwzuu.js → skill-detail-page-bMQCOgEU.js} +2 -2
- package/dist/assets/{skill-detail-panel-DVrh3t_h.js → skill-detail-panel-jkm8mNzk.js} +1 -1
- package/dist/assets/{skill-removal-dialog-CkduZswH.js → skill-removal-dialog-CWQDV20Q.js} +1 -1
- package/dist/assets/{skills-page-DS76T-t4.js → skills-page-CkHlkDe4.js} +1 -1
- package/dist/assets/{sounds-page-Bqrv7A7h.js → sounds-page-DZ9H_Uhf.js} +1 -1
- package/dist/assets/{start-screen-Cz9LflKA.js → start-screen-CPuK_kcL.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-Ckz32Oh1.js → stt-language-picker-modal-vTox8Zp8.js} +1 -1
- package/dist/assets/subagent-detail-panel-p9ahsacR.js +1 -0
- package/dist/assets/superpowers-page-BiVUrsDa.js +1 -0
- package/dist/assets/{system-events-page-D0fUUNzD.js → system-events-page-CxJryFCX.js} +1 -1
- package/dist/assets/system-events-redirect-page-CORiS4Xr.js +1 -0
- package/dist/assets/{text-preview-DozGQuv6.js → text-preview-BZ7GgUAU.js} +1 -1
- package/dist/assets/{theme-stage-page-CcBBPfjV.js → theme-stage-page-BBUhsE2D.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Db4_RKhj.js → tiptap-document-editor-DR6f403A.js} +1 -1
- package/dist/assets/tool-detail-panel-Bia85tXo.js +15 -0
- package/dist/assets/tool-detail-panel-CEtClwDC.js +1 -0
- package/dist/assets/{trait-cycle-row-C1uqLkCi.js → trait-cycle-row-BRsd1qDW.js} +1 -1
- package/dist/assets/upgrade-cancel-page-Cb2Knf6m.js +1 -0
- package/dist/assets/{upgrade-success-page-CkXzT8Ty.js → upgrade-success-page-5FOrQc3B.js} +1 -1
- package/dist/assets/{usage-redirect-page-CRrl2BDL.js → usage-redirect-page-DmacFGtX.js} +1 -1
- package/dist/assets/use-app-delete-C6E5CTp4.js +1 -0
- package/dist/assets/use-assistant-identity-details-BqNoC_Po.js +1 -0
- package/dist/assets/use-checkout-dismiss-refresh-DFYkYYpp.js +1 -0
- package/dist/assets/{use-edge-swipe-back-DYPOVsUT.js → use-edge-swipe-back-DMaMp9xI.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-Cj-vFxW2.js → use-hotkey-recorder-CVYKioKK.js} +1 -1
- package/dist/assets/use-invite-link-dialog-ChgRhNyN.js +1 -0
- package/dist/assets/{use-platform-assistant-id-D8KGJAMf.js → use-platform-assistant-id-CPNM_Svc.js} +1 -1
- package/dist/assets/use-return-to-short-circuit-dsa2YMci.js +1 -0
- package/dist/assets/{use-side-list-room-CSNBqjJu.js → use-side-list-room-XknEC6_F.js} +1 -1
- package/dist/assets/use-skill-actions-B7qsFEjO.js +1 -0
- package/dist/assets/{use-skill-detail-files-C5BA-Phb.js → use-skill-detail-files-Caa0kAOC.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-CxEHVJ-e.js +1 -0
- package/dist/assets/use-transcript-message-by-id-Bnbe06RA.js +1 -0
- package/dist/assets/{voice-page-DDLtbhsC.js → voice-page-D237ka3h.js} +1 -1
- package/dist/assets/{wake-detail-panel-C5K2zAvp.js → wake-detail-panel-JG7TyKGn.js} +1 -1
- package/dist/assets/{weather-forecast-display-CWGsPOa9.js → weather-forecast-display-CZYQX4n1.js} +1 -1
- package/dist/assets/welcome-screen-CQo-_cIi.js +1 -0
- package/dist/assets/{workflow-detail-panel-D6ip8R9Y.js → workflow-detail-panel-rYCgZeUb.js} +1 -1
- package/dist/assets/{workspace-page-D_4QLZh3.js → workspace-page-Bx0l3azH.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/activation-list-route-CSuVtIeq.js +0 -1
- package/dist/assets/add-credits-modal-Byhxttdb.js +0 -1
- package/dist/assets/ai-page-_iWq21vC.js +0 -1
- package/dist/assets/app-DFXcEvsi.js +0 -392
- package/dist/assets/archive-redirect-page-D1zUz-Kn.js +0 -1
- package/dist/assets/auth-store-BFk7tSVA.js +0 -1
- package/dist/assets/avatar-bundled-components-B-TO2nC_.js +0 -1
- package/dist/assets/avatar-random-DTCQMspt.js +0 -2
- package/dist/assets/background-task-detail-panel-Bm7wkZ5w.js +0 -1
- package/dist/assets/billing-page-BkUfkbYS.js +0 -3
- package/dist/assets/channel-transcript-panel-DFDoSX5e.js +0 -1
- package/dist/assets/channels-page-route-9NljMyj4.js +0 -1
- package/dist/assets/chat-info-panel-BENFQ0tW.js +0 -1
- package/dist/assets/checkout-continuation-C38t4ayV.js +0 -1
- package/dist/assets/checkout-return-target-CrM-Nhda.js +0 -1
- package/dist/assets/command-palette-Dj-GW7dm.js +0 -1
- package/dist/assets/common-l4KEHlw1.js +0 -1
- package/dist/assets/companion-surface-page-BrMY3X-F.js +0 -1
- package/dist/assets/contacts-gateway-C_BunUUf.js +0 -1
- package/dist/assets/contacts-page-route-DIxMGBde.js +0 -1
- package/dist/assets/credentials-page-D3PvFMgc.js +0 -1
- package/dist/assets/danger-zone-redirect-page-BVmYzrKj.js +0 -1
- package/dist/assets/debug-page-CJOt0BAt.js +0 -4
- package/dist/assets/deploy-dialogs-DY0pTVu1.js +0 -1
- package/dist/assets/developer-page-p4Ylxemb.js +0 -1
- package/dist/assets/devices-redirect-page-BcyaUgzH.js +0 -1
- package/dist/assets/document-load-B9O1A5E9.js +0 -1
- package/dist/assets/document-viewer-page-L_O7lYHa.js +0 -1
- package/dist/assets/emails-page-fgZebuJ7.js +0 -1
- package/dist/assets/general-page-iMRa5Ucp.js +0 -2
- package/dist/assets/hatching-screen-C9GXGQ2P.js +0 -1
- package/dist/assets/identity-page-route-D0fpi7db.js +0 -7
- package/dist/assets/integrations-page-3cwkXYyq.js +0 -1
- package/dist/assets/intelligence-layout-slots-store-CI7IhmZv.js +0 -1
- package/dist/assets/keyboard-shortcuts-redirect-page-Bcl-FjyB.js +0 -1
- package/dist/assets/library-page-D0OfVER_.js +0 -1
- package/dist/assets/local-mode-Dve-u3Zf.js +0 -1
- package/dist/assets/login-page-BA3GjFvS.js +0 -1
- package/dist/assets/logout-page-Dp--IQJm.js +0 -1
- package/dist/assets/memory-page-route-BzLfpam9.js +0 -2
- package/dist/assets/native-attachment-pickers-DVsB4Q0l.js +0 -1
- package/dist/assets/native-file-BKR4KkJt.js +0 -1
- package/dist/assets/paired-platform-identity-C4IGgtxq.js +0 -1
- package/dist/assets/password-reset-page-7yc-z_Pf.js +0 -1
- package/dist/assets/personality-sliders-BuInNb35.js +0 -1
- package/dist/assets/plans-page-B87o5Bm-.js +0 -1
- package/dist/assets/plugins-surface-2i_lZYet.js +0 -1
- package/dist/assets/privacy-page-BqqU59zB.js +0 -1
- package/dist/assets/referral-modal-VQ2vsPTh.js +0 -1
- package/dist/assets/research-onboarding-route-Bk2Zl9y9.js +0 -50
- package/dist/assets/routes-NC2Xyogy.js +0 -1
- package/dist/assets/schedules-Cslj2E_n.js +0 -1
- package/dist/assets/schedules-page-7QBCwWLg.js +0 -1
- package/dist/assets/security-redirect-page-D6C5fIZt.js +0 -1
- package/dist/assets/select-assistant-screen-BO9WTRBj.js +0 -1
- package/dist/assets/share-feedback-modal-D44y3KhU.js +0 -1
- package/dist/assets/share-feedback-modal-DsaGXNnY.js +0 -2
- package/dist/assets/subagent-detail-panel-C2AI9zu4.js +0 -1
- package/dist/assets/superpowers-page-CMOvPhlc.js +0 -1
- package/dist/assets/system-events-redirect-page-Dr4-w7Y1.js +0 -1
- package/dist/assets/tool-detail-panel-CNNnmtM6.js +0 -15
- package/dist/assets/tool-detail-panel-PjXqpW5b.js +0 -1
- package/dist/assets/upgrade-cancel-page-CKZWRtvT.js +0 -1
- package/dist/assets/use-app-delete-CFfw_T0x.js +0 -1
- package/dist/assets/use-assistant-identity-details-CGJTkSlu.js +0 -1
- package/dist/assets/use-checkout-dismiss-refresh-DB9VdW8-.js +0 -1
- package/dist/assets/use-invite-link-dialog-B4f3yyUN.js +0 -1
- package/dist/assets/use-return-to-short-circuit-Db6fiXSQ.js +0 -1
- package/dist/assets/use-skill-actions-BNpUjvgz.js +0 -1
- package/dist/assets/use-supports-credentials-settings-DIKVOLU1.js +0 -1
- package/dist/assets/use-transcript-message-by-id-ZVUnXf5k.js +0 -1
- package/dist/assets/welcome-screen-DuUuJIJ2.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ag as t,Cd as n,Cg as r,Cx as i,Eh as a,Ix as o,Kh as s,Kx as c,Mg as l,Mx as u,Ox as d,Oy as f,Pb as p,Sx as m,Tb as h,Td as g,Ux as _,Vf as v,Wh as y,Xf as b,Zf as ee,Zy as te,af as x,et as S,fl as ne,jg as re,kg as C,nl as w,of as T,px as E,rd as D,ym as O}from"./app-DFXcEvsi.js";import{Zn as k,dr as A,er as j,j as M,pr as ie,ur as ae}from"./vendor-DYOeoIwg.js";import{_ as oe,r as se,t as ce,x as le}from"./react-B9IgSVeK.js";import{A as N,Ai as P,E as F,Nr as I,_t as L,fa as R,qn as z,ur as B}from"./icons-QG1KAFmx.js";import{t as V}from"./detail-card-CGafPdBQ.js";import{t as H}from"./environment-store-7mW8BRRm.js";import{n as U}from"./assistant-status-panel-B-woG0mJ.js";var W=e(le(),1),G=ce();function ue({memoryEnabled:e,retrospectiveEnabled:t}){let{t:n}=M(`settings`),r=S(),a=j(),o=v({onSuccess:e=>{g(a,{path:{assistant_id:r}},e)}}),s=async e=>{try{await o.mutateAsync({path:{assistant_id:r},body:{memory:{retrospective:{enabled:e}}}}),i.success(n(e?`memoryRetrospectiveToggle.toastEnabled`:`memoryRetrospectiveToggle.toastPaused`))}catch(e){p(e,{context:`settings-memory-retrospective-toggle`}),i.error(n(`memoryRetrospectiveToggle.toastFailed`))}};return(0,G.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:n(`memoryRetrospectiveToggle.title`)}),(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n(`memoryRetrospectiveToggle.description`)})]}),(0,G.jsx)(u,{checked:t,onChange:e=>void s(e),"aria-label":n(`memoryRetrospectiveToggle.ariaLabel`),disabled:!e||o.isPending})]})}function de({memoryEnabled:e}){let{t}=M(`settings`),n=S(),r=j(),{data:a}=k({...x({path:{assistant_id:n}}),staleTime:3e4}),o=e=>{T(r,{path:{assistant_id:n}},t=>t&&{...t,status:e?`running`:`not_running`})},s=b({onSuccess:()=>o(!0)}),c=ee({onSuccess:()=>o(!1)}),l=async e=>{try{e?(await s.mutateAsync({path:{assistant_id:n}}),i.success(t(`memoryWorkerToggle.toastStarted`))):(await c.mutateAsync({path:{assistant_id:n}}),i.success(t(`memoryWorkerToggle.toastStopped`)))}catch(e){p(e,{context:`settings-memory-worker-toggle`}),i.error(t(`memoryWorkerToggle.toastFailed`))}};if(!a)return null;let d=s.isPending||c.isPending;return(0,G.jsxs)(`div`,{className:`flex flex-row items-start justify-between gap-4 border-t border-[var(--border-subtle)] pt-4`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,G.jsx)(`h3`,{className:`text-body-medium-default text-[var(--content-emphasised)]`,children:t(`memoryWorkerToggle.title`)}),(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:t(`memoryWorkerToggle.description`)})]}),(0,G.jsx)(u,{checked:a.status===`running`,onChange:e=>void l(e),"aria-label":t(`memoryWorkerToggle.ariaLabel`),disabled:!e||d})]})}function fe(){let{t:e}=M(`settings`),{healthz:t}=U(),r=S(),a=j(),o=t?.capabilities?.memoryOptOut===!0,{data:s}=k({...n({path:{assistant_id:r}}),staleTime:3e4,enabled:o}),c=v({onSuccess:e=>{g(a,{path:{assistant_id:r}},e)}}),l=s?.memory?.enabled!==!1,d=s?.memory?.retrospective?.enabled!==!1,f=async t=>{try{await c.mutateAsync({path:{assistant_id:r},body:{memory:{enabled:t}}}),i.success(e(t?`memoryCard.enabledToast`:`memoryCard.disabledToast`))}catch(t){p(t,{context:`settings-memory-toggle`}),i.error(e(`memoryCard.updateFailedToast`))}};return o?(0,G.jsxs)(V,{title:e(`memoryCard.title`),subtitle:e(`memoryCard.subtitle`),accessory:(0,G.jsx)(u,{checked:l,onChange:e=>void f(e),"aria-label":e(`memoryCard.enableAriaLabel`),disabled:c.isPending}),compactAccessory:!0,children:[(0,G.jsx)(ue,{memoryEnabled:l,retrospectiveEnabled:d}),(0,G.jsx)(de,{memoryEnabled:l})]}):null}function pe(){let{t:e}=M(`settings`),t=j(),[n,r]=(0,W.useState)(!1),[o,c]=(0,W.useState)(!1),l=O(),u=S(),{data:d,isLoading:p}=k({...ne({path:{id:u}}),enabled:l}),{data:h,isLoading:g}=k({...w({query:{hosting:`all`}}),enabled:l}),v=p||g,b=h?.results??[];return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(me,{assistant:d??null,loading:v}),(0,G.jsx)(he,{assistants:b,activeAssistantId:u,loading:v}),(0,G.jsxs)(V,{title:e(`assistantLifecyclePanel.hatchTitle`),subtitle:e(`assistantLifecyclePanel.hatchSubtitle`),children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`assistantLifecyclePanel.hatchDescription`)}),(0,G.jsx)(_,{variant:`outlined`,leftIcon:n?(0,G.jsx)(z,{className:`animate-spin`}):void 0,onClick:()=>c(!0),disabled:n,className:`shrink-0`,children:e(`assistantLifecyclePanel.hatch`)})]}),(0,G.jsx)(m,{open:o,title:e(`assistantLifecyclePanel.hatchConfirmTitle`),message:e(`assistantLifecyclePanel.hatchConfirmMessage`),confirmLabel:e(`assistantLifecyclePanel.hatch`),onConfirm:async()=>{c(!1),r(!0);try{let n=await y(void 0,`create`);if(n.ok){if(f())try{let e=await s();e.ok&&await te(e.data,a.getState().currentOrganizationId??void 0)}catch{}i.success(n.status===201?e(`assistantLifecyclePanel.hatchSuccessToast`):e(`assistantLifecyclePanel.hatchExistingToast`)),t.invalidateQueries({queryKey:[{_id:`assistantsRetrieve`}]}),t.invalidateQueries({queryKey:w({query:{hosting:`all`}}).queryKey})}else{let t=typeof n.error?.detail==`string`?n.error.detail:e(`assistantLifecyclePanel.hatchFailedToast`);i.error(t)}}catch{i.error(e(`assistantLifecyclePanel.hatchFailedToast`))}finally{r(!1)}},onCancel:()=>c(!1)})]})]})}function me({assistant:e,loading:t}){let{t:n}=M(`settings`);return t?(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(z,{className:`h-4 w-4 animate-spin`}),n(`assistantLifecyclePanel.infoLoading`)]})}):e?(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),subtitle:n(`assistantLifecyclePanel.infoSubtitle`),children:(0,G.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.name`)}),(0,G.jsx)(q,{children:e.name??n(`assistantLifecyclePanel.unnamed`)}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.status`)}),(0,G.jsx)(`div`,{children:(0,G.jsx)(o,{tone:e.status===`active`?`positive`:`neutral`,children:e.status})}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.assistantId`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id}),e.machine_id&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.machineId`)}),(0,G.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.machine_id})]}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.created`)}),(0,G.jsx)(q,{children:new Date(e.created).toLocaleDateString()}),(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.lastModified`)}),(0,G.jsx)(q,{children:new Date(e.modified).toLocaleDateString()}),e.current_release_version&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(K,{children:n(`assistantLifecyclePanel.version`)}),(0,G.jsx)(q,{children:e.current_release_version})]})]})}):(0,G.jsx)(V,{title:n(`assistantLifecyclePanel.infoTitle`),children:(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`assistantLifecyclePanel.infoEmpty`)})})}function he({assistants:e,activeAssistantId:t,loading:n}){let{t:r}=M(`settings`);return n||e.length===0?null:(0,G.jsx)(V,{title:r(`assistantLifecyclePanel.allAssistantsTitle`),subtitle:r(`assistantLifecyclePanel.allAssistantsSubtitle`,{count:e.length}),children:(0,G.jsx)(`div`,{className:`max-h-[300px] space-y-2 overflow-y-auto`,children:e.map(e=>{let n=e.id===t;return(0,G.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.name||r(`assistantLifecyclePanel.unnamed`)}),(0,G.jsx)(o,{tone:e.status===`active`?`positive`:`neutral`,children:e.status}),n&&(0,G.jsx)(o,{tone:`warning`,children:r(`assistantLifecyclePanel.current`)})]}),(0,G.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id})]})},e.id)})})})}function K({children:e}){return(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e})}function q({children:e}){return(0,G.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e})}function ge(){let{t:e}=M(`settings`),t=H.use.emailRootDomain(),n=H.use.isNonProduction(),r=H.use.setEnvironment();return(0,G.jsx)(V,{title:e(`environmentConfigPanel.title`),subtitle:e(`environmentConfigPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(u,{checked:n,onChange:e=>r({isNonProduction:e}),"aria-label":e(n?`environmentConfigPanel.nonProductionOnAriaLabel`:`environmentConfigPanel.nonProductionOffAriaLabel`)})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`environmentConfigPanel.nonProduction`)}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e(`environmentConfigPanel.nonProductionDescription`)})]})]}),(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(o,{tone:`neutral`,children:t})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`environmentConfigPanel.emailRootDomain`)}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e(`environmentConfigPanel.emailRootDomainDescription`)})]})]})]})})}async function _e(){let{data:e,response:t}=await r.get({url:`/v1/feature-flags/`,throwOnError:!1});return t?.ok?e?.flags??[]:[]}var J={client:`warning`,assistant:`positive`};function ve(){let{t:e}=M(`settings`),n=S(),{data:r}=k({queryKey:[`feature-flag-definitions`],queryFn:_e,enabled:O(),staleTime:300*1e3}),i=(0,W.useMemo)(()=>{let e=new Map;if(!r)return e;for(let t of r)t.type===`string`&&t.values?.length&&e.set(t.key,t.values);return e},[r]),[a,o]=(0,W.useState)(``),s=C(),c=D(),l=(0,W.useMemo)(()=>{let e=[];for(let n of re){let r=t(n.key);if(typeof n.defaultEnabled==`boolean`){let t=s[r],i=c[r],a=n.scope===`both`?t===!0||i===!0:n.scope===`assistant`?i:t;if(typeof a!=`boolean`)continue;e.push({kind:`boolean`,storeKey:r,scope:n.scope,label:n.label,description:n.description,value:a,defaultValue:n.defaultEnabled})}else if(typeof n.defaultEnabled==`string`){let t=s.stringFlags?.[r],a=c.stringFlags?.[r],o=n.scope===`assistant`?a??n.defaultEnabled:t??n.defaultEnabled;e.push({kind:`string`,storeKey:r,scope:n.scope,label:n.label,description:n.description,value:o,defaultValue:n.defaultEnabled,values:i.get(n.key)??n.values})}}return e.sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:`base`}))},[s,c,i]),u=(0,W.useMemo)(()=>{if(!a.trim())return l;let e=a.trim().toLowerCase();return l.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.storeKey.toLowerCase().includes(e)||t.scope.includes(e)||t.scope===`both`&&(`client`.includes(e)||`assistant`.includes(e)))},[l,a]);return(0,G.jsx)(V,{title:e(`featureFlagsPanel.title`),subtitle:e(`featureFlagsPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`relative`,children:[(0,G.jsx)(L,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--content-tertiary)]`}),(0,G.jsx)(`input`,{type:`text`,placeholder:e(`featureFlagsPanel.searchPlaceholder`),value:a,onChange:e=>o(e.target.value),className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-default)] py-2 pl-9 pr-3 text-body-medium-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:border-[var(--border-focus)] focus:outline-none`})]}),u.length===0&&(0,G.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`featureFlagsPanel.noMatching`)}),u.length>0&&(0,G.jsx)(`div`,{className:`max-h-[500px] space-y-2 overflow-y-auto`,children:u.map(e=>(0,G.jsx)(be,{flag:e,assistantId:n},e.storeKey))})]})})}function Y({scope:e}){let{t}=M(`settings`);return e===`both`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(o,{tone:J.client,children:t(`featureFlagsPanel.scopeClient`)}),(0,G.jsx)(o,{tone:J.assistant,children:t(`featureFlagsPanel.scopeAssistant`)})]}):(0,G.jsx)(o,{tone:J[e],children:t(e===`client`?`featureFlagsPanel.scopeClient`:`featureFlagsPanel.scopeAssistant`)})}function ye({flag:e,assistantId:t}){let{t:n}=M(`settings`),r=C.use.setFlag(),i=D.use.setFlag();return(0,G.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,G.jsx)(u,{checked:e.value,onChange:n=>{l(e.scope,`client`)&&r(e.storeKey,n),l(e.scope,`assistant`)&&i(e.storeKey,n,t)},"aria-label":e.value?n(`featureFlagsPanel.flagOnAriaLabel`,{label:e.label}):n(`featureFlagsPanel.flagOffAriaLabel`,{label:e.label})})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,G.jsx)(Y,{scope:e.scope})]}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`featureFlagsPanel.defaultLabel`)}),(0,G.jsx)(o,{tone:`neutral`,children:e.defaultValue?n(`featureFlagsPanel.on`):n(`featureFlagsPanel.off`)})]})]})]})}function X({flag:e,assistantId:t}){let{t:n}=M(`settings`),r=C.use.setStringFlag(),i=D.use.setStringFlag(),[a,s]=(0,W.useState)(e.value);(0,W.useEffect)(()=>{s(e.value)},[e.value]);let u=n=>{n!==e.value&&(l(e.scope,`client`)&&r(e.storeKey,n),l(e.scope,`assistant`)&&i(e.storeKey,n,t))},d=a!==e.value,f=e.values&&e.values.length>0?e.values:null,p=d&&f!=null&&!f.includes(a),m=()=>{p||u(a)},h=e=>{e.key===`Enter`&&e.currentTarget.blur()},g=f!=null&&f.includes(e.value);return(0,G.jsx)(`div`,{className:`flex items-start gap-3 py-3`,children:(0,G.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,G.jsx)(Y,{scope:e.scope})]}),(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),g?(0,G.jsx)(E,{value:e.value,onChange:e=>{s(e),u(e)},options:f.map(e=>({value:e,label:e})),className:`w-48`,"aria-label":n(`featureFlagsPanel.valueAriaLabel`,{label:e.label})}):(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`input`,{type:`text`,value:a,onChange:e=>s(e.target.value),onBlur:m,onKeyDown:h,className:c(`w-full rounded-lg border bg-[var(--surface-default)] px-3 py-1.5 text-body-small-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:outline-none`,p?`border-[var(--system-negative-strong)]`:`border-[var(--border-base)] focus:border-[var(--border-focus)]`),placeholder:e.defaultValue||n(`featureFlagsPanel.enterValue`)}),p&&(0,G.jsx)(`span`,{className:`block text-body-small-default text-[var(--system-negative-strong)]`,children:n(`featureFlagsPanel.expectedOneOf`,{values:f.join(`, `)})})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`featureFlagsPanel.defaultLabel`)}),(0,G.jsx)(o,{tone:`neutral`,children:e.defaultValue||n(`featureFlagsPanel.empty`)})]})]})})}function be({flag:e,assistantId:t}){return e.kind===`string`?(0,G.jsx)(X,{flag:e,assistantId:t}):(0,G.jsx)(ye,{flag:e,assistantId:t})}function xe(){let{t:e}=M(`settings`),t=(0,W.useCallback)(()=>{ae(Error(`[Dev Settings] Test error event`)),i.success(e(`sentryTestingPanel.errorSentToast`))},[e]),n=(0,W.useCallback)(()=>{A(`[Dev Settings] Test warning event`,`warning`),i.success(e(`sentryTestingPanel.warningSentToast`))},[e]),r=(0,W.useCallback)(()=>{A(`[Dev Settings] Test info event`,`info`),i.success(e(`sentryTestingPanel.infoSentToast`))},[e]),a=(0,W.useCallback)(()=>{A(`[Dev Settings] Test fatal event`,`fatal`),i.success(e(`sentryTestingPanel.fatalSentToast`))},[e]),o=(0,W.useCallback)(()=>{ie({name:`[Dev Settings] Test transaction`,op:`test.transaction`,forceTransaction:!0}).end(),i.success(e(`sentryTestingPanel.transactionSentToast`))},[e]);return(0,G.jsx)(V,{title:e(`sentryTestingPanel.title`),subtitle:e(`sentryTestingPanel.subtitle`),children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(Z,{icon:(0,G.jsx)(I,{className:`h-4 w-4 text-[var(--system-negative-strong)]`}),label:e(`sentryTestingPanel.fatalLabel`),description:e(`sentryTestingPanel.fatalDescription`),onClick:a}),(0,G.jsx)(Z,{icon:(0,G.jsx)(P,{className:`h-4 w-4 text-[var(--system-negative-default)]`}),label:e(`sentryTestingPanel.errorLabel`),description:e(`sentryTestingPanel.errorDescription`),onClick:t}),(0,G.jsx)(Z,{icon:(0,G.jsx)(F,{className:`h-4 w-4 text-[var(--system-warning-default)]`}),label:e(`sentryTestingPanel.warningLabel`),description:e(`sentryTestingPanel.warningDescription`),onClick:n}),(0,G.jsx)(Z,{icon:(0,G.jsx)(B,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),label:e(`sentryTestingPanel.infoLabel`),description:e(`sentryTestingPanel.infoDescription`),onClick:r}),(0,G.jsx)(Z,{icon:(0,G.jsx)(N,{className:`h-4 w-4 text-[var(--system-positive-default)]`}),label:e(`sentryTestingPanel.performanceLabel`),description:e(`sentryTestingPanel.performanceDescription`),onClick:o})]})})}function Z({icon:e,label:t,description:n,onClick:r}){let{t:i}=M(`settings`);return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-[var(--border-base)] px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`shrink-0`,children:e}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]}),(0,G.jsxs)(_,{variant:`outlined`,size:`compact`,onClick:r,children:[(0,G.jsx)(R,{className:`h-4 w-4`}),i(`sentryTestingPanel.send`)]})]})}var Q=[{id:`feature-flags`,labelKey:`developerPage.tabFeatureFlags`},{id:`lifecycle`,labelKey:`developerPage.tabLifecycle`},{id:`sentry`,labelKey:`developerPage.tabSentry`},{id:`memory`,labelKey:`developerPage.tabMemory`}],$=`flex min-h-0 flex-1 flex-col pt-6`;function Se(){let{t:e}=M(`settings`),[t,n]=oe(),r=D.use.settingsDeveloperNav(),i=D.use.hasHydrated(),a=(0,W.useMemo)(()=>{let e=t.get(`tab`);return Q.find(t=>t.id===e)?.id??`feature-flags`},[t]);return i&&!r?(0,G.jsx)(se,{replace:!0,to:h.settings.general}):(0,G.jsx)(`div`,{"data-slot":`developer-page`,className:`flex min-h-0 flex-1 flex-col`,children:(0,G.jsxs)(d.Root,{value:a,onValueChange:e=>{let r=new URLSearchParams(t.toString());e===`feature-flags`?r.delete(`tab`):r.set(`tab`,e),n(r,{replace:!0})},className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsx)(d.List,{className:`shrink-0`,"aria-label":e(`developerPage.sectionsAriaLabel`),children:Q.map(t=>(0,G.jsx)(d.Trigger,{value:t.id,children:e(t.labelKey)},t.id))}),(0,G.jsx)(d.Panel,{value:`feature-flags`,className:$,children:(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(ve,{}),(0,G.jsx)(ge,{})]})}),(0,G.jsx)(d.Panel,{value:`lifecycle`,className:$,children:(0,G.jsx)(pe,{})}),(0,G.jsx)(d.Panel,{value:`sentry`,className:$,children:(0,G.jsx)(xe,{})}),(0,G.jsx)(d.Panel,{value:`memory`,className:$,children:(0,G.jsx)(`div`,{className:`space-y-4`,children:(0,G.jsx)(fe,{})})})]})})}export{Se as DeveloperPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Tb as t}from"./app-DFXcEvsi.js";import{f as n,x as r}from"./react-B9IgSVeK.js";var i=e(r(),1);function a(){let e=n();return(0,i.useEffect)(()=>{e(t.settings.general,{replace:!0})},[e]),null}export{a as DevicesRedirectPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./document-load-CZeb0od7.js";export{e as loadDocumentContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$i as t,Cx as n,Gp as r,Hx as i,Ji as a,Ki as o,Pb as s,Qi as c,Tb as l,Tu as ee,Ux as u,Wp as d,Xi as f,Yi as p,Zi as m,_c as h,bm as g,ea as _,hc as v,hn as y,ia as b,jc as x,mn as S,pn as te,qi as C,sy as w,ta as ne}from"./app-DFXcEvsi.js";import{j as re}from"./vendor-DYOeoIwg.js";import{d as T,f as E,h as D,t as O,x as k}from"./react-B9IgSVeK.js";import{qn as ie}from"./icons-QG1KAFmx.js";import{t as A}from"./document-load-CZeb0od7.js";import{t as j}from"./use-edge-swipe-back-DYPOVsUT.js";var M=e(k(),1),N=O();function P(){let{t:e}=re(`chat`),{surfaceId:O}=D(),k=E(),{pathname:P,search:F,state:I}=T(),L=h(),[R]=(0,M.useState)(L?`conversation`:`standalone`),z=w.use.activeAssistantId(),B=w.use.assistantsHydrated(),V=g(),H=b(new URLSearchParams(F).get(ne)),U=(0,M.useRef)(null),W=(0,M.useRef)(null),G=(0,M.useRef)(null),[K,q]=(0,M.useState)({kind:`loading`}),[J,ae]=(0,M.useState)(0),[oe,Y]=(0,M.useState)(!1),X=(0,M.useRef)(!1),Z=K.kind===`ready`?K.doc:null,se=te(z,Z?.surfaceId??null,W);(0,M.useEffect)(()=>{if(q({kind:`loading`}),X.current=!1,Y(!1),!O||!z&&B||V===`unavailable`){q({kind:`error`});return}if(!z||V!==`ready`)return;let e=f(z);return G.current=e,(async()=>{try{let t=(e,t)=>{if(R===`conversation`&&t){C(k,e,t,z,H,!0,I);return}r.getState().clearDocumentEverywhere(O),q({kind:`ready`,doc:e,needsConversation:R===`conversation`})},n={assistantId:z,surfaceId:O,isCurrent:e.isCurrent};if(R===`conversation`)await c({...n,onReady:t});else{let r=await A(n);r&&e.isCurrent()&&t(r,null)}}catch(t){e.isCurrent()&&(s(t,{context:`document_viewer_page`}),q({kind:`error`}))}})(),e.dispose},[O,z,B,V,R,k,H,J,I]);let ce=(0,M.useCallback)(()=>{W.current?.refreshComments()},[]);ee(`sse.event`,S({surfaceId:O??``,enabled:!!O,onCommentsChanged:ce}));let Q=(0,M.useCallback)(()=>{G.current?.dispose(),a(k,O??``,H,I)},[k,O,H,I]);j({containerRef:U,onBack:Q,enabled:L,navKey:P});let $=(0,M.useCallback)(async r=>{if(!Z||!z||X.current||!W.current)return;let i=G.current;if(!i?.isCurrent())return;X.current=!0,Y(!0);let a=W.current.beginSendPreparation();try{let e=await a.flush();if(!i.isCurrent()||!a.isCurrent())return;let n={...Z,...e},s={assistantId:z,document:n,isCurrent:i.isCurrent},c=await t(s)??await _(s);if(!c||!i.isCurrent()||!a.isCurrent())return;r?(p(n,c,z),v(k,c,{silent:!0,...L?{replace:!0}:{},state:x(L?I:void 0),destination:L?o(c,Z.surfaceId,H,`chat`,m(n.title)):l.conversationWithPrompt(c,m(n.title))}),L||d.getState().setMainView(`document`)):C(k,n,c,z,H,!0,I)}catch(t){i.isCurrent()&&(s(t,{context:`document_prepare_conversation`}),n.error(e(`documentConversation.prepareFailed`)))}finally{a.release(),i.isCurrent()&&(X.current=!1,Y(!1))}},[Z,z,k,H,L,e,I]),le=(0,M.useCallback)(()=>$(!0),[$]),ue=(0,M.useCallback)(()=>$(!1),[$]);return K.kind===`loading`?(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,N.jsx)(ie,{size:24,className:`animate-spin text-[var(--content-tertiary)]`})}):K.kind===`error`||!Z||!z?(0,N.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,N.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e(`documentViewerPage.notFound`)}),(0,N.jsx)(u,{onClick:()=>ae(e=>e+1),children:e(`documentConversation.retry`)}),(0,N.jsx)(u,{variant:`ghost`,onClick:Q,children:e(`documentConversation.back`)})]}):(0,N.jsxs)(`div`,{ref:U,className:`flex min-h-0 flex-1 flex-col`,children:[K.needsConversation&&(0,N.jsxs)(`div`,{role:`status`,className:`flex shrink-0 flex-col gap-2 border-b border-[var(--border-default)] p-3`,children:[(0,N.jsx)(i,{variant:`body-small-default`,children:e(`documentConversation.missing`)}),(0,N.jsx)(u,{disabled:oe,onClick:ue,children:e(`documentConversation.start`)})]}),(0,N.jsx)(y,{source:`document`,surfaceId:Z.surfaceId,assistantId:z,conversationId:Z.conversationId,documentName:Z.title,content:Z.content,onClose:Q,onRenamed:e=>q(t=>t.kind===`ready`?{...t,doc:{...t.doc,title:e}}:t),onExport:se,onSubmitFeedback:le,handleRef:W},z+`:`+Z.surfaceId)]})}export{P as DocumentViewerPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$c as e,Ix as t,Tb as n,Zc as r,et as i,tl as a,un as o,xp as s}from"./app-DFXcEvsi.js";import{Zn as c,j as l}from"./vendor-DYOeoIwg.js";import{n as u,r as d,t as f}from"./react-B9IgSVeK.js";import{Ci as p,E as m,dr as h,gt as g,qn as _}from"./icons-QG1KAFmx.js";var v=f();function y(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function b({title:e,children:t}){return(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsx)(`h2`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e}),t]})}function x({tone:e=`info`,children:t}){let n=e===`error`;return(0,v.jsx)(`div`,{className:`rounded-md border px-4 py-3 text-body-medium-lighter`,style:{background:n?`var(--surface-negative-subtle, var(--surface-lift))`:`var(--surface-lift)`,borderColor:n?`var(--border-negative, var(--border-base))`:`var(--border-base)`,color:n?`var(--content-negative, var(--content-default))`:`var(--content-default)`},children:(0,v.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n&&(0,v.jsx)(m,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,v.jsx)(`div`,{className:`flex-1`,children:t})]})})}function S({message:e,onRetry:t,retrying:n}){let{t:r}=l(`logs`);return(0,v.jsx)(x,{tone:`error`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{children:e}),(0,v.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`text-body-small-default underline disabled:opacity-50`,style:{color:`var(--content-default)`},children:r(n?`errorRetryRow.retrying`:`errorRetryRow.retry`)})]})})}function C({label:e,value:t,sub:n}){return(0,v.jsxs)(`div`,{className:`rounded-xl border p-3`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,v.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e}),(0,v.jsx)(`p`,{className:`mt-1 text-title-large tabular-nums`,style:{color:`var(--content-default)`},children:t??`—`}),n&&(0,v.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-disabled)`},children:n})]})}function w({email:e}){let{t:n}=l(`logs`),r=e.direction===`inbound`;return(0,v.jsx)(`div`,{className:`rounded-xl border p-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(t,{tone:r?`positive`:`neutral`,leftIcon:r?(0,v.jsx)(h,{}):(0,v.jsx)(g,{}),children:n(r?`emailsTab.inbound`:`emailsTab.outbound`)}),(0,v.jsx)(`span`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.from_address})]}),(0,v.jsx)(`p`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.subject||n(`emailsTab.noSubject`)})]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,v.jsx)(p,{className:`h-3 w-3`}),(0,v.jsx)(`span`,{children:y(e.created_at)})]})]})})}function T({assistantId:t,platformGate:i}){let{t:o}=l(`logs`),s=i===`full`,d=c({...r({path:{assistant_id:t}}),enabled:s}),f=d.data?.results?.[0],p=c({...e({path:{assistant_id:t,id:f?.id??``}}),enabled:s&&!!f?.id}),m=c({...a({path:{assistant_id:t},query:{limit:10}}),enabled:s}),h=p.data?.usage,g=m.data?.results??[];return d.isLoading?(0,v.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,v.jsx)(_,{className:`h-8 w-8 animate-spin`,style:{color:`var(--content-tertiary)`}})}):d.isError?(0,v.jsx)(S,{message:o(`emailsTab.addressesLoadFailed`),onRetry:()=>{d.refetch()},retrying:d.isFetching}):f?(0,v.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,v.jsx)(b,{title:o(`emailsTab.totals`),children:(0,v.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,v.jsx)(C,{label:o(`emailsTab.sentToday`),value:h?.sent_today,sub:h?o(`emailsTab.dailyLimitSub`,{limit:h.daily_limit}):void 0}),(0,v.jsx)(C,{label:o(`emailsTab.receivedToday`),value:h?.received_today}),(0,v.jsx)(C,{label:o(`emailsTab.sentThisMonth`),value:h?.sent_this_month}),(0,v.jsx)(C,{label:o(`emailsTab.receivedThisMonth`),value:h?.received_this_month})]})}),(0,v.jsx)(b,{title:o(`emailsTab.recentEmails`),children:m.isLoading?(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,v.jsx)(_,{className:`h-4 w-4 animate-spin`}),o(`emailsTab.loading`)]}):m.isError?(0,v.jsx)(S,{message:o(`emailsTab.emailsLoadFailed`),onRetry:()=>{m.refetch()},retrying:m.isFetching}):g.length===0?(0,v.jsx)(x,{children:o(`emailsTab.noEmails`)}):(0,v.jsx)(`div`,{className:`space-y-2`,children:g.map(e=>(0,v.jsx)(w,{email:e},e.id))})})]}):(0,v.jsxs)(x,{children:[o(`emailsTab.noAddress`),` `,(0,v.jsx)(u,{to:`${n.channels}?setup=email`,className:`underline`,style:{color:`var(--content-tertiary)`},children:o(`emailsTab.setUpLink`)})]})}function E(){let{t:e}=l(`logs`),t=s(),r=i();return t===`gated`?(0,v.jsx)(d,{replace:!0,to:n.logs.root}):t===`disabled`?(0,v.jsx)(o,{children:e(`emailsPage.platformLoginNotice`)}):(0,v.jsx)(T,{assistantId:r,platformGate:t})}export{E as EmailsPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-CI79f_VT.js","assets/react-B9IgSVeK.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-DYOeoIwg.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$b as t,$d as n,$l as r,$m as i,A as a,Ab as o,Ai as s,As as c,Ax as l,Bx as u,Cb as d,Cg as f,Ch as p,Cx as m,Cy as h,Db as g,Dp as _,Dx as v,Dy as y,Eb as b,Eh as x,Em as S,Er as C,Fa as w,Fb as T,Fm as E,Fy as D,G_ as O,Gr as k,Hl as A,Hu as j,Ih as M,Im as N,Ix as P,J_ as ee,Jm as F,Km as te,Kx as I,M as L,Mb as ne,Mi as re,Mm as ie,Mx as ae,Na as oe,Nm as se,Nx as R,Ny as ce,Oy as le,Pb as z,Pm as ue,Qm as de,R as fe,Rb as pe,Rm as me,Sg as he,Si as ge,Sx as _e,Tb as B,Th as ve,Ti as ye,Tu as be,Tx as V,Uh as xe,Uu as Se,Ux as H,Vb as Ce,Vu as we,Vx as Te,W_ as Ee,Wb as De,Wc as Oe,Wh as ke,Wl as Ae,Wm as je,Wu as Me,Xa as Ne,Xh as Pe,Xm as Fe,Yb as Ie,Ym as Le,Yy as Re,Zh as ze,Zm as Be,_l as Ve,an as He,ax as U,bp as Ue,cg as We,ch as Ge,cl as Ke,cx as qe,db as Je,dl as Ye,dm as Xe,du as Ze,eb as Qe,eh as $e,et,fl as tt,fu as nt,gn as rt,gy as it,hg as at,hl as ot,hy as st,ig as ct,ih as lt,in as ut,iu as dt,ix as ft,j as pt,ji as mt,kg as W,ki as ht,km as gt,kx as _t,lg as vt,ll as yt,lu as bt,mg as xt,ml as St,mu as Ct,nl as wt,ob as Tt,oi as Et,pl as Dt,pu as Ot,px as kt,qb as At,qm as jt,qy as Mt,rb as Nt,rd as Pt,rg as Ft,rh as It,ru as Lt,sg as Rt,sh as zt,sn as Bt,sy as Vt,tb as Ht,tx as Ut,ul as Wt,un as Gt,uu as Kt,vl as qt,wi as Jt,wp as Yt,wy as Xt,xp as Zt,xy as Qt,yb as $t,ym as en,yp as tn,yx as nn,z as rn,zb as an,zx as on}from"./app-DFXcEvsi.js";import{E as sn,I as G,Jn as cn,N as ln,Q as un,Zn as K,_ as dn,er as q,f as fn,g as pn,j as J,k as mn}from"./vendor-DYOeoIwg.js";import{_ as hn,f as gn,n as _n,t as vn,v as yn,x as bn}from"./react-B9IgSVeK.js";import{B as xn,Ca as Sn,E as Cn,Et as wn,Hi as Tn,Ja as En,Ki as Dn,Q as On,Ri as kn,Tt as An,_n as jn,ci as Mn,gn as Nn,hr as Pn,i as Fn,kt as In,nt as Ln,qi as Rn,qn as Y,yr as zn}from"./icons-QG1KAFmx.js";import{t as X}from"./detail-card-CGafPdBQ.js";import{t as Bn}from"./environment-store-7mW8BRRm.js";import{t as Vn}from"./app-info-4gR8gnBC.js";import{a as Hn,i as Un,l as Wn,o as Gn}from"./machine-sizes-Cyr9sICv.js";import{t as Kn}from"./format-countdown-BEyU91h0.js";import{a as qn,i as Jn,n as Yn,r as Xn,t as Zn}from"./assistant-status-panel-B-woG0mJ.js";import{t as Qn}from"./trait-cycle-row-C1uqLkCi.js";import{t as $n}from"./use-hotkey-recorder-Cj-vFxW2.js";import{t as er}from"./settings-divider-D-IFmB_l.js";var tr=En(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),nr=En(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),rr=En(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(bn(),1),Q=vn();function ir(){let{t:e}=J(`settings`),t=W.use.velvet(),{theme:n,setThemePreference:r}=Et(),i=[{value:`system`,label:e(`themePicker.system`),icon:(0,Q.jsx)(jn,{className:`h-4 w-4`})},{value:`light`,label:e(`themePicker.light`),icon:(0,Q.jsx)(xn,{className:`h-4 w-4`})},{value:`dark`,label:e(`themePicker.dark`),icon:(0,Q.jsx)(Nn,{className:`h-4 w-4`})},...t?[{value:`velvet`,label:e(`themePicker.velvet`),icon:(0,Q.jsx)(Pn,{className:`h-4 w-4`})}]:[]];return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`themePicker.title`)}),(0,Q.jsx)(`div`,{className:`mt-2 max-w-[360px]`,children:(0,Q.jsx)(v,{ariaLabel:e(`themePicker.ariaLabel`),value:n,onChange:r,items:i})})]})}var ar=ie,or=`Please choose a different handle.`;async function sr(e,t){let{data:n,error:r,response:i}=await We({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:Ce(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=N(r,`handle`,ar.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=N(r,`handle`,or);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:Ce(r,i,`Failed to save handle.`)}}async function cr(e,t,n){let{data:r,error:i,response:a}=await Ft({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(an(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new pe(a.status,a.status===429?`Too many checks — try again in a moment.`:Ce(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function lr(e){return/\d{2,}$/.test(e)}var ur=300,dr=1400;function fr({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:s,fieldId:c}){let{t:l}=J(),[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(`idle`),[y,b]=(0,Z.useState)(null),x=fn(),S=(0,Z.useRef)(null),C=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),w=C===e.toLowerCase();(0,Z.useEffect)(()=>{if(w||C.length===0){g(!1),S.current?.abort();return}let e=new AbortController;S.current?.abort(),S.current=e,g(!0);let t=window.setTimeout(async()=>{try{let t=await i(C,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||b(t instanceof Error?t.message:l(`profileCard.checkAvailabilityFailed`))}finally{e.signal.aborted||g(!1)}},ur);return()=>{window.clearTimeout(t),e.abort()}},[C,w,i,l]);let T=(()=>{if(y)return y;if(f&&!f.available){let e=f.code;return f.message??(e?ar[e]:l(`profileCard.chooseDifferentHandle`))}return null})(),E=T?n:w?r??null:h?l(`profileCard.checkingAvailability`):f?.available?l(`profileCard.availableHelper`):null,D=!w&&!h&&f?.available!==!1&&_!==`saving`,O=(0,Z.useCallback)(async()=>{if(!D)return;v(`saving`),b(null);let e=await a(C);if(e.kind===`ok`){v(`saved`),o(e.data),m.success(s),window.setTimeout(()=>v(`idle`),dr);return}if(e.kind===`taken`){v(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){v(`idle`),p({available:!1,code:e.code,message:e.message});return}v(`error`),b(e.message),m.error(e.message)},[D,C,o,a,s]),k=(()=>{if(w&&u.length>0||u.length===0)return null;let e=h?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(dn,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(pn.span,{initial:x?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:x?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(Rn,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":l(`profileCard.available`)}),e===`invalid`&&(0,Q.jsx)(Tn,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":l(`profileCard.notAvailable`)})]},e)}):null})(),A=(()=>{switch(_){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(Y,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),l(`profileCard.saving`)]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(Rn,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),l(`profileCard.saved`)]});default:return l(`profileCard.save`)}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(R,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),b(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:k,errorText:T??void 0,helperText:E??void 0,"aria-invalid":!!T,fullWidth:!0,"data-testid":`${c}-input`}),(!w||_!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(H,{variant:`primary`,size:`compact`,onClick:O,disabled:!D,"aria-live":`polite`,"data-testid":`${c}-save`,children:A})})]})}function pr({initial:e,onSaved:t}){let{t:n}=J(),r=Yt.use.refreshSession(),i=lr(e.username)?n(`profileCard.userHandleIdleAutoGenerated`):void 0,a=(0,Z.useCallback)(async e=>await E({username:e}),[]),o=(0,Z.useCallback)((e,t)=>se(e,t),[]),s=(0,Z.useCallback)(e=>{t(e),r()},[t,r]);return(0,Q.jsx)(fr,{initialHandle:e.username,inputLabel:n(`profileCard.userHandleLabel`),helperText:n(`profileCard.handleHelper`),idleHelperText:i,checkAvailable:o,save:a,onSaved:s,saveSuccessToast:n(`profileCard.profileUpdated`),fieldId:`user-handle`})}function mr({assistant:e,onSaved:t}){let{t:n}=J(),r=e.handle??``,i=K({...Oe({path:{assistant_id:e.id}})}).data?.results?.[0],a=!!i&&i.subdomain.toLowerCase()===r.toLowerCase(),o=r.length===0?n(`profileCard.assistantHandleIdleEmpty`):void 0,s=(0,Z.useCallback)(async t=>await sr(e.id,t),[e.id]),c=(0,Z.useCallback)((t,n)=>cr(e.id,t,n),[e.id]);return a?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(R,{label:n(`profileCard.assistantHandleLabel`),value:r,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{i18nKey:`profileCard.handleLocked`,components:{releaseLink:(0,Q.jsx)(_n,{to:`${B.channels}?setup=email&release=1`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`})}})})]}):(0,Q.jsx)(fr,{initialHandle:r,inputLabel:n(`profileCard.assistantHandleLabel`),helperText:n(`profileCard.handleHelper`),idleHelperText:o,checkAvailable:c,save:s,onSaved:t,saveSuccessToast:n(`profileCard.assistantHandleUpdated`),fieldId:`assistant-handle`})}function hr(){let{t:e}=J();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(qe,{className:`h-3 w-16`}),(0,Q.jsx)(qe,{className:`h-9 w-full rounded-md`}),(0,Q.jsx)(qe,{className:`h-3 w-72`})]}),(0,Q.jsx)(qe,{className:`h-9 w-full rounded-md`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(qe,{className:`h-3 w-60`}),(0,Q.jsx)(qe,{className:`h-7 w-16 rounded-md`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:e(`profileCard.loading`)})]})}function gr(){return(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`})}function _r({assistant:e,showHandles:t=!0,children:n}={}){let{t:r}=J(),i=Yt.use.user?.()?.email??null;return(0,Q.jsx)(X,{title:r(`profileCard.title`),subtitle:r(`profileCard.subtitle`),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i&&(0,Q.jsx)(`div`,{className:`max-w-[420px]`,children:(0,Q.jsx)(R,{label:r(`profileCard.emailLabel`),value:i,disabled:!0,readOnly:!0})}),t&&(0,Q.jsxs)(Q.Fragment,{children:[i&&(0,Q.jsx)(gr,{}),(0,Q.jsx)(vr,{assistant:e})]}),n!=null&&(0,Q.jsxs)(Q.Fragment,{children:[(i||t)&&(0,Q.jsx)(gr,{}),n]})]})})}function vr({assistant:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=fn(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return ue().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(pn.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(pr,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(mr,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(hr,{})}var yr=.5,br={dazed:.55,bashful:.4},xr=.224,Sr=`var(--surface-sunken)`,Cr=64;function wr(e){return br[e]??yr}function Tr(e,t,n,r){let i=e?.eyeStyles.find(e=>e.id===t);if(!i||i.paths.length===0)return null;let a=ye(i.paths.map(e=>Jt(e.svgPath)));if(a.w<=0||a.h<=0)return null;let o=n*(r?yr:wr(t)),s=Math.min(o/a.w,o/a.h),c=n/2-(a.x+a.w/2)*s,l=n/2-(a.y+a.h/2)*s;return{paths:i.paths,transform:`matrix(${s},0,0,${s},${c},${l})`}}function Er({components:e,eyeStyle:t,color:n,primary:r=!1,fieldColor:i,size:a=Cr,className:o}){let s=(0,Z.useMemo)(()=>Tr(e,t,a,r),[e,t,a,r]),c=e?.colors.find(e=>e.id===n)?.hex,l=i??c,u=a*xr;return(0,Q.jsxs)(`svg`,{"aria-hidden":`true`,"data-testid":`app-icon-preview`,className:o,width:a,height:a,viewBox:`0 0 ${a} ${a}`,style:{display:`block`,flexShrink:0},children:[(0,Q.jsx)(`rect`,{"data-testid":`app-icon-preview-field`,width:a,height:a,rx:u,ry:u,fill:l??Sr}),s?(0,Q.jsx)(`g`,{"data-testid":`app-icon-preview-eyes`,transform:s.transform,children:s.paths.map((e,t)=>(0,Q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))}):null]})}var Dr={production:`#4C9B50`,staging:`#E9C91A`,dev:`#FF88C9`};ge.eyeStyles.find(e=>e.id===`quirky`);var Or=`avatar-eyes-`,kr={eyeStyle:`quirky`,color:`green`};function Ar(e,t){return`${Or}${e}-${t}`}function jr(e){if(e===null||e.kind!==`character`)return null;let t=e.traits;return S(t)?Ar(t.eyeStyle,t.color):null}function Mr(e){return e!==null&&e.startsWith(Or)}function Nr(e){if(e===null||!Mr(e))return null;let t=e.slice(12),n=t.indexOf(`-`);return n<=0||n===t.length-1?null:{eyeStyle:t.slice(0,n),color:t.slice(n+1)}}function Pr(e,t){let n=jr(e);return{target:n,availableMatch:t.supported&&n!==null&&t.available.includes(n)}}var Fr=160;function Ir(e,t,n){return t<=0?0:(e+n+t)%t}function Lr(e,t){let n=e?.findIndex(e=>e.id===t)??-1;return n>=0?n:0}function Rr({open:e,onClose:t,components:n,currentIcon:r,targetIcon:i,canSyncAvatar:a,availableIcons:o,onApply:s,onReset:c}){let{t:l}=J(`settings`),u=de(),[d,f]=(0,Z.useState)(0),[p,m]=(0,Z.useState)(0),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),y=a?Nr(i):null;(0,Z.useEffect)(()=>{if(!e)return;let t=Nr(r)??Nr(i)??kr;f(Lr(n?.eyeStyles,t.eyeStyle)),m(Lr(n?.colors,t.color)),v(!1)},[e,n,r,i]);let b=n?.eyeStyles[d],x=n?.colors[p],S=b?.id??kr.eyeStyle,C=x?.id??kr.color,w=Ar(S,C),T=w!==r&&o.includes(w),E=async e=>{g(!0),v(!1);try{await e()?t():v(!0)}finally{g(!1)}};return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(V.Content,{size:`sm`,"data-testid":`app-icon-modal`,children:[(0,Q.jsx)(V.Header,{children:(0,Q.jsx)(V.Title,{children:l(`appIcon.title`)})}),(0,Q.jsxs)(V.Body,{className:`space-y-4`,children:[(0,Q.jsx)(`div`,{className:`flex justify-center`,children:(0,Q.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,Q.jsx)(Er,{components:n,eyeStyle:S,color:C,size:Fr})})}),(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(Qn,{label:l(`appIcon.eyes`),value:S,onPrev:()=>f(Ir(d,n?.eyeStyles.length??0,-1)),onNext:()=>f(Ir(d,n?.eyeStyles.length??0,1))}),(0,Q.jsx)(Qn,{label:l(`appIcon.color`),value:C,colorHex:x?.hex,onPrev:()=>m(Ir(p,n?.colors.length??0,-1)),onNext:()=>m(Ir(p,n?.colors.length??0,1))})]}),y===null?null:(0,Q.jsx)(H,{type:`button`,variant:`outlined`,fullWidth:!0,disabled:h,onClick:()=>{y!==null&&(f(Lr(n?.eyeStyles,y.eyeStyle)),m(Lr(n?.colors,y.color)),v(!1))},children:l(`appIcon.matchAvatar`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:l(u?`appIcon.androidApplyNote`:`appIcon.note`)}),_?(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-lighter text-[color:var(--content-negative)]`,children:l(u?`appIcon.androidError`:`appIcon.error`)}):null]}),(0,Q.jsxs)(V.Footer,{children:[r===null?null:(0,Q.jsx)(H,{type:`button`,variant:`outlined`,disabled:h,onClick:()=>void E(c),children:l(`appIcon.reset`)}),(0,Q.jsx)(H,{type:`button`,variant:`primary`,disabled:h||!T,onClick:()=>void E(()=>s(w)),children:l(`appIcon.apply`)})]})]})})}var zr=`AppIcon`,Br=mn(zr);function Vr(){return{supported:!1,current:null,available:[]}}function Hr(){return te()&&sn.isPluginAvailable(zr)}async function Ur(){if(!Hr())return Vr();try{let{supported:e,current:t,available:n}=await Br.getState();return{supported:e===!0,current:typeof t==`string`?t:null,available:n??[]}}catch(e){return z(e,{context:`app_icon_get_state`,bestEffort:!0}),Vr()}}async function Wr(e){if(!Hr())return!1;try{let{ok:t,error:n}=await Br.set({name:e});return t===!0?!0:(z(Error(n??`setAlternateIconName failed`),{context:`app_icon_set`,bestEffort:!0}),!1)}catch(e){return z(e,{context:`app_icon_set`,bestEffort:!0}),!1}}var Gr={supported:!1,current:null,available:[]};function Kr(e,t){return e.supported===t.supported&&e.current===t.current&&e.available.length===t.available.length&&e.available.every((e,n)=>e===t.available[n])}var qr=Ut(un()((e,t)=>({snapshot:Gr,setSnapshot:n=>{Kr(t().snapshot,n)||e({snapshot:n})}}))),Jr=[];function Yr(e){let t=i(),n=de(),r=W.use.androidAvatarAppIcon(),a=t||n&&r,{state:o}=Xe(e),s=qr.use.snapshot(),c=qr.use.setSnapshot(),l=(0,Z.useCallback)(async()=>{if(!a)return c(Gr),Gr;let e=await Ur();return c(e),e},[a,c]);(0,Z.useEffect)(()=>{l()},[l]),be(`app.resume`,()=>{l()});let u=a&&s.supported,{target:d,availableMatch:f}=Pr(o,s),p=f&&d!==s.current,m=s.available,h=(0,Z.useCallback)(async e=>{if(!u||!m.includes(e))return!1;await Wr(e);let t=await l();return t.supported&&t.current===e},[u,m,l]),g=(0,Z.useCallback)(async()=>{if(!u)return!1;await Wr(null);let e=await l();return e.supported&&e.current===null},[u,l]);return{enabled:u,currentIcon:u?s.current:null,targetIcon:u?d:null,availableIcons:u?m:Jr,canSyncAvatar:p,apply:h,reset:g}}var Xr=[`ai.vocify-inc.vellum-assistant-ios`,`ai.vellum.assistant`],Zr={"":`production`,".staging":`staging`,".dev":`dev`};function Qr(e){for(let t of Xr){if(!e.startsWith(t))continue;let n=Zr[e.slice(t.length)];if(n)return n}return null}async function $r(){try{let{App:e}=await yn(async()=>{let{App:e}=await import(`./esm-CI79f_VT.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t}=await e.getInfo();return Qr(t)}catch(e){return console.debug(`[shell-environment] no native shell identity:`,e),null}}function ei(){let[e,t]=(0,Z.useState)();return(0,Z.useEffect)(()=>{let e=!0;return $r().then(n=>{e&&t(n)}),()=>{e=!1}},[]),e}var ti=32,ni={dev:{displayP3:`color(display-p3 0.9387 0.55755 0.7777)`,srgb:Dr.dev},staging:{displayP3:`color(display-p3 0.89313 0.79283 0.2841)`,srgb:Dr.staging}},ri={local:`dev`,dev:`dev`,staging:`staging`};function ii(){return typeof CSS>`u`||typeof CSS.supports!=`function`?!1:CSS.supports(`color`,`color(display-p3 1 1 1)`)}function ai(e){if(e)return ii()?e.displayP3:e.srgb}function oi(e){if(e)return e;if(e===null)return ri.local}function si(e,t){let n=oi(e);if(!n)return;let r=ni[n];return t?r?.srgb:ai(r)}function ci(){let e=Vt.use.activeAssistantId(),t=Yr(e);return t.enabled?(0,Q.jsx)(li,{assistantId:e,sync:t}):null}function li({assistantId:e,sync:t}){let{t:n}=J(`settings`),{components:r}=Xe(e),i=k(),a=ei(),o=de(),[s,c]=(0,Z.useState)(!1),l=r??i,u=Nr(t.currentIcon),d=u??kr,f=u===null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:n(`appIcon.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:n(`appIcon.description`)})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3`,children:[(0,Q.jsx)(Er,{components:l,eyeStyle:d.eyeStyle,color:d.color,primary:f,fieldColor:f?si(a,o):void 0,size:ti}),(0,Q.jsx)(H,{variant:`outlined`,onClick:()=>c(!0),children:n(`appIcon.change`)})]})]}),(0,Q.jsx)(Rr,{open:s,onClose:()=>c(!1),components:l,currentIcon:t.currentIcon,targetIcon:t.targetIcon,canSyncAvatar:t.canSyncAvatar,availableIcons:t.availableIcons,onApply:t.apply,onReset:t.reset})]})}var ui=wt({query:{hosting:`platform`}});function di(){let{t:e}=J(`settings`),t=et(),n=K(ui),r=n.data?.results??[];return n.isPending||r.length<2?null:(0,Q.jsx)(X,{title:e(`assistantPicker.title`),subtitle:e(`assistantPicker.subtitle`),children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:r.map(n=>{let r=n.id===t;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${r?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(jn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:n.name||e(`assistantPicker.unnamed`)}),n.status!==`active`&&(0,Q.jsx)(P,{tone:`warning`,children:n.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:r?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(Rn,{className:`h-4 w-4`}),e(`assistantPicker.active`)]}):(0,Q.jsx)(H,{variant:`outlined`,size:`compact`,disabled:n.status!==`active`,onClick:()=>{p(n.id),m.success(e(`assistantPicker.switchedToast`))},children:e(`assistantPicker.switch`)})})]},n.id)})})})}var fi=[0,300,600,3600,10800,86400,259200,604800,1209600,2592e3],pi=new Set([300,600]);function mi(e,t){if(e===0)return t(`assistantSleepPolicy.neverSleep`);let n=Math.floor(e/86400),r=Math.floor(e%86400/3600);if(n>0&&r>0)return t(`assistantSleepPolicy.daysHours`,{days:n,hours:r});if(n>0)return t(`assistantSleepPolicy.days`,{days:n});if(r>0)return t(`assistantSleepPolicy.hours`,{hours:r});let i=Math.floor(e/60);return i>0?t(`assistantSleepPolicy.minutes`,{minutes:i}):t(`assistantSleepPolicy.seconds`,{seconds:e})}function hi(e,t){switch(e){case 0:return t(`assistantSleepPolicy.presetNever`);case 300:return t(`assistantSleepPolicy.preset5Min`);case 600:return t(`assistantSleepPolicy.preset10Min`);case 3600:return t(`assistantSleepPolicy.preset1Hour`);case 10800:return t(`assistantSleepPolicy.preset3Hours`);case 86400:return t(`assistantSleepPolicy.preset1Day`);case 259200:return t(`assistantSleepPolicy.preset3Days`);case 604800:return t(`assistantSleepPolicy.preset7Days`);case 1209600:return t(`assistantSleepPolicy.preset14Days`);case 2592e3:return t(`assistantSleepPolicy.preset30Days`);default:return mi(e,t)}}function gi({assistantId:e}){let{t}=J(`settings`),n=q(),r=Bn.use.isNonProduction(),i=(0,Z.useMemo)(()=>fi.filter(e=>!pi.has(e)||r),[r]),{data:a,isLoading:o,isError:s}=K(St({path:{id:e}})),c=(0,Z.useMemo)(()=>a?.idle_timeout_seconds??259200,[a]),[l,u]=(0,Z.useState)(null),d=l??c,f=l!==null,p=dt({onSuccess:()=>{m.success(t(`assistantSleepPolicy.savedToast`)),u(null),n.invalidateQueries({queryKey:ot({path:{id:e}})})},onError:()=>{m.error(t(`assistantSleepPolicy.saveErrorToast`))}});return o?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),t(`assistantSleepPolicy.loading`)]}):s?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:t(`assistantSleepPolicy.loadError`)}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t(`assistantSleepPolicy.idleTimeout`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:t(`assistantSleepPolicy.idleTimeoutDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:i.map(e=>(0,Q.jsx)(H,{variant:`outlined`,active:d===e,onClick:()=>u(e),children:hi(e,t)},e))}),(0,Q.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:t(`assistantSleepPolicy.current`,{duration:mi(d,t)})})]}),f&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(H,{variant:`primary`,leftIcon:p.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>p.mutate({path:{id:e},body:{idle_timeout_seconds:d}}),disabled:p.isPending,children:t(`assistantSleepPolicy.save`)}),(0,Q.jsx)(H,{variant:`outlined`,onClick:()=>u(null),disabled:p.isPending,children:t(`assistantSleepPolicy.cancel`)})]})]})}function _i(e,t,n){let r=[e.version];return e.version===n&&r.push(G(`settings:assistantUpgrades.latestSuffix`)),t&&e.version===t&&r.push(G(`settings:assistantUpgrades.currentSuffix`)),r.join(` `)}var vi=3e3;function yi({version:e,assistantId:t}){let{onTap:n,message:r}=Jn(t);return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`block min-w-0 break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:n,children:e??`—`}),r&&(0,Q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:r})]})}function bi({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:i}){let{t:a}=J(`settings`),o=Pt.use.rollbackEnabled(),c=W.use.previewChannel(),l=q(),u=s(n,c),d=u===`preview`,[f,p]=(0,Z.useState)(!1),h=(0,Z.useRef)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{C(a(b?`assistantUpgrades.successRolledBack`:`assistantUpgrades.successUpdated`,{version:h.current})),p(!1),h.current=null,_(null),m.success(a(b?`assistantUpgrades.toastRollbackComplete`:`assistantUpgrades.toastUpdateComplete`),{id:`runtime-upgrade-complete`,tone:`strong`}),i?.()}),!1):vi;K({...tt({path:{id:e}}),refetchInterval:f?e=>w(e.state.data?.current_release_version):!1});let{data:T,isLoading:E}=K(r({query:{channel:u}})),D=T?.find(e=>e.is_stable!==!1)??T?.[0],O=g??D?.version??null,k=(0,Z.useMemo)(()=>{if(!o||!O||!t)return!1;let e=Ge(O),n=Ge(t);return!e||!n?!1:zt(e,n)<0},[o,O,t]),A=(0,Z.useMemo)(()=>{if(!O)return!1;if(!t)return!0;let e=Ge(O),n=Ge(t);if(!e||!n)return O!==t;let r=zt(e,n);return o?r!==0:r>0},[o,O,t]),j=cn({mutationFn:async t=>{let{data:n}=await xt({path:{id:e},body:t,throwOnError:!0});return n}}),M=cn({mutationFn:async t=>{let{data:n}=await vt({path:{id:e},body:t,throwOnError:!0});return n}}),N=async()=>{y(!1),C(null);let t=o?O??void 0:void 0;try{if(k){let e=await M.mutateAsync({version:t});h.current=e.version??t??null,m.success(e.detail||a(`assistantUpgrades.toastRollbackInitiated`,{version:t}))}else{let e=await j.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){m.warning(e.detail);return}h.current=e.version??t??null,m.success(e.detail||a(`assistantUpgrades.toastUpdateInitiated`,{version:e.version??t??a(`assistantUpgrades.latest`)}))}x(k),p(!0),l.invalidateQueries({queryKey:Dt({path:{id:e}})})}catch{m.error(a(k?`assistantUpgrades.toastRollbackFailed`:`assistantUpgrades.toastUpdateFailed`))}},P=a(d?`assistantUpgrades.previewRelease`:A?k?`assistantUpgrades.rollbackTo`:`assistantUpgrades.updateTo`:`assistantUpgrades.selected`);return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:a(`assistantUpgrades.current`)}),(0,Q.jsx)(yi,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:P}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 md:flex-row md:items-center md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`block min-w-0 flex-1`,children:E?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`}),a(`assistantUpgrades.loading`)]}):T&&T.length>0?o?(0,Q.jsx)(kt,{value:O??``,onChange:e=>_(e===D?.version?null:e),disabled:f||j.isPending||M.isPending,options:T.map(e=>({value:e.version,label:_i(e,t,D?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:D?_i(D,t,D.version):`—`}):a(`assistantUpgrades.noReleases`)}),(0,Q.jsx)(H,{variant:k?`outlined`:`primary`,className:`min-w-[160px] shrink-0`,leftIcon:j.isPending||M.isPending||f?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:()=>y(!0),disabled:!A||j.isPending||M.isPending||f||E||!T?.length,children:a(f?b?`assistantUpgrades.rollingBack`:`assistantUpgrades.updating`:k?`assistantUpgrades.rollback`:d?`assistantUpgrades.updatePreview`:`assistantUpgrades.update`)})]})]})]}),d&&(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`assistantUpgrades.usingPreviewReleases`,components:{stableLink:(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`})}})}),!A&&t&&O&&!E&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:S??a(`assistantUpgrades.alreadyOnVersion`)}),(0,Q.jsx)(_e,{open:v,title:a(k?`assistantUpgrades.confirmRollbackTitle`:d?`assistantUpgrades.confirmPreviewTitle`:`assistantUpgrades.confirmUpdateTitle`),message:k?a(`assistantUpgrades.confirmRollbackMessage`,{version:O??a(`assistantUpgrades.unknown`)}):a(d?`assistantUpgrades.confirmPreviewMessage`:`assistantUpgrades.confirmUpdateMessage`,{version:O??a(`assistantUpgrades.latest`)}),confirmLabel:a(k?`assistantUpgrades.rollback`:d?`assistantUpgrades.updatePreview`:`assistantUpgrades.update`),onConfirm:N,onCancel:()=>y(!1)})]})}function xi({assistantId:e,currentVersion:t,onUpgradeComplete:n}){let{t:i}=J(`settings`),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(null),{data:l,isLoading:u}=K(r({query:{stable:!0,limit:100}})),d=(0,Z.useMemo)(()=>ht(l),[l]),f=d?.version,p=t?mt(t,f):!!f,h=re({assistantId:e,targetVersion:f});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i(`assistantUpgrades.current`)}),(0,Q.jsx)(yi,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:i(`assistantUpgrades.updateTo`)}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:u?i(`assistantUpgrades.loading`):f&&d?_i(d,t,f):i(`assistantUpgrades.noReleases`)})]})]}),(0,Q.jsx)(H,{variant:`primary`,className:`min-w-[160px]`,leftIcon:h.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:()=>o(!0),disabled:h.isPending||u||!f||!p,children:h.isPending?i(`assistantUpgrades.updating`):f?i(`assistantUpgrades.updateToVersion`,{version:f}):i(`assistantUpgrades.update`)}),s&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:s}),!s&&!p&&f&&!u&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:i(`assistantUpgrades.alreadyOnVersion`)}),(0,Q.jsx)(_e,{open:a,title:i(`assistantUpgrades.confirmUpdateTitle`),message:i(`assistantUpgrades.confirmUpdateMessage`,{version:f??i(`assistantUpgrades.latest`)}),confirmLabel:i(`assistantUpgrades.update`),onConfirm:async()=>{o(!1),c(null);try{c(i(`assistantUpgrades.successUpdated`,{version:(await h.upgrade()).version??f??i(`assistantUpgrades.latest`)})),m.success(i(`assistantUpgrades.toastUpdateComplete`),{id:`runtime-upgrade-complete`,tone:`strong`}),n?.()}catch(e){m.error(e instanceof Error?e.message:i(`assistantUpgrades.toastUpdateFailed`))}},onCancel:()=>o(!1)})]})}function Si(){let{t:e}=J(`settings`),t=Zt({platformHostedOnly:!0}),n=Ue(),r=Yt.use.user()?.id??null,i=Yt.use.logout(),[a,o]=(0,Z.useState)(!1),s=bt({onSuccess:async()=>{m.success(e(`deleteAccountSection.toastRequested`)),gt(r),await i(),c(B.account.login)},onError:()=>{m.error(e(`deleteAccountSection.toastFailed`))}}),l=t===`full`&&n;return(0,Z.useEffect)(()=>{l&&a&&o(!1)},[l,a]),t===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`deleteAccountSection.title`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`deleteAccountSection.description`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:t===`disabled`?(0,Q.jsx)(Gt,{children:e(`deleteAccountSection.platformLoginNotice`)}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(H,{variant:`dangerOutline`,onClick:()=>o(!0),disabled:s.isPending||l,className:`self-start`,children:e(`deleteAccountSection.deleteMyAccount`)}),l&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})})]}),(0,Q.jsx)(_e,{open:a,title:e(`deleteAccountSection.confirmTitle`),message:e(`deleteAccountSection.confirmMessage`),confirmLabel:e(`deleteAccountSection.confirmLabel`),destructive:!0,onConfirm:()=>{if(l){o(!1);return}o(!1),s.mutate({})},onCancel:()=>o(!1)})]})}function Ci({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(X,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(H,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function wi({promotion:e}){let{t}=J(`settings`),{appName:n,target:r}=e;return(0,Z.useEffect)(()=>{He(`settings`,r)},[r]),(0,Q.jsx)(Ci,{title:n===null?t(`nativeAppCard.titleGeneric`):t(`nativeAppCard.title`,{appName:n}),subtitle:n===null?t(`nativeAppCard.subtitleGeneric`):t(`nativeAppCard.subtitle`,{appName:n}),benefits:[{icon:Sn,text:t(`nativeAppCard.benefitPush`)},{icon:tr,text:t(`nativeAppCard.benefitBiometric`)},{icon:rr,text:t(`nativeAppCard.benefitHaptics`)},{icon:Ln,text:t(`nativeAppCard.benefitHomeScreen`)}],ctaLabel:t(`nativeAppCard.download`),ctaLeftIcon:(0,Q.jsx)(Ln,{size:16}),onAction:()=>{ut(`click`,`settings`,r),L(r),a(r)}})}function Ti(){let e=Fe(),t=Le(),n=F(),r=Be();return!e&&!t&&!n&&!r?null:(0,Q.jsx)(wi,{promotion:pt(e||t?`ios`:n?`android`:null)})}var Ei=`0.10.0`;function Di(){return lt(Ei)}var Oi=`/v1/remote-web/pairing-challenge`,ki=`/v1/remote-web/pairing-verification`,Ai=`/v1/remote-web/pairing-requests`,ji=`${Ai}/approve`,Mi=`${Ai}/deny`;function Ni(){return G(`settings:pairDeviceClient.connectivityHint`)}var Pi=class extends Error{hint;status;code;constructor(e,t={}){super(e),this.name=`PairDeviceError`,this.hint=t.hint,this.status=t.status,this.code=t.code}},Fi=5e3;function Ii(){if(typeof window>`u`)return null;let e=Xt(),t=it(e);return t?{base:`${window.location.origin}${t}`,assistantName:e?.name?.trim()||null,ingressUrl:e?.ingressUrl?.trim()||null}:null}function Li(e){let t=e?.error?.message;return typeof t==`string`&&t.trim()?t:null}function Ri(e){let t=e?.error?.code;return typeof t==`string`&&t?t:void 0}async function zi(e,t,n,r){let i;try{i=await fetch(e,{...t,signal:n})}catch(e){throw T(e)?e:new Pi(G(`settings:pairDeviceClient.networkError`))}let a=await i.json().catch(()=>null);if(!i.ok)throw new Pi(Li(a)??G(`settings:pairDeviceClient.httpError`,{status:i.status}),{hint:r,status:i.status,code:Ri(a)});if(typeof a!=`object`||!a)throw new Pi(G(`settings:pairDeviceClient.unexpectedResponse`));return a}function Bi(e,t,n,r){return zi(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)},n,r)}async function Vi(e){let{base:t,publicBaseUrl:n,signal:r}=e,i=await Bi(`${t}${Oi}`,{publicBaseUrl:n},r,Ni());try{await Bi(`${t}${ki}`,{userCode:i.userCode},r,Ni())}catch(e){let n=AbortSignal.timeout(Fi);throw T(e)?Hi(t,i.userCode,n):await Hi(t,i.userCode,r?AbortSignal.any([r,n]):n),e}return{pairUrl:Ie(i),expiresAt:i.expiresAt}}async function Hi(e,t,n){try{let r=(await Ui({base:e,signal:n})).find(e=>e.userCode===t);r&&await Ki({base:e,requestId:r.requestId,signal:n})}catch(e){if(T(e))return;z(e,{context:`pair-device-orphan-cleanup`,bestEffort:!0})}}async function Ui(e){let t=await zi(`${e.base}${Ai}`,{method:`GET`},e.signal);return Array.isArray(t.requests)?t.requests:[]}async function Wi(e,t){await Bi(`${t.base}${e}`,{requestId:t.requestId},t.signal)}function Gi(e){return Wi(ji,e)}function Ki(e){return Wi(Mi,e)}var qi=Object.defineProperty,Ji=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Xi=Object.prototype.propertyIsEnumerable,Zi=(e,t,n)=>t in e?qi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qi=(e,t)=>{for(var n in t||={})Yi.call(t,n)&&Zi(e,n,t[n]);if(Ji)for(var n of Ji(t))Xi.call(t,n)&&Zi(e,n,t[n]);return e},$i=(e,t)=>{var n={};for(var r in e)Yi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Ji)for(var r of Ji(e))t.indexOf(r)<0&&Xi.call(e,r)&&(n[r]=e[r]);return n},ea;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(ea||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(ea||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(ea||={});var ta=ea,na={L:ta.QrCode.Ecc.LOW,M:ta.QrCode.Ecc.MEDIUM,Q:ta.QrCode.Ecc.QUARTILE,H:ta.QrCode.Ecc.HIGH},ra=128,ia=`L`,aa=`#FFFFFF`,oa=`#000000`,sa=!1,ca=1,la=4,ua=0,da=.1;function fa(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function pa(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function ma(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*da),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function ha(e,t){return t==null?e?la:ua:Math.max(Math.floor(t),0)}function ga({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=Z.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...ta.QrSegment.makeSegments(t)),e),[]);return ta.QrCode.encodeSegments(r,na[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=Z.useMemo(()=>{let e=c.getModules(),t=ha(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:ma(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var _a=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),va=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=ra,level:a=ia,bgColor:o=aa,fgColor:s=oa,includeMargin:c=sa,minVersion:l=ca,boostLevel:u,marginSize:d,imageSettings:f}=n,p=$i(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=$i(p,[`style`]),g=f?.src,_=Z.useRef(null),v=Z.useRef(null),y=Z.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=Z.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=ga({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});Z.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=pa(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,_a?t.fill(new Path2D(fa(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),Z.useEffect(()=>{x(!1)},[g]);let E=Qi({height:i,width:i},m),D=null;return g!=null&&(D=Z.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),Z.createElement(Z.Fragment,null,Z.createElement(`canvas`,Qi({style:E,height:i,width:i,ref:y,role:`img`},h)),D)});va.displayName=`QRCodeCanvas`;var ya=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=ra,level:a=ia,bgColor:o=aa,fgColor:s=oa,includeMargin:c=sa,minVersion:l=ca,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=$i(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=ga({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=pa(g,v.excavation)),b=Z.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=fa(y,h);return Z.createElement(`svg`,Qi({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&Z.createElement(`title`,null,d),Z.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),Z.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});ya.displayName=`QRCodeSVG`;function ba(e,t){return!Number.isFinite(t)||t<=0?e(`pairDeviceReady.singleUse`):e(`pairDeviceReady.expiresIn`,{time:Kn(t)})}function xa({pairUrl:e,remainingMs:t,expired:n,copied:r,onCopy:i}){let{t:a}=J(`settings`);return n?(0,Q.jsx)(u,{tone:`warning`,title:a(`pairDeviceReady.expiredTitle`),children:a(`pairDeviceReady.expiredBody`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`div`,{className:`w-fit rounded-lg bg-white p-3`,children:(0,Q.jsx)(ya,{value:e,size:192,level:`M`,title:a(`pairDeviceReady.qrTitle`)})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`code`,{"data-testid":`pair-device-url`,className:`min-w-0 flex-1 truncate rounded-md bg-[var(--surface-active)] px-2.5 py-1.5 text-body-small-default text-[var(--content-secondary)]`,children:e}),(0,Q.jsx)(H,{variant:`outlined`,size:`compact`,leftIcon:r?(0,Q.jsx)(Rn,{}):(0,Q.jsx)(Mn,{}),onClick:()=>i(e),children:a(r?`pairDeviceReady.copiedButton`:`pairDeviceReady.copyButton`)})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:ba(a,t)})]})}function Sa(e){return/iPhone|iPod/.test(e)?`iPhone`:/iPad/.test(e)||/Macintosh/.test(e)&&/Mobile/.test(e)?`iPad`:/Android/.test(e)?`Android`:/Macintosh|Mac OS X/.test(e)?`macOS`:/Windows/.test(e)?`Windows`:/CrOS/.test(e)?`ChromeOS`:/Linux/.test(e)?`Linux`:null}function Ca(e){return/Edg\/|EdgA\/|EdgiOS\//.test(e)?`Edge`:/OPR\/|OPiOS\//.test(e)?`Opera`:/Firefox\/|FxiOS\//.test(e)?`Firefox`:/Chrome\/|CriOS\//.test(e)?`Chrome`:/Safari\//.test(e)?`Safari`:null}function wa(e){if(!e||e.trim()===``)return null;let t=Sa(e),n=Ca(e);return t===null&&n===null?null:{browser:n,os:t}}var Ta=3e4;function Ea(e){let[,t]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(e=>e+1),Ta);return()=>clearInterval(n)},[e])}function Da(e){return rt(typeof e==`string`?new Date(e).getTime():e,{locale:g(),minimumUnit:`minute`})}var Oa=5e3,ka=6e4;function Aa({pollWhilePairing:e=!1,revalidateKey:t,isExpanded:n=!1}={}){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(null),d=(0,Z.useRef)(!0),f=(0,Z.useRef)(0);(0,Z.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let p=(0,Z.useCallback)((e=Xt()?.assistantId)=>{if(!e)return;i(t=>t&&t.assistantId!==e?null:t);let t=++f.current;Nt(e).then(n=>{!d.current||t!==f.current||i(n.ok?{assistantId:e,devices:n.devices}:null)})},[]),m=Vt.use.selectedAssistantId()??Xt()?.assistantId;(0,Z.useEffect)(()=>{o(null),u(null),p(m)},[m,p]);let h=(0,Z.useRef)(t);(0,Z.useEffect)(()=>{t!==h.current&&(h.current=t,p(m))},[t,m,p]);let g=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(e&&!s){g.current=!0;let e=setInterval(()=>p(),Oa);return()=>clearInterval(e)}!e&&g.current&&(g.current=!1,p())},[e,s,p]);let _=(r?.devices.length??0)>0;(0,Z.useEffect)(()=>{if(!n||!_||e||s)return;let t=setInterval(()=>p(),ka);return()=>clearInterval(t)},[n,_,e,s,p]);let v=(0,Z.useCallback)(e=>{u(null),o(e)},[]),y=(0,Z.useCallback)(()=>{o(null),u(null)},[]),b=(0,Z.useCallback)(()=>{!r||!a||s||(c(!0),u(null),Tt(r.assistantId,a.hashedDeviceId).then(e=>{d.current&&(c(!1),e.ok?(o(null),p()):u(e.error))}))},[r,a,s,p]);return{devices:r?.devices??null,confirmTarget:a,isRevoking:s,revokeError:l,requestRevoke:v,cancelRevoke:y,confirmRevoke:b}}var ja=600*1e3,Ma=`paired-devices`;function Na(e){return e.slice(0,12)}function Pa(e,t){return t?t.charAt(0).toUpperCase()+t.slice(1):e(`pairedDevicesSection.platformUnknown`)}function Fa(e,t){if(typeof t.clientReportedName==`string`&&t.clientReportedName.trim()!==``)return{name:t.clientReportedName,isRealIdentity:!0};let n=wa(t.pairingUserAgent);if(n!==null){let{browser:t,os:r}=n;return t!==null&&r!==null?{name:e(`pairedDevicesSection.browserOnOs`,{browser:t,os:r}),isRealIdentity:!0}:{name:t??r??``,isRealIdentity:!0}}return{name:Pa(e,t.platform),isRealIdentity:!1}}function Ia(e,t){return t===null?e(`pairedDevicesSection.dateUnknown`):new Date(t).toLocaleDateString(g())}function La(e,t){let n=Ia(e,t.issuedAt);return t.lastUsedAt===null?e(`pairedDevicesSection.pairedLine`,{paired:n}):Date.now()-t.lastUsedAt<=ja?e(`pairedDevicesSection.pairedActiveLine`,{paired:n}):e(`pairedDevicesSection.pairedAndUsedLine`,{paired:n,lastUsed:Da(t.lastUsedAt)})}function Ra({pollWhilePairing:e=!1,revalidateKey:t}={}){let{t:n}=J(`settings`),[r,i]=(0,Z.useState)(!1),a=Aa({pollWhilePairing:e,revalidateKey:t,isExpanded:r}),{devices:o,confirmTarget:s}=a;Ea(o?.some(e=>e.lastUsedAt!==null)??!1);let c=(0,Z.useMemo)(()=>o===null?null:[...o].sort((e,t)=>(t.lastUsedAt??0)-(e.lastUsedAt??0)),[o]);return c===null||c.length===0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U.Root,{type:`multiple`,value:r?[Ma]:[],onValueChange:e=>i(e.includes(Ma)),children:(0,Q.jsxs)(U.Item,{value:Ma,children:[(0,Q.jsxs)(U.Trigger,{className:`group flex w-full items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:n(`pairedDevicesSection.title`,{count:c.length})}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:c.map(e=>{let t=Fa(n,e);return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,title:t.isRealIdentity?e.hashedDeviceId:void 0,children:t.name}),!t.isRealIdentity&&(0,Q.jsx)(`span`,{className:`shrink-0 font-mono text-[var(--content-tertiary)]`,title:e.hashedDeviceId,children:Na(e.hashedDeviceId)}),e.isCurrentHost&&(0,Q.jsx)(`span`,{className:`shrink-0 text-[var(--content-tertiary)]`,children:`· ${n(`pairedDevicesSection.thisMachine`)}`})]}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:La(n,e)})]}),(0,Q.jsx)(H,{variant:`dangerOutline`,size:`compact`,className:`shrink-0`,disabled:e.isCurrentHost===!0,title:e.isCurrentHost?n(`pairedDevicesSection.hostRevokeDisabledTitle`):void 0,onClick:()=>a.requestRevoke(e),children:n(`pairedDevicesSection.revokeButton`)})]},e.hashedDeviceId)})})})]})}),(0,Q.jsx)(_e,{open:s!==null,title:n(`pairedDevicesSection.confirmTitle`),message:s&&(0,Q.jsxs)(Q.Fragment,{children:[n(`pairedDevicesSection.confirmMessageNamed`,{name:Fa(n,s).name,hash:Na(s.hashedDeviceId)}),a.revokeError&&(0,Q.jsx)(`span`,{className:`mt-2 block text-[var(--system-negative-strong)]`,children:a.revokeError})]}),confirmLabel:n(`pairedDevicesSection.revokeButton`),destructive:!0,isPending:a.isRevoking,onConfirm:a.confirmRevoke,onCancel:a.cancelRevoke})]})}var za=5e3;function Ba(e,t){return e.length===t.length&&t.every((t,n)=>e[n]?.requestId===t.requestId)}function Va(e,t){let[n,r]=(0,Z.useState)([]),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(null),d=(0,Z.useRef)(null),[f,p]=(0,Z.useState)(e);e!==f&&(p(e),r([]),a(null),s(null),l(null)),(0,Z.useEffect)(()=>()=>{d.current?.abort(),d.current=null},[e]),(0,Z.useEffect)(()=>{let t=async()=>{u.current?.abort();let t=new AbortController;u.current=t;try{let n=await Ui({base:e,signal:t.signal});if(t.signal.aborted)return;r(e=>Ba(e,n)?e:n),l(e=>e&&!e.sticky&&!n.some(t=>t.requestId===e.requestId)?null:e),s(null)}catch(e){if(t.signal.aborted)return;if(e instanceof Pi){s(e.message);return}z(e,{context:`pair-device-pending-requests-poll`}),s(G(`settings:usePendingPairingRequests.pollErrorFallback`))}};t();let n=setInterval(()=>void t(),za);return()=>{clearInterval(n),u.current?.abort()}},[e]);let m=(0,Z.useCallback)(async(n,i)=>{if(d.current)return;let o=new AbortController;d.current=o,a({requestId:n,action:i}),l(null);let s=()=>{u.current?.abort(),r(e=>e.filter(e=>e.requestId!==n))};try{if(await(i===`approve`?Gi:Ki)({base:e,requestId:n,signal:o.signal}),o.signal.aborted)return;s(),i===`approve`&&t?.()}catch(e){if(o.signal.aborted)return;e instanceof Pi?i===`deny`&&e.status===409&&e.code===`ALREADY_APPROVED`?(s(),t?.(),l({requestId:n,message:G(`settings:usePendingPairingRequests.denyAlreadyApproved`),sticky:!0})):e.status===404||e.status===410?s():l({requestId:n,message:e.message}):(z(e,{context:`pair-device-pending-request-action`}),l({requestId:n,message:G(`settings:usePendingPairingRequests.actionErrorFallback`)}))}finally{d.current===o&&(d.current=null),o.signal.aborted||a(null)}},[e,t]),h=(0,Z.useCallback)(e=>m(e,`approve`),[m]),g=(0,Z.useCallback)(e=>m(e,`deny`),[m]);return{requests:n,actingOn:i,error:c?.message??o,approve:h,deny:g}}function Ha({base:e,onApproved:t}){let{t:n}=J(`settings`),{requests:r,actingOn:i,error:a,approve:o,deny:s}=Va(e,t);return Ea(r.length>0),r.length===0&&!a?null:(0,Q.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-[var(--border-element)] pt-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:n(`pendingPairingRequests.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`pendingPairingRequests.instruction`)})]}),a&&(0,Q.jsx)(u,{tone:`error`,title:a}),r.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-2`,children:r.map(e=>{let t=i!==null&&i.requestId===e.requestId?i.action:null,r=t===`approve`,a=t===`deny`;return(0,Q.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-lg border border-[var(--border-element)] p-3`,children:[(0,Q.jsx)(`code`,{className:I(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`w-fit px-2.5 py-1.5 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`),children:e.userCode}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.viaEdgeProxy===!1?n(`pendingPairingRequests.requestedMetaHost`,{when:Da(e.requestedAt)}):n(`pendingPairingRequests.requestedMeta`,{when:Da(e.requestedAt),ip:e.requesterIp})}),e.requesterUserAgent&&(0,Q.jsx)(`p`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,title:e.requesterUserAgent,children:e.requesterUserAgent})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(H,{variant:`primary`,size:`compact`,disabled:i!==null,"aria-busy":r||void 0,leftIcon:r?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>void o(e.requestId),children:n(`pendingPairingRequests.approveButton`)}),(0,Q.jsx)(H,{variant:`dangerOutline`,size:`compact`,disabled:i!==null,"aria-busy":a||void 0,leftIcon:a?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>void s(e.requestId),children:n(`pendingPairingRequests.denyButton`)})]})]},e.requestId)})})]})}function Ua({onRefresh:e,isRefreshing:t,labelled:n=!1}){let{t:r}=J(`settings`),i=r(`tunnelStatusRow.refreshLabel`),a=(0,Q.jsx)(In,{className:t?`animate-spin`:void 0});return n?(0,Q.jsx)(H,{variant:`outlined`,size:`compact`,leftIcon:a,disabled:t,onClick:e,children:i}):(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,iconOnly:a,"aria-label":i,disabled:t,onClick:e})}function Wa(e){return`publicBaseUrl`in e&&e.publicBaseUrl?e.publicBaseUrl:null}function Ga(e){return`checkedAt`in e&&e.checkedAt?e.checkedAt:null}function Ka(e,t){let n=t?.trim();return n?`vellum tunnel ${Ja(n)} --provider ${e}`:`vellum tunnel --provider ${e}`}var qa=/^[A-Za-z0-9._-]+$/;function Ja(e){return qa.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}var Ya={checking:`var(--content-tertiary)`,stopped:`var(--content-tertiary)`,healthy:`var(--system-positive-strong)`,unpairable:`var(--system-mid-strong)`,unreachable:`var(--system-mid-strong)`,foreign:`var(--system-negative-strong)`},Xa=`text-body-small-default text-[var(--content-tertiary)]`,Za=`truncate ${Xa}`;function Qa({status:e,onRefresh:t,isRefreshing:n,assistantName:r=null}){let{t:i}=J(`settings`);if(e.kind===`unconfigured`||e.kind===`unavailable`)return null;let a=Ga(e),o=Wa(e),s=`provider`in e?e.provider:void 0,c=`detail`in e?e.detail:void 0;return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg border border-[var(--border-element)] px-3 py-2.5`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`mt-1.5 inline-block h-2 w-2 shrink-0 rounded-full`,style:{backgroundColor:Ya[e.kind]}}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-default)]`,children:$a(e,i)}),c&&(0,Q.jsx)(`p`,{className:Za,title:c,children:c}),s&&(0,Q.jsx)(`p`,{className:Xa,children:(0,Q.jsx)(ln,{i18nKey:e.kind===`stopped`?`tunnelStatusRow.stoppedRestart`:`tunnelStatusRow.restartHint`,ns:`settings`,values:{command:Ka(s,r)},components:{code:(0,Q.jsx)(`code`,{className:I(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`px-1.5 py-0.5`)})}})}),o&&(0,Q.jsx)(`p`,{className:Za,title:o,children:o}),a&&(0,Q.jsx)(`p`,{className:Xa,children:i(`tunnelStatusRow.checkedAt`,{when:Da(a)})})]}),(0,Q.jsx)(Ua,{onRefresh:t,isRefreshing:n})]})}function $a(e,t){switch(e.kind){case`checking`:return t(`tunnelStatusRow.checkingStatus`);case`stopped`:return t(`tunnelStatusRow.stoppedStatus`);case`healthy`:return t(`tunnelStatusRow.healthyStatus`);case`unpairable`:return t(`tunnelStatusRow.unpairableStatus`);case`unreachable`:return t(`tunnelStatusRow.unreachableStatus`);case`foreign`:return e.servingAssistantName?t(`tunnelStatusRow.foreignStatusNamed`,{name:e.servingAssistantName}):t(`tunnelStatusRow.foreignStatus`)}}var eo=`vellum:pair-device:public-base-url`;function to(e){let t=e?.trim();if(t)return{url:t,source:`tunnel`};let n=De(eo,``).trim();return n?{url:n,source:`stored`}:{url:``,source:`none`}}function no(e,n){let r=(0,Z.useMemo)(()=>to(n),[n]),[i,a]=(0,Z.useState)(null),o=i??r.url,[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)({kind:`idle`}),[d,f]=(0,Z.useState)(()=>Date.now()),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>p.current?.abort(),[]),(0,Z.useEffect)(()=>{if(l.kind!==`ready`)return;f(Date.now());let e=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(e)},[l]);let m=(0,Z.useCallback)(e=>{a(e),c(null)},[]),h=(0,Z.useCallback)(()=>{if(!e)return;let n=o.trim(),r=t(n);if(!r.ok){c($t(r.reason,n));return}c(null),p.current?.abort();let i=new AbortController;p.current=i,u({kind:`minting`}),(async()=>{try{let t=await Vi({base:e,publicBaseUrl:r.url,signal:i.signal});if(i.signal.aborted)return;At(eo,r.url),u({kind:`ready`,pairUrl:t.pairUrl,expiresAtMs:Date.parse(t.expiresAt)})}catch(e){if(i.signal.aborted)return;if(e instanceof Pi){u({kind:`error`,message:e.message,hint:e.hint});return}z(e,{context:`pair-device-mint`}),u({kind:`error`,message:G(`settings:usePairDevice.mintErrorFallback`)})}})()},[e,o]),g=l.kind===`ready`?Math.max(0,l.expiresAtMs-d):0,_=l.kind===`ready`&&g<=0;return{publicBaseUrl:o,setPublicBaseUrl:m,prefillSource:r.source,inputError:s,phase:l,remainingMs:g,expired:_,generate:h}}var ro=`0.11.6`;function io(e){return It(ro,e)}function ao(e){let t=et(),r=io(t),i=en(),a=e&&r&&i,{data:o,isFetching:s,refetch:c}=K({...n({path:{assistant_id:t}}),enabled:a,staleTime:0,refetchOnWindowFocus:!1}),l=(0,Z.useCallback)(()=>{a&&c()},[a,c]);return{status:oo(o,s),isRefreshing:s,refresh:l}}function oo(e,t){if(!e)return t?{kind:`checking`}:{kind:`unavailable`};let{lastTunnel:n}=e,r=e.publicBaseUrl??``,i=e.checkedAt??``,a=n?{provider:n.provider}:{};switch(e.state){case`unconfigured`:return{kind:`unconfigured`};case`stopped`:return{kind:`stopped`,...a,...n?{publicBaseUrl:n.publicBaseUrl}:{}};case`healthy`:return{kind:`healthy`,publicBaseUrl:r,checkedAt:i};case`unpairable`:case`unreachable`:return{kind:e.state,publicBaseUrl:r,checkedAt:i,...e.detail?{detail:e.detail}:{},...a};case`foreign`:return{kind:`foreign`,publicBaseUrl:r,checkedAt:i,...e.servingAssistantName?{servingAssistantName:e.servingAssistantName}:{},...a};default:return{kind:`unavailable`}}}var so=`tailscale`,co=`public-url`,lo=new Set([`unpairable`,`unreachable`,`foreign`]),uo=`vellum tunnel --help`,fo=d(B.docs.pairADevice);function po(){let{t:e}=J(`settings`),t=Ii(),n=Di(),r=W.use.pairedDevicesUI(),i=ao(n&&t!==null),a=i.status.kind!==`unavailable`;be(`app.resume`,()=>{i.refresh()}),Ea(Ga(i.status)!==null);let o=i.status.kind===`stopped`?null:Wa(i.status),s=no(t?.base??null,a?o:t?.ingressUrl??null),[c,l]=(0,Z.useState)(0),[d,f]=(0,Z.useState)(!1),{copy:p,copied:m}=Ee({errorMessage:e(`pairDeviceCard.copyError`)});if(!t||!n)return null;let h=t.assistantName??e(`pairDeviceCard.subtitleFallbackName`),{phase:g}=s,_=g.kind===`minting`,v=g.kind===`ready`,y=s.prefillSource===`tunnel`,b=a?i.status.kind===`unconfigured`:s.prefillSource===`none`&&s.publicBaseUrl.trim()===``,x=b&&a,S=a&&lo.has(i.status.kind),C=e(_?`pairDeviceCard.generateButtonMinting`:v?`pairDeviceCard.generateButtonRegenerate`:S?`pairDeviceCard.generateButtonWarned`:`pairDeviceCard.generateButton`),w=a&&o!==null,T=d||s.inputError!==null,E=(0,Q.jsx)(H,{variant:S?`outlined`:`primary`,className:`self-start`,disabled:_||s.publicBaseUrl.trim()===``,onClick:s.generate,children:C}),D=(0,Q.jsx)(R,{label:e(`pairDeviceCard.publicUrlLabel`),fullWidth:!0,placeholder:e(`pairDeviceCard.publicUrlPlaceholder`),helperText:e(y?`pairDeviceCard.publicUrlHelperTunnel`:`pairDeviceCard.publicUrlHelper`),value:s.publicBaseUrl,errorText:s.inputError??void 0,disabled:_,onChange:e=>{f(!0),s.setPublicBaseUrl(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),s.generate())}});return(0,Q.jsx)(X,{title:e(`pairDeviceCard.title`),subtitle:e(`pairDeviceCard.subtitle`,{name:h}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[b&&(0,Q.jsx)(u,{tone:`info`,title:e(`pairDeviceCard.noTunnelTitle`),actions:x?(0,Q.jsx)(Ua,{onRefresh:i.refresh,isRefreshing:i.isRefreshing,labelled:!0}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{children:e(`pairDeviceCard.noTunnelWhy`,{name:h})}),(0,Q.jsx)(`code`,{className:I(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`w-fit max-w-full overflow-x-auto px-2.5 py-1.5`),children:Ka(so,t.assistantName)}),(0,Q.jsx)(`p`,{children:e(`pairDeviceCard.noTunnelNext`)}),(0,Q.jsx)(`p`,{children:(0,Q.jsx)(ln,{i18nKey:`pairDeviceCard.noTunnelMore`,ns:`settings`,values:{command:uo},components:{code:(0,Q.jsx)(`code`,{className:I(`rounded-md bg-[var(--surface-active)] text-body-small-default text-[color:var(--content-primary)]`,`px-1.5 py-0.5`)})}})})]})}),(0,Q.jsx)(Qa,{status:i.status,onRefresh:i.refresh,isRefreshing:i.isRefreshing,assistantName:t.assistantName}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-3`,children:w?(0,Q.jsxs)(Q.Fragment,{children:[E,(0,Q.jsx)(U.Root,{type:`single`,collapsible:!0,value:T?co:``,onValueChange:e=>f(e===co),children:(0,Q.jsxs)(U.Item,{value:co,children:[(0,Q.jsxs)(U.Trigger,{className:`group flex w-full items-center justify-between gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:e(`pairDeviceCard.publicUrlDisclosure`)}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsx)(`div`,{className:`mt-3`,children:D})})]})})]}):(0,Q.jsxs)(Q.Fragment,{children:[D,E]})}),g.kind===`error`&&(0,Q.jsx)(u,{tone:`error`,title:g.message,children:g.hint}),v&&(0,Q.jsx)(xa,{pairUrl:g.pairUrl,remainingMs:s.remainingMs,expired:s.expired,copied:m,onCopy:p}),(0,Q.jsx)(Ha,{base:t.base,onApproved:()=>l(e=>e+1)}),r&&(0,Q.jsx)(Ra,{pollWhilePairing:v&&!s.expired,revalidateKey:c}),(0,Q.jsx)(`a`,{href:fo,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>ee(e,fo),className:`self-start text-body-medium-default text-[var(--content-tertiary)] underline hover:text-[var(--content-default)]`,children:e(`pairDeviceCard.learnMore`)})]})})}function mo(e){return[{scope:`global`,title:e(`shortcutsSections.globalTitle`),description:e(`shortcutsSections.globalDescription`)},{scope:`menu`,title:e(`shortcutsSections.appTitle`),description:e(`shortcutsSections.appDescription`)}]}function ho({hotkey:e,recording:t,conflictLabel:n,alternateBinding:r,onStartRecording:i,onCancelRecording:a,onReset:o,onRemove:s}){let{t:c}=J(`settings`),l=e.accelerator===``,u=e.override!==null;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),n!==null&&(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c(`shortcutsSections.alreadyUsedBy`,{label:n})})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[r,t?(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:c(`shortcutsSections.recordingHint`)}):l?(0,Q.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:c(`shortcutsSections.none`)}):(0,Q.jsx)(nn,{accelerator:e.accelerator}),t?(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,onClick:a,children:c(`shortcutsSections.cancel`)}):(0,Q.jsx)(H,{variant:`outlined`,size:`compact`,onClick:i,"aria-label":c(`shortcutsSections.recordShortcutAriaLabel`,{label:e.label}),children:c(`shortcutsSections.record`)}),(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,disabled:!u,leftIcon:(0,Q.jsx)(An,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":c(`shortcutsSections.resetShortcutAriaLabel`,{label:e.label})}),(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,disabled:l,leftIcon:(0,Q.jsx)(Fn,{className:`h-3.5 w-3.5`}),onClick:s,"aria-label":c(`shortcutsSections.removeBindingAriaLabel`,{label:e.label})})]})]})}function go(){let{t:e}=J(`settings`),{catalog:t,recordingKey:n,conflict:r,startRecording:i,stopRecording:a,resetHotkey:o,removeHotkey:s}=$n(),c=(0,Z.useMemo)(()=>mo(e).map(e=>({...e,commands:t.filter(t=>t.rebindable&&t.scope===e.scope)})).filter(e=>e.commands.length>0),[t,e]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[r!==null&&(0,Q.jsxs)(u,{tone:`warning`,children:[e(`shortcutsSections.conflictNoticePrefix`,{label:r.label}),` `,e(n===null?`shortcutsSections.conflictResetHint`:`shortcutsSections.conflictRecordingHint`)]}),c.map(e=>(0,Q.jsxs)(Te,{bordered:!0,children:[(0,Q.jsxs)(`div`,{className:`mb-2`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.title}),(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,Q.jsx)(ho,{hotkey:e,recording:n===e.key,conflictLabel:r!==null&&r.key===e.key?r.label:null,onStartRecording:()=>i(e.key),onCancelRecording:a,onReset:()=>o(e.key),onRemove:()=>s(e.key)},e.key))})]},e.scope))]})}async function _o(){if(!b())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function vo(e){if(!b())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function yo(){let{t:e}=J(`settings`),t=fe.useValue(),n=rn.useValue(),r=!Ne(),i=je();return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`preferencesModal.composerTitle`)}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-4`,children:[r&&(0,Q.jsx)(ae,{checked:t,onChange:fe.save,label:e(i?`preferencesModal.sendWithCmdEnter`:`preferencesModal.sendWithCtrlEnter`),helperText:e(i?`preferencesModal.sendWithCmdEnterHelper`:`preferencesModal.sendWithCtrlEnterHelper`)}),(0,Q.jsx)(ae,{checked:n,onChange:rn.save,label:e(`preferencesModal.showContextWindow`),helperText:e(`preferencesModal.showContextWindowHelper`)})]})]})}function bo(){let{t:e}=J(`settings`),[t,n]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{_o().then(n)},[]);let r=async e=>{n(e);try{await vo(e)}catch{n(!e)}};return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`preferencesModal.launchAtLoginTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(jt()===`windows`?`preferencesModal.launchAtLoginDescriptionWindows`:`preferencesModal.launchAtLoginDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ae,{checked:t,onChange:e=>void r(e),"aria-label":e(`preferencesModal.launchAtLoginAriaLabel`)})})]})}function xo({open:e,onClose:t}){let{t:n}=J(`settings`);return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(V.Content,{size:`lg`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:n(`preferencesModal.title`)}),(0,Q.jsx)(V.Description,{children:n(`preferencesModal.description`)})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[b()&&(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:n(`preferencesModal.keyboardShortcutsTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n(`preferencesModal.keyboardShortcutsDescription`)}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(go,{})})]}),(0,Q.jsx)(yo,{}),b()&&(0,Q.jsx)(bo,{})]})})]})})}function So(e){return e===`preview`?`preview`:`stable`}function Co(e,t){if(!e)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:n.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function wo(e){return e.filter(e=>e.ready_to_use)}function To(e){return e?.feature_enabled===!1}function Eo({assistantId:e,onComplete:t}){let{t:n}=J(`settings`),r=W.use.previewChannel(),i=q(),[a,o]=(0,Z.useState)(),[s,c]=(0,Z.useState)(!1),[l,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=Wt({path:{assistant_id:e}}),v=Ye({path:{assistant_id:e}}),y=Dt({path:{id:e}}),{data:b,isLoading:x,isError:S}=K({..._,enabled:r,retry:!1}),C=(0,Z.useMemo)(()=>wo(b?.preview_backups??[]),[b?.preview_backups]),w=C[0],T=C.find(e=>e.snapshot_name===h)??w,E=()=>{i.invalidateQueries({queryKey:v}),i.invalidateQueries({queryKey:y}),t?.()},D=cn(Ke()),O=cn(yt()),k=So(b?.current_channel),A=D.isPending||O.isPending,j=A||To(b)||!b?.latest_preview_release,M=f===`restore_backup`&&!T;if((0,Z.useEffect)(()=>{o(k===`preview`?`release-channel`:void 0)},[k]),!r)return null;let N=b?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(U.Root,{type:`single`,collapsible:!0,value:a,onValueChange:e=>o(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(U.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(U.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:n(`previewReleaseChannel.title`)}),b&&(0,Q.jsx)(P,{tone:k===`preview`?`warning`:`neutral`,children:n(k===`preview`?`previewReleaseChannel.preview`:`previewReleaseChannel.stable`)})]}),(0,Q.jsx)(Dn,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(U.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[x&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),n(`previewReleaseChannel.loading`)]}),S&&(0,Q.jsx)(u,{tone:`error`,title:n(`previewReleaseChannel.loadErrorTitle`),children:n(`previewReleaseChannel.loadErrorBody`)}),b&&(0,Q.jsxs)(Q.Fragment,{children:[To(b)&&(0,Q.jsx)(u,{tone:`neutral`,title:n(`previewReleaseChannel.unavailableTitle`),children:n(`previewReleaseChannel.unavailableBody`)}),k===`stable`?(0,Q.jsx)(Do,{status:b,isChangingChannel:A,optInDisabled:j,onOptIn:()=>c(!0)}):(0,Q.jsx)(Oo,{status:b,isChangingChannel:A,onOptOut:()=>{let e=w;g(e?.snapshot_name??``),p(e?`restore_backup`:N?`standard_upgrade`:`restore_backup`),d(!0)}})]})]})})]})}),(0,Q.jsx)(Ao,{open:s,isPending:D.isPending,previewVersion:b?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await D.mutateAsync({path:{assistant_id:e}});m.success(t.detail||n(`previewReleaseChannel.previewEnabledToast`)),c(!1),E()}catch(e){m.error(Ce(e,void 0,n(`previewReleaseChannel.previewEnableFailedToast`)))}},onCancel:()=>c(!1)}),(0,Q.jsx)(jo,{open:l,backups:C,mode:f,selectedSnapshotName:T?.snapshot_name??``,isPending:O.isPending,restoreModeDisabled:M,standardUpgradeAvailable:N,onModeChange:p,onSnapshotChange:g,onConfirm:async()=>{if(!M)try{let t=await O.mutateAsync({path:{assistant_id:e},body:f===`restore_backup`?{mode:`restore_backup`,snapshot_name:T?.snapshot_name}:{mode:`standard_upgrade`}});m.success(t.detail||n(`previewReleaseChannel.stableEnabledToast`)),d(!1),E()}catch(e){m.error(Ce(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>d(!1)})]})}function Do({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){let{t:i}=J(`settings`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ko,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(u,{tone:`neutral`,title:i(`previewReleaseChannel.noPreviewTitle`),children:i(`previewReleaseChannel.noPreviewBody`)}),(0,Q.jsx)(H,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(wn,{}),disabled:n,onClick:r,children:i(`previewReleaseChannel.optIn`)})]})}function Oo({status:e,isChangingChannel:t,onOptOut:n}){let{t:r}=J(`settings`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(ko,{status:e}),(0,Q.jsx)(H,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(An,{}),disabled:t,onClick:n,children:r(`previewReleaseChannel.switchBack`)})]})}function ko({status:e}){let{t}=J(`settings`);return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:t(`previewReleaseChannel.latestStable`)}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??t(`previewReleaseChannel.none`)})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:t(`previewReleaseChannel.latestPreview`)}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??t(`previewReleaseChannel.none`)})]})]})}function Ao({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){let{t:a}=J(`settings`);return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(V.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(V.Header,{icon:Cn,children:[(0,Q.jsx)(V.Title,{children:a(`previewReleaseChannel.optInTitle`)}),(0,Q.jsx)(V.Description,{children:a(`previewReleaseChannel.optInDescription`)})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(u,{tone:`warning`,title:a(`previewReleaseChannel.dataLossTitle`),children:a(`previewReleaseChannel.dataLossBody`)}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep1`)}),(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep2`,{version:n??a(`previewReleaseChannel.latest`)})}),(0,Q.jsx)(`li`,{children:a(`previewReleaseChannel.optInStep3`)})]})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(H,{variant:`outlined`,disabled:t,onClick:i,children:a(`previewReleaseChannel.cancel`)}),(0,Q.jsx)(H,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(wn,{}),onClick:r,children:a(t?`previewReleaseChannel.switching`:`previewReleaseChannel.takeBackupAndSwitch`)})]})]})})}function jo({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:s,onSnapshotChange:c,onConfirm:d,onCancel:f}){let{t:p}=J(`settings`),m=p(`previewReleaseChannel.unknownDate`);return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>!e&&f(),children:(0,Q.jsxs)(V.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(V.Header,{icon:Cn,children:[(0,Q.jsx)(V.Title,{children:p(`previewReleaseChannel.optOutTitle`)}),(0,Q.jsx)(V.Description,{children:p(`previewReleaseChannel.optOutDescription`)})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(l,{value:n,onValueChange:s,disabled:i,"aria-label":p(`previewReleaseChannel.returnMethodAriaLabel`),children:[(0,Q.jsx)(_t,{value:`restore_backup`,disabled:t.length===0,label:p(`previewReleaseChannel.restoreBackupLabel`),helperText:p(`previewReleaseChannel.restoreBackupHelper`)}),(0,Q.jsx)(_t,{value:`standard_upgrade`,disabled:!o,label:p(`previewReleaseChannel.standardUpgradeLabel`),helperText:p(o?`previewReleaseChannel.standardUpgradeHelper`:`previewReleaseChannel.standardUpgradeUnavailable`)})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[p(`previewReleaseChannel.safetyBackup`),(0,Q.jsx)(kt,{value:r,onChange:c,disabled:i,options:t.map(e=>{let t=e.source_release_version?p(`previewReleaseChannel.stableBackupLabel`,{version:e.source_release_version}):e.snapshot_name;return{value:e.snapshot_name,label:p(`previewReleaseChannel.backupOptionLabel`,{name:t,date:Co(e.created_at,m)})}})})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(u,{tone:`error`,title:p(`previewReleaseChannel.requiresBackupTitle`),children:p(`previewReleaseChannel.requiresBackupBody`)}),n===`standard_upgrade`&&(0,Q.jsx)(u,{tone:`error`,title:p(`previewReleaseChannel.mayNotSurviveTitle`),children:p(`previewReleaseChannel.mayNotSurviveBody`)})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(H,{variant:`outlined`,disabled:i,onClick:f,children:p(`previewReleaseChannel.cancel`)}),(0,Q.jsx)(H,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),onClick:d,children:p(i?`previewReleaseChannel.switching`:`previewReleaseChannel.switchToStable`)})]})]})})}function Mo(){let{t:e}=J(`settings`),t=Yt.use.user(),n=(0,Z.useCallback)(e=>{Se(e),window.location.reload()},[]);if(!Me(t))return null;let r=j(),i=we(),a=i.version??e(`previewUiChannel.versionUnknown`);return(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`previewUiChannel.title`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`previewUiChannel.description`)}),(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(i.channel===`preview`?`previewUiChannel.runningPreview`:`previewUiChannel.runningStable`,{version:a})}),r&&i.channel===`stable`&&(0,Q.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`previewUiChannel.unavailableHint`)})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:(0,Q.jsx)(ae,{checked:r,onChange:n,"aria-label":e(r?`previewUiChannel.onAriaLabel`:`previewUiChannel.offAriaLabel`)})})]})}var No=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function Po(e,t){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&No.has(e.error)?`That size isn't available on your plan.`:Ce(e,void 0,t)}function Fo({assistant:e,healthz:t,healthzLoading:n,healthzFetching:r,healthzPolling:i,refetch:a,refetchUntilResized:o}){let{t:s}=J(`settings`),c=gn(),l=K(Ae()),d=l.data,f=!e.is_local,p=d?.plan_id===`pro`,h=K({...A(),enabled:p}),g=e.machine_size||`small`,_=Hn(h.data?.max_machine_tier??null),v=(0,Z.useMemo)(()=>Gn(_,g,(0,Q.jsx)(P,{tone:`positive`,children:s(`resizeCard.current`)})),[_,g,s]),y=h.data?.selected_storage_gib??null,[b,x]=(0,Z.useState)(!1),S=_.length>0?_[_.length-1]:null,[C,w]=(0,Z.useState)(null),T=C??S??g,[E,D]=(0,Z.useState)(!1),[O,k]=(0,Z.useState)(null),j=Lt({onSuccess:(e,n)=>{m.success(s(`resizeCard.toastStarted`),{id:`assistant-resize`}),k(null),w(null),x(!1),n.body?.machine_size==null?a():o(t)},onError:e=>{k(Po(e,s(`resizeCard.resizeFailed`)))}});if(l.isError&&d==null)return(0,Q.jsx)(X,{id:`storage-resources`,title:s(`resizeCard.title`),subtitle:s(`resizeCard.subtitle`),children:(0,Q.jsx)(u,{tone:`error`,children:s(`resizeCard.subscriptionLoadError`)})});let M=p&&_.includes(T)&&T!==g?T:null,N=p&&y!=null&&!0,ee=p&&_.length>0&&Wn(g)<Wn(_[_.length-1]),F=j.isPending||i,te=y==null?t?.disk?.totalMb??null:y*1024,I=t?.disk&&te!=null?{value:t.disk.usedMb,max:te,caption:s(`resizeCard.usedOf`,{used:Zn(t.disk.usedMb),total:Zn(te)})}:null,L=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,ne=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:s(`resizeCard.usedOf`,{used:Zn(t.memory.currentMb),total:Zn(t.memory.maxMb)})}:null,re=(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,onClick:()=>D(!0),children:s(`resizeCard.resize`)}),ie=f?p?N?(0,Q.jsxs)(`button`,{type:`button`,disabled:F,onClick:()=>x(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(On,{className:`h-3.5 w-3.5`}),s(`resizeCard.increaseStorage`)]}):(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,disabled:F,onClick:()=>x(!0),children:s(`resizeCard.resize`)}):re:null,ae=f?p?ee?(0,Q.jsxs)(`button`,{type:`button`,disabled:F,onClick:()=>x(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(On,{className:`h-3.5 w-3.5`}),s(`resizeCard.increaseSize`)]}):(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,disabled:F,onClick:()=>x(!0),children:s(`resizeCard.resize`)}):re:null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{id:`storage-resources`,title:s(`resizeCard.title`),subtitle:s(`resizeCard.subtitle`),compactAccessory:!0,accessory:(0,Q.jsx)(H,{variant:`ghost`,size:`compact`,iconOnly:r||i?(0,Q.jsx)(Y,{className:`animate-spin`}):(0,Q.jsx)(In,{}),tooltip:s(i?`resizeCard.applyingResize`:`resizeCard.refreshMetrics`),"aria-label":s(`resizeCard.refreshMetrics`),disabled:r||i,onClick:()=>void a()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(zn,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.disk`)})]}),ie]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.storage`)}),I?(0,Q.jsx)(qn,{value:I.value,max:I.max,caption:I.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.unavailable`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(nr,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.machine`)}),(0,Q.jsx)(P,{tone:`neutral`,children:Un[g]})]}),ae]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.cpu`)}),L?(0,Q.jsx)(qn,{value:L.value,max:L.max,caption:L.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:s(`resizeCard.memory`)}),ne?(0,Q.jsx)(qn,{value:ne.value,max:ne.max,caption:ne.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(Y,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(V.Root,{open:E,onOpenChange:e=>{e||D(!1)},children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:s(`resizeCard.upgradeTitle`)}),(0,Q.jsx)(V.Description,{children:s(`resizeCard.upgradeDescription`)})]}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(H,{variant:`ghost`,onClick:()=>D(!1),children:s(`resizeCard.cancel`)}),(0,Q.jsx)(H,{onClick:()=>{D(!1),c(B.plans)},children:s(`resizeCard.upgrade`)})]})]})}),(0,Q.jsx)(V.Root,{open:b,onOpenChange:e=>{e||(x(!1),w(null),k(null))},children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{icon:nr,children:[(0,Q.jsx)(V.Title,{children:s(`resizeCard.modalTitle`)}),(0,Q.jsx)(V.Description,{children:s(`resizeCard.modalDescription`)})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[_.length===0?(0,Q.jsx)(u,{tone:`warning`,children:s(`resizeCard.noMachineTier`)}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:s(`resizeCard.machineSize`)}),(0,Q.jsx)(kt,{options:v,value:T,onChange:w,"aria-label":s(`resizeCard.machineSizeAriaLabel`),"data-testid":`resize-machine-size`})]}),N?(0,Q.jsx)(u,{tone:`info`,children:s(`resizeCard.storageExpandTo`,{to:y})}):(0,Q.jsx)(u,{tone:`neutral`,children:s(`resizeCard.storageUnchanged`)}),O&&(0,Q.jsx)(u,{tone:`error`,children:O})]})}),(0,Q.jsxs)(V.Footer,{className:`items-center justify-between`,children:[(0,Q.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`resizeCard.needMore`,components:{upgradeLink:(0,Q.jsx)(_n,{to:B.plans,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>x(!1)})}})}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(H,{variant:`ghost`,onClick:()=>{x(!1),w(null),k(null)},children:s(`resizeCard.cancel`)}),(0,Q.jsx)(H,{disabled:M==null&&!N||F,leftIcon:F?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:()=>{k(null);let t={};M!=null&&(t.machine_size=M),N&&y!=null&&(t.storage_gib=y),j.mutate({path:{id:e.id},body:t})},children:s(O?`resizeCard.retry`:`resizeCard.apply`)})]})]})]})})]})}function Io({assistantId:e}){let{t}=J(`settings`),n=gn(),r=q(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(H,{variant:`dangerOutline`,onClick:()=>a(!0),className:`shrink-0`,children:t(`retireAssistant.button`)}),(0,Q.jsx)(oe,{open:i,isPending:o,onConfirm:async()=>{s(!0);let t=await w(r,e);if(t.ok){a(!1),n(t.nextRoute,{replace:!0});return}m.error(t.error),s(!1),a(!1)},onCancel:()=>a(!1)})]})}var Lo=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function Ro(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...Lo].sort()}function zo(e,t,n){let r=parseInt(n??`0`,10);if(r>59)return null;let i=parseInt(t??`0`,10)*60+r;return(e===`-`?-1:1)*i}function Bo(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);n&&(i=zo(n[1],n[2],n[3])??0)}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function Vo(){return Ro().map(e=>Bo(e)).filter(e=>e!==null)}function Ho(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function Uo(e,t){if(!e)return t;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}function Wo(e){if(e===`utc`||e===`gmt`)return 0;let t=e.match(/^(?:utc|gmt)?\s*([+-])(\d{1,2})(?::?(\d{2}))?$/);if(!t)return null;let n=zo(t[1],t[2],t[3]);return n!==null&&Math.abs(n)<=840?n:null}var Go=200,Ko=[];function qo({value:e,onChange:t}){let{t:n}=J(`settings`),[r,i]=(0,Z.useState)(``),[a,o]=(0,Z.useState)(!1),s=(0,Z.useMemo)(()=>a?Vo():Ko,[a]),c=r.trim().toLowerCase(),l=(0,Z.useMemo)(()=>{let e=Wo(c);return(c?s.filter(t=>e===null?t.city.toLowerCase().includes(c)||t.region.toLowerCase().includes(c)||t.offsetLabel.toLowerCase().includes(c)||t.identifier.toLowerCase().includes(c):t.offsetMinutes===e):s).slice(0,Go)},[s,c]),u=(0,Z.useMemo)(()=>l.map(e=>e.identifier),[l]),d=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.timezone`)}),(0,Q.jsxs)(ft.Root,{className:`w-full md:max-w-[280px]`,options:u,value:e,onSelect:t,onOpenChange:e=>{if(e){o(!0);return}i(``)},autoActivateFirst:c.length>0,children:[(0,Q.jsx)(ft.Input,{type:`text`,"aria-label":n(`timezonePicker.timezone`),value:r,placeholder:d||n(`timezonePicker.searchPlaceholder`),onChange:e=>i(e.target.value),fullWidth:!0}),(0,Q.jsx)(ft.List,{"aria-label":n(`timezonePicker.timezonesAriaLabel`),className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,emptyState:(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.noMatches`)}),children:l.map(e=>(0,Q.jsxs)(ft.Option,{value:e.identifier,className:I(`flex w-full items-center justify-between gap-3 px-3 py-2`,`text-body-medium-lighter text-[var(--content-default)] transition-colors`,`hover:bg-[var(--surface-active)]`,`data-[active]:bg-[var(--surface-active)] aria-selected:bg-[var(--surface-active)]`),children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:e.city}),e.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:Ho(e.identifier)}),(0,Q.jsx)(`span`,{children:e.offsetLabel})]})]},e.identifier))})]})]}),(0,Q.jsx)(er,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:n(`timezonePicker.zoneName`)}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:Uo(e,n(`timezonePicker.notSet`))})]})]})}function Jo(){let{t:e}=J(`settings`),t=Vt.use.activeAssistantId(),[n,r]=(0,Z.useState)(()=>o(`timezone`,``)),i=(0,Z.useRef)(t);(0,Z.useEffect)(()=>{i.current=t},[t]);let a=(0,Z.useRef)(!1),s=(0,Z.useRef)(null),c=(0,Z.useRef)(()=>{}),l=e=>{if(a.current){s.current=e;return}let t=i.current;if(!t){s.current=null;return}a.current=!0,s.current=null,f.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{z(e,{context:`settings-timezone-override`})}).finally(()=>{a.current=!1;let e=s.current;s.current=null,e!==null&&c.current(e)})};return(0,Z.useEffect)(()=>{c.current=l}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`timezoneSection.title`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`timezoneSection.description`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(0,Q.jsx)(qo,{value:n,onChange:e=>{r(e),ne(`timezone`,e),l(e)}})})]})}var Yo=[0,1,2,3,4,5,6];function Xo(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),t,n));return`${i.getHours().toString().padStart(2,`0`)}:${i.getMinutes().toString().padStart(2,`0`)}`}function Zo(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate(),t,n);return`${i.getUTCHours().toString().padStart(2,`0`)}:${i.getUTCMinutes().toString().padStart(2,`0`)}`}function Qo(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function $o(e){let t=e?.schedule?.window.start??`06:00`,n=e?.schedule?.window.end??`08:00`;return{enabled:e?.enabled??!0,timezone:`UTC`,frequency:e?.schedule?.frequency??`weekly`,daysOfWeek:e?.schedule?.days_of_week??[0],daysOfMonth:e?.schedule?.days_of_month??[],windowStart:Xo(t),windowEnd:Xo(n)}}function es({assistantId:e}){let{t}=J(`settings`),n=q(),r=[t(`updateWindowPolicy.dayMon`),t(`updateWindowPolicy.dayTue`),t(`updateWindowPolicy.dayWed`),t(`updateWindowPolicy.dayThu`),t(`updateWindowPolicy.dayFri`),t(`updateWindowPolicy.daySat`),t(`updateWindowPolicy.daySun`)],{data:i,isLoading:a,isError:o}=K(Ve({path:{id:e}})),s=(0,Z.useMemo)(()=>$o(i),[i]),[c,l]=(0,Z.useState)(null),u=c??s,d=c!==null,f=(0,Z.useMemo)(()=>Qo(),[]),[p,h]=(0,Z.useState)(null),g=p??u.daysOfMonth.join(`, `),_=cn({mutationFn:async t=>{let{data:n}=await at({path:{id:e},body:t,throwOnError:!0});return n}}),y=e=>{l(t=>({...t??s,...e}))},b=e=>{y({daysOfWeek:u.daysOfWeek.includes(e)?u.daysOfWeek.filter(t=>t!==e):[...u.daysOfWeek,e].sort((e,t)=>e-t)})},x=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),t(`updateWindowPolicy.loading`)]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:t(`updateWindowPolicy.loadError`)}):(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(ae,{checked:u.enabled,onChange:e=>y({enabled:e}),label:t(`updateWindowPolicy.automaticUpdates`),helperText:t(`updateWindowPolicy.automaticUpdatesHelper`)}),u.enabled&&(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:t(`updateWindowPolicy.frequency`)}),(0,Q.jsx)(`div`,{className:`max-w-[400px]`,children:(0,Q.jsx)(v,{ariaLabel:t(`updateWindowPolicy.frequency`),value:u.frequency,onChange:e=>{e!==`monthly`&&h(null),y({frequency:e})},items:[{value:`daily`,label:t(`updateWindowPolicy.daily`)},{value:`weekly`,label:t(`updateWindowPolicy.weekly`)},{value:`monthly`,label:t(`updateWindowPolicy.monthly`)}]})})]}),u.frequency===`weekly`&&(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:t(`updateWindowPolicy.daysOfWeek`)}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Yo.map(e=>(0,Q.jsx)(H,{variant:`outlined`,size:`compact`,active:u.daysOfWeek.includes(e),onClick:()=>b(e),children:r[e]},e))})]}),u.frequency===`monthly`&&(0,Q.jsx)(R,{label:t(`updateWindowPolicy.daysOfMonth`),type:`text`,value:g,onChange:e=>h(e.target.value),onBlur:e=>{let t=x(e.target.value);y({daysOfMonth:t}),h(t.join(`, `))},placeholder:t(`updateWindowPolicy.daysOfMonthPlaceholder`),helperText:t(`updateWindowPolicy.daysOfMonthHelper`),className:`w-48`}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:f?t(`updateWindowPolicy.updateWindowWithTz`,{tz:f}):t(`updateWindowPolicy.updateWindow`)}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(R,{type:`time`,value:u.windowStart,onChange:e=>y({windowStart:e.target.value})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:t(`updateWindowPolicy.to`)}),(0,Q.jsx)(R,{type:`time`,value:u.windowEnd,onChange:e=>y({windowEnd:e.target.value})})]})]})]}),(0,Q.jsx)(H,{variant:`primary`,leftIcon:_.isPending?(0,Q.jsx)(Y,{className:`animate-spin`}):void 0,onClick:async()=>{let r=u.frequency===`monthly`&&p!==null?x(p):u.daysOfMonth;try{await _.mutateAsync({enabled:u.enabled,timezone:`UTC`,schedule:{frequency:u.frequency,days_of_week:u.frequency===`weekly`?u.daysOfWeek:[],days_of_month:u.frequency===`monthly`?r:[],window:{start:Zo(u.windowStart),end:Zo(u.windowEnd)}}}),m.success(t(`updateWindowPolicy.toastSaved`)),l(null),h(null),n.invalidateQueries({queryKey:qt({path:{id:e}})})}catch{m.error(t(`updateWindowPolicy.toastSaveFailed`))}},disabled:_.isPending||!d,children:t(`updateWindowPolicy.savePolicy`)})]})}function ts({assistantId:e,open:t,onClose:n}){let{t:r}=J(`settings`);return(0,Q.jsx)(V.Root,{open:t,onOpenChange:e=>{e||n()},children:(0,Q.jsxs)(V.Content,{size:`md`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:r(`updateWindowModal.title`)}),(0,Q.jsx)(V.Description,{children:r(`updateWindowModal.description`)})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsx)(es,{assistantId:e})})]})})}function ns(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}function rs({open:e,onOpenChange:t}){let{t:n}=J(`settings`),r=q(),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(!1),d=(0,Z.useRef)(e),f=()=>r.invalidateQueries({queryKey:Ct()}),p=e=>{he({path:{id:e}}).catch(()=>void 0).finally(()=>void f())},h=Kt({onSuccess:e=>{if(!d.current){p(e.factor_id);return}a(e)},onError:e=>{let r=ns(e);r===`no_workos_account`?m.error(n(`enrollTotpModal.toastNoWorkosAccount`)):r===`throttled`||r===`workos_rate_limited`?m.error(n(`enrollTotpModal.toastThrottled`)):r===`factor_limit_reached`?m.error(n(`enrollTotpModal.toastFactorLimitReached`)):m.error(n(`enrollTotpModal.toastStartFailed`)),t(!1)}}),g=nt({onSuccess:e=>{e.valid?(u.current=!0,m.success(n(`enrollTotpModal.toastEnabled`)),f(),t(!1)):l(n(`enrollTotpModal.errorCodeMismatch`))},onError:e=>{let r=ns(e);if(r===`challenge_already_verified`){u.current=!0,m.success(n(`enrollTotpModal.toastEnabled`)),f(),t(!1);return}if(r===`challenge_expired`||r===`challenge_not_found`){i&&p(i.factor_id),a(null),s(``),l(n(`enrollTotpModal.errorSessionExpired`)),h.mutate({});return}if(r===`throttled`||r===`workos_rate_limited`){l(n(`enrollTotpModal.errorThrottledInline`));return}l(n(`enrollTotpModal.errorVerifyFailed`))}});(0,Z.useEffect)(()=>{d.current=e,e&&(u.current=!1,a(null),s(``),l(null),h.mutate({}))},[e]);let _=e=>{!e&&g.isPending||(!e&&i&&!u.current&&p(i.factor_id),t(e))},v=()=>{i&&O(i.secret,{successMessage:n(`enrollTotpModal.copySuccess`),errorMessage:n(`enrollTotpModal.copyError`)})},y=()=>{!i||o.length!==6||g.isPending||(l(null),g.mutate({body:{challenge_id:i.challenge_id,code:o}}))};return(0,Q.jsx)(V.Root,{open:e,onOpenChange:_,children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:n(`enrollTotpModal.title`)}),(0,Q.jsx)(V.Description,{children:n(`enrollTotpModal.description`)})]}),(0,Q.jsx)(V.Body,{children:i===null?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(Y,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,Q.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),y()},children:[(0,Q.jsx)(`img`,{src:i.qr_code,alt:n(`enrollTotpModal.qrCodeAlt`),className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`enrollTotpModal.manualKeyHint`)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:v,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,Q.jsx)(`span`,{className:`break-all text-left`,children:i.secret}),(0,Q.jsx)(Mn,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:n(`enrollTotpModal.codeLabel`)}),(0,Q.jsx)(R,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:n(`enrollTotpModal.codePlaceholder`),value:o,onChange:e=>s(e.target.value.replace(/\D/g,``).slice(0,6))}),c&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c})]})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(H,{variant:`outlined`,onClick:()=>_(!1),disabled:g.isPending,children:n(`enrollTotpModal.cancel`)}),(0,Q.jsx)(H,{onClick:y,disabled:i===null||o.length!==6||g.isPending,children:g.isPending?n(`enrollTotpModal.verifying`):n(`enrollTotpModal.verify`)})]})]})})}function is(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function as(){let{t:e}=J(`settings`),t=q(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(null),o=K({...Ot()}),s=o.data??[],c=()=>t.invalidateQueries({queryKey:Ct()}),l=Ze({onSuccess:()=>{m.success(e(`twoFactorSection.toastRemoved`)),c()},onError:t=>{if(ns(t)===`factor_not_found`){c();return}m.error(e(`twoFactorSection.toastRemoveFailed`))}});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[o.isPending?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:e(`twoFactorSection.loading`)})]}):o.isError?(0,Q.jsx)(u,{tone:`error`,children:(0,Q.jsx)(ln,{ns:`settings`,i18nKey:`twoFactorSection.loadError`,components:{retryButton:(0,Q.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void o.refetch()})}})}):s.length===0?(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`twoFactorSection.emptyDescription`)}):(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:s.map(t=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(Ln,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`twoFactorSection.authenticatorApp`)}),(0,Q.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[t.user,t.created_at?e(`twoFactorSection.addedOn`,{date:is(t.created_at)}):``]})]})]}),(0,Q.jsx)(H,{variant:`dangerOutline`,onClick:()=>a(t),disabled:l.isPending,children:e(`twoFactorSection.remove`)})]},t.id))}),!o.isPending&&!o.isError&&s.length===0&&(0,Q.jsx)(H,{onClick:()=>r(!0),className:`self-start`,children:e(`twoFactorSection.addAuthenticatorApp`)}),(0,Q.jsx)(rs,{open:n,onOpenChange:r}),(0,Q.jsx)(_e,{open:i!==null,title:e(`twoFactorSection.removeDialogTitle`),message:e(`twoFactorSection.removeDialogMessage`),confirmLabel:e(`twoFactorSection.removeDialogConfirm`),destructive:!0,onConfirm:()=>{i&&l.mutate({path:{id:i.id}}),a(null)},onCancel:()=>a(null)})]})}var $=class extends Error{code;constructor(e,t){super(t),this.name=`TeleportError`,this.code=e}},os=`local`,ss=`docker`,cs=`vellum`;function ls(e){switch((e??``).toLowerCase()){case os:return`local`;case ss:return`docker`;case cs:return`managed`;default:return`other`}}function us(e){let t=ls(e);return t===`managed`?`local`:t===`local`?`platform`:null}function ds(e){switch(e){case`docker`:return`teleportCard.moveToDocker`;case`platform`:return`teleportCard.moveToPlatform`;case`local`:return`teleportCard.moveToLocal`}}var fs={macos:`Macos`,windows:`Windows`,linux:`Linux`};function ps(e,t=`macos`){switch(e){case`docker`:return`teleportCard.dockerDescription${fs[t]}`;case`platform`:return`teleportCard.platformDescription`;case`local`:return`teleportCard.localDescription${fs[t]}`}}function ms(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.reason!==`version_mismatch`)return null;let n=t.bundle_compat,r=t.target_runtime_version;if(!n||typeof n!=`object`||typeof r!=`string`)return null;let i=n,a=i.min_runtime_version;if(typeof a!=`string`)return null;let o=typeof i.max_runtime_version==`string`?i.max_runtime_version:null;return`Cannot import: bundle requires runtime ${o?`${a}–${o}`:`${a}+`}, but this local runtime is ${r}. Update your local runtime before importing.`}var hs=3600*1e3;function gs(e,t=Date.now(),n=hs){for(let r of e){if(!r)continue;let e=Date.parse(r);if(Number.isNaN(e))continue;let i=t-e;if(i>=0&&i<=n)return!0}return!1}function _s(e){return e.filter(e=>e.ready_to_use!==!1).map(e=>e.created_at)}function vs(e,t){return e.some(e=>e.snapshot_name===t&&e.ready_to_use===!0)}async function ys(e,t){let n=Number(e.headers.get(`Content-Length`)??0);if(!e.body||!t||n<=0){let n=await e.arrayBuffer();return t?.(1),n}let r=e.body.getReader(),i=[],a=0;for(;;){let{done:e,value:o}=await r.read();if(e)break;i.push(o),a+=o.length,t(a/n)}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return t(1),o.buffer}function bs(e){let t=it(e);if(!t)throw new $(`local_assistant_not_found`,`Assistant ${e.assistantId} has no resolved local gateway.`);return`${window.location.origin}${t}`}async function xs(e,t){let n=await Qe(e.assistantId),r=await fetch(`${t}/auth/token`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`not_signed_in`,`Gateway token request failed (HTTP ${r.status}).`);let{token:i}=await r.json();return i}async function Ss(e,t){let n=bs(e),r=await xs(e,n),i=await fetch(`${n}/v1/migrations/export`,{method:`POST`,headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new $(`export_failed`,`Export failed (HTTP ${i.status}).`);return ys(i,t)}async function Cs(e,t){let n=bs(e),r=await xs(e,n),i=await fetch(`${n}/v1/migrations/import`,{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:new Blob([t],{type:`application/octet-stream`})});if(!i.ok)throw new $(`import_failed`,`Import failed (HTTP ${i.status}).`);let a=await Ds(i);if(a&&a.success===!1)throw new $(`import_failed`,a.error??`Import reported failure`)}async function ws(e){let t=bs(e),n=await xs(e,t),r=await fetch(`${t}/v1/backups/create`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`backup_failed`,G(`settings:teleportCard.backupLocalFailed`,{status:r.status}));let i=await Ds(r);if(i&&i.success===!1)throw new $(`backup_failed`,G(`settings:teleportCard.backupLocalReportedFailure`))}async function Ts(e,t){let{data:n,response:r}=await f.post({url:`/v1/assistants/{assistant_id}/migrations/export-to-gcs/`,path:{assistant_id:e},body:{upload_url:t},throwOnError:!1}),i=r?.status??0;if(!(r?.ok??!1)&&i!==202)throw new $(`export_failed`,`Export failed (HTTP ${i}).`);let a=n?.job_id;if(!a)throw new $(`export_failed`,`Export accepted but no job ID was returned.`);return a}async function Es(e,t){let{data:n,response:r}=await f.get({url:`/v1/assistants/{assistant_id}/migrations/jobs/{job_id}`,path:{assistant_id:e,job_id:t},throwOnError:!1}),i=r?.status??0;if(i>=500)return`processing`;if(!(r?.ok??!1))throw new $(`export_job_failed`,`Job status check failed (HTTP ${i})`);let a=n;if(a?.status===`failed`)throw new $(`export_job_failed`,a.error??`Export job failed`);return a?.status??`processing`}async function Ds(e){try{return await e.json()}catch{return null}}async function Os(e,t={}){let n=ls(e.cloud);if(n===`managed`)return js(e.assistantId,t);if(n===`local`)return ws(e);throw new $(`backup_failed`,G(`settings:teleportCard.backupUnsupported`))}async function ks(e){let t=await ze({path:{assistant_id:e},throwOnError:!1});if(!(t.response?.ok??!1))throw new $(`backup_failed`,G(`settings:teleportCard.backupListFailed`,{status:t.response?.status??0}));let n=t.data?.backups;return Array.isArray(n)?n:[]}var As=e=>new Promise(t=>setTimeout(t,e));async function js(e,t){if(gs(_s(await ks(e))))return;let n=await Pe({path:{assistant_id:e},throwOnError:!1});if(!(n.response?.ok??!1))throw new $(`backup_failed`,G(`settings:teleportCard.backupCreateFailed`,{status:n.response?.status??0}));let r=n.data,i=r?.snapshot_name;if(!i)throw new $(`backup_failed`,G(`settings:teleportCard.backupNoSnapshotName`));if(r?.ready_to_use===!0)return;let a=t.readyTimeoutMs??6e5,o=t.readyPollIntervalMs??5e3,s=Date.now()+a;for(;Date.now()<s;)if(await As(o),vs(await ks(e),i))return;throw new $(`backup_failed`,G(`settings:teleportCard.backupNotReady`,{snapshot:i,seconds:Math.round(a/1e3)}))}var Ms=new Set([500,502,503,504]),Ns=3,Ps=e=>new Promise(t=>setTimeout(t,e));async function Fs(e,t=new Set){for(let n=0;n<=Ns;n++){let{response:r,data:i,error:a}=await e(),o=r?.status??0;if(n<Ns&&Ms.has(o)&&!t.has(o)){await Ps(2**n*1e3);continue}return{status:o,data:i,error:a}}throw new $(`unknown`,`Unexpected retry loop exit`)}async function Is(e,t){let n={operation:`upload`};e&&(n.min_runtime_version=e,n.max_runtime_version=null),t&&(n.consumer=t);let{status:r,data:i}=await Fs(()=>f.post({url:`/v1/migrations/signed-url/`,body:n,throwOnError:!1}),new Set([404,503]));if(r===503||r===404)throw new $(`export_failed`,`Signed URL uploads are not available — the platform may not support this feature yet.`);if(r!==201)throw new $(`export_failed`,`Migration request failed (HTTP ${r}).`);let a=i;return{url:a.url,bundleKey:a.bundle_key,expiresAt:a.expires_at}}async function Ls(e,t){let{status:n,data:r,error:i}=await Fs(()=>f.post({url:`/v1/migrations/signed-url/`,body:{operation:`download`,bundle_key:e,target_runtime_version:t},throwOnError:!1}),new Set([422]));if(n===422){let e=ms(i);if(e)throw new $(`version_mismatch`,e)}if(n!==200&&n!==201)throw new $(`import_failed`,`Migration request failed (HTTP ${n}).`);return r.url}async function Rs(e,t,n){for(let r=0;r<=Ns;r++){let i=await zs(e,t,n);if(r<Ns&&Ms.has(i)){await Ps(2**r*1e3),n?.(0);continue}if(i<200||i>=300)throw new $(`export_failed`,`Bundle upload failed (HTTP ${i}).`);return}}function zs(e,t,n){return new Promise((r,i)=>{let a=new XMLHttpRequest;a.open(`PUT`,e),a.setRequestHeader(`Content-Type`,`application/octet-stream`),a.timeout=36e5,n&&(a.upload.onprogress=e=>{e.lengthComputable&&n(e.loaded/e.total)}),a.onload=()=>{n?.(1),r(a.status)},a.onerror=()=>i(new $(`export_failed`,`Bundle upload failed.`)),a.ontimeout=()=>i(new $(`export_timed_out`,`Bundle upload timed out.`)),a.send(t)})}async function Bs(e,t){for(let n=0;n<=Ns;n++){let r=await fetch(e,{method:`GET`});if(n<Ns&&Ms.has(r.status)){await Ps(2**n*1e3),t?.(0);continue}if(!r.ok)throw new $(`import_failed`,`Bundle download failed (HTTP ${r.status}).`);return ys(r,t)}throw new $(`import_failed`,`Unexpected retry loop exit`)}async function Vs(e){let{status:t,data:n,error:r}=await Fs(()=>f.post({url:`/v1/migrations/import-from-gcs/`,body:{bundle_key:e},throwOnError:!1}));return{status:t,body:n??r??null}}async function Hs(e){let{status:t,data:n}=await Fs(()=>f.get({url:`/v1/migrations/jobs/{job_id}/`,path:{job_id:e},throwOnError:!1}));if(t!==200)throw new $(`import_failed`,`Job status check failed (HTTP ${t})`);let r=n??{};return{status:typeof r.status==`string`?r.status:`unknown`,jobId:typeof r.job_id==`string`?r.job_id:null,error:typeof r.error==`string`?r.error:null}}var Us=5e3,Ws=36e5,Gs=5*6e4,Ks=30,qs=e=>new Promise(t=>setTimeout(t,e));function Js(){let e=gn(),t=q(),n=Xt(),r=us(n?.cloud),[i,a]=(0,Z.useState)({kind:`idle`}),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useCallback)(e=>{a({kind:`transferring`,step:e,progress:null})},[]),d=(0,Z.useCallback)(e=>{a(t=>t.kind===`transferring`?{...t,progress:e}:t)},[]),f=(0,Z.useCallback)(async()=>{if(!(!n||!r)){l.current={id:n.assistantId,kind:ls(n.cloud)===`managed`?`managed`:`local`,createdFresh:!1};try{if(u(G(`settings:teleportCard.backupStep`)),await Os(n),r===`platform`)await Ys(n,u,d,c);else if(r===`local`)await Xs(n,u,d,c);else throw new $(`unknown`,G(`settings:teleportCard.unsupportedDestination`));a({kind:`verifying`})}catch(e){a({kind:`failed`,error:G(`settings:teleportCard.teleportFailed`,{message:e instanceof $||e instanceof Error?e.message:G(`settings:teleportCard.teleportFailedUnknown`)})}),z(e,{context:`teleport-execute`}),await Qs(t,c.current,l.current,`teleport-execute-cleanup`),c.current=null}}},[n,r,u,d,t]),p=(0,Z.useCallback)(()=>s(!0),[]),m=(0,Z.useCallback)(()=>s(!1),[]),h=(0,Z.useCallback)(()=>{s(!1),f()},[f]),g=(0,Z.useCallback)(()=>{c.current=null,l.current=null,a({kind:`idle`})},[]);return{destination:r,phase:i,confirmOpen:o,requestTeleport:p,cancelConfirm:m,confirm:h,confirmAndSwitch:(0,Z.useCallback)(()=>{let n=c.current,r=l.current;n&&(async()=>{try{let e=Yt.getState();n.kind===`managed`?await e.connectPlatformAssistant(n.id):(await e.connectLocalAssistant(n.id),me(n.id,{onError:e=>z(e,{context:`teleport-inject-platform-identity`})}))}catch(e){a({kind:`failed`,error:G(`settings:teleportCard.switchFailed`,{message:e instanceof Error?e.message:G(`settings:teleportCard.switchFailedUnknown`)})}),z(e,{context:`teleport-confirm-switch`});return}r&&w(t,r.id).then(e=>{e.ok||z(Error(e.error),{context:`teleport-retire-source`})}),g(),e(B.assistant,{replace:!0})})()},[e,g,t]),cancelTeleport:(0,Z.useCallback)(()=>{let e=c.current,n=l.current;c.current=null,l.current=null,a({kind:`idle`}),Qs(t,e,n,`teleport-cancel-retire-target`)},[t]),reset:g}}async function Ys(e,t,n,r){t(G(`settings:teleportCard.stepExportingLocal`));let i=await Ss(e,n);t(G(`settings:teleportCard.stepResolvingOrganization`));let a=await ec();t(G(`settings:teleportCard.stepCheckingExisting`));let o=(await ct({query:{hosting:`platform`},throwOnError:!1})).data?.results?.[0];if(o)throw new $(`existing_platform_assistant`,G(`settings:teleportCard.existingPlatformAssistant`,{id:o.id}));t(G(`settings:teleportCard.stepUploading`));let s=await Is(e.resources?.runtimeVersion);await Rs(s.url,i,n),t(G(`settings:teleportCard.stepSettingUpCloud`));let c=await ke(void 0,`create`);if(!c.ok)throw new $(`import_failed`,G(`settings:teleportCard.cloudSetupFailed`));if(c.status===200)throw new $(`existing_platform_assistant`,G(`settings:teleportCard.existingPlatformAssistant`,{id:c.data.id}));let l=c.data.id;await Mt({assistantId:l,name:c.data.name,cloud:`vellum`,runtimeUrl:Je(),hatchedAt:c.data.created??new Date().toISOString(),organizationId:a}),await Re(e.assistantId),r.current={id:l,kind:`managed`,createdFresh:!0},t(G(`settings:teleportCard.stepFinalizingCloud`)),await tc(l),t(G(`settings:teleportCard.stepImportingToCloud`));let u=await Vs(s.bundleKey);if(u.status<200||u.status>=300){let e=u.body;throw new $(`import_failed`,e?.error??G(`settings:teleportCard.importFailedHttp`,{status:u.status}))}if(u.status===202){let e=u.body?.job_id;if(!e)throw new $(`import_failed`,G(`settings:teleportCard.importNoJobId`));await nc(e)}else{let e=u.body;if(e&&e.success===!1)throw new $(`import_failed`,e.error??G(`settings:teleportCard.importReportedFailure`))}}async function Xs(e,t,n,r){t(G(`settings:teleportCard.stepPreparingExport`));let i=await Is(await $s(e.assistantId),`runtime`);t(G(`settings:teleportCard.stepExportingCloud`));let a=await Ts(e.assistantId,i.url);await rc(e.assistantId,a),t(G(`settings:teleportCard.stepPreparingLocal`));let{assistant:o,createdFresh:s}=await ic();r.current={id:o.assistantId,kind:`local`,createdFresh:s};let c=await Zs(o,s);if(!c)throw new $(`local_assistant_not_found`,G(`settings:teleportCard.localRuntimeVersionUnknown`));t(G(`settings:teleportCard.stepPreparingImport`));let l=await Ls(i.bundleKey,c);t(G(`settings:teleportCard.stepDownloading`));let u=await Bs(l,n);t(G(`settings:teleportCard.stepImporting`)),await oc(o,u),await Re(e.assistantId)}async function Zs(e,t){if(e.resources?.runtimeVersion)return e.resources.runtimeVersion;if(t)return(await Vn())?.version??void 0}async function Qs(e,t,n,r){if(t?.createdFresh){let n=await w(e,t.id);n.ok||z(Error(n.error),{context:r})}n&&await Re(n.id)}async function $s(e){let t=await xe(e);return t.ok?t.data.version??void 0:void 0}async function ec(){let e=x.getState();e.organizations.length===0&&await e.fetchOrganizations();let t=x.getState().organizations,n=ve();if(n&&t.some(e=>e.id===n))return n;if(t.length===0)throw new $(`no_organizations`,G(`settings:teleportCard.noOrganizations`));if(t.length>1)throw new $(`multiple_organizations`,G(`settings:teleportCard.multipleOrganizations`));let r=t[0].id;return x.getState().setCurrentOrganizationId(r),r}async function tc(e){let t=Date.now();for(;Date.now()-t<Gs;){let{data:t,response:n}=await Rt({path:{id:e},throwOnError:!1});if(n?.ok&&t?.state===`active`)return;await qs(Us)}}async function nc(e){let t=Date.now();for(;Date.now()-t<Ws;){await qs(Us);let t=await Hs(e);if(t.status===`complete`)return;if(t.status===`failed`)throw new $(`import_failed`,t.error??G(`settings:teleportCard.importJobFailed`))}throw new $(`import_failed`,G(`settings:teleportCard.importTimedOut`))}async function rc(e,t){let n=Date.now();for(;Date.now()-n<Ws;)if(await qs(Us),await Es(e,t)===`complete`)return;throw new $(`export_timed_out`,G(`settings:teleportCard.exportTimedOut`))}async function ic(){let e=await Ht(void 0,void 0);if(!e.ok)throw new $(`local_assistant_not_found`,e.error??G(`settings:teleportCard.localCreateFailed`));await D();let t=e.assistantId?st().find(t=>t.assistantId===e.assistantId):ac();if(!t)throw new $(`local_assistant_not_found`,G(`settings:teleportCard.localNotFound`));return{assistant:t,createdFresh:!0}}function ac(){return st().slice().sort((e,t)=>(t.hatchedAt??``).localeCompare(e.hatchedAt??``))[0]}async function oc(e,t){let n;for(let r=0;r<Ks;r++)try{await Cs(e,t);return}catch(e){n=e,await qs(1e3)}throw n instanceof Error?n:new $(`import_failed`,G(`settings:teleportCard.importFailed`))}function sc(){let{t:e}=J(`settings`),t=Js(),{destination:n,phase:r}=t,i=W.use.teleport(),a=Zt();return!n||a===`gated`||r.kind===`idle`&&n===`platform`&&!i?null:(0,Q.jsxs)(X,{title:e(`teleportCard.title`),subtitle:e(`teleportCard.subtitle`),children:[r.kind===`idle`&&a===`disabled`&&(0,Q.jsx)(Gt,{children:e(`teleportCard.loginNotice`)}),r.kind===`idle`&&a===`full`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(ps(n,jt()))}),(0,Q.jsx)(H,{variant:`outlined`,className:`self-start`,onClick:t.requestTeleport,children:e(ds(n))})]}),r.kind===`transferring`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r.progress==null&&(0,Q.jsx)(Y,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:r.step})]}),r.progress!=null&&(0,Q.jsx)(on,{value:r.progress,"aria-label":e(`teleportCard.progressAriaLabel`),className:`max-w-[240px]`})]}),r.kind===`verifying`&&(0,Q.jsx)(u,{tone:`success`,icon:(0,Q.jsx)(kn,{className:`h-4 w-4`}),title:e(`teleportCard.verifyTitle`),actions:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(H,{variant:`primary`,onClick:t.confirmAndSwitch,children:e(`teleportCard.confirmAndSwitch`)}),(0,Q.jsx)(H,{variant:`outlined`,onClick:t.cancelTeleport,children:e(`teleportCard.cancel`)})]})}),r.kind===`failed`&&(0,Q.jsx)(u,{tone:`error`,title:r.error,actions:(0,Q.jsx)(H,{variant:`outlined`,onClick:t.reset,children:e(`teleportCard.tryAgain`)})}),(0,Q.jsx)(_e,{open:t.confirmOpen,title:e(ds(n)),message:e(`teleportCard.confirmMessage`),confirmLabel:e(`teleportCard.confirmLabel`),onConfirm:t.confirm,onCancel:t.cancelConfirm})]})}function cc(){let{t:e}=J(`settings`),{assistant:t,healthz:n,healthzLoading:r,healthzFetching:i,healthzPolling:a,refetch:o,refetchUntilResized:s}=Yn(),c=W.use.multiPlatformAssistant(),l=W.use.accountMfa(),u=Pt.use.settingsSleepPolicy(),d=_(),f=$e(),p=le()||d||ce()||f,m=gn(),g=Zt(),v=Zt({platformHostedOnly:!0}),x=tn(),S=C({assistantId:t?.id??null,enabled:v===`full`&&x}),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(!1),[O,k]=hn();(0,Z.useEffect)(()=>{if(O.get(`preferences`)!==`open`)return;let e=new URLSearchParams(O);e.delete(`preferences`),k(e,{replace:!0}),D(!0)},[O,k]);let A=t?.is_local&&!le()?null:t,j=Xt(),N=le()&&!!t&&!!j&&y(j),P=N,ee=N&&!ce(),F=v===`full`&&!!A||ee&&!!t;(0,Z.useEffect)(()=>{!t||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[t]);let te=n?.version??t?.current_release_version??null,I=()=>{let e=h();if(ce()&&!f&&e){let t=new URLSearchParams({register:M()}),n=Qt();n&&t.set(`name`,n);let r=new URL(e).origin;window.location.assign(`${r}${B.selectAssistant}?${t.toString()}`);return}m(`${B.selectAssistant}?noAutoSkip=1`)},L=(g===`full`||P)&&!!A||g===`disabled`&&!P,ne=v!==`gated`;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[S.status&&S.mode!==`inactive`&&(0,Q.jsx)(Bt,{status:S.status,mode:S.mode,isAcknowledging:S.isAcknowledging,acknowledgeError:S.acknowledgeError?.message??null,onAcknowledge:()=>void S.acknowledge(),onReviewWorkspaceData:()=>void m(`${B.workspace}?sort=size`),onUpgradeStorage:v===`full`?()=>void m(B.plans):null}),(0,Q.jsxs)(_r,{assistant:x?A:null,showHandles:d&&g===`full`,children:[(0,Q.jsx)(Jo,{}),l&&g!==`gated`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.twoFactorTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.twoFactorDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:g===`disabled`?(0,Q.jsx)(Gt,{children:e(`generalPage.twoFactorLoginNotice`)}):(0,Q.jsx)(as,{})})]})]})]}),(0,Q.jsx)(X,{title:e(`generalPage.versionTitle`),subtitle:e(`generalPage.versionSubtitle`),accessory:v===`full`&&A?(0,Q.jsx)(H,{variant:`outlined`,onClick:()=>T(!0),children:e(`generalPage.updateWindow`)}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[v===`full`&&A&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(bi,{assistantId:A.id,currentVersion:te,releaseChannel:A.release_channel,onUpgradeComplete:()=>{o()}}),(0,Q.jsx)(Eo,{assistantId:A.id,onComplete:()=>{o()}})]}),ee&&t&&(0,Q.jsx)(xi,{assistantId:t.id,currentVersion:te,onUpgradeComplete:()=>{o()}}),!F&&t&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.current`)}),(0,Q.jsx)(Xn,{version:te,loading:r&&!t.current_release_version,assistantId:t.id??null})]}),v===`disabled`&&!ee&&(0,Q.jsx)(Gt,{children:e(`generalPage.updatesLoginNotice`)}),(0,Q.jsx)(Mo,{})]})}),v===`full`&&A&&(0,Q.jsx)(ts,{assistantId:A.id,open:w,onClose:()=>T(!1)}),v===`full`&&t&&(0,Q.jsx)(Fo,{assistant:t,healthz:n,healthzLoading:r,healthzFetching:i,healthzPolling:a,refetch:o,refetchUntilResized:s}),v===`disabled`&&(0,Q.jsx)(X,{id:`storage-resources`,title:e(`generalPage.computeResourcesTitle`),subtitle:e(`generalPage.computeResourcesSubtitle`),children:(0,Q.jsx)(Gt,{children:e(`generalPage.computeResourcesLoginNotice`)})}),(0,Q.jsx)(X,{title:e(`generalPage.preferencesTitle`),subtitle:e(`generalPage.preferencesSubtitle`),accessory:(0,Q.jsx)(H,{variant:`outlined`,onClick:()=>D(!0),children:e(`generalPage.customize`)}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsx)(ir,{}),(0,Q.jsx)(ci,{})]})}),(0,Q.jsx)(xo,{open:E,onClose:()=>D(!1)}),(0,Q.jsx)(Ti,{}),(0,Q.jsx)(po,{}),v===`full`&&A&&u&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(gi,{assistantId:A.id})}),v===`disabled`&&u&&(0,Q.jsx)(X,{title:e(`generalPage.sleepPolicyTitle`),subtitle:e(`generalPage.sleepPolicySubtitle`),children:(0,Q.jsx)(Gt,{children:e(`generalPage.sleepPolicyLoginNotice`)})}),c&&!p&&(0,Q.jsx)(di,{}),p&&(0,Q.jsx)(X,{title:e(`generalPage.switchAssistantTitle`),subtitle:e(`generalPage.switchAssistantSubtitle`),accessory:(0,Q.jsx)(H,{variant:`outlined`,onClick:I,children:e(`generalPage.chooseAssistant`)})}),b()&&(0,Q.jsx)(sc,{}),(L||ne)&&(0,Q.jsx)(X,{variant:`danger`,title:e(`generalPage.dangerZoneTitle`),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[L&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:e(`generalPage.retireAssistantTitle`)}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e(`generalPage.retireAssistantDescription`)}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(g===`full`||P)&&A?(0,Q.jsx)(Io,{assistantId:A.id}):(0,Q.jsx)(Gt,{children:e(`generalPage.retireAssistantLoginNotice`)})})]}),L&&ne&&(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Si,{})]})})]})}export{cc as GeneralPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Ah as t,Au as n,Bh as r,Bu as i,Ch as a,Du as o,Eb as s,Fy as ee,Hh as c,Hr as l,Jy as te,Lh as ne,Mu as re,Oh as ie,Ou as u,Oy as d,Pb as f,Rh as ae,Ry as oe,Si as p,Tb as m,Th as se,Uh as ce,Ux as h,Vb as le,Vy as ue,Wh as de,_v as g,fb as _,gb as fe,mm as v,sy as y,tb as pe,th as b,wp as x,xv as me,zh as S,zx as C}from"./app-DFXcEvsi.js";import{dr as w,er as he,j as T}from"./vendor-DYOeoIwg.js";import{_ as E,f as ge,t as D,x as O}from"./react-B9IgSVeK.js";import{c as _e,n as ve,t as ye}from"./provider-key-fvCko3IH.js";import{a as be,i as k,n as xe,o as Se,r as Ce,s as we,t as Te}from"./avatar-random-DTCQMspt.js";import{t as Ee}from"./plugin-attribution-B2jD5Q1N.js";var A=e(O(),1),j=D(),De=800,M=null,N,P=null,F=null;function I(){M=null,N=void 0,P=null,F=null}var Oe={initializing:0,provisioning:.33,connecting:.66,resizing:.85,ready:1},L=1500,ke={initializing:`hatchingScreen.phase.initializing`,provisioning:`hatchingScreen.phase.provisioning`,connecting:`hatchingScreen.phase.connecting`,resizing:`hatchingScreen.phase.resizing`,ready:`hatchingScreen.phase.ready`};function Ae(e,t,n){if(e>=t)return t;let r=1-(1-Math.min(1,n/L))**3;return e+(t-e)*r}function je(){let e=n(o(),{kind:`hatch-gate`});return e.action===`redirect`?{kind:`redirect`,to:e.to}:e.action===`wait`?{kind:`wait`}:{kind:`proceed`}}function R(){let{t:e}=T(`onboarding`),n=b(),o=ge(),D=he(),[O]=E(),L=O.get(`hosting`),R=O.get(`fail`),z=O.get(Ee),B=s(),V=d()&&L!==null&&L!==`vellum-cloud`,H=L===`vellum-cloud`,Me=O.get(u)===`1`,Ne=x.use.sessionStatus(),Pe=V?t(Ne):Ne,[U]=(0,A.useState)(()=>F??=Te(p)),Fe=(0,A.useMemo)(()=>{let e=v(p,U.bodyShape,U.eyeStyle,U.color,320);return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:``},[U]),[W,G]=(0,A.useState)(`initializing`),[Ie,K]=(0,A.useState)(null),[Le,q]=(0,A.useState)(!1),[Re,ze]=(0,A.useState)(!1),[Be,Ve]=(0,A.useState)(0),[He,J]=(0,A.useState)(0),[Ue,We]=(0,A.useState)(0),Y=(0,A.useRef)(W),X=(0,A.useRef)(0),Z=(0,A.useRef)(0),Q=(0,A.useRef)(0),$=(0,A.useCallback)(e=>{X.current=Q.current,Z.current=Date.now(),Y.current=e,G(e),We(e=>e+1)},[]);return(0,A.useEffect)(()=>{if(R!==null){K(`Simulated hatch failure (developer menu → Replay Hatch Failure).`);return}let e=je();if(e.kind===`redirect`){o(e.to,{replace:!0});return}if(e.kind===`wait`)return;H&&d()&&(_(),fe(null)),q(!1),ze(!1);let t=!1,n=null,s=null,l=null,u=Date.now(),p,h=!1,g=!1,v=re(),b=e=>{try{i(``)}catch(e){f(e,{context:`onboarding_mark_completed`})}J(1),Q.current=1,X.current=1,G(`ready`),Y.current=`ready`,s=setTimeout(()=>{t||(I(),(async()=>{if(await ie.checkAssistant(),!t){if(me(O)){Se(e),o(`${m.assistant}?onboarding=1`,{replace:!0});return}if(V){let t=new URLSearchParams;L&&t.set(`hosting`,L),e&&t.set(`assistant`,e),z&&t.set(Ee,z);let n=t.toString();o(`${m.onboarding.research}${n?`?${n}`:``}`,{replace:!0});return}o(m.onboarding.research,{replace:!0})}})())},De)},C=e=>we(e,U,D),he=async()=>{if($(`provisioning`),!V){try{let e=await c(),n=S(e);if(!t&&e.ok&&n.kind===`active`){d()&&te(e.data.id,e.data.name,se()??void 0),await E(e.data.id);return}n.kind===`auto_hatch`&&(g=!0)}catch{}if(t)return}if(V){try{let e=L===`docker`?`docker`:void 0;M&&N!==e&&I(),M||=(N=e,pe(void 0,e));let n=await M;if(t)return;if(!n.ok){I(),K(n.error??`Failed to hatch local assistant.`);return}await ee(),n.assistantId&&a(n.assistantId),$(`connecting`);let r=!1;for(;!t&&!r;){if(await ue()){_(),await oe(),r=!0;break}if(Date.now()-u>=3e5){I(),K(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{l=setTimeout(e,k)}),l=null}if(t)return;if(n.assistantId)try{await ve(n.assistantId)}catch(e){if(e instanceof ye){if(!t){let t=_e(e.provider)?.displayName??e.provider;ze(!0);let n=`Update your ${t} API key to continue.`;K(e.reason?`${e.reason} ${n}`:n)}return}f(e,{context:`onboarding_apply_provider_key`})}n.assistantId&&await x.getState().connectLocalAssistant(n.assistantId),n.assistantId&&(y.getState().upsertFromApi({id:n.assistantId,name:n.assistantId,status:`active`,is_local:!0,created:new Date().toISOString()}),a(n.assistantId),C(n.assistantId)),b(n.assistantId)}catch{if(I(),t)return;K(`Failed to hatch local assistant. Check CLI logs for details.`)}return}try{P||=de(v?{version:v}:void 0);let e=await P;if(P=null,t)return;if(e.ok&&(p=e.data.id),h=e.ok&&e.status===201,!e.ok){if(w(`Onboarding hatch request failed`,{level:`warning`,extra:{status:e.status,error:e.error}}),ae(e.status,e.error)){K(ne),q(!0);return}if(!r(e.status)){K(le(e.error,void 0,`Failed to start your assistant. Please try again.`));return}}}catch(e){if(P=null,f(e,{context:`onboarding_hatch_assistant`}),t)return}T(0)},T=e=>{t||(n=setTimeout(ge,e))},E=async e=>{for($(`connecting`);!t;){try{if((await ce(e)).ok)break}catch{}if(Date.now()-u>=3e5){K(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{n=setTimeout(e,k)}),n=null}if(t)return;let r=await be({assistantId:e,postCheckoutReturn:Me,managedHatch:H,hatchStartMs:u,isCancelled:()=>t,onResizeWait:()=>$(`resizing`),registerTimer:e=>{n=e}});if(!t){if(r===`health_timeout`){w(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:Ce,stage:`post_resize_health`}}),K(`Your assistant is taking longer than expected. Please try again.`);return}b(e)}},ge=async()=>{if(!t){if(Date.now()-u>=3e5){w(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:Ce}}),K(`Your assistant is taking longer than expected. Please try again.`);return}try{let e=await c(p);if(t||p&&!e.ok&&e.status===404&&(p=void 0,e=await c(),t))return;let n=S(e);if(n.kind===`active`){if(e.ok){let t=e.data.id;y.getState().upsertFromApi(e.data),a(t),(h||g)&&C(t),d()&&te(t,e.data.name,se()??void 0),await E(t);return}b();return}if(n.kind===`error`){K(n.message);return}n.kind!==`auto_hatch`&&Y.current===`provisioning`&&$(`connecting`),T(k)}catch(e){if(f(e,{context:`onboarding_poll_assistant`}),t)return;T(k)}}};return he(),()=>{t=!0,n&&clearTimeout(n),s&&clearTimeout(s),l&&clearTimeout(l)}},[Be,R,U,H,Me,Pe,o,D,$,V]),(0,A.useEffect)(()=>{Z.current===0&&(Z.current=Date.now());let e,t=()=>{let n=Date.now()-Z.current,r=Oe[Y.current],i=Ae(X.current,r,n);Q.current=i,J(i),r-i>1e-6&&(e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[Ue]),Ie?(0,j.jsx)(l,{avatarWave:`beside`,children:(0,j.jsxs)(`div`,{role:`alert`,className:`mx-auto flex w-full max-w-xl flex-col items-center ${B?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40 md:min-h-full md:pb-6`} text-center text-[var(--content-default)]`,children:[(0,j.jsx)(`h1`,{className:B?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:e(Re?`hatchingScreen.apiKeyFailed`:`hatchingScreen.genericFailure`)}),(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${B?`mt-3.5`:`mt-4`}`,children:Ie}),Le&&(0,j.jsxs)(`div`,{className:`mt-6 flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,j.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e(`hatchingScreen.localFallbackPitch`)}),(0,j.jsx)(h,{asChild:!0,variant:`primary`,size:`regular`,fullWidth:!0,className:B?void 0:`h-11 text-base`,children:(0,j.jsx)(`a`,{href:`${window.location.origin}/download`,children:e(xe(n))})})]}),(0,j.jsx)(`img`,{src:Fe,alt:``,width:160,height:160,className:`${B?`my-auto py-8`:`my-16`} onboarding-avatar-failed`}),(0,j.jsxs)(`div`,{className:`flex w-full flex-col ${B?`gap-2.5 max-w-[280px]`:`gap-2 max-w-sm`}`,children:[Re?(0,j.jsx)(h,{variant:`primary`,size:`regular`,fullWidth:!0,className:B?void 0:`h-11 text-base`,onClick:()=>void o(L?`${m.onboarding.apiKey}?hosting=${L}`:m.onboarding.apiKey,{replace:!0}),children:e(`hatchingScreen.updateApiKey`)}):(0,j.jsx)(h,{variant:`primary`,size:`regular`,fullWidth:!0,className:B?void 0:`h-11 text-base`,onClick:()=>{X.current=0,Z.current=Date.now(),Y.current=`initializing`,Q.current=0,G(`initializing`),J(0),We(e=>e+1),K(null),q(!1),Ve(e=>e+1)},children:e(`actions.tryAgain`)}),(0,j.jsx)(h,{variant:`outlined`,size:`regular`,fullWidth:!0,className:B?void 0:`h-11 text-base`,onClick:()=>void o(V?m.onboarding.hosting:`${m.onboarding.privacy}?${g}=1`,{replace:!0}),children:e(`actions.back`)})]})]})}):(0,j.jsx)(l,{avatarWave:`beside`,children:(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${B?`min-h-full px-8 pt-21 pb-28 electron-prechat-type`:`min-h-screen justify-center px-6 pb-40 md:min-h-full md:pb-6`} text-center text-[var(--content-default)]`,children:[(0,j.jsx)(`h1`,{className:B?`text-title-large`:`text-3xl font-semibold tracking-tight`,children:e(W===`ready`?`hatchingScreen.ready`:`hatchingScreen.waking`)}),W!==`ready`&&(0,j.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${B?`mt-3.5`:`mt-4`}`,children:e(`hatchingScreen.wakingBody`)}),(0,j.jsx)(`img`,{src:Fe,alt:``,width:160,height:160,className:`${B?`my-auto py-8`:`my-16`} ${W===`ready`?`onboarding-avatar-awake`:`onboarding-avatar-pulse`}`}),(0,j.jsx)(C,{value:He,height:6,className:`w-full ${B?`max-w-[200px]`:`max-w-sm`}`,"aria-label":e(`hatchingScreen.progressAriaLabel`)}),(0,j.jsx)(`p`,{className:`text-[var(--content-tertiary)] ${B?`mt-4 text-label-small-default`:`mt-3 text-body-small-default`}`,children:e(ke[W])})]})})}export{R as HatchingScreen};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{$n as t,Af as n,Bd as r,Bo as i,Cf as a,Ci as o,Cm as s,Cx as c,Ei as l,Fd as u,Mt as d,Qn as f,Sn as p,Tb as m,Ti as h,Tm as g,Tx as _,Ux as v,Vx as y,Wn as b,_d as x,bd as S,ci as C,d as w,dm as T,ds as E,eh as D,et as O,fs as k,lb as A,o as j,wm as M,xb as N,xm as P}from"./app-DFXcEvsi.js";import{I as F,Zn as I,d as L,er as R,f as z,g as B,j as V}from"./vendor-DYOeoIwg.js";import{n as H,t as U,x as W}from"./react-B9IgSVeK.js";import{Ja as G,La as K,Q as q,Tt as ee,Wi as J,Xt as te,aa as ne,ii as re,jr as ie,ma as ae,nr as oe,r as se,v as ce,x as le}from"./icons-QG1KAFmx.js";import{n as Y,r as ue,t as de}from"./personality-sliders-BuInNb35.js";import{a as fe,i as pe,n as me,r as he,t as ge}from"./use-assistant-identity-details-CGJTkSlu.js";import{t as _e}from"./plugins-surface-2i_lZYet.js";import{t as ve}from"./trait-cycle-row-C1uqLkCi.js";var ye=G(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),X=e(W(),1),Z=U();function Q(e,t,n){return n===`forward`?(e+1)%t:(e-1+t)%t}function be({open:e,onClose:t,assistantId:n,components:r,traits:i,customImageUrl:a,accent:o,onSaveCharacter:c,onUploadImage:l,onSaveAccent:u,assistantName:d,onRenameSubmit:f,isRenaming:p=!1}){let{t:m}=V(),h=(0,X.useRef)(null),[y,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(!1),w=r??y,[T,E]=(0,X.useState)(0),[D,O]=(0,X.useState)(0),[k,A]=(0,X.useState)(0),[j,N]=(0,X.useState)(`character`),[F,I]=(0,X.useState)(null),[L,R]=(0,X.useState)(!1),[z,B]=(0,X.useState)(!1),[H,U]=(0,X.useState)(d??``),[W,G]=(0,X.useState)(void 0),K=F??a,q=!!K;(0,X.useEffect)(()=>{e&&U(d??``)},[e,d]);let ee=(0,X.useRef)(!1);(0,X.useEffect)(()=>{e&&!ee.current&&N(a?`custom`:`character`),ee.current=e},[e,a]),(0,X.useEffect)(()=>{if(e)if(w&&i){let e=w.bodyShapes.findIndex(e=>e.id===i.bodyShape),t=w.eyeStyles.findIndex(e=>e.id===i.eyeStyle),n=w.colors.findIndex(e=>e.id===i.color);E(e>=0?e:0),O(t>=0?t:0),A(n>=0?n:0)}else E(0),O(0),A(0)},[e,w,i]),(0,X.useEffect)(()=>{if(!e||w||S)return;let t=!1;return C(!0),P(n).then(e=>{t||(x(e),C(!1))}),()=>{t=!0}},[e,w,S,n]),(0,X.useEffect)(()=>{if(F)return()=>{URL.revokeObjectURL(F)}},[F]),(0,X.useEffect)(()=>{e||(I(null),G(void 0))},[e]);let J=H.trim(),te=!!f&&J.length>0&&J!==(d??``),ne=(0,X.useCallback)(()=>{w&&(N(`character`),E(Math.floor(Math.random()*w.bodyShapes.length)),O(Math.floor(Math.random()*w.eyeStyles.length)),A(Math.floor(Math.random()*w.colors.length)))},[w]),ie=(0,X.useCallback)(()=>{h.current?.click()},[]),ae=(0,X.useCallback)(async e=>{let t=e.target.files?.[0];if(!t)return;B(!0);let r=await g(n,t);B(!1),r&&(l(),I(URL.createObjectURL(t)),N(`custom`),G(void 0)),h.current&&(h.current.value=``)},[n,l]),oe=(0,X.useCallback)(async e=>{if(e.preventDefault(),L||p)return;te&&f&&f(J);let r=w&&j===`character`;if(j===`custom`&&o!==null&&W!==void 0){R(!0);try{await s(n,W)&&(G(void 0),u())}finally{R(!1)}}if(r){let e={bodyShape:w.bodyShapes[T].id,eyeStyle:w.eyeStyles[D].id,color:w.colors[k].id};R(!0);try{await M(n,e),I(null),c(e)}finally{R(!1)}}t()},[L,p,te,f,J,w,j,o,W,T,D,k,n,c,u,t]),se=w?.bodyShapes[T],ce=w?.eyeStyles[D],Y=w?.colors[k],ue=j===`custom`&&q,de=d!==void 0&&f?(0,Z.jsx)(xe,{value:H,onChange:U,disabled:p}):null;return(0,Z.jsx)(_.Root,{open:e,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(_.Content,{size:`sm`,children:[(0,Z.jsx)(_.Header,{children:(0,Z.jsx)(_.Title,{children:m(`avatarManagementModal.title`)})}),(0,Z.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:oe,children:[(0,Z.jsx)(_.Body,{className:`space-y-4`,children:ue?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex justify-center`,children:(0,Z.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,Z.jsx)(`img`,{src:K,alt:m(`avatarManagementModal.uploadedAlt`),className:`h-40 w-40 rounded-xl object-cover`})})}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[de,o&&(0,Z.jsx)(Se,{accent:o,draft:W,onChange:G}),(0,Z.jsx)(Ce,{label:m(`avatarManagementModal.useCharacterLabel`),description:m(`avatarManagementModal.useCharacterDescription`),onClick:()=>N(`character`),thumbnail:w&&se&&ce&&Y?(0,Z.jsx)(b,{components:w,bodyShapeId:se.id,eyeStyleId:ce.id,colorId:Y.id,size:32}):(0,Z.jsx)(re,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})]})]}):w?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex justify-center`,children:(0,Z.jsx)(`div`,{className:`rounded-2xl bg-[var(--surface-sunken)] p-6`,children:(0,Z.jsx)(b,{components:w,bodyShapeId:se.id,eyeStyleId:ce.id,colorId:Y.id,size:160})})}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[de,(0,Z.jsx)(ve,{label:m(`avatarManagementModal.body`),value:se.id,onPrev:()=>E(Q(T,w.bodyShapes.length,`backward`)),onNext:()=>E(Q(T,w.bodyShapes.length,`forward`))}),(0,Z.jsx)(ve,{label:m(`avatarManagementModal.eyes`),value:ce.id,onPrev:()=>O(Q(D,w.eyeStyles.length,`backward`)),onNext:()=>O(Q(D,w.eyeStyles.length,`forward`))}),(0,Z.jsx)(ve,{label:m(`avatarManagementModal.color`),value:Y.id,colorHex:Y.hex,onPrev:()=>A(Q(k,w.colors.length,`backward`)),onNext:()=>A(Q(k,w.colors.length,`forward`))})]}),q&&(0,Z.jsx)(Ce,{label:m(`avatarManagementModal.keepUploadedLabel`),description:m(`avatarManagementModal.keepUploadedDescription`),onClick:()=>N(`custom`),thumbnail:(0,Z.jsx)(`img`,{src:K,alt:``,className:`h-8 w-8 rounded-md object-cover`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[de,S?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,Z.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2 border-[var(--border-element)] border-t-[var(--content-tertiary)]`})}):(0,Z.jsx)(`div`,{className:`py-8 text-center text-body-medium-lighter text-[var(--content-quiet)]`,children:m(`avatarManagementModal.loadError`)})]})}),(0,Z.jsxs)(_.Footer,{className:`justify-between`,children:[(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(v,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(re,{}),"aria-label":m(`avatarManagementModal.randomize`),tooltip:m(`avatarManagementModal.randomize`),onClick:ne,disabled:!w}),(0,Z.jsx)(v,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(le,{}),"aria-label":m(`avatarManagementModal.uploadImage`),tooltip:m(`avatarManagementModal.uploadImage`),onClick:ie,disabled:z})]}),(0,Z.jsx)(v,{type:`submit`,variant:`primary`,disabled:L||p||z,children:m(L||p?`avatarManagementModal.saving`:`avatarManagementModal.save`)})]})]}),(0,Z.jsx)(`input`,{ref:h,type:`file`,accept:`image/png,image/jpeg,image/webp,image/gif`,className:`hidden`,onChange:ae})]})})}function xe({value:e,onChange:t,disabled:n}){let{t:r}=V();return(0,Z.jsxs)(`label`,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-small-default uppercase tracking-wider text-[var(--content-quiet)]`,children:r(`avatarManagementModal.name`)}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(`div`,{className:`flex min-w-[80px] items-center justify-center`,children:(0,Z.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),disabled:n,maxLength:40,size:8,placeholder:r(`avatarManagementModal.name`),"aria-label":r(`avatarManagementModal.name`),className:`h-7 min-w-0 field-sizing-content bg-transparent text-center text-body-medium-default text-[var(--content-strong)] outline-none placeholder:text-[var(--content-tertiary)] disabled:cursor-not-allowed disabled:opacity-60`})}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-7 shrink-0`})]})]})}function Se({accent:e,draft:t,onChange:n}){let{t:r}=V(),i=t===null,a=t??e.hex,o=t===void 0?e.source===`custom`:!i;return(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2`,children:[(0,Z.jsx)(`span`,{className:`text-body-small-default uppercase tracking-wider text-[var(--content-quiet)]`,children:r(`avatarManagementModal.accent`)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o?(0,Z.jsx)(`button`,{type:`button`,onClick:()=>n(null),"aria-label":r(`avatarManagementModal.accentReset`),title:r(`avatarManagementModal.accentReset`),className:`flex h-7 w-7 cursor-pointer items-center justify-center rounded-md text-[var(--content-quiet)] transition-colors hover:bg-[var(--surface-active)]`,children:(0,Z.jsx)(ee,{className:`h-4 w-4`})}):(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-7 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex min-w-[80px] items-center justify-center gap-2`,children:[(0,Z.jsx)(`input`,{type:`color`,value:a,onChange:e=>n(e.target.value),"aria-label":r(`avatarManagementModal.accentPickerLabel`),className:`h-5 w-5 cursor-pointer appearance-none rounded-full border border-[var(--border-element)] bg-transparent p-0 [&::-moz-color-swatch]:rounded-full [&::-moz-color-swatch]:border-0 [&::-webkit-color-swatch-wrapper]:p-0 [&::-webkit-color-swatch]:rounded-full [&::-webkit-color-swatch]:border-0`}),(0,Z.jsx)(`span`,{className:`text-body-medium-default uppercase text-[var(--content-strong)]`,children:i?r(`avatarManagementModal.accentAutomatic`):a.replace(`#`,``)})]}),(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-7 shrink-0`})]})]})}function Ce({label:e,description:t,thumbnail:n,onClick:r}){return(0,Z.jsxs)(`button`,{type:`button`,onClick:r,className:`flex w-full cursor-pointer items-center gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,Z.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center overflow-hidden rounded-md bg-[var(--surface-sunken)]`,children:n}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block truncate text-body-medium-default text-[var(--content-strong)]`,children:e}),(0,Z.jsx)(`span`,{className:`block truncate text-body-small-default text-[var(--content-quiet)]`,children:t})]}),(0,Z.jsx)(J,{className:`h-4 w-4 shrink-0 text-[var(--content-quiet)]`})]})}function we(e){let t=e.trim();return`<system-message>
|
|
2
|
-
The user renamed you: your name is now ${t}.
|
|
3
|
-
|
|
4
|
-
Update IDENTITY.md so its name line reads exactly \`- **Name:** ${t}\`. This is a rename only — keep everything else in IDENTITY.md and SOUL.md exactly as it is, and do not touch users/ (that is your user's profile, not your identity). If your name appears elsewhere in those files, update those mentions to ${t} too.
|
|
5
|
-
|
|
6
|
-
Reply with a single short sentence acknowledging your new name.
|
|
7
|
-
</system-message>`}async function Te(e,t){return he({assistantId:e,content:we(t),title:F(`applyRename.conversationTitle`,{ns:`intelligence`}),context:`identity_overview_rename`})}var Ee=6e4,De=3;function Oe(e,{supportsPlugins:i,isNativeMobile:o}){let{t:s}=V(`intelligence`),c={assistant_id:e},l={staleTime:Ee,retry:!1,enabled:!0},d=I({...n({path:c,query:{kind:`installed`}}),select:e=>e.skills.length,...l}),f=I({...t(e),select:e=>e.plugins.length,enabled:i}),m=I({...x({path:c}),select:e=>e.apps.length,...l}),h=I({...r({path:c}),select:e=>e.documents.length,...l}),g=I({...p({assistantId:e}),select:e=>e.entries.length,...l,enabled:!o}),_=I({...u({path:c}),select:e=>e.contacts.length,...l}),v=I({...S({path:c}),select:e=>e.snapshots.filter(e=>e.ready).length,...l}),y=I({queryKey:a({path:c}),queryFn:()=>w(e),select:e=>{let t=e.filter(e=>e.enabled).sort((e,t)=>e.nextRunAt-t.nextRunAt);return{count:t.length,items:t.slice(0,De).map(e=>({id:e.id,name:e.name,cadence:e.cadenceDescription,nextRunAt:e.nextRunAt}))}},...l}),b=I({queryKey:ue(e),queryFn:()=>Y(e),...l});return{personality:{signature:b.data===void 0?void 0:de(b.data??{})},superpowers:d.data===void 0?void 0:{text:f.data===void 0?s(`useIdentitySectionStats.skillCount`,{count:d.data}):s(`useIdentitySectionStats.skillAndPluginCount`,{count:d.data+f.data})},library:m.data===void 0?void 0:{text:h.data===void 0?s(`useIdentitySectionStats.appCount`,{count:m.data}):s(`useIdentitySectionStats.appAndDocCount`,{count:m.data+h.data})},workspace:g.data===void 0?void 0:{value:g.data,label:s(`useIdentitySectionStats.itemLabel`,{count:g.data}),text:s(`useIdentitySectionStats.itemCount`,{count:g.data})},contacts:_.data===void 0?void 0:{value:_.data,label:s(`useIdentitySectionStats.personLabel`,{count:_.data}),text:s(`useIdentitySectionStats.personCount`,{count:_.data})},channels:v.data===void 0?void 0:{value:v.data,label:s(`useIdentitySectionStats.connectedLabel`,{count:v.data}),text:s(`useIdentitySectionStats.connectedCount`,{count:v.data})},schedules:y.data===void 0?void 0:y.data.count===0?{text:s(`useIdentitySectionStats.noSchedulesText`)}:{value:y.data.count,label:s(`useIdentitySectionStats.activeLabel`,{count:y.data.count}),text:s(`useIdentitySectionStats.activeCount`,{count:y.data.count}),schedules:{items:y.data.items,more:y.data.count-y.data.items.length}}}}var ke=96,Ae=150,je=36,Me=46,Ne=58,Pe=(e,t,n)=>Math.max(t,Math.min(n,e));function Fe(e,t,n){let r=Pe(n.x-e.left,ke,e.width-ke),i=Pe(n.y-e.top,ke,e.height-ke);return{rect:e,facing:t,peek:t===`top`?{x:r,y:0}:t===`bottom`?{x:r,y:e.height}:t===`left`?{x:0,y:i}:{x:e.width,y:i}}}var Ie={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0}},Le={type:`spring`,stiffness:150,damping:19},Re=.22,ze=.15;function Be({hex:e,components:t,traits:n,target:r}){let i=r!==null,[a,s]=(0,X.useState)(null);r&&r!==a&&s(r);let c=r??a,[l,u]=(0,X.useState)(!1);(0,X.useEffect)(()=>{let e=!1,t,n=()=>{t=setTimeout(()=>{e||(u(!0),t=setTimeout(()=>{e||(u(!1),n())},140))},2500+Math.random()*4e3)};return n(),()=>{e=!0,clearTimeout(t)}},[]);let d=(0,X.useMemo)(()=>{let e=t.eyeStyles.find(e=>e.id===n.eyeStyle);return e?{paths:e.paths,bbox:h(e.paths.map(e=>o(e.svgPath)))}:null},[t,n.eyeStyle]);if(!d||!c)return null;let{rect:f,facing:p,peek:m}=c,g={x:f.left+m.x,y:f.top+m.y},_=Ie[p],v=d.bbox.h/d.bbox.w,y=Ne,b=y*v,x={x:g.x+_.x*je,y:g.y+_.y*je},S={x:-_.x*Me,y:-_.y*Me},C=d.bbox.x+d.bbox.w/2,w=d.bbox.y+d.bbox.h/2,T=i?{...Le,delay:Re,opacity:{duration:.15,delay:Re}}:{duration:ze};return(0,Z.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0`,children:[(0,Z.jsx)(B.div,{className:`absolute top-0 left-0 rounded-full`,style:{backgroundColor:e,width:Ae,height:Ae},initial:!1,animate:{x:g.x-Ae/2+(i?0:S.x),y:g.y-Ae/2+(i?0:S.y),opacity:+!!i},transition:T}),(0,Z.jsx)(B.div,{className:`absolute top-0 left-0`,initial:!1,animate:{x:x.x-y/2+(i?0:S.x),y:x.y-b/2+(i?0:S.y),width:y,height:b,opacity:+!!i},transition:T,children:(0,Z.jsx)(`svg`,{viewBox:`${d.bbox.x} ${d.bbox.y} ${d.bbox.w} ${d.bbox.h}`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`,style:{overflow:`visible`,display:`block`},children:(0,Z.jsx)(`g`,{style:{transform:l?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${C}px ${w}px`,transition:`transform 0.14s ease-in-out`},children:d.paths.map((e,t)=>(0,Z.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})]})}var Ve=65,He=26;function Ue(e,t){let n=z(),[r,i]=(0,X.useState)(n?e.length:0);return(0,X.useEffect)(()=>{if(n){i(e.length);return}i(0);let r=setInterval(()=>{i(t=>t>=e.length?(clearInterval(r),t):t+1)},t);return()=>clearInterval(r)},[e,t,n]),{typed:e.slice(0,r),typing:r<e.length}}function We({name:e,isRenaming:t,overrideText:n=null}){let{t:r}=V(`intelligence`),i=n??r(`assistantNameEditor.greeting`,{name:e}),{typed:a,typing:o}=Ue(i,n?He:Ve);return(0,Z.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,Z.jsxs)(`h1`,{"aria-label":i,className:`relative leading-none whitespace-nowrap text-[var(--content-strong)] ${n?`text-[2.1rem] max-sm:text-[1.4rem]`:`text-[3.25rem] max-sm:text-[2rem]`}`,style:{fontFamily:`var(--font-serif)`},children:[(0,Z.jsx)(`span`,{className:`invisible`,"aria-hidden":`true`,children:i}),(0,Z.jsxs)(`span`,{className:`absolute inset-0`,"aria-hidden":`true`,children:[a,o&&(0,Z.jsx)(`span`,{className:`animate-pulse`,children:`▎`})]})]}),!n&&t&&(0,Z.jsx)(`div`,{"aria-label":r(`assistantNameEditor.renamingInProgressAriaLabel`),className:`h-5 w-5 shrink-0 animate-spin rounded-full border-2 border-[var(--border-base)]`,style:{borderTopColor:`var(--content-default)`}})]})}var Ge={personality:{label:`identitySections.personality.label`,description:`identitySections.personality.description`},schedules:{label:`identitySections.schedules.label`,description:`identitySections.schedules.description`},superpowers:{label:`identitySections.superpowers.label`,description:`identitySections.superpowers.description`},memory:{label:`identitySections.memory.label`,description:`identitySections.memory.description`},library:{label:`identitySections.library.label`,description:`identitySections.library.description`},workspace:{label:`identitySections.workspace.label`,description:`identitySections.workspace.description`},contacts:{label:`identitySections.contacts.label`,description:`identitySections.contacts.description`},channels:{label:`identitySections.channels.label`,description:`identitySections.channels.description`}};function $(e){let{to:t}=N(e),n=Ge[e];return{key:e,label:F(n.label,{ns:`intelligence`}),description:F(n.description,{ns:`intelligence`}),to:t}}var Ke=[`memory`,`workspace`];function qe({isNativeMobile:e=!1}={}){let t=[{key:`personality`,label:F(Ge.personality.label,{ns:`intelligence`}),description:F(Ge.personality.description,{ns:`intelligence`}),to:m.personality},$(`schedules`),$(`superpowers`),$(`memory`),$(`library`),$(`workspace`),$(`contacts`),$(`channels`)];return e?t.filter(e=>!Ke.includes(e.key)):t}var Je=340,Ye=46,Xe=11.5,Ze={h:226,mid:113,span:58,topY:15,bottomY:216},Qe={h:108,mid:52,span:18,topY:12,bottomY:96},$e=5,et=10,tt=.42,nt=.26,rt=pe.map((e,t)=>Ye+t*(Je-Ye*2)/(pe.length-1));function it(e,t){let n=e[t]??fe;return Math.max(0,Math.min(100,n))}function at(e,t){return t.mid-(e-50)/50*t.span}function ot(e){return e.length>8&&e.includes(` `)?e.split(` `):[e]}function st({x:e,label:t,frame:n,above:r,leaning:i,neutral:a,magnitude:o}){let s=ot(t),c=r?n.topY:n.bottomY-(s.length-1)*Xe,l=i&&!a,u=a?tt:l?.62+.38*o:nt;return(0,Z.jsx)(`text`,{x:e,y:c,textAnchor:`middle`,fontSize:10,fontWeight:l?600:400,fill:`currentColor`,fillOpacity:u,children:s.map((t,n)=>(0,Z.jsx)(`tspan`,{x:e,dy:n===0?0:Xe,children:t},t))})}function ct({values:e,compact:t=!1,className:n}){let{t:r}=V(`intelligence`),i=z(),a=t?Qe:Ze,o=pe.map(t=>{let n=it(e,t.id),i=n-50,a=Math.abs(i)<=$e;return{axis:t,left:r(t.leftKey),right:r(t.rightKey),value:n,lean:i,neutral:a,magnitude:Math.abs(i)/50}}),[s,c]=(0,X.useState)(+!!i);(0,X.useEffect)(()=>{if(i){c(1);return}let e=L(0,1,{type:`spring`,stiffness:140,damping:16,onUpdate:c});return()=>e.stop()},[i]);let l=o.map(e=>at(50+(e.value-50)*s,a)),u=o.map(({left:e,right:t,lean:n,neutral:i,magnitude:a})=>i?r(`personalitySignature.axisBalanced`,{left:e,right:t}):r(`personalitySignature.axisLean`,{percent:Math.round(a*100),label:n>0?t:e})).join(`, `);return(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${Je} ${a.h}`,role:`img`,"aria-label":r(`personalitySignature.ariaLabel`,{summary:u}),className:n,children:[(0,Z.jsx)(`line`,{x1:Ye-14,y1:a.mid,x2:Je-Ye+14,y2:a.mid,stroke:`currentColor`,strokeOpacity:.3,strokeWidth:1,strokeDasharray:`2 4`}),o.map(({axis:e},t)=>(0,Z.jsx)(`rect`,{x:rt[t]-et/2,y:Math.min(a.mid,l[t])-et/2,width:et,height:Math.abs(l[t]-a.mid)+et,rx:et/2,fill:`var(--card-accent)`},e.id)),o.map(({axis:e,left:t,right:n,lean:r,neutral:i,magnitude:o},s)=>(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(st,{x:rt[s],label:n,frame:a,above:!0,leaning:r>0,neutral:i,magnitude:o}),(0,Z.jsx)(st,{x:rt[s],label:t,frame:a,above:!1,leaning:r<0,neutral:i,magnitude:o})]},e.id))]})}var lt={personality:q,schedules:ne,superpowers:se,memory:ae,library:oe,workspace:ie,contacts:ce,channels:ye},ut={personality:`rounded-3xl`,schedules:`rounded-3xl`,superpowers:`rounded-[1.25rem_2.75rem_1.25rem_2.5rem]`,channels:`rounded-[2.25rem_1rem_2.5rem_1.25rem]`,contacts:`rounded-[1rem_2.5rem_1.25rem_2.75rem]`,workspace:`rounded-[1.25rem_2.5rem_1rem_2.5rem]`},dt=720,ft=480,pt=[`superpowers`,`memory`,`library`,`workspace`,`contacts`,`channels`],mt={personality:`identityOverview.cardHoverLine.personality`,superpowers:`identityOverview.cardHoverLine.superpowers`,memory:`identityOverview.cardHoverLine.memory`,library:`identityOverview.cardHoverLine.library`,schedules:`identityOverview.cardHoverLine.schedules`,workspace:`identityOverview.cardHoverLine.workspace`,contacts:`identityOverview.cardHoverLine.contacts`,channels:`identityOverview.cardHoverLine.channels`},ht=[{nameKey:`identityOverview.scheduleGhosts.morningBriefingName`,cadenceKey:`identityOverview.scheduleGhosts.morningBriefingCadence`},{nameKey:`identityOverview.scheduleGhosts.inboxTriageName`,cadenceKey:`identityOverview.scheduleGhosts.inboxTriageCadence`}];function gt(e){let t=new Date(e);return e<=0||Number.isNaN(t.getTime())?`—`:d(t.toISOString())}var _t=280,vt=140,yt=.44,bt=1118,xt=300,St=.09,Ct=14,wt=5,Tt=22,Et={"--card-bg":`#24292e`,"--card-feature-bg":`rgba(23, 25, 28, 0.35)`,"--card-hover":`#2d3339`,"--card-accent":`#bd4900`,"--card-flood-fg":`#fdfdfc`,"--content-default":`#fdfdfc`,"--content-strong":`#fdfdfc`,"--content-secondary":`#a9b2bb`,"--content-tertiary":`#8d99a5`,"--border-base":`rgba(255, 255, 255, 0.08)`};function Dt({assistantId:e}){let{t}=V(`intelligence`),n=R(),{components:r,traits:i,customImageUrl:a,accentHex:o,accent:s,isLoading:l,invalidate:u}=T(e),d=me(e),f=_e(),p=D(),m=Oe(e,{supportsPlugins:f,isNativeMobile:p}),h=E(I({...k(e),enabled:!p}).data),g={...m,memory:h===void 0?void 0:{value:h,label:t(`identityOverview.memoryCountLabel`,{count:h}),text:t(`identityOverview.memoryCount`,{count:h})}},[_,v]=(0,X.useState)(!1),[y,b]=(0,X.useState)(!1),x=(0,X.useCallback)(r=>{b(!0),Te(e,r).then(i=>{if(b(!1),i){n.invalidateQueries({queryKey:ge(e)});let{version:i,assistantId:a,setIdentity:o}=A.getState();o(r,i,a),c.success(t(`identityOverview.renameSuccessToast`,{newName:r}))}else c.error(t(`identityOverview.renameErrorToast`))})},[e,n,t]),S=(0,X.useCallback)(()=>{u()},[u]),C=qe({isNativeMobile:p}),w=l||d.isLoading,O=!!a,M=O?null:o;return(0,Z.jsxs)(j,{bleed:!O,className:O?`relative overflow-hidden`:void 0,style:M?{backgroundColor:`color-mix(in srgb, ${M} ${Ct}%, var(--surface-overlay))`}:void 0,children:[O&&a&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,children:(0,Z.jsx)(`img`,{src:a,alt:``,className:`h-full w-full scale-110 object-cover blur-[60px] brightness-[0.65]`})}),w?(0,Z.jsx)(`div`,{className:`relative flex flex-1 items-center justify-center`,children:(0,Z.jsx)(`div`,{className:`h-6 w-6 animate-spin rounded-full border-2`,style:{borderColor:`var(--border-base)`,borderTopColor:`var(--content-tertiary)`}})}):(0,Z.jsx)(jt,{components:r,traits:i,customImageUrl:a,name:d.data?.identity?.name||t(`identityOverview.defaultAssistantName`),sections:C,stats:g,avatarHex:M,photoBackdrop:O,isRenaming:y,onOpenAvatarModal:()=>v(!0)}),(0,Z.jsx)(be,{open:_,onClose:()=>v(!1),assistantId:e,components:r,traits:i,customImageUrl:a,accent:s,onSaveCharacter:S,onUploadImage:S,onSaveAccent:S,assistantName:d.data?.identity?.name||t(`identityOverview.defaultAssistantName`),onRenameSubmit:x,isRenaming:y})]})}function Ot({name:e,cadence:t,fg:n,fgMuted:r,flooded:i,ghost:a=!1}){return(0,Z.jsxs)(`span`,{className:`flex flex-col gap-0.5 rounded-xl px-3 py-2 transition-colors duration-300 ${a?`border border-dashed opacity-60`:``}`,style:a?{borderColor:i?`color-mix(in srgb, var(--card-flood-fg) 45%, transparent)`:`var(--border-base)`}:{backgroundColor:i?`color-mix(in srgb, var(--card-flood-fg) 12%, transparent)`:`color-mix(in srgb, var(--content-default) 5%, transparent)`},children:[(0,Z.jsx)(`span`,{className:`truncate text-[13px] font-medium transition-colors duration-300 ${a?r:n}`,children:e}),(0,Z.jsx)(`span`,{className:`truncate text-[12px] transition-colors duration-300 ${r}`,children:t})]})}function kt({section:e,stat:t,gridArea:n,cardStyle:r,hoverFill:i,mini:a,compact:o=!1,flooded:s=!1,floodOrigin:c,photoBackdrop:l=!1,linkRef:u,onHoverChange:d}){let{t:f}=V(`intelligence`),p=lt[e.key]??q,[m,h]=(0,X.useState)({x:50,y:100});c&&c!==m&&h(c);let g=s?`text-[var(--card-flood-fg)]`:`text-[var(--content-default)]`,_=s?`text-[var(--card-flood-fg)]`:`text-[var(--content-strong)]`,v=s?`text-[var(--card-flood-fg)] opacity-75`:`text-[var(--content-secondary)]`,b=(0,Z.jsx)(B.span,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0`,style:{backgroundColor:`var(--card-accent)`},initial:!1,animate:{clipPath:s?`circle(141% at ${m.x}% ${m.y}%)`:`circle(0% at ${m.x}% ${m.y}%)`},transition:s?{duration:.5,ease:`easeOut`}:{duration:.35,ease:`easeIn`}});if(a)return(0,Z.jsx)(y.Root,{asChild:!0,bordered:!1,elevated:!0,clipContents:!0,className:`rounded-[12px] border-0 bg-[var(--card-bg)]`,children:(0,Z.jsxs)(H,{to:e.to,ref:u,onMouseEnter:()=>d?.(!0),onMouseLeave:()=>d?.(!1),className:`relative flex h-full flex-1 cursor-pointer items-center transition-all duration-150 active:scale-[0.98] ${o?`gap-1 py-3 pr-3 pl-2`:`gap-2 px-4 py-2.5`} ${i?`hover:bg-[var(--card-hover)]`:``}`,children:[b,(0,Z.jsx)(`span`,{className:`relative flex h-10 w-10 shrink-0 items-center justify-center`,children:(0,Z.jsx)(p,{className:`${o?`h-3.5 w-3.5`:`h-5 w-5`} transition-colors duration-300 ${v}`,"aria-hidden":!0})}),(0,Z.jsxs)(`span`,{className:`relative flex min-w-0 flex-col gap-0`,children:[(0,Z.jsx)(`span`,{className:`truncate text-title-small leading-normal transition-colors duration-300 ${_}`,children:e.label}),t?.text&&(0,Z.jsx)(`span`,{className:`truncate text-[11px] leading-normal font-medium transition-colors duration-300 ${s?`text-[var(--card-flood-fg)] opacity-75`:`text-[var(--content-tertiary)]`}`,children:t.text})]})]})});let x=e.key===`personality`||e.key===`schedules`,S=!!n&&e.key===`schedules`&&t!==void 0&&!t.schedules;return(0,Z.jsx)(y.Root,{asChild:!0,bordered:!x,elevated:!x,className:`${ut[e.key]??``} ${x?`border bg-[var(--card-feature-bg,var(--card-bg))] ${l?`border-transparent backdrop-blur-[32px]`:`border-[var(--border-base)]`}`:`bg-[var(--card-bg)]`}`,style:{...n?{gridArea:n}:{},...r},children:(0,Z.jsxs)(H,{to:e.to,ref:u,onMouseEnter:()=>d?.(!0),onMouseLeave:()=>d?.(!1),className:`relative flex h-full w-full cursor-pointer flex-col justify-between gap-3 overflow-hidden p-5 text-left transition-all duration-150 active:scale-[0.98] ${i?`hover:bg-[var(--card-hover)]`:``}`,children:[b,n&&t?.signature&&(0,Z.jsxs)(`span`,{className:`absolute inset-x-5 top-14 bottom-9 flex flex-col justify-start transition-colors duration-300 ${s?`text-[var(--card-flood-fg)]`:l?`text-[var(--content-default)]`:`text-[var(--content-secondary)]`}`,style:s?{"--card-accent":`var(--card-flood-fg)`}:void 0,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`max-h-10 flex-1`}),(0,Z.jsx)(ct,{values:t.signature,className:`h-auto max-h-full w-full`})]}),x?(0,Z.jsxs)(`span`,{className:`relative flex items-center gap-2`,children:[(0,Z.jsx)(p,{className:`h-5 w-5 transition-colors duration-300 ${g}`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default transition-colors duration-300 ${g}`,children:e.label})]}):(0,Z.jsxs)(`span`,{className:`relative flex flex-col items-start gap-1.5`,children:[(0,Z.jsx)(p,{className:`h-6 w-6 transition-colors duration-300 ${g}`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{className:`text-body-medium-default transition-colors duration-300 ${g}`,children:e.label}),(0,Z.jsx)(`span`,{className:`text-[13px] transition-colors duration-300 ${v}`,children:e.description})]})]}),n&&t?.schedules&&t.schedules.items.length>0&&(0,Z.jsxs)(`span`,{className:`relative flex min-h-0 flex-1 flex-col justify-start gap-2 overflow-hidden py-2`,children:[t.schedules.items.map(e=>(0,Z.jsx)(Ot,{name:e.name,cadence:f(`identityOverview.scheduleCadence`,{cadence:e.cadence,nextRun:gt(e.nextRunAt)}),fg:g,fgMuted:v,flooded:s},e.id)),t.schedules.more>0&&(0,Z.jsx)(`span`,{className:`text-[12px] font-medium transition-colors duration-300 ${v}`,children:f(`identityOverview.viewMoreSchedules`,{count:t.schedules.more})})]}),S&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`relative flex min-h-0 flex-1 flex-col justify-start gap-2 overflow-hidden py-2`,children:ht.map(e=>(0,Z.jsx)(Ot,{name:f(e.nameKey),cadence:f(e.cadenceKey),fg:g,fgMuted:v,flooded:s,ghost:!0},e.nameKey))}),t?.value===void 0?t?.text?(0,Z.jsxs)(`span`,{className:`relative flex flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-[14px] font-medium italic transition-colors duration-300 ${g}`,children:t.text}),S&&(0,Z.jsxs)(`span`,{className:`flex items-center gap-1 text-[13px] font-medium transition-colors duration-300 ${g}`,children:[f(`identityOverview.setUpSchedule`),(0,Z.jsx)(K,{size:13,"aria-hidden":!0})]})]}):null:(0,Z.jsxs)(`span`,{className:`relative flex flex-col leading-none`,children:[(0,Z.jsx)(`span`,{className:`text-[3.25rem] transition-colors duration-300 max-lg:text-[2.5rem] ${_}`,style:{fontFamily:`var(--font-serif)`},children:t.value}),(0,Z.jsx)(`span`,{className:`mt-1 text-[13px] transition-colors duration-300 ${v}`,children:t.label})]})]})})}function At({components:e,traits:t,customImageUrl:n,name:r,avatarSize:i,isRenaming:a,onEdit:o}){let{t:s}=V(`intelligence`);return(0,Z.jsxs)(`div`,{className:`relative z-[1] flex flex-col items-center justify-center gap-5`,children:[(0,Z.jsx)(We,{name:r,isRenaming:a}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":s(`identityOverview.updateAvatarAndName`),title:s(`identityOverview.updateAvatarAndName`),onClick:o,className:`avatar-edit-cursor outline-none keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:n&&!t?(0,Z.jsx)(`img`,{src:n,alt:``,width:i,height:i,className:`rounded-[32px] object-cover`,style:{width:i,height:i}}):(0,Z.jsx)(C,{components:e,traits:t,customImageUrl:n,size:i,interactive:!0})})]})}function jt({components:e,traits:t,customImageUrl:n,name:r,sections:a,stats:o,avatarHex:s,photoBackdrop:c,isRenaming:u,onOpenAvatarModal:d}){let{t:p}=V(`intelligence`),{ref:m,size:h}=l(),g=z(),_=h.w>=dt&&h.h>=ft,v=Math.round(Math.min(_t,Math.max(vt,Math.min(h.w,h.h)*.32))),b=!!(s&&e&&t),x=_&&!g&&b,S=(0,X.useRef)(null),w=(0,X.useRef)({}),[T,E]=(0,X.useState)(null),D=(0,X.useCallback)(e=>{S.current=e,m(e)},[m]),O=(0,X.useCallback)((e,t)=>{if(!x)return;if(!t){E(null);return}let n=S.current,r=w.current[e];if(!n||!r)return;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o={left:a.left-i.left,top:a.top-i.top,width:a.width,height:a.height},s=(o.left+o.width/2-i.width/2)/(i.width/2),c=(o.top+o.height/2-i.height/2)/(i.height/2),l=Fe(o,Math.abs(s)>Math.abs(c)?s<0?`right`:`left`:c<0?`bottom`:`top`,{x:i.width/2,y:i.height/2});E({key:e,target:l,origin:{x:l.peek.x/o.width*100,y:l.peek.y/o.height*100}})},[x]),k=x?T:null,A=k?mt[k.key]:void 0,j=A?p(A):null,M=c?Et:{"--card-bg":s?`color-mix(in srgb, ${s} var(--card-tint-pct, ${wt}%), var(--card-surface, var(--surface-lift)))`:`var(--surface-lift)`,"--card-feature-bg":s?`color-mix(in srgb, var(--card-accent) 28%, var(--card-surface, var(--surface-lift)))`:`var(--surface-lift)`,"--card-hover":s?`color-mix(in srgb, ${s} ${Tt}%, var(--card-surface, var(--surface-lift)))`:`var(--surface-hover)`,"--card-accent":s??`var(--content-default)`,"--card-flood-fg":s?i(s):`var(--content-default)`},N=(h.h-8)/(1-St),P=Math.round(Math.min(bt,N,Math.max(xt,h.w*yt))),F=Math.round(P*St),I=(0,Z.jsx)(At,{components:e,traits:t,customImageUrl:n,name:r,avatarSize:v,isRenaming:u,onEdit:d});if(!_){let e=a.find(e=>e.key===`schedules`),t=a.find(e=>e.key===`personality`),n=a.filter(e=>e.key!==`schedules`&&e.key!==`personality`),r=o.schedules?.schedules,i=r?r.items.length+r.more:void 0,s=o.personality?.signature,l=`w-full rounded-[12px] border border-transparent bg-[var(--card-feature-bg,var(--card-bg))] backdrop-blur-[32px]`;return(0,Z.jsxs)(`div`,{ref:D,className:`identity-bento relative flex min-h-0 flex-1 flex-col items-center gap-6 overflow-y-auto px-2 py-4`,style:c?{...M,"--card-feature-bg":`rgba(23, 25, 28, 0.3)`,"--card-bg":`#17191c`,"--card-hover":`#24292e`}:{...M,"--card-feature-bg":`color-mix(in srgb, var(--surface-base) 30%, transparent)`,"--card-bg":`var(--surface-base)`,"--card-hover":`var(--surface-lift)`},children:[I,(0,Z.jsxs)(`div`,{className:`flex w-full max-w-md shrink-0 flex-col gap-2`,children:[e&&(0,Z.jsx)(y.Root,{asChild:!0,bordered:!1,elevated:!1,clipContents:!0,className:l,children:(0,Z.jsxs)(H,{to:e.to,className:`flex w-full cursor-pointer items-center gap-2 p-4 transition-all duration-150 hover:bg-[var(--card-hover)] active:scale-[0.98]`,children:[(0,Z.jsx)(ne,{className:`h-6 w-6 shrink-0 text-[var(--content-default)]`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-title-small leading-normal text-[var(--content-default)]`,children:e.label}),i!==void 0&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{}),(0,Z.jsx)(`span`,{className:`text-title-small leading-normal text-[var(--content-tertiary)]`,children:i})]})]}),(0,Z.jsx)(J,{className:`h-6 w-6 shrink-0 text-[var(--content-default)]`,"aria-hidden":!0})]})}),t&&(0,Z.jsx)(y.Root,{asChild:!0,bordered:!1,elevated:!1,clipContents:!0,className:l,children:(0,Z.jsxs)(H,{to:t.to,className:`flex w-full cursor-pointer flex-col gap-4 px-4 pt-4 pb-6 transition-all duration-150 hover:bg-[var(--card-hover)] active:scale-[0.98]`,children:[(0,Z.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[(0,Z.jsx)(q,{className:`h-6 w-6 shrink-0 text-[var(--content-default)]`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-title-small leading-normal text-[var(--content-default)]`,children:t.label})]}),s&&(0,Z.jsx)(`span`,{className:`flex items-center justify-center ${c?`text-[var(--content-default)]`:`text-[var(--content-secondary)]`}`,children:(0,Z.jsx)(ct,{values:s,compact:!0,className:`h-auto w-full`})})]})}),(0,Z.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:n.map(e=>(0,Z.jsx)(kt,{section:e,stat:o[e.key],hoverFill:!0,mini:!0,compact:!0},e.key))})]})]})}let L=a.filter(e=>!pt.includes(e.key)),R=a.filter(e=>pt.includes(e.key)),U=[1.15,1,.45,.3],W=(h.h-(U.length-1)*12)/U.reduce((e,t)=>e+t,0),G=Math.round(W*U[0]),K=(b?[`"personality greeting greeting greeting schedules"`,`". . . . schedules"`,`". . . . ."`,`"smalls smalls smalls smalls smalls"`]:[`"personality greeting greeting greeting schedules"`,`". avatar avatar avatar schedules"`,`". avatar avatar avatar ."`,`"smalls smalls smalls smalls smalls"`]).join(` `),ee=e=>({section:e,stat:o[e.key],hoverFill:!x,photoBackdrop:c,flooded:k?.key===e.key,floodOrigin:k?.key===e.key?k.origin:void 0,linkRef:t=>{w.current[e.key]=t},onHoverChange:t=>O(e.key,t)});return(0,Z.jsxs)(`div`,{ref:D,className:`identity-bento relative grid min-h-0 flex-1 gap-3 overflow-hidden`,style:{...M,gridTemplateColumns:`1.55fr 1fr 1fr 1fr 1.55fr`,gridTemplateRows:U.map(e=>`${e}fr`).join(` `),gridTemplateAreas:K},children:[b?(0,Z.jsx)(B.div,{className:`pointer-events-none absolute left-1/2 z-0`,style:{width:P,height:P,bottom:-F,x:`-50%`},initial:!1,animate:k?{scale:.4,opacity:0}:{scale:1,opacity:1},transition:k?{duration:.15}:{delay:.25,type:`spring`,stiffness:210,damping:18},children:(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-label":p(`identityOverview.updateAvatarAndName`),title:p(`identityOverview.updateAvatarAndName`),onClick:d,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d())},className:`avatar-edit-cursor group pointer-events-auto relative h-full w-full scale-100 outline-none transition-transform duration-200 ease-out hover:scale-105 keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:[(0,Z.jsx)(C,{components:e,traits:t,customImageUrl:n,size:P,interactive:!0}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center opacity-0 transition-opacity duration-150 group-hover:opacity-100`,children:(0,Z.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full bg-black/40`,children:(0,Z.jsx)(te,{className:`h-5 w-5 text-white`})})})]})}):(0,Z.jsx)(`div`,{className:`relative z-[1] flex items-start justify-center`,style:{gridArea:`avatar`},children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":p(`identityOverview.updateAvatarAndName`),title:p(`identityOverview.updateAvatarAndName`),onClick:d,className:`avatar-edit-cursor rounded-full outline-none keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)]`,children:n?(0,Z.jsx)(`img`,{src:n,alt:``,width:v,height:v,className:`rounded-full object-cover`,style:{width:v,height:v}}):(0,Z.jsx)(C,{components:e,traits:t,customImageUrl:null,size:v})})}),(0,Z.jsx)(`div`,{className:`relative z-[1] flex items-center justify-center`,style:{gridArea:`greeting`},children:(0,Z.jsx)(We,{name:r,isRenaming:u,overrideText:j})}),x&&s&&e&&t&&(0,Z.jsx)(Be,{hex:s,components:e,traits:t,target:k?.target??null}),L.map(e=>(0,Z.jsx)(kt,{...ee(e),gridArea:e.key,cardStyle:e.key===`schedules`?{alignSelf:`start`,height:`auto`,minHeight:G}:void 0},e.key)),(0,Z.jsx)(`div`,{className:`flex min-h-0 items-stretch gap-3`,style:{gridArea:`smalls`},children:R.map(e=>(0,Z.jsx)(kt,{...ee(e),mini:!0},e.key))})]})}function Mt(){return(0,Z.jsx)(Dt,{assistantId:O()})}function Nt(){return(0,Z.jsx)(Mt,{},O())}export{Nt as IdentityPageRoute};
|