@vellumai/web 0.10.11-dev.202607221913.60a3564 → 0.10.11-dev.202607222129.31c06e5
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/{AnimatePresence-C8APSgIu.js → AnimatePresence-C42g9zWi.js} +3 -3
- package/dist/assets/{BundleConfirmPage-DNYvq-iC.js → BundleConfirmPage-3mylM4ZL.js} +1 -1
- package/dist/assets/{Combination-CRZ7Bg3f.js → Combination-DXrVEfaA.js} +1 -1
- package/dist/assets/{about-page-XGv9RAQu.js → about-page-CDdCEGZl.js} +1 -1
- package/dist/assets/{account-page-Bf2PEUv4.js → account-page-CzZuoekz.js} +1 -1
- package/dist/assets/{account-shell-CGkhTBfc.js → account-shell-Bw5tLjak.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-CuypU3Yl.js → acp-run-detail-panel-DssICbn8.js} +4 -4
- package/dist/assets/{activity-steps-panel-BeVPR67-.js → activity-steps-panel-CeLVlAeY.js} +1 -1
- package/dist/assets/{add-credits-modal-BPS1WgVs.js → add-credits-modal-BFTdUmH6.js} +1 -1
- package/dist/assets/ai-page-ukSnDSJr.js +1 -0
- package/dist/assets/{animated-avatar-D36iTfMF.js → animated-avatar-6bSYRHZr.js} +1 -1
- package/dist/assets/{api-DEsuNFB4.js → api-CxAtNZ-r.js} +1 -1
- package/dist/assets/api-DqHVnn1b.js +1 -0
- package/dist/assets/{api-key-screen-nVrKzGm4.js → api-key-screen-DD_TJKco.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-DuuDCLuS.js → assistant-feature-flag-store-Bh-_qc7v.js} +1 -1
- package/dist/assets/{assistant-status-panel-SfdM2T3V.js → assistant-status-panel-gpwr0glD.js} +1 -1
- package/dist/assets/auth-store-Lzg3kiaw.js +2 -0
- package/dist/assets/{background-task-detail-panel-Bqwjrblv.js → background-task-detail-panel-BCXH3MXV.js} +1 -1
- package/dist/assets/billing-page-BZwgqWS1.js +3 -0
- package/dist/assets/{bookmarks-page-_SrYM_K_.js → bookmarks-page-B-PbfvFN.js} +1 -1
- package/dist/assets/{browser-CUpmd8oz.js → browser-Cvy3lr__.js} +2 -2
- package/dist/assets/{build-state-Cli1x11w.js → build-state-Bo2Ut5Js.js} +1 -1
- package/dist/assets/button-CW7wKp2r.js +1 -0
- package/dist/assets/{card-D8zyWtZh.js → card-Cf8bWrcq.js} +1 -1
- package/dist/assets/{channels-page-route-Bs1E-pfl.js → channels-page-route-DEwl411M.js} +2 -2
- package/dist/assets/chat-CNlH625o.js +1 -0
- package/dist/assets/chat-markdown-message-CjK8FRpm.js +2 -0
- package/dist/assets/{checkbox-1DytZ46G.js → checkbox-D5aqx2QZ.js} +1 -1
- package/dist/assets/{client-feature-flag-store-BI4z6UOY.js → client-feature-flag-store-BOcAh56y.js} +1 -1
- package/dist/assets/{command-palette-DaLkHNJq.js → command-palette-DNujIsf0.js} +1 -1
- package/dist/assets/{command-palette-window-page-DRHq4liK.js → command-palette-window-page-mWNMMe4I.js} +1 -1
- package/dist/assets/{community-page-BxNGowwV.js → community-page-DEcDCjsQ.js} +1 -1
- package/dist/assets/{confirm-dialog-Zyfei9GV.js → confirm-dialog-DxBl6zcI.js} +1 -1
- package/dist/assets/{connect-page-BupENOsi.js → connect-page-DuBhY8KD.js} +1 -1
- package/dist/assets/{consent-controls-a3lLNrbR.js → consent-controls-HYKKj225.js} +1 -1
- package/dist/assets/contacts-page-route-BS2duMoh.js +1 -0
- package/dist/assets/{credential-entry-page-Bo9MyWJX.js → credential-entry-page-CVOU9a8m.js} +1 -1
- package/dist/assets/{credentials-page-BnA14a0T.js → credentials-page-DDgYexAA.js} +1 -1
- package/dist/assets/{debug-page-Cgc5gCcZ.js → debug-page-B_us491I.js} +3 -3
- package/dist/assets/{deploy-dialogs-CHne8RuR.js → deploy-dialogs-CB5PSyxZ.js} +1 -1
- package/dist/assets/{detail-card-BXVPDa5J.js → detail-card-CAHT277C.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CvmF0YEf.js → detail-panel-stop-button-26G26Tqs.js} +1 -1
- package/dist/assets/developer-page-Dqug_k0U.js +1 -0
- package/dist/assets/{dictation-overlay-page-DFB9tRnQ.js → dictation-overlay-page-Rz3bqW3f.js} +1 -1
- package/dist/assets/{dist-Krx5xY9z.js → dist-B_4-HXSm.js} +1 -1
- package/dist/assets/{dist-y8XVYHzD.js → dist-D7fbUVVD.js} +1 -1
- package/dist/assets/{dist-CO5a5--H.js → dist-V7BKcICH.js} +1 -1
- package/dist/assets/{dist-Cul7ysiV.js → dist-kYT5dDAe.js} +1 -1
- package/dist/assets/{document-viewer-page-Czia2m4a.js → document-viewer-page-DmHPShuz.js} +1 -1
- package/dist/assets/{dropdown-BxYrCXBS.js → dropdown-DQozlhbb.js} +1 -1
- package/dist/assets/{emails-page-BUejCja5.js → emails-page-s9TxP6jP.js} +1 -1
- package/dist/assets/{esm-CtFJECNT.js → esm-BGZHdoYP.js} +2 -2
- package/dist/assets/{esm-BvREcXsb.js → esm-CZhfXk6a.js} +2 -2
- package/dist/assets/{esm-CABHbixu.js → esm-Da6ZHZYd.js} +2 -2
- package/dist/assets/{esm-u9ag4ek2.js → esm-DcTPJLRl.js} +2 -2
- package/dist/assets/esm-LOX7qY3n.js +2 -0
- package/dist/assets/{esm-Dy0d6BZB.js → esm-hFTNI1fw.js} +2 -2
- package/dist/assets/feature-flag-catalog-W5kYlNH2.js +1 -0
- package/dist/assets/{file-editor-CmUOlTjl.js → file-editor-BdFicqX_.js} +1 -1
- package/dist/assets/{file-markdown-BXMDJYDD.js → file-markdown-BCMtcYze.js} +1 -1
- package/dist/assets/{general-page-9SnnE5sd.js → general-page-DsrG3cM2.js} +1 -1
- package/dist/assets/{haptics-CXVXviY1.js → haptics-ThOnpgA-.js} +2 -2
- package/dist/assets/{hatching-screen-rf3Z0Gxk.js → hatching-screen-CuzULcU_.js} +1 -1
- package/dist/assets/home-page-route-Cc3ksf3X.js +1 -0
- package/dist/assets/{hosting-screen-C3GrkYPJ.js → hosting-screen-DufVMlwF.js} +1 -1
- package/dist/assets/identity-page-route-CUrEsO_0.js +7 -0
- package/dist/assets/index-BRSW3eiH.css +2 -0
- package/dist/assets/index-C7ix_asE.js +217 -0
- package/dist/assets/{input-ZpyYt_a0.js → input-D3MhHg0d.js} +1 -1
- package/dist/assets/{inspect-page-BRT1YIxa.js → inspect-page-BUAbv6xj.js} +4 -4
- package/dist/assets/{integrations-page-lel-Jqn3.js → integrations-page-9JcrAORp.js} +1 -1
- package/dist/assets/{intelligence-layout-Cn7wBfns.js → intelligence-layout-DJjUScCy.js} +1 -1
- package/dist/assets/{library-detail-page-BqVI_6aQ.js → library-detail-page-BCAZmbR6.js} +1 -1
- package/dist/assets/{library-page-DQlfLucf.js → library-page-CiTHHvZ5.js} +1 -1
- package/dist/assets/{list-row-CFyYr-FU.js → list-row-CVw67M2Z.js} +1 -1
- package/dist/assets/{login-flow-BV1EIzHx.js → login-flow-DYrO-od6.js} +1 -1
- package/dist/assets/{login-page-BTBlwv0-.js → login-page-DAFzFbRp.js} +1 -1
- package/dist/assets/{logout-page-Dsa6YQJt.js → logout-page-CsPkQ-4I.js} +1 -1
- package/dist/assets/{logs-layout-Bz1-7ocE.js → logs-layout-DBJaWlOK.js} +1 -1
- package/dist/assets/memory-page-route-CpPfBU9j.js +2 -0
- package/dist/assets/{memory-router-playground-page-DZYQAcku.js → memory-router-playground-page-DfGhXcZW.js} +1 -1
- package/dist/assets/{menu-C9SOvGlk.js → menu-DSB0wFjY.js} +1 -1
- package/dist/assets/{metric-card-DDHse5we.js → metric-card-TrndloL3.js} +1 -1
- package/dist/assets/{misc-D0u5tzSd.js → misc-BMp6WHdm.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-DSbq4sER.js → mobile-sidebar-drawer-CVT3O8os.js} +1 -1
- package/dist/assets/{modal-BtcwNEBj.js → modal-D_Y2RPD5.js} +1 -1
- package/dist/assets/mutation-error-CSy2D6ry.js +1 -0
- package/dist/assets/native-anchor-ChGbTnsU.js +1 -0
- package/dist/assets/{native-file-CIQQYbIp.js → native-file-CKFw72Il.js} +2 -2
- package/dist/assets/{notice-DkAWz47A.js → notice-CvJ7MBx5.js} +1 -1
- package/dist/assets/{notifications-page-DegIVhms.js → notifications-page-DcHyVoSk.js} +1 -1
- package/dist/assets/{oauth-complete-page-COVKYmQo.js → oauth-complete-page-DjKBNbdN.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BY0q9SCv.js → oauth-popup-complete-page-2KKVC5zM.js} +1 -1
- package/dist/assets/{page-empty-state-Co5e7lOF.js → page-empty-state-DhwyXbFT.js} +1 -1
- package/dist/assets/{page-shell-CAoXXReY.js → page-shell-BUD21prh.js} +1 -1
- package/dist/assets/{pairing-page-B-d3KfNN.js → pairing-page-7NMcVDJj.js} +1 -1
- package/dist/assets/{panel-item-An-BBeyL.js → panel-item-D1WbMkez.js} +1 -1
- package/dist/assets/{personality-page-BPldAcdE.js → personality-page-CwaMBzXV.js} +1 -1
- package/dist/assets/plans-page-Cre3Gpys.js +1 -0
- package/dist/assets/{platform-loopback-page-BKhQMyfg.js → platform-loopback-page-CIcVs3UP.js} +1 -1
- package/dist/assets/{plugin-detail-page-DZZ8cqNq.js → plugin-detail-page-R7HOcOd1.js} +1 -1
- package/dist/assets/{popover-Bl6742nZ.js → popover-BglbovUA.js} +1 -1
- package/dist/assets/privacy-page-CTQpOjs-.js +1 -0
- package/dist/assets/{privacy-screen-T1Es2Mbp.js → privacy-screen-DgHmBdN-.js} +1 -1
- package/dist/assets/{progress-bar-Bqv7D4mZ.js → progress-bar-DrwFU9Ti.js} +1 -1
- package/dist/assets/{provider-callback-page-UYIaiqij.js → provider-callback-page-kcYxB4WF.js} +1 -1
- package/dist/assets/{provider-signup-page-BZbQ9sDo.js → provider-signup-page-D9aI4WFt.js} +1 -1
- package/dist/assets/{proxy-BzlH_XAe.js → proxy-DoUA9mK6.js} +1 -1
- package/dist/assets/{quick-input-page-CSlyR24V.js → quick-input-page-D2Bqa3St.js} +1 -1
- package/dist/assets/{research-mock-page-9ARkjErx.js → research-mock-page-C6zrZtBI.js} +1 -1
- package/dist/assets/research-onboarding-route-AYDHEowO.js +43 -0
- package/dist/assets/{review-terms-screen-CShEkhkr.js → review-terms-screen-BSa9jNvG.js} +1 -1
- package/dist/assets/{risk-DIRsQZCZ.js → risk-C-ZyBTAb.js} +1 -1
- package/dist/assets/{schedules-page-CnnnCYfu.js → schedules-page-gqD1Tbf8.js} +1 -1
- package/dist/assets/{select-assistant-screen-CWxEexKs.js → select-assistant-screen-CFvCmydl.js} +1 -1
- package/dist/assets/{setting-row-BL-mNsNh.js → setting-row-DbMFAasE.js} +1 -1
- package/dist/assets/settings-divider-RhnS0iml.js +1 -0
- package/dist/assets/{settings-layout-UOu5ylBm.js → settings-layout-XYxLMpW0.js} +1 -1
- package/dist/assets/share-feedback-modal-Bjh3dK-n.js +1 -0
- package/dist/assets/{shared-ui-BQzVwlXn.js → shared-ui-CUd8SsYi.js} +1 -1
- package/dist/assets/{sidebar-tree-RaVaSMU0.js → sidebar-tree-CDqUGPSK.js} +1 -1
- package/dist/assets/{signup-page-C7h6qevI.js → signup-page-DgYRwrxX.js} +1 -1
- package/dist/assets/{signup-shell-C--ZjbjA.js → signup-shell-BXZMEgBY.js} +1 -1
- package/dist/assets/{site-favicon-DewrgH-a.js → site-favicon-DHBOONR1.js} +1 -1
- package/dist/assets/{skill-detail-page-mxE2bsEv.js → skill-detail-page-Dnh8ep5N.js} +1 -1
- package/dist/assets/{skill-detail-panel-Dzc1BjkB.js → skill-detail-panel-DIn7RLCC.js} +1 -1
- package/dist/assets/{skills-C7LCNEFA.js → skills-BFnEzvAC.js} +1 -1
- package/dist/assets/{src-BNYQ8guL.js → src-BT0gNVcT.js} +2 -2
- package/dist/assets/{start-screen-9oDT_2kX.js → start-screen-CJb-0lgs.js} +1 -1
- package/dist/assets/{subagent-detail-panel-CEK2SOmH.js → subagent-detail-panel-V44LtNl6.js} +1 -1
- package/dist/assets/{subagent-store-fW_6VjMe.js → subagent-store-CPEG25fH.js} +1 -1
- package/dist/assets/superpowers-page-X0kSM_TF.js +1 -0
- package/dist/assets/{system-events-page-BXQGR9rS.js → system-events-page-Duos2ubJ.js} +1 -1
- package/dist/assets/{tag-B6WeUtBW.js → tag-CJyI1Y2J.js} +1 -1
- package/dist/assets/{theme-stage-page-DXdUqPSk.js → theme-stage-page-BU-Gj4c2.js} +1 -1
- package/dist/assets/tier-upgrade-resize-modal-CbRtJhAf.js +1 -0
- package/dist/assets/{tiptap-document-editor-BXHXu76M.js → tiptap-document-editor-D1aVS6nK.js} +2 -2
- package/dist/assets/{toast-Be8FEQ-I.js → toast-zHo1wvF9.js} +1 -1
- package/dist/assets/{toggle-QSEiPr3k.js → toggle-Ca1aoG-l.js} +1 -1
- package/dist/assets/{tool-detail-panel-BgEjIRst.js → tool-detail-panel-C-O4opDs.js} +1 -1
- package/dist/assets/typography-1kyF_Eu1.js +1 -0
- package/dist/assets/{upgrade-cancel-page-CsVBsIBD.js → upgrade-cancel-page-UaVSwAVr.js} +1 -1
- package/dist/assets/{upgrade-success-page-nRtieAwY.js → upgrade-success-page-CBs03tVb.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-DqplTJa2.js → use-assistant-identity-details-CKel0e_r.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-BYssdjD2.js → use-edge-swipe-back-Dv1ShCT7.js} +1 -1
- package/dist/assets/use-invite-link-dialog-BfVPh6F5.js +1 -0
- package/dist/assets/use-is-org-ready-Ba5vxuqM.js +1 -0
- package/dist/assets/{use-onboarding-login-Mfgj6Xuw.js → use-onboarding-login-DMLLDHRX.js} +1 -1
- package/dist/assets/{use-reduced-motion-CcGT6CHV.js → use-reduced-motion-DpK6cQN-.js} +1 -1
- package/dist/assets/{use-skill-actions-61i-zd4P.js → use-skill-actions-DPXX5qWL.js} +1 -1
- package/dist/assets/{use-skill-detail-files-ZX56pOWj.js → use-skill-detail-files-CuoCiyOy.js} +1 -1
- package/dist/assets/voice-page-DdjI8A76.js +1 -0
- package/dist/assets/{weather-forecast-display-DIlvnndQ.js → weather-forecast-display-0GtxW555.js} +1 -1
- package/dist/assets/{web-C_RyjuPn.js → web-BgxqKmFT.js} +1 -1
- package/dist/assets/{web-D1Wdlc7e.js → web-TTULY5zV.js} +1 -1
- package/dist/assets/{welcome-screen-DazDV-Xb.js → welcome-screen-DZhajJW3.js} +1 -1
- package/dist/assets/{workflow-detail-panel-DvACgzj_.js → workflow-detail-panel-Cw0kRLTK.js} +1 -1
- package/dist/assets/workspace-page-7j1DZUlp.js +1 -0
- package/dist/index.html +52 -51
- package/package.json +1 -1
- package/dist/assets/ai-page-DmgRQHNM.js +0 -1
- package/dist/assets/api-4X-X5R5M.js +0 -1
- package/dist/assets/auth-store-DmFYd_Lh.js +0 -2
- package/dist/assets/billing-page-KLL3-gsD.js +0 -3
- package/dist/assets/button-BQVYX8n_.js +0 -1
- package/dist/assets/chat-BDhsGoUo.js +0 -1
- package/dist/assets/chat-markdown-message-DdvPHLTI.js +0 -2
- package/dist/assets/contacts-page-route-DwfcqQRi.js +0 -1
- package/dist/assets/developer-page-CvkSnIsB.js +0 -1
- package/dist/assets/esm-B-GaVjH1.js +0 -2
- package/dist/assets/feature-flag-catalog-XCUDf5iL.js +0 -1
- package/dist/assets/home-page-route-2K3P_hNP.js +0 -1
- package/dist/assets/identity-page-route-D9xF7A6I.js +0 -7
- package/dist/assets/index-BTyMkqXw.js +0 -217
- package/dist/assets/index-CtMfDVgi.css +0 -2
- package/dist/assets/memory-page-route-qt7Gsc8n.js +0 -2
- package/dist/assets/mutation-error-C9sr8Rue.js +0 -1
- package/dist/assets/plans-page-C1AMOAUn.js +0 -1
- package/dist/assets/privacy-page-DZ8EItv9.js +0 -1
- package/dist/assets/research-onboarding-route-BbbR7D_b.js +0 -43
- package/dist/assets/settings-divider-jsYVGphg.js +0 -1
- package/dist/assets/share-feedback-modal-CVaN1Q2a.js +0 -1
- package/dist/assets/superpowers-page-BmHwZ5QG.js +0 -1
- package/dist/assets/tier-upgrade-resize-modal-_oeYFLBS.js +0 -1
- package/dist/assets/typography-Cqi8q9o7.js +0 -1
- package/dist/assets/use-invite-link-dialog-CTb5kAaK.js +0 -1
- package/dist/assets/use-is-org-ready-CiJgEDMB.js +0 -1
- package/dist/assets/voice-page-C4ka3T0e.js +0 -1
- package/dist/assets/workspace-page-9gWqH9ZL.js +0 -1
- /package/dist/assets/{a2a-invite-VS3p3CfD.js → a2a-invite-sGxHSsPS.js} +0 -0
- /package/dist/assets/{app-info-Clwt3pCt.js → app-info-DDWMarAq.js} +0 -0
- /package/dist/assets/{app-types-XM5qKBD0.js → app-types-CR9QB0-8.js} +0 -0
- /package/dist/assets/{archive-redirect-page-Brvq3ES5.js → archive-redirect-page-emWqj2aZ.js} +0 -0
- /package/dist/assets/{billing-redirect-page-B3C0OqCH.js → billing-redirect-page-BFcz_1bP.js} +0 -0
- /package/dist/assets/{build.umd-Cygy7skA.js → build.umd-CW7LiBLq.js} +0 -0
- /package/dist/assets/{contacts-gateway-C1Oif2mf.js → contacts-gateway-C1Yhfk72.js} +0 -0
- /package/dist/assets/{danger-zone-redirect-page-DjzXSO6Q.js → danger-zone-redirect-page-CKqC2kf5.js} +0 -0
- /package/dist/assets/{definitions-yU7UnVpH.js → definitions-BUCExH-9.js} +0 -0
- /package/dist/assets/{definitions-BEx8SBhF.js → definitions-DpZNNWA7.js} +0 -0
- /package/dist/assets/{devices-redirect-page-aDimdAFs.js → devices-redirect-page-BBmdT-cM.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-D8lRMt3A.js → emoji-catalog-data-Do3FUA8t.js} +0 -0
- /package/dist/assets/{environment-store-R_3zZFKL.js → environment-store-geigPfHz.js} +0 -0
- /package/dist/assets/{esm-BhZb3XhL.js → esm-BNfE-1QY.js} +0 -0
- /package/dist/assets/{format-file-size-BSrdQr7P.js → format-file-size-B9DWgk-8.js} +0 -0
- /package/dist/assets/{get-memory-stats-KWGzIlTp.js → get-memory-stats-CswQQLY0.js} +0 -0
- /package/dist/assets/{keyboard-shortcuts-redirect-page-Cwga2alP.js → keyboard-shortcuts-redirect-page-BlXA_79i.js} +0 -0
- /package/dist/assets/{latest-assistant-text-BKts4hYK.js → latest-assistant-text-CQ8YGbvQ.js} +0 -0
- /package/dist/assets/{link-click-Cw5JZikw.js → link-click-B_ZqHynd.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-2XcmxqFN.js → onboarding-step-layout-CEt9JOpN.js} +0 -0
- /package/dist/assets/{password-reset-page-BJ68aXQ5.js → password-reset-page-DzLdCWhJ.js} +0 -0
- /package/dist/assets/{pdf-aq5Mn3GZ.js → pdf-BFBTGjwO.js} +0 -0
- /package/dist/assets/{plugin-attribution-6W3_ulYk.js → plugin-attribution-meUNq3wV.js} +0 -0
- /package/dist/assets/{plugins-page-DbqKT2CS.js → plugins-page-CeEkVNFM.js} +0 -0
- /package/dist/assets/{profile-metadata-CMym5q9r.js → profile-metadata-C6i7Ro9a.js} +0 -0
- /package/dist/assets/{provider-key-ACM9xzKs.js → provider-key-BPINSkGG.js} +0 -0
- /package/dist/assets/{schedules-CqDlgP0M.js → schedules-CL3Ox7Jc.js} +0 -0
- /package/dist/assets/{security-redirect-page-x1aDP81r.js → security-redirect-page-DYh8CKKb.js} +0 -0
- /package/dist/assets/{skills-page-bdypLibR.js → skills-page-CX46pcIo.js} +0 -0
- /package/dist/assets/{sounds-redirect-page-Blt0vV_7.js → sounds-redirect-page-DfVvXEAS.js} +0 -0
- /package/dist/assets/{status-badge-pill-0N6rTEBg.js → status-badge-pill-j3ke1d9o.js} +0 -0
- /package/dist/assets/{system-events-redirect-page-CMriM4T-.js → system-events-redirect-page-BHASNLky.js} +0 -0
- /package/dist/assets/{three-dot-indicator-CwchtNVS.js → three-dot-indicator-BuZzHFUJ.js} +0 -0
- /package/dist/assets/{usage-redirect-page-CYLunqbd.js → usage-redirect-page-1zbr09t0.js} +0 -0
- /package/dist/assets/{use-copy-to-clipboard-D3nUm_6n.js → use-copy-to-clipboard-Ap1ESW2j.js} +0 -0
- /package/dist/assets/{web-DwtkFwhF.js → web-Cfu1-OYV.js} +0 -0
- /package/dist/assets/{web-DE01jWtm.js → web-CpMgd0X0.js} +0 -0
- /package/dist/assets/{web-D2t1-p2V.js → web-D5EBYCt2.js} +0 -0
- /package/dist/assets/{web-DNkvgjT6.js → web-DT7Uml3n.js} +0 -0
- /package/dist/assets/{web-DK4RzUrM.js → web-D_z4FjB0.js} +0 -0
- /package/dist/assets/{web-DoV8m3zw.js → web-F3CAps0-.js} +0 -0
- /package/dist/assets/{xterm-DUb6-aPw.js → xterm-BSc05cUt.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-D82wciIP.js → xterm-addon-fit-CW_qH798.js} +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-anSemq95.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{m as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./pencil-CsnkG5VN.js";import{t as p}from"./plus-DZZypDUF.js";import{t as m}from"./x-CswtfvgS.js";import{t as h}from"./tag-B6WeUtBW.js";import{t as g}from"./input-ZpyYt_a0.js";import{i as _,r as v,t as y}from"./dist-Cul7ysiV.js";import{n as b}from"./toast-Be8FEQ-I.js";import{n as x,t as S}from"./create-selectors-8NePGNlX.js";import{ct as C,f as w,o as T,y as E}from"./local-mode-Dydd46cS.js";import{Gn as D,Or as O,Tr as k,V as A,Wn as j,bn as M,tt as N,xn as P}from"./sdk.gen-BR-xXIZm.js";import{r as ee}from"./api-errors-CoE1wFl2.js";import{A as F,B as te,L as I,R as ne,n as re,z as ie}from"./auth-store-DmFYd_Lh.js";import{a as L,o as R,r as ae}from"./api-DEsuNFB4.js";import{u as oe}from"./routes-D4ff4ONd.js";import{n as se}from"./platform-detection-BBQ3eUv5.js";import{a as ce}from"./feature-flag-catalog-XCUDf5iL.js";import{o as le,s as ue}from"./prechat-mDxOfWth.js";import{t as de}from"./browser-timezone-2SnmKDjM.js";import{c as fe}from"./conversation-list-fetchers-DKtnmlFF.js";import{i as pe,n as me,r as he,t as ge}from"./research-onboarding-persistence-C4LT0Ekr.js";import{A as _e,B as ve,C as ye,D as be,E as xe,F as Se,I as Ce,L as we,M as Te,N as Ee,O as De,P as Oe,R as ke,S as z,T as Ae,V as B,a as je,d as V,f as Me,g as Ne,i as Pe,j as Fe,k as Ie,m as Le,o as H,p as Re,r as ze,s as Be,t as U,v as Ve,w as He,x as W,y as Ue}from"./proxy-BzlH_XAe.js";import{t as We}from"./AnimatePresence-C8APSgIu.js";import{t as G}from"./use-reduced-motion-CcGT6CHV.js";import{t as K}from"./animated-avatar-D36iTfMF.js";import{Da as Ge,Ea as Ke,En as qe,Es as Je,Fn as Ye,Fo as Xe,Ia as Ze,Kn as Qe,Nn as $e,On as et,Rr as tt,Tn as nt,Ws as q,Yo as rt,_n as it,_t as at,gn as ot,kn as st,sn as ct,vn as lt,vt as J,yn as ut}from"./index-BTyMkqXw.js";import{c as dt,i as ft,l as pt,n as mt,r as ht,s as gt,t as _t}from"./latest-assistant-text-BKts4hYK.js";import{n as vt,t as yt}from"./onboarding-step-layout-2XcmxqFN.js";import{n as bt}from"./plugin-attribution-6W3_ulYk.js";var xt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function St(e,t){return Te(e)?e[xt(0,e.length,t)]:e}var Ct=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return wt(this.animations,`duration`)}get iterationDuration(){return wt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function wt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Tt=class extends Ct{then(e,t){return this.finished.finally(e).then(()=>{})}};function Et(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=xe(i,a,o);return t?s(r):s}function Dt(e,t){return e in t}var Ot=class extends Be{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Dt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Me()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},Y=e(n(),1);function kt(e){let t=B(()=>z(e)),{isStatic:n}=(0,Y.useContext)(ze);if(n){let[,n]=(0,Y.useState)(e);(0,Y.useEffect)(()=>t.on(`change`,n),[])}return t}function At(e,t){let n=kt(t()),r=()=>n.set(t());return r(),ve(()=>{let t=()=>Fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),_e(r)}}),n}function jt(e){W.current=[],e();let t=At(W.current,e);return W.current=void 0,t}function Mt(e,t,n,r){if(typeof e==`function`)return jt(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return Pt(e,t,n,r);let i=typeof t==`function`?t:Et(t,n,r),a=Array.isArray(e)?Nt(e,i):Nt([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function Nt(e,t){let n=B(()=>[]);return At(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function Pt(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=Mt(e,t,n[o],r);return a}function Ft(e){return typeof e==`object`&&!Array.isArray(e)}function It(e,t,n,r){return e==null?[]:typeof e==`string`&&Ft(t)?Ne(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Lt(e,t,n){return e*(t+1)+n*t}function Rt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function zt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(ke(e,i),r--)}}function Bt(e,t,n,r,i,a){zt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ie(i,a,r[o]),easing:St(n,o)})}function Vt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function Ht(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Ut=`easeInOut`,Wt=20;function Gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Rt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Rt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Jt(e),{delay:l=0,times:u=He(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=ye(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Zt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=De(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&Ae(u,T),c.length===1&&c.unshift(null),m&&we(m<Wt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Wt} or apply repeat at the sequence level instead.`),m&&m<Wt){let e=b>0?_/b:0;b=Lt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Ee(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:St(f,e-1))}Vt(u,m,e)}let E=w+b;Bt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ue(p)){let e=Kt(p,s);_(m,h,qt(`default`,e))}else{let e=It(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Kt(r,s);for(let e in m)_(m[e],Yt(h,e),qt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(Ht);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Se(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Ut)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Kt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function qt(e,t){return t[e]||(t[e]=[]),t[e]}function Jt(e){return Array.isArray(e)?e:[e]}function Yt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Xt=e=>typeof e==`number`,Zt=e=>e.every(Xt);function Qt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Le(e)&&!Re(e)?new je(t):new H(t);n.mount(e),V.set(e,n)}function $t(e){let t=new Ot({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function en(e,t){return Ue(e)||typeof e==`number`||typeof e==`string`&&!Ft(t)}function tn(e,t,n,r){let i=[];if(en(e,t))i.push(Pe(e,Ft(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=It(e,t,r),o=a.length;Ce(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Qt:$t;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ve(c,{...t,transition:l},{}))}}return i}function nn(e,t,n){let r=[];return Gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=z(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:be}).forEach(({keyframes:e,transition:t},n)=>{r.push(...tn(n,e,t))}),r}function rn(e){return Array.isArray(e)&&e.some(Array.isArray)}function an(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),rn(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=nn(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=tn(e,i,{...c,...r},t)}let l=new Tt(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{ke(t.animations,l)})),l}return i}var on=an(),sn=`grounded`,cn=12;function ln(e,t){let n=e.slice(0,cn).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
|
-
`);return n?`
|
|
3
|
-
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
|
-
${n}
|
|
5
|
-
|
|
6
|
-
Add a "plugins" array as the FIRST key in your JSON object, ${t?`before "claims" and "suggestions"`:`before "claims"`}: the 1-2 capabilities from the list above (exact names) that best fit who I am — judged by what you researched about my real role, stack, and day-to-day work. (Emit it first so setup can start while you finish the rest.) These get set up for me automatically as part of getting started, so pick by overall fit to ME, not to any single suggestion. Prefer fewer over forcing a match; use [] if nothing clearly fits. Example: "plugins": ["<exact name from the list above>"]. ${t?`Don't reference the setup in the claims or suggestions text.`:`Don't reference the setup in the claims text.`}
|
|
7
|
-
`:``}function un({firstName:e,lastName:t,occupation:n,hobbies:r,timezone:i},a=[],{includeSuggestions:o=!0}={}){let s=[e.trim(),t.trim()].filter(Boolean).join(` `),c=n.trim(),l=(r??[]).map(e=>e.trim()).filter(Boolean).join(`, `),u=i?.trim()??``,d=ln(a,o),f=d?`"plugins": ["<exact name from the list above>"], `:``,p=[s?`My name is ${s}.`:``,c?`I work as ${c}.`:``,l?`My hobby is ${l}.`:``].filter(Boolean).join(` `),m=p?[p,u?`My timezone is ${u}.`:``].filter(Boolean).join(` `):`I'd like you to get to know me before we start working together.`,h=o?` "suggestions": [ { "suggestion": "I'll find the 3 newest arXiv eval papers worth your time", "prompt": "Find me the 3 newest arXiv eval papers worth reading." }, { "suggestion": "I'll draft a crisp summary of the latest model-serving trade-offs", "prompt": "Draft me a short summary of the latest model-serving trade-offs." }, { "suggestion": "Connect GitHub and I'll triage your stalest issues", "prompt": "Connect to GitHub and triage my oldest open issues." }, { "suggestion": "I'll plan a weekend climbing trip near Boulder", "prompt": "Plan me a weekend climbing trip near Boulder." } ]`:``,g=`{ ${f}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user", "https://example-infra.com/about"] }, { "claim": "Based in Boulder, CO", "confidence": "maybe", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Into climbing and the outdoors", "confidence": "guessing", "sources": [] } ]${h?`,${h}`:``} }`;return`${m}
|
|
8
|
-
|
|
9
|
-
Get to know me. Search the web for what's publicly known about me, and infer a handful of things about who I am: what I do, my role, where I'm based, what I'm into, anything that would help you assist me better. Prefer sources people author about themselves — LinkedIn, a personal site, GitHub, an employer's team page, published work, public social profiles. Never fetch or cite people-search or background-check aggregators (Instant Checkmate, Spokeo, BeenVerified, TruePeopleSearch, Whitepages, and similar); data-broker directories (ZoomInfo, RocketReach, Apollo) may corroborate another source but must never be a claim's only basis.
|
|
10
|
-
|
|
11
|
-
IDENTITY GATE — decide who a page is about before you use it: a name match alone is NEVER enough to attribute a page to me. Attribute it to me only when it also corroborates something I stated — my role, my hobby, or a location consistent with my timezone if I gave one. If several people share my name and none clears that bar, or you find no verifiable match at all, then I have no public profile you can use: return ONLY inferences from what I stated above, each labeled "guessing" with "sources": []. An honest near-empty card beats a stranger's biography. If my details above read as placeholder or joke input rather than a real identity, skip the web search and return an empty claims array.
|
|
12
|
-
|
|
13
|
-
Treat the name, role, and hobby I provided above as first-party context from me. Use public sources to enrich that context, not to override or correct it. If public sources use a different title or omit part of my stated role, do not frame my stated role as wrong; mention the public title only as supporting nuance when it is useful, and keep ${o?`claims and suggestions`:`claims`} aligned with my stated role.
|
|
14
|
-
|
|
15
|
-
CRITICAL: your final reply must be ONLY a JSON object. No preamble, no explanation, no prose, nothing before or after it. Do your thinking and searching, then respond with exactly this shape and nothing else:
|
|
16
|
-
|
|
17
|
-
${g}
|
|
18
|
-
|
|
19
|
-
Rules for "claims":
|
|
20
|
-
|
|
21
|
-
AT MOST 5 claims, typically 3 to 4. Never pad the list or inflate a confidence tier to seem thorough.
|
|
22
|
-
Phrase each claim in third person as a short headline ("Senior engineer at an AI infra startup", "Based in Boulder, CO", "Active climber on Mountain Project"). No multi-clause sentences, no em-dash asides, no explanations. Good: "Contributed to Chirps (vector-DB security)". Bad: "You've done real work in vector database security. You contributed to Chirps, a tool for scanning vector DBs for sensitive data".
|
|
23
|
-
Each claim must be independently true-or-false so I can remove the ones that are wrong.
|
|
24
|
-
Every specific in a claim (employer, title, publication, city) must appear in a source you actually fetched this turn — never synthesize or embellish specifics a source doesn't state.
|
|
25
|
-
"confidence" is earned per the identity gate: "confident" needs 2+ independent gate-passing sources, "maybe" needs exactly one, and a claim with no sources is an inference from my stated details and must be "guessing".
|
|
26
|
-
"sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
|
|
27
|
-
${o?`Rules for "suggestions":
|
|
28
|
-
|
|
29
|
-
Each suggestion is an object with two fields:
|
|
30
|
-
"suggestion": the offer in YOUR voice (the assistant), exactly as it appears on the clickable card — first-person "I" refers to you (whatever your name). Pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." Lead with the offer; no intake question in front of it — you gather the details in the follow-up conversation after the click.
|
|
31
|
-
"prompt": the same offer re-voiced as the message sent on the user's behalf when they click, in the USER's first person ("I"/"my" = the user) — what they'd say to take you up on it (suggestion "I'll find you 3 papers" → prompt "Find me 3 papers worth reading"). State the request; don't echo the assistant-voiced wording and don't ask a question back.
|
|
32
|
-
|
|
33
|
-
Generate EXACTLY 4 suggestions covering four DIFFERENT capabilities, each making me think "wait, you can do that?" Draw on your range — a quick researched answer, a recurring brief or monitor, a doc drafted in a live editor, an integration (GitHub, Gmail, Calendar, Slack, Linear) connected with a first action, or a hobby hook if research surfaced one — but pick what genuinely fits; don't force a fixed set.
|
|
34
|
-
Ground every suggestion in what you actually learned about me — my real role, stack, industry, and (if given) hobby. Specific to me, not generic assistant stuff; skip bare "summarize" or "draft a post."
|
|
35
|
-
CRITICAL: every suggestion must be a fast win you can deliver in the first reply, never a long-running build. NEVER suggest building an app, dashboard, tool, site, or tracker, or any multi-step "build me a ___" project — those kill the first impression. The ambitious build can come later in the conversation, never on the first card.
|
|
36
|
-
Keep each SHORT and skimmable: under 10 words, ONE clause, ONE artifact, no lists of three ("X, Y, and Z"). The reader scans four cards in seconds — a long line loses them.
|
|
37
|
-
`:``}${d}
|
|
38
|
-
${o?`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support, and lean on broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support.`}
|
|
39
|
-
Keep every string value simple so the JSON always parses: one line, no line breaks inside a value, and NO double-quote characters inside a value — use single quotes (or none) for emphasis, quoted names, or tool names. Output ONLY the JSON object. No code fence, no extra text.`}function dn({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var fn=3e3,pn=3e5,mn=`Failed to start your assistant. Please try again.`,hn=`Your assistant is taking longer than expected. Please try again.`,gn=e=>new Promise(t=>setTimeout(t,e));function _n({adoptExisting:e=!1,adoptAssistantId:n}={}){let[r,i]=(0,Y.useState)(!1),[a,o]=(0,Y.useState)(null),[s,c]=(0,Y.useState)(null),l=(0,Y.useRef)(!1),u=(0,Y.useRef)([]),d=(0,Y.useRef)(null),f=(0,Y.useCallback)(e=>{if(!d.current){d.current={kind:`ready`,id:e},i(!0);for(let t of u.current)t.resolve(e);u.current=[]}},[]),p=(0,Y.useCallback)(e=>{if(d.current)return;d.current={kind:`error`,message:e},c(e);let t=Error(e);for(let e of u.current)e.reject(t);u.current=[]},[]);return{start:(0,Y.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=pn;(async()=>{if(e&&n){let e=T(n);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?n:void 0;if(!e)try{let e=await R();if(e.ok)r=e.data.id,o(e.data.id);else{if(ne(e.status,e.error)){p(I);return}if(!te(e.status)){p(ee(e.error,void 0,mn));return}}}catch(e){t(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(hn);return}try{let e=await ae(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await ae());let t=ie(e);if(t.kind===`active`&&e.ok){a=e.data.id,o(a);break}if(t.kind===`error`){p(t.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await gn(fn)}if(e)for(;!await E();){if(i()){p(hn);return}await gn(fn)}else for(;;){try{if((await L(a)).ok)break}catch{}if(i()){p(hn);return}await gn(fn)}f(a)})()},[p,f,e,n]),ready:r,assistantId:a,error:s,awaitReady:(0,Y.useCallback)(()=>{let e=d.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{u.current.push({resolve:e,reject:t})})},[])}}async function vn(e,n){try{await A({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var yn=[`admin-copilot`],bn=[{plugin:`marketing-expert`,keywords:[`founder`,`cofounder`,`co founder`,`ceo`,`cmo`,`chief executive`,`chief marketing`,`entrepreneur`,`marketing`,`marketer`,`growth`,`brand`,`content`,`copywriter`,`copywriting`,`seo`,`demand gen`,`demand generation`,`sales`,`account executive`,`business development`,`creator`,`social media`,`community manager`]},{plugin:`git-workflow`,keywords:`developer.swe.programmer.coder.devops.dev ops.sre.site reliability.software engineer.software architect.backend engineer.back end engineer.frontend engineer.front end engineer.full stack engineer.fullstack engineer.platform engineer.infrastructure engineer.data engineer.machine learning engineer.ml engineer.qa engineer.embedded engineer.security engineer.staff engineer.principal engineer.solutions architect.tech lead.technical lead.engineering manager.engineering lead.head of engineering.director of engineering.vp of engineering.vp engineering.cto`.split(`.`)}];function xn(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function Sn(e,t){return e.includes(` ${t} `)}function Cn(e){let t=xn(e),n=[];for(let{plugin:e,keywords:r}of bn)r.some(e=>Sn(t,e))&&n.push(e);return n}function wn(e,t){let n=[...yn,...bt(),...Cn(e)],r=new Set,i=[];for(let e of n)!t.has(e)||r.has(e)||(r.add(e),i.push(e));return i}var Tn=1500,En=12e4,Dn=2;function On({complete:e,stableReads:t}){return e&&t>=Dn}function kn({sawCompletePayload:e}){return e?`done`:`error`}function An({sawCompletePayload:e}){return e}var jn=`vellum-ai`,Mn=new Set([`simple-memory`,`level-up`]);function Nn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function Pn(e){return e?.split(`/`)[0]?.trim()??``}function Fn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||Pn(r.source?.repo)===jn&&(Mn.has(e)||(n.add(e),t.push({name:e,description:Nn(i)})))}return{capabilities:t,validNames:n}}async function In(e){try{return Fn((await D({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function Ln(e,n){try{await j({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var Rn=32;function zn(e,t){return e.filter(e=>e.confidence===t).length}async function Bn({assistantId:e,conversationId:n,status:r,subject:i,claims:a,suggestions:o,plugins:s,installedPlugins:c}){try{await k({path:{assistant_id:e},body:{type:`onboarding_research`,...r===`done`?{daemon_event_id:`onboarding_research:${n}`}:{},fields:{conversation_id:n,status:r,self_reported_occupation:i.occupation,self_reported_hobbies:(i.hobbies??[]).slice(0,Rn),self_reported_timezone:i.timezone,claims:a,claim_count:a.length,claims_confident:zn(a,`confident`),claims_maybe:zn(a,`maybe`),claims_guessing:zn(a,`guessing`),suggestions:o,suggestion_count:o.length,plugins:s,installed_plugins:c}},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_telemetry`})}}var Vn=e=>new Promise(t=>setTimeout(t,e));function Hn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...wn(e,t),...n.filter(e=>t.has(e))])]}function Un(){let[e,n]=(0,Y.useState)({status:`idle`,claims:[],droppedClaims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,Y.useRef)(0),i=(0,Y.useRef)(null),a=(0,Y.useRef)(new Map),o=(0,Y.useRef)(Promise.resolve()),c=s(),l=(0,Y.useCallback)(({awaitAssistantId:e,subject:s,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(s);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};o.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],droppedClaims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,o=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await In(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=wn(s.occupation,p);for(let e of v)_.has(e)||_.set(e,Ln(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:un(s,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:se(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await P({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await N({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await M({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let S=Date.now()+En,C=``,w=0,T=!1,E=[],D=[],O=[],k=v;for(;Date.now()<S;){if(await Vn(Tn),h())return;let e=await M({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=_t(e.data?.messages??[]);if(r){let{claims:e,droppedClaims:i,suggestions:a,plugins:c,pluginsResolved:l,complete:u}=lt(r),d=c.filter(e=>p.has(e));for(let e of d)_.has(e)||_.set(e,Ln(t,e));l&&g();let f=Hn({role:s.occupation,validNames:p,modelPlugins:d});if(n({status:`running`,claims:e,droppedClaims:i,suggestions:a,installedPlugins:f,pluginCatalog:m}),E=e,D=a,O=c,k=f,u&&(o=!0),u&&!T&&(T=!0,Bn({assistantId:t,conversationId:x,status:`done`,subject:s,claims:e,suggestions:a,plugins:c,installedPlugins:f})),w=r===C?w+1:0,C=r,On({complete:u,stableReads:w}))break}}if(h())return;T||(T=!0,Bn({assistantId:t,conversationId:x,status:`error`,subject:s,claims:E,suggestions:D,plugins:O,installedPlugins:k})),n(e=>({...e,status:kn({sawCompletePayload:o})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),An({sawCompletePayload:o})&&r&&i&&(await vn(r,i),Ge(c,r))}})()},[c]),u=(0,Y.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,Y.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await Ln(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function Wn({removedClaims:e,rejectedAll:t}){if(t)return[`Correction: none of what you found in that web search is actually me —`,`it looks like you matched someone else with a similar name. Please`,`disregard everything from that search and don't remember any of it as`,`true about me. We'll build up what you actually know about me from here,`,`as we talk.`].join(` `);let n=e.map(e=>e.trim()).filter(Boolean);return n.length===0?null:[`Quick correction on what you found about me — these aren't true, so please`,`disregard them and don't remember them as facts about me:`,``,...n.map(e=>`- ${e}`)].join(`
|
|
40
|
-
`)}async function Gn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=Wn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:se(),clientMessageId:crypto.randomUUID()};await P({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await vn(e,n)}}var Kn=1500,qn=12e4,Jn=e=>new Promise(t=>setTimeout(t,e));async function Yn({awaitAssistantId:e,values:n,userName:r,assistantName:i}){let a,o;try{a=await e();let t=await N({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=t.data?.id,!t.response?.ok||!o)return;let s={conversationId:o,content:dt(n,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await P({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;await gt(a,ft(n));let c=Date.now()+qn,l=``,u=0,d=!1;for(;Date.now()<c;){await Jn(Kn);let e=await M({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=_t(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),pt({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await A({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function Xn(e){let t=e?.trim();return`You're about to begin your first conversation.${t?`\nYour name is ${t} — introduce yourself as ${t}.`:``}
|
|
41
|
-
Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
|
|
42
|
-
End with exactly one short question about something specific you already know about them (see your Onboarding Context) — a question they can answer in five words or less. If you know almost nothing about them yet, ask one specific, concrete question anyway (still five-word-answerable). Never ask what they want to do, what you're getting into, or anything else open-ended: an open question hands a stranger a blank page.
|
|
43
|
-
Keep it short! For this opening greeting only, don't use \`recall\` or read any files — just say hello. (This applies to the greeting alone; use your tools normally for everything the user asks afterward.)`}function Zn(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,...t?{timeZone:t}:{}}).format(n)}catch{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n)}}var X=l(),Qn=(0,Y.createContext)(null);function $n({size:e,children:t}){return(0,X.jsx)(Qn.Provider,{value:e,children:t})}function er(){let e=(0,Y.useContext)(Qn),[t,n]=(0,Y.useState)(()=>ht());return(0,Y.useEffect)(()=>{if(e)return;let t=()=>n(ht());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var tr={x:.5,y:.43},nr=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function rr(e){return nr[e%nr.length]??0}var ir=[1,0,1,0,1,0,1,0,1,0,0],ar=[.72,1],or=[.4,1],sr=[10,20],cr=50,lr={6:1.1};function ur(e){return(ar[ir[e]??1]??1)*(lr[e]??1)}function dr(e){return or[ir[e]??1]??1}function fr(e){return sr[ir[e]??1]??20}function pr(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function mr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function hr(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r-t*.03},{x:e*.72,y:r-t*.1},{x:e-i,y:i},{x:e-r,y:t*.72},{x:e-i,y:t-i},{x:i,y:t-i},{x:r,y:t*.5},{x:e-r,y:t*.3},{x:e*.28,y:t-r+t*.05},{x:e*.77,y:t-r}]}function gr(e,t,n,r,i){let a=e.x-t,o=e.y-n,s=Math.hypot(a,o)||1,c=Math.max(r,i);return{x:e.x+a/s*c,y:e.y+o/s*c}}function _r({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=er(),u=G(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=pr(c,l),h=m/2,g=m/2,_=mr(c,l)/m,v=mr(c,l),y=(0,Y.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),b=tr.x*c,x=tr.y*l,S=b-h,C=x-h,w=(0,Y.useMemo)(()=>hr(c,l,g),[c,l,g]);return(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:v*.62,height:16,left:b-v*.31,top:x+v*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,g=!u&&a?.char===r;if(f){let n=w[i.fromSlot],a=gr(n,b,x,c,l),s=ur(i.fromSlot),u=dr(i.fromSlot);return(0,X.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:cr},initial:!1,animate:{x:[n.x-h,a.x-h,a.x-h,S,S,S],y:[n.y-h,a.y-h,a.y-h,C,C,C],scale:[s,s,s,_*.7,_*1.08,_],opacity:[u,u,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,X.jsx)(K,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=w[a.toSlot],i=gr(n,b,x,c,l),o=ur(a.toSlot),s=dr(a.toSlot);return(0,X.jsx)(U.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:fr(a.toSlot)},initial:!1,animate:{x:[S,S,i.x-h,i.x-h,n.x-h,n.x-h],y:[C,C,i.y-h,i.y-h,n.y-h,n.y-h],scale:[_,_*.6,o,o,o*1.1,o],opacity:[1,0,0,s,s,s]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,X.jsx)(`div`,{style:{transform:`rotate(${rr(a.toSlot)}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:m,breathe:!1})})},r)}let v=y.get(r)??0;if(!d&&p(v))return null;let T=d?{x:b,y:x}:w[v];return(0,X.jsx)(U.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:m,height:m,zIndex:d?cr:fr(v)},initial:!1,animate:{x:T.x-h,y:T.y-h,scale:d?_:ur(v),opacity:d?1:dr(v)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,X.jsx)(`div`,{style:{transform:d?void 0:`rotate(${rr(y.get(r)??0)}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var vr=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`surprised`,color:`orange`},{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`quirky`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`dazed`,color:`orange`},{bodyShape:`star`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`flower`,eyeStyle:`angry`,color:`pink`},{bodyShape:`cloud`,eyeStyle:`curious`,color:`yellow`}],Z=S(x((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:vr,selectedIndex:0})},setSelectedIndex:t=>e({selectedIndex:t}),selectNext:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex+1)%e.characters.length})),selectPrev:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex-1+e.characters.length)%e.characters.length}))})));function yr(){let[e,t]=(0,Y.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,Y.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function br(){let e=J(),t=Z.use.characters(),n=Z.use.ensureGenerated(),r=G(),{w:i,h:a}=yr();(0,Y.useEffect)(()=>{e&&n(e)},[e,n]);let o=pr(i,a),s=(0,Y.useMemo)(()=>hr(i,a,o/2),[i,a,o]),c=i<640,l=new Set([4,7,8,9,10]);return!e||t.length===0?null:(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:t.map((t,n)=>{if(n===0)return null;let i=n-1;if(c&&l.has(i))return null;let a=s[i];if(!a)return null;let u=nr[i%nr.length]??0,d=o*ur(i),f=dr(i),p=fr(i);return(0,X.jsx)(`div`,{className:`absolute`,style:{left:a.x-d/2,top:a.y-d/2,width:d,height:d,zIndex:p,animation:r?void 0:`character-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ${.1+n*.05}s both`},children:(0,X.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,X.jsx)(K,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var xr=r(`flex w-full items-center gap-1.5 rounded-md border bg-[var(--field-bg)] px-3`,`border-[var(--field-border)] transition-[border-color,background-color] duration-150 ease-out`,`focus-within:border-[var(--border-active)]`),Sr=r(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,yt);function Q(e){return e.trim().toLowerCase()}function Cr(e,t,n=[],r=8){let i=Q(t),a=new Set(n.map(Q)),o=[];for(let t of e)if(!a.has(Q(t))&&((i.length===0||Q(t).includes(i))&&o.push(t),o.length>=r))break;return o}function wr({id:e,options:t,highlighted:n,showAddHint:i,onPick:a,onHover:o}){return(0,X.jsxs)(`ul`,{id:e,role:`listbox`,className:r(`absolute left-0 right-0 top-full z-50 mt-1.5 max-h-60 overflow-auto`,`rounded-lg bg-[var(--surface-lift)] p-1 shadow-[var(--shadow-popover)]`,`animate-[fadeInUp_0.12s_ease-out]`),children:[t.map((t,i)=>(0,X.jsx)(`li`,{id:`${e}-opt-${i}`,role:`option`,"aria-selected":i===n,onMouseDown:e=>{e.preventDefault(),a(t.value)},onMouseEnter:()=>o(i),className:r(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,i===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(p,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,X.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,X.jsx)(`span`,{className:`ml-auto shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:`↵ Enter`})]}):t.value},t.isAdd?`__add__${t.value}`:t.value)),i&&(0,X.jsx)(`li`,{role:`presentation`,className:`mt-0.5 border-t border-[var(--border-base)] px-2.5 pb-0.5 pt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Type anything and press ↵ to add your own`})]})}function Tr({htmlFor:e,required:t,children:n}){return(0,X.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function Er(e,t){(0,Y.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function Dr({label:e,placeholder:t,values:n,onChange:i,suggestions:a}){let o=(0,Y.useId)(),s=`tac-${o}`,c=`tac-list-${o}`,l=(0,Y.useRef)(null),[u,d]=(0,Y.useState)(``),[f,p]=(0,Y.useState)(!1),[m,g]=(0,Y.useState)(-1),_=(0,Y.useMemo)(()=>Cr(a,u,n),[a,u,n]),v=u.trim(),y=(0,Y.useMemo)(()=>{if(!v)return!1;let e=Q(v);return!(n.some(t=>Q(t)===e)||_.some(t=>Q(t)===e))},[v,n,_]),b=(0,Y.useMemo)(()=>{let e=_.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[_,y,v]);Er(l,()=>p(!1)),(0,Y.useEffect)(()=>{g(e=>e>=b.length?b.length-1:e)},[b.length]);let x=f&&b.length>0,S=!y;function C(e){let t=e.trim();t&&(n.some(e=>Q(e)===Q(t))||i([...n,t]),d(``),g(-1))}function w(e){i(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),p(!0),g(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?x&&m>=0?(e.preventDefault(),C(b[m].value)):u.trim()&&(e.preventDefault(),C(u)):e.key===`,`?(e.preventDefault(),C(u)):e.key===`Backspace`&&u.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&p(!1)}return(0,X.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,X.jsx)(Tr,{htmlFor:s,children:e}),(0,X.jsxs)(`div`,{className:r(xr,`min-h-9 flex-wrap py-1.5`),children:[(0,X.jsx)(rt,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,X.jsx)(h,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,X.jsx)(`input`,{id:s,role:`combobox`,"aria-expanded":x,"aria-controls":c,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${c}-opt-${m}`:void 0,autoComplete:`off`,className:r(Sr,`h-6 w-24`),placeholder:n.length===0?t:``,value:u,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:T})]}),x&&(0,X.jsx)(wr,{id:c,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:g})]})}var Or=`Reading.Writing.Cooking.Baking.Gardening.Photography.Painting.Drawing.Hiking.Running.Cycling.Swimming.Yoga.Climbing.Weightlifting.Gaming.Board games.Chess.Traveling.Cars.Woodworking.Knitting.Playing guitar.Playing piano.Singing.Dancing.Fishing.Camping.Surfing.Skiing.Snowboarding.Coffee.Wine.Birdwatching.Pottery.Investing.Podcasts.Movies.Soccer.Basketball.Tennis.Golf.Meditation.Volunteering.Astronomy.3D printing`.split(`.`);function kr(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Ar({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,a]=(0,Y.useState)(e),[o,s]=(0,Y.useState)(t),[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)([]),f=r.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,X.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,X.jsxs)(ot,{showCreatureFooter:!1,children:[(0,X.jsx)(br,{}),(0,X.jsxs)(`form`,{className:`relative z-10 mx-auto flex min-h-screen w-full max-w-sm flex-col items-center justify-center px-6 py-16 text-[var(--content-default)]`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,X.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:kr(.05),children:`Let's start with you.`}),(0,X.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:kr(.12),children:`A few details so I can get to know you.`}),(0,X.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,X.jsx)(`div`,{style:kr(.2,40),children:(0,X.jsx)(g,{label:(0,X.jsxs)(X.Fragment,{children:[`What should I call you?`,(0,X.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:r,onChange:e=>a(e.target.value),className:yt,autoFocus:!0,required:!0,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.27,30),children:(0,X.jsx)(g,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:yt,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.34,20),children:(0,X.jsx)(g,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:yt,required:!0,fullWidth:!0})}),(0,X.jsx)(`div`,{style:kr(.41,10),children:(0,X.jsx)(Dr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Or})})]}),(0,X.jsx)(`div`,{className:`mt-10 w-full`,style:kr(.5),children:(0,X.jsx)(i,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}function jr(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex();return(0,Y.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return et(i??`var(--surface-base)`)},[e,t,n])}function $({onBack:e,onNext:t,tone:n}){let r=jr(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=`color-mix(in srgb, ${i} 10%, transparent)`,o=`color-mix(in srgb, ${i} 18%, transparent)`;return(0,X.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-10 w-10 items-center justify-center rounded-full transition-colors duration-150`,style:{color:i,backgroundColor:a},onMouseEnter:e=>e.currentTarget.style.backgroundColor=o,onMouseLeave:e=>e.currentTarget.style.backgroundColor=a,children:(0,X.jsx)(u,{className:`h-4 w-4`})}),t?(0,X.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-10 w-10 items-center justify-center rounded-full transition-colors duration-150`,style:{color:i,backgroundColor:a},onMouseEnter:e=>e.currentTarget.style.backgroundColor=o,onMouseLeave:e=>e.currentTarget.style.backgroundColor=a,children:(0,X.jsx)(q,{className:`h-4 w-4`})}):null]})}async function Mr(e,t){try{let{data:n,error:r,response:i}=await O({path:{assistant_id:e},body:{text:t},parseAs:`blob`,throwOnError:!1});return r||!i?.ok||!n?null:n}catch{return null}}var Nr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Pr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Fr({onContinue:e,onBack:t,onForward:n,voiceEnabled:r=!1,assistantId:a=null}){let o=J(),s=Z.use.characters(),c=Z.use.ensureGenerated(),l=Z.use.selectedIndex(),p=Z.use.setSelectedIndex();(0,Y.useEffect)(()=>{o&&c(o)},[o,c]);let m=s.length,[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(``),[y,x]=(0,Y.useState)(!1),S=(0,Y.useRef)(!1),C=(0,Y.useRef)(null),{ref:w,size:T}=mt(),[E,D]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{m>0&&h===null&&g(Pr(m,l))},[m,l,h]),(0,Y.useEffect)(()=>{h&&p(h.centerChar)},[h,p]);let O=h?.centerChar;(0,Y.useEffect)(()=>{O!=null&&!S.current&&v(Nr[O%Nr.length])},[O]),(0,Y.useEffect)(()=>{y&&(C.current?.focus(),C.current?.select())},[y]);function k(e){if(!h||e===h.centerChar)return;let t=h.edgeOrder.indexOf(e);if(t<0)return;let n=[...h.edgeOrder];n[t]=h.centerChar,D({entering:{char:e,fromSlot:t},exiting:{char:h.centerChar,toSlot:t}}),g({centerChar:e,edgeOrder:n})}let A=()=>h&&k((h.centerChar+1)%m),j=()=>h&&k((h.centerChar-1+m)%m),M=(0,Y.useMemo)(()=>h?s[h.centerChar]:void 0,[h,s]),N=!!o&&!!h&&!!M;function P(){M&&e({traits:M,name:_.trim()})}let[ee,F]=(0,Y.useState)(!1),te=(0,Y.useRef)(null),I=(0,Y.useRef)(null),ne=(0,Y.useRef)(0);function re(){te.current?.pause(),te.current=null,I.current&&=(URL.revokeObjectURL(I.current),null)}(0,Y.useEffect)(()=>()=>{ne.current++,re()},[]);async function ie(){if(!a){b.error(`Your assistant is still warming up — try again in a moment.`);return}re();let e=++ne.current,t=()=>ne.current===e;F(!0);try{let e=_.trim(),n=await Mr(a,e?`Hi! It's ${e}. This is how I sound.`:`Hi there! This is how I sound.`);if(!t())return;if(!n){b.error(`Couldn't play a sample just now — give it another try.`);return}let r=URL.createObjectURL(n);I.current=r;let i=new Audio(r);te.current=i,i.onended=()=>re(),await i.play()}catch{t()&&b.error(`Couldn't play a sample just now — give it another try.`)}finally{t()&&F(!1)}}function L(){S.current=!0,v(e=>{let t=Nr.filter(t=>t!==e),n=t.length>0?t:Nr;return n[Math.floor(Math.random()*n.length)]})}let R=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,X.jsx)(`div`,{ref:w,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,X.jsxs)($n,{size:T,children:[N&&(0,X.jsx)(_r,{components:o,characters:s,centerChar:h.centerChar,edgeOrder:h.edgeOrder,entering:E?.entering??null,exiting:E?.exiting??null,onEnterComplete:e=>D(t=>t?.entering.char===e?null:t),onSelectChar:k}),(0,X.jsx)($,{tone:`light`,onBack:t,onNext:n?P:void 0}),(0,X.jsx)(`h1`,{className:`absolute left-1/2 top-[22%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none max-md:w-[90vw] max-md:whitespace-normal max-md:text-[2.08rem]`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:j,className:`absolute left-[calc(50%-170px)] top-[43%] -translate-y-1/2 ${R}`,children:(0,X.jsx)(u,{className:`h-4 w-4`})}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:A,className:`absolute right-[calc(50%-170px)] top-[43%] -translate-y-1/2 ${R}`,children:(0,X.jsx)(q,{className:`h-4 w-4`})}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[58%] z-10 flex -translate-x-1/2 flex-col items-center gap-10 max-md:top-[54%]`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[y?(0,X.jsx)(`input`,{ref:C,value:_,onChange:e=>{S.current=!0,v(e.target.value)},onBlur:()=>x(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),x(!1))},placeholder:`Name your assistant`,"aria-label":`Assistant name`,className:`w-[234px] rounded-2xl border border-[var(--border-element)] bg-transparent px-4 py-2.5 text-center text-lg text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-colors duration-150 focus:border-[var(--border-active)]`}):(0,X.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>x(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,X.jsx)(`span`,{className:`text-2xl font-medium ${_?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:_||`Name your assistant`}),(0,X.jsx)(f,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,X.jsx)(`button`,{type:`button`,onClick:L,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,X.jsx)(Je,{className:`h-5 w-5`})})]}),r&&(0,X.jsxs)(`button`,{type:`button`,onClick:ie,disabled:ee,title:`Hear my voice`,"aria-label":`Hear my voice`,className:`flex cursor-pointer items-center gap-2 rounded-full border border-[color-mix(in_srgb,var(--content-default)_22%,transparent)] px-4 py-2 text-sm text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] disabled:cursor-default disabled:opacity-70`,children:[ee?(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`}):(0,X.jsx)(Xe,{className:`h-4 w-4`}),`Hear my voice`]})]}),(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),disabled:!N,onClick:P,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}function Ir(e){let t=tt(),{data:n}=c({...Ke({path:{assistant_id:e??``}}),enabled:e!==null,...t,retry:1});return n?.flags?.some(e=>ce(e.key)===`voiceMode`&&e.enabled===!0)??!1}var Lr=.25,Rr=.46,zr=.3,Br=.85,Vr=40,Hr=14,Ur=8;function Wr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=J(),a=Z.use.characters(),o=Z.use.selectedIndex(),s=G(),{w:c,h:l}=er(),[u,d]=(0,Y.useState)({x:0,y:0});(0,Y.useEffect)(()=>{if(s)return;let e=e=>{d({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[s]);let f=e&&!s,p=st();(0,Y.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(!e);(0,Y.useEffect)(()=>{if(s||!g)return;let e=!1,t,n=n=>{e||(h(!0),t=setTimeout(()=>{e||(h(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[s,g,r]);let v=a.length>0?a[o]:void 0,y=(0,Y.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:qe(e.paths.map(e=>nt(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Br,x=Math.min(Math.min(c,l)*zr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Lr)*x+l*.05,T=Vr/100*l-(w+x/2),E=(Rr-Lr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:C,top:w,width:S,height:x,transformOrigin:`center`},initial:f?{y:T,scale:.35}:!1,animate:f?{y:[T,E,0],scale:[.35,1,1]}:{y:0,scale:1},transition:f?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,X.jsx)(U.div,{animate:p,children:(0,X.jsx)(`div`,{style:{transform:`translate(${u.x*Hr}px, ${u.y*Ur}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,X.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,X.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${O}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,X.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var Gr=200,Kr=40;function qr({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:a}){let o=J(),s=Z.use.characters(),c=Z.use.selectedIndex(),l=G(),{ref:u,size:{w:d,h:f}}=mt(),p=jr(),m=s.length>0?s[c]:void 0,h=(0,Y.useMemo)(()=>{if(!o||!m)return null;let e=o.bodyShapes.find(e=>e.id===m.bodyShape),t=o.colors.find(e=>e.id===m.color);return!e||!t?null:{body:e,color:t.hex}},[o,m]),g=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,_=t?.trim()?`I’m ${t.trim()}, your new AI assistant.`:`I’m your new AI assistant.`;if(!h)return(0,X.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let v=1.25*Math.max(d,f),y=v*h.body.viewBox.height/h.body.viewBox.width,b=(d-v)/2,x=(f-y)/2,S=Gr/v,C=(Kr/100-.5)*f;return(0,X.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,X.jsxs)($n,{size:{w:d,h:f},children:[(0,X.jsx)(U.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:h.color},initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.6,delay:.35}}),(0,X.jsx)(U.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${h.body.viewBox.width} ${h.body.viewBox.height}`,width:v,height:y,style:{left:b,top:x,transformOrigin:`center`},initial:l?!1:{scale:S,y:C},animate:{scale:1,y:0},transition:l?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,X.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,X.jsx)(Wr,{entrance:!0}),(0,X.jsx)(U.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,X.jsx)($,{onBack:r,onNext:a})}),(0,X.jsxs)(`div`,{className:vt,children:[(0,X.jsxs)(U.h1,{className:`text-center leading-[1.15] max-md:leading-[1.25]`,style:{fontFamily:`var(--font-serif)`},initial:l?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,X.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,X.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,X.jsx)(U.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Jr=.3,Yr=.85,Xr=.25;function Zr(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=er(),o=(0,Y.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:qe(t.paths.map(e=>nt(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Jr,i*Yr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Xr*s,centerX:i/2,w:i,h:a}}function Qr({art:e,eyesW:t,eyesH:n,centerX:r,eyeCy:i,eyeScale:a,eyeX:o,blinking:s,className:c=`pointer-events-none absolute top-0 z-0`}){let l=Mt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,X.jsx)(U.div,{"aria-hidden":`true`,className:c,style:{left:r-t/2,top:0,x:o,y:l,width:t,height:n,scale:a,transformOrigin:`center`},children:(0,X.jsx)(`svg`,{viewBox:`${e.bbox.x} ${e.bbox.y} ${e.bbox.w} ${e.bbox.h}`,width:t,height:n,style:{overflow:`visible`,display:`block`},children:(0,X.jsx)(`g`,{style:{transform:s?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${u}px ${d}px`,transition:`transform 0.13s ease-in-out`},children:e.paths.map((e,t)=>(0,X.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var $r={green:[`pink`,`purple`,`orange`,`yellow`],orange:[`teal`,`purple`,`green`,`yellow`],pink:[`teal`,`green`,`yellow`,`purple`],purple:[`yellow`,`teal`,`green`,`orange`],teal:[`pink`,`orange`,`yellow`,`purple`],yellow:[`purple`,`teal`,`pink`,`green`]};function ei(e,t){let n=$r[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var ti=new Set([`orange`,`pink`,`red`]);function ni(e,t){return ti.has(e)&&ti.has(t)}function ri(e,t,n){let r=ei(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>ni(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var ii=`You’ve used AI that just answers questions.`,ai=`The more I help,`,oi=`I’m different.`,si=`the better I get,`,ci=`and the less you have to do.`,li=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ui=290;function di({firstH:e,secondH:t,color:n,firstText:r,secondText:i,revealed:a,carouseled:o,revealFrom:s,revealDuration:c,reduce:l}){let u=s===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return!e||!t?null:(0,X.jsx)(U.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,X.jsxs)(U.div,{className:`flex flex-col`,style:{color:n},initial:!1,animate:{y:o?-e:0},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:[(0,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,X.jsx)(U.span,{className:`block`,initial:!1,animate:{clipPath:a?`inset(0% 0 0% 0)`:u},transition:l?{duration:0}:{duration:c,ease:`easeOut`},children:r})}),(0,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,X.jsx)(`span`,{className:`block`,children:i})})]})})}function fi({onContinue:e,onBack:t,onForward:n}){let r=jr(),a=G(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Zr(),p=J(),m=Z.use.characters(),h=Z.use.selectedIndex(),g=m.length>0?m[h]:void 0,_=f>0&&f<=800,v=_?.17:.22,y=_?`top-[17%]`:`top-[22%]`,b=kt(0),x=kt(1),S=(0,Y.useMemo)(()=>!p||!g?`orange`:ri(g.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,g]),C=Math.min(220,Math.max(150,d*.16)),w=-C,T=-C*.4,E=kt(-220),D=(0,Y.useMemo)(()=>!p||!g?[]:ri(g.color,p.colors.map(e=>e.id),3),[p,g]),O=Math.max(.42,Math.min(d/1100,1)),k=Math.round(ui*O),A=-k*1.1,j=-k*.42,M=kt(-320),[N,P]=(0,Y.useState)(!!a),[ee,F]=(0,Y.useState)(!!a),[te,I]=(0,Y.useState)(!1),[ne,re]=(0,Y.useState)(!1),[ie,L]=(0,Y.useState)(!1),[R,ae]=(0,Y.useState)(!1),[oe,se]=(0,Y.useState)(!!a),ce=Math.min(d,768)-48,le=(0,Y.useRef)(null),ue=(0,Y.useRef)(null),de=(0,Y.useRef)(null),fe=(0,Y.useRef)(null),pe=(0,Y.useRef)(null),[me,he]=(0,Y.useState)(0),[ge,_e]=(0,Y.useState)(0),[ve,ye]=(0,Y.useState)(0),[be,xe]=(0,Y.useState)(0),[Se,Ce]=(0,Y.useState)(0);return(0,Y.useLayoutEffect)(()=>{le.current?.offsetHeight&&he(le.current.offsetHeight),ue.current?.offsetHeight&&_e(ue.current.offsetHeight),de.current?.offsetHeight&&ye(de.current.offsetHeight),fe.current?.offsetHeight&&xe(fe.current.offsetHeight),pe.current?.offsetHeight&&Ce(pe.current.offsetHeight)},[ce]),(0,Y.useEffect)(()=>{b.set(l),ae(!0)},[l,b]),(0,Y.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{I(!0),re(!0),L(!0)},1400);return()=>clearTimeout(e)},[a]),(0,Y.useEffect)(()=>{if(a||!o)return;b.set(l),x.set(1),E.set(w),M.set(A),P(!1),F(!1),I(!1),re(!1);let e=Math.max(c*.5,f*v-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(P(!0),await Promise.all([i(on(b,e,{duration:.55,ease:`easeOut`})),i(on(x,.55,{duration:.55,ease:`easeOut`}))]),r)||(F(!0),await Promise.all([i(on(b,l,{type:`spring`,stiffness:210,damping:15})),i(on(x,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(I(!0),re(!0),await i(on(E,[w,T,T,w],{duration:1.5,times:[0,.28,.62,1],ease:[`easeOut`,`easeInOut`,`easeInOut`]})),r)||(await s(150),r))return;L(!0);let t=i(on(M,[A,j,j,A],{duration:1.5,times:[0,.28,.62,1],ease:[`easeOut`,`easeInOut`,`easeInOut`]}));await s(700),!r&&(se(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,v,c,l,b,x,E,w,T,M,A,j]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,X.jsx)($,{onBack:t,onNext:n}),(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute -left-[9999px] top-0 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{width:ce,fontFamily:`var(--font-serif)`},children:[(0,X.jsx)(`span`,{ref:le,className:`block`,children:ii}),(0,X.jsx)(`span`,{ref:ue,className:`block`,children:ai}),(0,X.jsx)(`span`,{ref:de,className:`block`,children:oi}),(0,X.jsx)(`span`,{ref:fe,className:`block`,children:si}),(0,X.jsx)(`span`,{ref:pe,className:`block`,children:ci})]}),R&&o&&(0,X.jsx)(Qr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:b,eyeScale:x,blinking:!1}),!a&&p&&(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:E,width:C,height:C},children:(0,X.jsx)(K,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:S},size:C,breathe:!1})}),!a&&p&&(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(k*.12),y:M},children:li.map((e,t)=>(0,X.jsx)(`div`,{style:{width:k,height:k,marginLeft:t===0?0:-k*.34,zIndex:li.length-t},children:(0,X.jsx)(K,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:D[t]??`teal`},size:k,breathe:!1})},e.bodyShape))}),(0,X.jsxs)(`div`,{className:`${vt.replace(`top-[30%]`,y)} max-w-3xl max-md:top-[34%]`,children:[(0,X.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{fontFamily:`var(--font-serif)`},children:[(0,X.jsx)(di,{firstH:me,secondH:ge,color:r.fgDeep,firstText:ii,secondText:ai,revealed:N,carouseled:te,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,X.jsx)(di,{firstH:ve,secondH:be,color:r.fg,firstText:oi,secondText:si,revealed:ee,carouseled:ne,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,X.jsx)(U.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:ie?Se:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:Se>0&&(0,X.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:Se},children:(0,X.jsx)(U.span,{className:`block`,initial:!1,animate:{clipPath:ie?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:ci})})})]}),oe&&(0,X.jsx)(U.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,X.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,X.jsx)(q,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function pi({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,X.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,X.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,X.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,X.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,X.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,X.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,X.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,X.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`45.5`,fill:`none`,stroke:`#FFF6CF`,strokeOpacity:`0.6`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`70 210`,transform:`rotate(-128 50 50)`}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,X.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,X.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,X.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,X.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,X.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function mi({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,X.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,X.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:`50%`,bottom:-e*.14,width:e*.74,height:e*.16,transform:`translateX(-50%)`,background:`radial-gradient(ellipse at center, rgba(0,0,0,0.22), rgba(0,0,0,0) 70%)`,filter:`blur(2px)`}}),(0,X.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,X.jsxs)(U.div,{className:a,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:t,rotateY:i?[n,n+360,n+760,n+1180]:n},transition:i?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[(0,X.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,X.jsx)(pi,{idSuffix:`front`})}),(0,X.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,X.jsx)(pi,{idSuffix:`back`})})]})})]})}var hi=.3,gi=.95;function _i({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=G(),a=jr(),{h:o}=er(),[s,c]=(0,Y.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,hi*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,X.jsx)($,{onBack:n,onNext:r}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,X.jsxs)(`h1`,{className:`text-[2.6rem] leading-[1.1] max-md:max-w-[80vw]`,style:{fontFamily:`var(--font-serif)`},children:[`Here are some free credits`,(0,X.jsx)(`br`,{className:`max-md:hidden`}),` to get started.`]}),(0,X.jsx)(`div`,{className:`mt-10 flex flex-col items-center gap-4`,children:(0,X.jsx)(U.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:gi,times:[0,hi/gi,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,X.jsx)(mi,{size:88,spinning:s&&!i})})}),!s&&(0,X.jsxs)(`button`,{type:`button`,onClick:l,className:`flex cursor-pointer h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{marginTop:Math.round(24+o*.05),backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}at();var vi=640,yi=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`,leftAvatar:{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},rightAvatar:{bodyShape:`ninja`,eyeStyle:`curious`,color:`purple`}},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`,leftAvatar:{bodyShape:`burst`,eyeStyle:`quirky`,color:`yellow`},rightAvatar:{bodyShape:`cloud`,eyeStyle:`dazed`,color:`green`}},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`,leftAvatar:{bodyShape:`star`,eyeStyle:`angry`,color:`orange`},rightAvatar:{bodyShape:`flower`,eyeStyle:`goofy`,color:`teal`}},{id:`playful-serious`,left:`Playful`,right:`Serious`,leftAvatar:{bodyShape:`star`,eyeStyle:`goofy`,color:`yellow`},rightAvatar:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`}},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`,leftAvatar:{bodyShape:`sprout`,eyeStyle:`bashful`,color:`green`},rightAvatar:{bodyShape:`urchin`,eyeStyle:`surprised`,color:`orange`}}],bi=[`9%`,`27%`,`45%`,`62%`,`79%`],xi=50,Si=.3*.75,Ci=`rgba(36, 41, 46, 0.2)`,wi=`#FDFDFC`,Ti=.16;function Ei(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=r[i-1],o=e[i+1],s=e[i]??``,c=e=>e===t||e===a;if(!c(s)){r.push(s);continue}let l=n.find(e=>!c(e)&&e!==o)??n.find(e=>!c(e))??s;r.push(l)}return r}function Di(){let[e,t]=(0,Y.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,Y.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Oi({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+Ti*100,c=n===`left`?-100+s*o:100-s*o;return(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute`,style:{[n]:`calc(50% - 50vw)`,top:r,width:i,height:i,opacity:Math.min(1,o*1.6),transform:`translate(${c}%, -50%) scale(${.8+.2*o})`,transformOrigin:`${n} center`,transition:`transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease`,willChange:`transform, opacity`},children:(0,X.jsx)(K,{components:e,traits:t,size:i,breathe:!1})})}function ki({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,X.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:i?.7:1},children:[(0,X.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r},children:e.left}),(0,X.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,X.jsxs)(y,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??xi),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,X.jsx)(_,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:Ci}}),(0,X.jsx)(v,{className:`block h-5 w-5 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100 sm:h-6 sm:w-6`,style:{backgroundColor:wi}})]})]})}function Ai({components:e,values:t,sideAvatars:n,size:r}){return(0,X.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:yi.map((i,a)=>{let o=t[i.id]??xi,s=Math.max(0,(xi-o)/xi),c=Math.max(0,(o-xi)/xi),l=bi[a]??`50%`,u=n[a];return u?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(Oi,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,X.jsx)(Oi,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function ji({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=jr(),s=J(),c=Di(),{w:l,h:u}=er(),d=Math.round(Si*Math.min(l,u))+12,f=c>=vi,p=Z.use.characters()[Z.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,Y.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Ei(yi.map(e=>e.leftAvatar.color),p,e),n=Ei(yi.map(e=>e.rightAvatar.color),p,e);return yi.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,p]);return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),f&&s&&(0,X.jsx)(Ai,{components:s,values:e,sideAvatars:h,size:m}),(0,X.jsxs)(`div`,{className:`absolute inset-x-0 top-0 bottom-0 mx-auto flex w-full max-w-2xl flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:d},children:[(0,X.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,X.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-4`,children:[(0,X.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,X.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):null]}),(0,X.jsx)(`div`,{className:`w-full min-h-3 shrink-[2]`,style:{flexBasis:Math.round(40+u*.03)}}),yi.map((r,i)=>(0,X.jsxs)(Y.Fragment,{children:[i>0&&(0,X.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,X.jsx)(ki,{axis:r,value:e[r.id]??xi,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,X.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,X.jsxs)(`button`,{type:`button`,onClick:r,className:`flex h-11 w-[234px] shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Continue`,(0,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}function Mi({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=jr(),{handleConnect:u,oauthInProgress:f}=ct({assistantId:e??``,onConnect:n}),p=()=>{s?.(),u()},m=!e||!t,h=m||f;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-[360px] -translate-x-1/2 flex-col items-center gap-5 text-center`,children:[(0,X.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:m?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,X.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:m?`Your assistant is getting ready`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,X.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:p,disabled:h,className:`flex cursor-pointer h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:l.isLight?`#1A1A1A`:`#FFFFFF`,color:l.isLight?`#FFFFFF`:`#1A1A1A`},children:m?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!m||c)&&(0,X.jsx)(`button`,{type:`button`,onClick:r,disabled:f,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Ni=et(`#17191C`);function Pi(){let[e,t]=(0,Y.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,Y.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Fi(){let e=J(),t=Z.use.characters(),n=Z.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ii({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Fi();return!n||!r?(0,X.jsx)(`div`,{style:{width:e,height:e}}):(0,X.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,X.jsx)(K,{components:n,traits:r,size:e,isAssistantBusy:t})})}var Li=`pt-[0.7rem] text-[2.6rem] leading-none`,Ri=64,zi=4500,Bi=7e3;function Vi({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Fi(),s=G(),{w:c,h:l}=Pi(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,Y.useEffect)(()=>{let t=setTimeout(e,i&&!r?Bi:zi);return()=>clearTimeout(t)},[e,i,r]);let d=(0,Y.useRef)(null),[f,p]=(0,Y.useState)(null);(0,Y.useLayoutEffect)(()=>{let e=()=>{let e=d.current?.getBoundingClientRect();e&&p({cx:e.left+e.width/2,cy:e.top+e.height/2})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]);let m=1.3*Math.max(c,l)/Ri,h=f?c/2-f.cx:0,g=f?l*.88-f.cy:0,_=l*.05;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,X.jsx)($,{onBack:t,onNext:n,tone:`light`}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,X.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ri,height:Ri},children:a&&o&&f&&(0,X.jsx)(U.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:m,x:h,y:g},animate:{x:[h,h,0,0],y:[g,g+_,0,0],scale:[m,m,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,X.jsx)(K,{components:a,traits:o,size:Ri})})}),(0,X.jsx)(U.span,{className:Li,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Hi=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Ui=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Wi=`Almost there…`,Gi=[...Hi,Wi],Ki=[...Ui,Wi],qi=2800;function Ji({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Ni,[o,s]=(0,Y.useState)(0);return(0,Y.useEffect)(()=>{n?.(o);let t=o>=Gi.length-1;if(i&&t){let t=setTimeout(e,qi);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Gi.length),qi);return()=>clearTimeout(r)},[o,i,e,n]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,X.jsx)($,{onBack:t,onNext:r}),(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-1/2 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 items-center gap-3 px-6`,children:[(0,X.jsx)(Ii,{isAssistantBusy:!0}),(0,X.jsx)(We,{mode:`wait`,children:(0,X.jsx)(U.p,{className:`${Li} flex min-h-[4.4rem] items-center !pt-0 !text-[2.08rem]`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Gi[o]},o)})]})]})}function Yi({onDone:e,ready:t}){let n=Ni,[r,i]=(0,Y.useState)(0);return(0,Y.useEffect)(()=>{let n=Ki.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,qi);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Ki.length),qi);return()=>clearTimeout(a)},[r,t,e]),(0,X.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,X.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,X.jsx)(Ii,{isAssistantBusy:!0}),(0,X.jsx)(We,{mode:`wait`,children:(0,X.jsx)(U.p,{className:Li,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ki[r]},r)})]})})}function Xi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Ni,s=G(),[c,l]=(0,Y.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:i,onNext:a}),(0,X.jsxs)(`div`,{className:`absolute bottom-0 left-1/2 top-[11%] sm:top-[8%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6 pb-8`,children:[(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [scrollbar-width:none]`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,X.jsx)(Ii,{}),(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,X.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:o.fgMuted},children:d?t?`Still checking the rest. You can review these as they come in.`:`I searched the web. Feel free to remove anything that isn’t true.`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,X.jsx)(We,{children:u.map(e=>(0,X.jsxs)(U.div,{layout:!0,initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:s?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,X.jsx)(`span`,{children:e.claim}),(0,X.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>l(t=>new Set(t).add(e.claim)),className:`flex cursor-pointer h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:o.fgMuted},children:(0,X.jsx)(m,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,X.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start shrink-0 cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`})]}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] shrink-0 items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[f?`Continue`:`Still searching…`,f&&(0,X.jsx)(q,{className:`h-4 w-4`})]})]})]})}var Zi=38,Qi=Zi;function $i({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Fi();if(!a||!o)return null;let s=Zi/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,X.jsx)(U.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:Zi,height:Zi,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,X.jsx)(K,{components:a,traits:o,size:Zi})})}function ea({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i,disabled:a=!1}){let o=Ni,s=G(),[c,l]=(0,Y.useState)(!1),{components:u,chosen:d}=Fi(),{h:f}=Pi(),p=e.map(e=>({name:e,displayName:ut(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),m=p.length>0,h=(0,Y.useRef)(null),g=(0,Y.useRef)(null),_=(0,Y.useRef)(null),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)(!1),w=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{w.current=b},[b]),(0,Y.useLayoutEffect)(()=>{let e=h.current,t=g.current;if(!e||!t)return;let n=()=>{if(w.current)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=_.current;y({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};n();let r=new ResizeObserver(n);return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n)}},[]);let T=v?.note?.y;return(0,Y.useEffect)(()=>{T===void 0||b||x(!0)},[T,b]),(0,X.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,X.jsx)($,{onBack:r,onNext:i}),(0,X.jsxs)(`div`,{ref:h,className:`absolute left-1/2 top-1/2 z-10 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col px-6`,children:[(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsx)(U.div,{ref:g,className:`shrink-0`,style:{height:Zi},initial:!1,animate:b?{width:0,marginRight:0}:{width:Zi,marginRight:12},transition:s?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),(0,X.jsxs)(`div`,{className:`mt-4 flex items-center gap-3`,children:[S&&u&&d?(0,X.jsx)(`div`,{className:`shrink-0`,children:(0,X.jsx)(K,{components:u,traits:d,size:Qi})}):(0,X.jsx)(`div`,{ref:_,className:`shrink-0`,style:{width:Qi,height:Qi}}),(0,X.jsx)(U.p,{className:`text-[15px]`,style:{color:o.fg},initial:!1,animate:{opacity:+!!S,x:S?0:-6},transition:s?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),m&&(0,X.jsx)(`div`,{className:`flex flex-col gap-3`,style:{marginTop:Math.round(64-f*.02)},children:p.map((e,t)=>(0,X.jsxs)(U.div,{initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:s?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,X.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,X.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:o.fgMuted},children:e.description})]},e.name))}),(0,X.jsxs)(`button`,{type:`button`,onClick:()=>{c||a||(l(!0),Promise.resolve().then(n).catch(()=>l(!1)))},disabled:c||a,className:`mt-16 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[c?`Starting…`:`Let's chat`,!c&&(0,X.jsx)(q,{className:`h-4 w-4`})]}),v&&!S&&(0,X.jsx)($i,{head:v.head,note:v.note,flyToNote:b&&v.note!==void 0,reduce:s,onLanded:()=>C(!0)})]})]})}var ta=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],na=`#17191C`,ra=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ia=290;function aa({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1,eyesEntrance:a=!1}){let o=J(),s=Z.use.characters(),c=Z.use.selectedIndex(),l=G(),{w:u}=er(),d=Math.max(.42,Math.min(u/1100,1)),f=u<640,p=s.length>0?s[c]:void 0,{bg:m,peekColors:h}=(0,Y.useMemo)(()=>!o||!p?{bg:`var(--surface-base)`,peekColors:[]}:{bg:o.colors.find(e=>e.id===p.color)?.hex??`var(--surface-base)`,peekColors:ri(p.color,o.colors.map(e=>e.id),3)},[o,p]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(U.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?na:m},transition:l?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,X.jsx)(Wr,{bumpNonce:t,settleBlink:a,entrance:a}),i&&o&&(0,X.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(ia*d)*.42,right:-Math.round(ia*d)*.12},children:ra.map((e,t)=>{let n=Math.round(ia*d);return(0,X.jsx)(U.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:ra.length-t},initial:l?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,X.jsx)(K,{components:o,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),o&&(0,X.jsx)(We,{children:(f?ta.filter(e=>e.mobile):ta).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*d),r=f&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,X.jsx)(U.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:l?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:l?void 0:{scale:0,opacity:0},transition:l?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,X.jsx)(K,{components:o,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var oa={established:!1,assistantName:null};async function sa(e,n={hasAnyActiveConversation:fe,fetchAssistantIdentity:Ze}){try{if(!await n.hasAnyActiveConversation(e))return oa}catch(e){return t(e,{context:`research_onboarding_established_check`}),oa}let r=await n.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function ca({assistantName:e,onKeep:t,onRedo:n,onBack:r}){let a=e?.trim()||``,o=a||`your assistant`,s=a?`${a}'s`:`its`;return(0,X.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,X.jsx)($,{onBack:r,tone:`light`}),(0,X.jsxs)(`div`,{className:`${vt} max-w-xl`,children:[(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,X.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:a?`${a} is already up and running`:`Your assistant is already up and running`}),(0,X.jsxs)(`p`,{className:`text-[15px]`,style:{color:`var(--content-secondary)`},children:[`You two have history — a personality, memories, and past conversations. Running setup again would overwrite who `,o,` is now.`]})]}),(0,X.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,X.jsxs)(i,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,X.jsx)(q,{className:`h-4 w-4`})]}),(0,X.jsxs)(i,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var la=4e3;function ua(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobbies:e.hobbies,timezone:de()}}function da(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}at();function fa(){let e=o(),t=re.use.user(),n=t?.id??null,r=Qe.use.enterFocus(),i=Qe.use.exitFocus(),s=Qe.use.setPendingAvatarTraits(),c=Qe.use.requestSidebarCollapse(),[l,u]=(0,Y.useState)(`form`),{ref:d,size:f}=mt(),[p,m]=(0,Y.useState)([]),[h,g]=(0,Y.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){Ye($e[l],{userId:n,outcome:t}),m([]),_(e)}function y(e){m(e=>[...e,l]),_(e)}function b(){let e=p[p.length-1];e&&(m(e=>e.slice(0,-1)),_(e))}let x=p.length>0?b:void 0,[S,T]=(0,Y.useState)(null),E=(0,Y.useRef)(null),[D,O]=(0,Y.useState)(null),[k,A]=(0,Y.useState)(null),j=(0,Y.useRef)(!1),[M,N]=(0,Y.useState)(!1),[P,ee]=(0,Y.useState)(null),[te,I]=(0,Y.useState)({}),[ne,ie]=(0,Y.useState)(!1),[L,R]=(0,Y.useState)(null),[ae,se]=(0,Y.useState)(null),[ce,de]=(0,Y.useState)(!1),[fe,_e]=(0,Y.useState)(!1),[ve,ye]=(0,Y.useState)(!1),[be,xe]=(0,Y.useState)(0),[Se,Ce]=(0,Y.useState)(0),[we]=a(),Te=dn({hostingParam:we.get(`hosting`),localMode:w(),gatewayAuthSession:C()}),Ee=we.get(`assistant`)??void 0,De=Te,{start:Oe,ready:ke,assistantId:z,error:Ae,awaitReady:B}=_n({adoptExisting:Te,adoptAssistantId:Ee}),je=Ir(z),V=Un(),{start:Me,hydrate:Ne}=V,Pe=(0,Y.useRef)(Promise.resolve()),Fe=(0,Y.useRef)(!1),[Ie,Le]=(0,Y.useState)(!1),H=(0,Y.useCallback)(e=>{Fe.current=e,Le(e)},[]),[Re,ze]=(0,Y.useState)(null),Be=(0,Y.useRef)(Promise.resolve()),[U,Ve]=(0,Y.useState)(!1),He=V.status===`idle`||V.status===`running`,W=!He&&V.claims.length===0;(0,Y.useEffect)(()=>{i(),s(null),Oe()},[i,s,Oe]),(0,Y.useEffect)(()=>{if(E.current)return;let e=B().then(e=>sa(e)).catch(()=>oa);E.current=e,e.then(O)},[B]);let Ue=(0,Y.useCallback)(()=>Promise.race([E.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),la)})]),[]);(0,Y.useLayoutEffect)(()=>{if(h||!n)return;let e=me(n);if(e?.formValues){T(e.formValues),ee(e.faceValues),se(e.checkinTime),_e(e.checkinBooked),ze(e.keptClaims??null),R(e.researchConversationId??null),e.research&&(Ne({...e.research,pluginCatalog:e.research.pluginCatalog??{},droppedClaims:e.research.droppedClaims??[]},B),H(e.droppedClaimsScrubbed??!1),N(!0));let t=he(e);u(De&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Ne,B,De,H]),(0,Y.useEffect)(()=>{!h||!S||pe(n,{step:l,formValues:S,faceValues:P,checkinTime:ae,checkinBooked:fe,research:V.status===`done`?{status:`done`,claims:V.claims,droppedClaims:V.droppedClaims,suggestions:V.suggestions,installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog}:null,...L?{researchConversationId:L}:{},...Re?{keptClaims:Re}:{},...Ie?{droppedClaimsScrubbed:!0}:{}})},[h,n,l,Re,S,P,ae,fe,L,V.status,V.claims,V.droppedClaims,V.suggestions,V.installedPlugins,V.pluginCatalog,Ie]),(0,Y.useEffect)(()=>{if(!h||!S||V.status!==`idle`&&V.status!==`done`)return;let e=V.status===`idle`,t=S,n=!1;return(async()=>{if(!j.current){let e=await Ue();if(n)return;if(e?.established){A(t),m([]),T(null),u(`existing`),N(!1);return}}N(!1),e&&Me({awaitAssistantId:B,subject:ua(t),conversationTitle:da(t),...L?{resumeConversationId:L}:{},onConversationCreated:R,includeSuggestions:!1})})(),()=>{n=!0,N(!1)}},[h,S,L,V.status,Me,B,!0,Ue]),(0,Y.useEffect)(()=>{l===`results`&&W&&(m([]),u(`suggestions`))},[l,W]),(0,Y.useEffect)(()=>{Fe.current||He||V.droppedClaims.length!==0&&(!L||!z||V.claims.length>0&&l!==`suggestions`||(H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:V.droppedClaims,rejectedAll:!1})))},[He,V.claims.length,V.droppedClaims,L,z,l,H]);function We(t,i,a,{skip:o=!1,hidden:l=!1}={}){ge(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;ue({tools:[],tasks:[],tone:sn,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??un({firstName:u,lastName:d,occupation:f,hobbies:p}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{},...Re?.length?{researchFindings:Re}:{}});let _=i?.name?.trim();_&&le(_),s(i?.traits??null),g&&r(),o||F.markExpectingFirstMessage(),c(),F.checkAssistant(z??void 0).finally(()=>{e(`${oe.assistant}?onboarding=1`,{replace:!0})})}async function G(){S&&(await Promise.all([V.awaitPluginInstalls(),Pe.current,Be.current]),We(S,P,Xn(P?.name),{hidden:!0}))}function K(e){H(!1),V.start({awaitAssistantId:B,subject:ua(e),conversationTitle:da(e),onConversationCreated:R,includeSuggestions:!1})}async function Ge(e){if(!j.current&&(await Ue())?.established){A(e),v(`existing`);return}T(e),K(e),v(`face`)}function Ke(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){ye(!0);return}if(ye(!1),z&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);se(null),_e(!1),de(!0),it({assistantId:z,userName:e||void 0,assistantName:P?.name?.trim()||void 0}).then(e=>{e.scheduled&&(_e(!0),se(Zn(e.start,e.timeZone)))}).finally(()=>de(!1))}v(`meeting`)}if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l)&&S){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l);return(0,X.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,X.jsxs)($n,{size:f,children:[(0,X.jsx)(aa,{eyesBumpNonce:be,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?Se:0,darkBg:e,showBottomEyes:!e&&l!==`different`,eyesEntrance:l===`personality`}),l===`different`&&(0,X.jsx)(fi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,X.jsx)(ji,{values:te,onValueChange:(e,t)=>I(n=>({...n,[e]:t})),locked:ne,onContinue:()=>{ne||(Ve(!0),Be.current=Yn({awaitAssistantId:B,values:te,userName:S?.firstName?.trim()||void 0,assistantName:P?.name?.trim()||void 0}).finally(()=>Ve(!1)),ie(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,X.jsx)(_i,{onClaim:()=>v(De?`looking`:`letschat`),onBumpEyes:()=>xe(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,X.jsx)(Mi,{assistantId:z,assistantReady:ke,hatchError:Ae,onConnected:Ke,missingCalendarScope:ve,onRetry:()=>ye(!1),onSkip:()=>{ye(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,X.jsx)(Vi,{scheduledTime:ae??void 0,awaitingTime:ce,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,X.jsx)(Ji,{onDone:()=>v(W?`suggestions`:`results`),onBack:()=>y(De?`integration`:`letschat`),onAdvance:e=>Ce(Math.min(e+1,4)),onForward:x,ready:!He}),l===`results`&&(0,X.jsx)(Xi,{claims:V.claims,loading:He,onContinue:e=>{let t=new Set(e);ze(V.claims.filter(e=>!t.has(e.claim)).map(e=>e.claim));let n=Fe.current?[]:V.droppedClaims,r=[...e,...n];L&&z&&r.length>0&&(n.length>0&&H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:r,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{ze([]),L&&z&&(H(!0),Pe.current=Gn({assistantId:z,conversationId:L,removedClaims:V.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,X.jsx)(ea,{installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog,disabled:M,onStart:async()=>{if(Ye($e.suggestions,{userId:n,outcome:`completed`}),U){m([]),u(`finishing`);return}await G()},onBack:()=>y(W?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,X.jsx)(Yi,{ready:!U,onDone:()=>void G()})]})})}return l===`existing`?(0,X.jsx)(ca,{assistantName:D?.assistantName??null,onKeep:()=>{Ye($e.existing,{userId:n,outcome:`completed`}),ge(n),F.checkAssistant(z??void 0).finally(()=>{e(oe.assistant,{replace:!0})})},onRedo:()=>{let e=k;e&&(j.current=!0,Ye($e.existing,{userId:n,outcome:`skipped`}),T(e),K(e),m([]),_(`face`))},onBack:()=>{A(null),y(`form`)}}):l===`intro`&&S?(0,X.jsx)(qr,{firstName:S.firstName,assistantName:P?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,X.jsx)(Fr,{voiceEnabled:je,assistantId:z,onContinue:e=>{ee(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,X.jsx)(Ar,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ge})}export{fa as ResearchOnboardingRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{P as e}from"./button-BQVYX8n_.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import"./src-BNYQ8guL.js";var n=t();function r({className:t}){return(0,n.jsx)(`div`,{role:`presentation`,className:e(`h-px w-full bg-[var(--border-base)]`,t)})}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{n as r,t as i,z as a}from"./button-BQVYX8n_.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./bug-BMI_6ziD.js";import{t as l}from"./download-B6XjnEzx.js";import{t as u}from"./info-CqgkBvyS.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./x-CswtfvgS.js";import{t as p}from"./notice-DkAWz47A.js";import{n as ee,t as m}from"./input-ZpyYt_a0.js";import{t as h}from"./toggle-QSEiPr3k.js";import{t as g}from"./dropdown-BxYrCXBS.js";import{t as _}from"./is-electron-y5bNUVyG.js";import{sn as v}from"./sdk.gen-BR-xXIZm.js";import{t as y}from"./impersonate-version-flag-DRJTfKcP.js";import{n as te}from"./auth-store-DmFYd_Lh.js";import{t as b}from"./dist-DyRKd0bN2.js";import{n as x}from"./diagnostics-DbnQqLDx.js";import{Jo as S,bi as ne,cs as re,ms as C,os as w,rs as ie}from"./index-BTyMkqXw.js";var T=e(n(),1),ae=e(a(),1),E=`vellum:debug:`;function oe(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function D(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:y()},overrides:oe()}}var O=t({ShareFeedbackModal:()=>z}),k=s(),A=[{value:`bug_report`,label:`Bug Report`,icon:c,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:C,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:w,includesLogsByDefault:!1}],j=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],se=j.map(e=>({value:e.value,label:e.label})),M=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),N=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),P=10,F=50*1024*1024,ce={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function le(){return _()?`electron`:b.getPlatform()===`ios`?`ios`:`web`}function ue(e){if(e.size>F)return!1;if(e.type&&M.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?N.has(t):!1}return!1}function I(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function L(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await v({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function R(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=j.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,d=u==null?null:new Date(u).toISOString(),f=null;try{f=i?.()??null}catch{f=null}let p=x(f),ee={collected_at:s.toISOString(),time_range:e,cutoff:d,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},m=new TextEncoder,h=m.encode(JSON.stringify(ee,null,2)),g=m.encode(JSON.stringify(p,null,2)),v=[I(`web-client-context.json`,h),I(`web-chat-diagnostics.json`,g)],y=new TextEncoder().encode(JSON.stringify(D(),null,2));v.push(I(`web-debug-flags.json`,y));for(let e of o){let t=e.contents.trim();t&&v.push(I(e.filename,m.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));v.push(I(`web-sse-liveness-triage.json`,n))}}catch{}if(_()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));v.push(I(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);v.push(I(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await L(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&v.push(I(`platform-logs.tar.gz`,e))}v.push(new Uint8Array(1024));let te=v.reduce((e,t)=>e+t.length,0),b=new Uint8Array(te),S=0;for(let e of v)b.set(e,S),S+=e.length;let ne=new Blob([b.buffer]),re=await new Response(ne.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([re],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,initialMessage:a,onSubmitted:s,assistantId:c,assistantVersion:v,activeConversationId:y,doctorSessionId:b,doctorSessionLog:x,getDiagnosticsSnapshot:C}){let w=te.use.user(),E=w?.email,oe=w?.isStaff??!1,D=(0,T.useId)(),O=(0,T.useRef)(null),j=(0,T.useRef)(null),M=(0,T.useRef)(null),N=(0,T.useRef)(null),[F,I]=(0,T.useState)(n??`bug_report`),[L,z]=(0,T.useState)(``),[B,pe]=(0,T.useState)(``),[V,H]=(0,T.useState)(A.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[me,he]=(0,T.useState)(!1),[U,W]=(0,T.useState)(`past_hour`),[G,K]=(0,T.useState)([]),[ge,q]=(0,T.useState)(null),[_e,J]=(0,T.useState)(!1),[Y,ve]=(0,T.useState)(!1),[X,ye]=(0,T.useState)(!1),Z=o(ne()),[be,Q]=(0,T.useState)(!1),$=Z.isPending||be,xe=!E,Se=(0,T.useMemo)(()=>L.trim().length>0&&B.trim().length>0,[L,B]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),z(a??``),pe(E??``),H(A.find(e=>e.value===t)?.includesLogsByDefault??!0),he(!1),W(`past_hour`),K([]),ve(!1),ye(!1),q(null),Q(!1),Z.reset();let r=setTimeout(()=>{E?M.current?.focus():N.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let Ce=e=>{I(e),me||H(A.find(t=>t.value===e)?.includesLogsByDefault??!1)},we=()=>{H(e=>!e),he(!0)},Te=x?.trim()?[{filename:`doctor-session.txt`,contents:x}]:[],Ee=(0,T.useCallback)(e=>{e.key===`Escape`&&!$&&t()},[t,$]),De=(0,T.useCallback)(e=>{e.target===O.current&&!$&&t()},[t,$]),Oe=(0,T.useCallback)(e=>{K(t=>{let n=P-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ue(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),ke=e=>{e.target.files&&Oe(Array.from(e.target.files)),e.target.value=``},Ae=e=>{e.preventDefault(),J(!1),e.dataTransfer.files?.length&&Oe(Array.from(e.dataTransfer.files))},je=e=>{e.preventDefault(),J(!0)},Me=e=>{e.preventDefault(),e.currentTarget===e.target&&J(!1)},Ne=e=>{K(t=>t.filter((t,n)=>n!==e))};return e?(0,ae.createPortal)((0,k.jsx)(`div`,{ref:O,role:`dialog`,"aria-modal":`true`,"aria-labelledby":D,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:Ee,onClick:De,onDrop:Ae,onDragOver:je,onDragLeave:Me,children:(0,k.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,k.jsx)(`h2`,{id:D,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,k.jsx)(i,{variant:`ghost`,iconOnly:(0,k.jsx)(f,{}),onClick:t,disabled:$,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[oe&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5 rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,k.jsx)(h,{checked:X,onChange:()=>ye(e=>!e),"aria-label":`Download diagnostics directly`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Download diagnostics directly`})]}),(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Admin only — builds the diagnostics archive locally and downloads it instead of submitting feedback or notifying Slack.`})]}),X?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Time range`}),(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}):(0,k.jsxs)(k.Fragment,{children:[xe&&(0,k.jsx)(m,{id:`${D}-email`,ref:N,label:`Email`,type:`email`,placeholder:`you@example.com`,value:B,onChange:e=>pe(e.target.value),leftIcon:(0,k.jsx)(re,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:A.map(e=>(0,k.jsx)(de,{option:e,isSelected:F===e.value,onSelect:()=>Ce(e.value)},e.value))})]}),(0,k.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),F===`feature_request`&&(0,k.jsxs)(p,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,k.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,k.jsx)(ee,{id:`${D}-message`,ref:M,label:F===`bug_report`?`What went wrong?`:F===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:F===`bug_report`?`What did you expect to happen, and what happened instead?`:F===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:L,onChange:e=>z(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:V,onChange:we,"aria-label":`Include browser diagnostics`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,k.jsx)(r,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,k.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,k.jsx)(u,{className:`h-3.5 w-3.5`})})})]}),V&&(0,k.jsx)(g,{options:se,value:U,onChange:W,"aria-label":`Diagnostics time range`})]}),_()&&y&&F!==`feature_request`&&(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,k.jsx)(h,{checked:Y,onChange:()=>ve(e=>!e),"aria-label":`Include the most recent conversation`}),(0,k.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,G.length>0&&(0,k.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,G.length,`/`,P]})]}),(0,k.jsx)(i,{variant:`outlined`,size:`compact`,leftIcon:(0,k.jsx)(ie,{}),onClick:()=>j.current?.click(),disabled:G.length>=P,children:`Add files`}),(0,k.jsx)(`input`,{ref:j,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:ke,className:`hidden`})]}),G.length>0&&(0,k.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:G.map((e,t)=>(0,k.jsx)(fe,{file:e,onRemove:()=>Ne(t)},`${e.name}-${t}`))}),_e&&(0,k.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]})]}),ge&&(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:ge})]}),(0,k.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,k.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,k.jsx)(d,{className:`h-4 w-4 animate-spin`}),X?`Preparing diagnostics…`:`Sending feedback…`]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(i,{variant:`ghost`,onClick:t,children:`Cancel`}),X?(0,k.jsx)(i,{variant:`primary`,leftIcon:(0,k.jsx)(l,{}),onClick:async()=>{if(!$){q(null),Q(!0);try{let e=await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te});if(!e){q(`Diagnostics export isn't supported in this browser.`);return}let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=e.name,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),0),t()}catch(e){q(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:`Download diagnostics`}):(0,k.jsx)(i,{variant:`primary`,leftIcon:(0,k.jsx)(S,{}),onClick:async()=>{if(!(!Se||$)){q(null),Q(!0);try{let e=V&&F!==`feature_request`?await R(U,c??null,_()?Y?y??null:null:y??null,{diagnosticsProvider:C,doctorSessionId:b,extraLogFiles:Te}):null;await Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ce[F],email:B.trim(),client:le(),client_version:void 0,...c?{assistant_id:c}:{},...v?{assistant_version:v}:{},...b?{doctor_session_id:b}:{},...e?{logs_file:e}:{},...G.length?{attachments:G}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),s?.(),t()}catch(e){q(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!Se,children:`Submit`})]})})]})}),document.body):null}function de({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,k.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,k.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,k.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function fe({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,k.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,k.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,k.jsx)(ie,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,k.jsx)(i,{variant:`ghost`,size:`compact`,iconOnly:(0,k.jsx)(f,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{O as n,z as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i,z as a}from"./button-BQVYX8n_.js";import{l as o,m as s,u as c}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./card-D8zyWtZh.js";import{t as m}from"./createLucideIcon-Bjb-Kuq7.js";import{t as h}from"./arrow-left-C2re-gYj.js";import{a as g,i as _,n as v,o as y,r as b,s as x,t as ee}from"./use-skill-actions-61i-zd4P.js";import{t as S}from"./brain-Ci5ws6Wl.js";import{n as C,t as w}from"./settings-wSv59mkN.js";import{t as T}from"./check-wF3S-AV4.js";import{n as E,t as D}from"./panel-item-An-BBeyL.js";import{t as O}from"./cloud-off-DT0KnUQ4.js";import{t as te}from"./code-B_ruRFrX.js";import{t as ne}from"./download-B6XjnEzx.js";import{t as re}from"./external-link-Cczz6xJ4.js";import{t as ie}from"./globe-DgKSh933.js";import{t as k}from"./hard-drive-DVmyHlZR.js";import{t as A}from"./link-2-B9c5ZsFq.js";import{t as j}from"./loader-circle-Ck8fq3yv.js";import{t as M}from"./mic-DEmgi4rh.js";import{t as ae}from"./puzzle-C894zd87.js";import{t as oe}from"./sparkles-BK3KXCjl.js";import{t as se}from"./triangle-alert-CnjNKhNx.js";import{t as ce}from"./x-CswtfvgS.js";import"./src-BNYQ8guL.js";import{t as N}from"./tag-B6WeUtBW.js";import{t as le}from"./popover-Bl6742nZ.js";import{t as ue}from"./input-ZpyYt_a0.js";import{t as de}from"./toggle-QSEiPr3k.js";import{n as P}from"./toast-Be8FEQ-I.js";import{t as fe}from"./confirm-dialog-Zyfei9GV.js";import{t as pe}from"./file-markdown-BXMDJYDD.js";import{Bn as me,Ln as F,Rn as he,Un as ge}from"./sdk.gen-BR-xXIZm.js";import{St as _e,an as ve,at as ye,ct as be,in as xe,rn as Se,rt as Ce,st as we,xt as Te}from"./react-query.gen-DfzfX_Jv.js";import{t as Ee}from"./assistant-identity-store-CgJwLRMd.js";import{r as De}from"./utils-DvUW9GK8.js";import{u as Oe}from"./routes-D4ff4ONd.js";import{t as ke}from"./misc-D0u5tzSd.js";import{Ba as Ae,Bo as je,Fa as Me,J as Ne,Ko as Pe,Ks as I,Lo as L,Ot as Fe,Rn as Ie,Rs as Le,Yo as Re,cs as ze,hs as R,jo as z,os as Be,ys as B,zo as V,zs as H}from"./index-BTyMkqXw.js";import{n as Ve,r as He}from"./skills-C7LCNEFA.js";var Ue=m(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),We=m(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),U=e(r(),1),W=f(),Ge={sm:`h-7 w-7`,md:`h-8 w-8 text-3xl`};function G({external:e=!1,icon:t,iconSrc:n,size:r=`sm`,className:i}){let[a,o]=(0,U.useState)(!1);(0,U.useEffect)(()=>{o(!1)},[n]);let s=t||(e?`📦`:`🧩`),c=!!n&&!a;return(0,W.jsx)(`span`,{className:ke(`flex shrink-0 items-center justify-center`,Ge[r],i),children:c?(0,W.jsx)(`img`,{src:n,alt:``,"aria-hidden":!0,loading:`lazy`,className:`h-full w-full object-contain`,onError:()=>o(!0)}):s})}var Ke=e=>`Remove "${e}" from this assistant?`,qe=e=>`"${e}" has local edits that will be overwritten by the upgrade. Continue?`,Je=`Upgrade anyway`,Ye=`Failed to install plugin. Please try again.`,Xe=`Failed to remove plugin. Please try again.`,Ze=`Failed to upgrade plugin. Please try again.`,Qe=`Failed to update plugin. Please try again.`;function $e(e,t){let n=e.map(e=>({name:e.name,description:e.description??void 0,status:`installed`,external:void 0,version:e.version??void 0,path:e.path,issues:e.issues,enabled:e.enabled,icon:e.icon,hasIcon:e.hasIcon,iconVersion:e.iconVersion})),r=new Set(n.map(e=>e.name)),i=t.filter(e=>!r.has(e.name)).map(e=>({name:e.name,description:e.description,status:`available`,external:!0,path:e.path}));return[...n,...i]}function et(e,t){let n=t.trim().toLowerCase();return n?[e.name,e.description].some(e=>e?.toLowerCase().includes(n)):!0}function tt(e){return[...e].sort((e,t)=>{let n=e.status===`installed`;return n===(t.status===`installed`)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function nt(e,t){switch(t){case`all`:return e;case`available`:return e.filter(e=>e.status===`available`);case`installed`:return e.filter(e=>e.status===`installed`);case`active`:return e.filter(e=>e.status===`installed`&&e.enabled!==!1);case`off`:return e.filter(e=>e.status===`installed`&&e.enabled===!1)}}function rt(e){return e?e.slice(0,7):`unknown`}function K({plugin:e,surfaces:t=null,className:n}){let r=[{label:`Source`,value:e.source?.kind===`github`?e.source.repo:`Local`,href:(e.source?.kind===`github`?`https://github.com/${e.source.repo}`:null)??void 0}];return e.homepage&&r.push({label:`Homepage`,value:e.homepage,href:e.homepage}),e.license&&r.push({label:`License`,value:e.license}),t&&(t.skills.length>0&&r.push({label:`Skills`,value:String(t.skills.length)}),t.hooks.length>0&&r.push({label:`Hooks`,value:String(t.hooks.length)}),t.tools.length>0&&r.push({label:`Tools`,value:String(t.tools.length)})),(0,W.jsx)(`dl`,{className:ke(`mb-5 grid gap-x-6 gap-y-2 border-b pb-5 sm:grid-cols-[max-content_1fr]`,n),style:{borderColor:`var(--border-base)`},children:r.map(e=>(0,W.jsxs)(`div`,{className:`contents`,children:[(0,W.jsx)(`dt`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.label}),(0,W.jsx)(`dd`,{className:`min-w-0 truncate text-body-small-default`,style:{color:`var(--content-secondary)`},children:e.href?(0,W.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 underline`,style:{color:`var(--primary-base, #60a5fa)`},children:[e.value,(0,W.jsx)(re,{className:`h-3 w-3`,"aria-hidden":!0})]}):e.value})]},e.label))})}function it({plugin:e,drift:t,onInstall:n,onRemove:r,onUpgrade:a,isInstalling:o,isRemoving:s,isUpgrading:c,hasLocalEdits:l,enabled:u,onToggle:d,isToggling:f}){let[p,m]=(0,U.useState)(!1),[h,g]=(0,U.useState)(!1),_=e.installed??!1,v=e.artifact??null,y=t?.status===`update-available`,b=y?`Upgrade ${rt(t?.local?.commit??null)} → ${rt(t?.remote?.commit??null)}`:void 0;return(0,W.jsxs)(W.Fragment,{children:[_?(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:flex-nowrap md:shrink-0`,children:[u!==void 0&&d?(0,W.jsx)(de,{label:`Auto-include in chat`,checked:u,onChange:()=>d(),disabled:f}):null,v?(0,W.jsx)(i,{asChild:!0,leftIcon:(0,W.jsx)(ne,{"aria-hidden":!0}),children:(0,W.jsx)(`a`,{href:v.url,download:!0,children:v.label??`Download`})}):null,y?(0,W.jsx)(i,{type:`button`,onClick:()=>{if(l){g(!0);return}a()},disabled:c,title:b,leftIcon:c?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(H,{"aria-hidden":!0}),children:`Upgrade`}):null,(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,onClick:()=>m(!0),disabled:s,leftIcon:s?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),children:`Remove`})]}):(0,W.jsx)(i,{type:`button`,onClick:n,disabled:o,leftIcon:o?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(I,{"aria-hidden":!0}),children:`Install`}),(0,W.jsx)(fe,{open:p,title:`Remove plugin`,message:Ke(e.name),confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{m(!1),r()},onCancel:()=>m(!1)}),(0,W.jsx)(fe,{open:h,title:`Upgrade plugin`,message:qe(e.name),confirmLabel:Je,destructive:!0,onConfirm:()=>{g(!1),a()},onCancel:()=>g(!1)})]})}function at(){return(0,W.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,W.jsx)(j,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function q(){return(0,W.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 py-12 text-center`,style:{color:`var(--content-tertiary)`},children:[(0,W.jsx)(se,{className:`h-6 w-6`,"aria-hidden":!0}),(0,W.jsx)(`p`,{className:`text-body-medium-default`,children:`We couldn't load this plugin.`}),(0,W.jsx)(`p`,{className:`text-body-small-default`,children:`It may not exist, or your assistant may be on an older build.`})]})}function ot({isInstallError:e,isRemoveError:t,isUpgradeError:n}){let r=e?Ye:t?Xe:n?Ze:null;return r?(0,W.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 rounded px-3 py-2 text-body-small-default`,style:{backgroundColor:`var(--surface-secondary)`,color:`var(--content-warning, var(--content-tertiary))`},role:`alert`,children:[(0,W.jsx)(se,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),r]}):null}function st({external:e,className:t}){let n=e?{label:`External`,icon:ie}:{label:`Local`,icon:k};return(0,W.jsx)(N,{tone:`neutral`,leftIcon:(0,U.createElement)(n.icon),className:t,children:n.label})}function J({onClick:e,isUpgrading:t=!1}={}){let n=(0,W.jsx)(N,{tone:`warning`,leftIcon:(0,U.createElement)(t?j:H,{className:t?`animate-spin`:void 0}),className:`shrink-0`,children:`Update available`});return e?(0,W.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),e()},disabled:t,"aria-label":`Upgrade plugin`,className:`shrink-0 rounded-[6px] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:cursor-not-allowed`,children:n}):n}var ct=300*1e3;function Y({assistantId:e,name:t,enabled:n=!0}){return u({...ye({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t&&n,staleTime:ct,retry:!1})}function lt(e){let t=e?.local?.localChanges;return!!t&&t?.clean===!1}function ut(e,t,n){let r=l(),i=n?.onRemoved,a=u({...Ce({path:{assistant_id:e,name:t}}),enabled:!!e&&!!t}),o=Y({assistantId:e,name:t,enabled:a.data?.installed??!1}).data,s=(0,U.useCallback)(()=>Me(r,e,t),[e,t,r]),c=ve({onSuccess:()=>{s(),P.success(`Installed ${t||`plugin`}`)}}),d=Se({onSuccess:()=>{s(),i?.()}}),f=xe({onSuccess:e=>{s(),P.success(e.outcome===`already-up-to-date`?`${t||`Plugin`} is already up to date`:`Upgraded ${t||`plugin`} to ${rt(e.toCommit)}`)}});return{plugin:a.data??null,drift:o,isLoading:a.isLoading,isError:a.isError,install:()=>{c.mutate({path:{assistant_id:e},body:{name:t}})},remove:()=>{d.mutate({path:{assistant_id:e,name:t}})},upgrade:()=>{f.mutate({path:{assistant_id:e,name:t},body:{}})},isInstalling:c.isPending,isRemoving:d.isPending,isUpgrading:f.isPending,isInstallError:c.isError,isRemoveError:d.isError,isUpgradeError:f.isError,hasLocalEdits:lt(o)}}var dt=`0.10.5`;function ft(){return De(dt)}function X(e,t,n,r){let i=ft(),{data:a}=u({queryKey:[`pluginIcon`,e,t,r],queryFn:async()=>{let{data:n,error:r}=await me({path:{assistant_id:e,name:t},parseAs:`blob`,throwOnError:!1});if(r||!(n instanceof Blob))throw Error(`Failed to load plugin icon`);return n},enabled:!!(i&&n&&r),staleTime:1/0,retry:!1}),[o,s]=(0,U.useState)(void 0);return(0,U.useEffect)(()=>{if(!a){s(void 0);return}let e=URL.createObjectURL(a);return s(e),()=>{URL.revokeObjectURL(e)}},[a]),o}function Z(e){let t=l(),n={queryKey:we({path:{assistant_id:e}})},r=(e,r)=>{t.setQueriesData(n,t=>t&&{...t,plugins:t.plugins.map(t=>t.name===e?{...t,enabled:r}:t)})},i=d({mutationFn:async({name:t,nextEnabled:n})=>{let r=await(n?he({path:{assistant_id:e,name:t},throwOnError:!1}):F({path:{assistant_id:e,name:t},throwOnError:!1})),i=r.response?.status;if(r.response?.ok||i===409)return r;throw Error(`Plugin toggle failed (${i??`network error`})`)},onMutate:async({name:e,nextEnabled:i})=>{await t.cancelQueries(n),r(e,i)},onError:(e,{name:t,nextEnabled:n})=>{r(t,!n),P.error(Qe)},onSettled:(n,r,i)=>{Me(t,e,i.name)}});return{toggle:(e,t)=>{i.mutate({name:e,nextEnabled:t})},togglingName:i.isPending?i.variables?.name??null:null}}function pt({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=ut(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=Z(e),C=X(e,t,o?.hasIcon,o?.iconVersion);return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col`,children:[(0,W.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,W.jsx)(i,{type:`button`,variant:`ghost`,iconOnly:(0,W.jsx)(h,{"aria-hidden":!0}),"aria-label":`Back to plugins`,onClick:n}),(0,W.jsx)(Q,{name:t,plugin:o,externalHint:r,iconSrc:C,drift:s,onInstall:u,onRemove:d,onUpgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,hasLocalEdits:x,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t})]}),(v||y||b)&&(0,W.jsx)(ot,{isInstallError:v,isRemoveError:y,isUpgradeError:b}),(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:c?(0,W.jsx)(at,{}):l||!o?(0,W.jsx)(q,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,W.jsx)(pe,{content:o.readme}):(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})]})}function Q({name:e,plugin:t,externalHint:n,iconSrc:r,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}){let h=t?.source?.kind===`github`,g=t?h:n,_=i?.status===`update-available`;return(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-3`,children:[g===void 0?(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,W.jsx)(G,{external:g,icon:t?.icon??void 0,iconSrc:r,size:`md`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,W.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t?.name??e}),t?.version?(0,W.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,t?(0,W.jsx)(st,{external:h}):null,_?(0,W.jsx)(J,{}):null]}),t?.description?(0,W.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}):null]})]}),t?(0,W.jsx)(it,{plugin:t,drift:i,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c,isRemoving:l,isUpgrading:u,hasLocalEdits:d,enabled:f,onToggle:p,isToggling:m}):null]})}var mt=e(a(),1);function ht({assistantId:e,name:t,onBack:n,externalHint:r,enabled:a}){let{plugin:o,drift:s,isLoading:c,isError:l,install:u,remove:d,upgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,isInstallError:v,isRemoveError:y,isUpgradeError:b,hasLocalEdits:x}=ut(e,t,{onRemoved:n}),{toggle:ee,togglingName:S}=Z(e),[C,w]=(0,U.useState)(null);(0,U.useEffect)(()=>{w(document.getElementById(`viewport-overlays`))},[]);let T=o?.source?.kind===`github`,E=o?T:r,D=s?.status===`update-available`,O=o?.name??t,te=X(e,t,o?.hasIcon,o?.iconVersion),ne=(0,W.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsx)(i,{variant:`ghost`,iconOnly:(0,W.jsx)(h,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to plugins`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:O}),(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0 touch-mobile:h-10 touch-mobile:w-10`})]}),(0,W.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[E===void 0?(0,W.jsx)(`span`,{"aria-hidden":!0,className:`h-8 w-8 shrink-0`}):(0,W.jsx)(G,{external:E,icon:o?.icon??void 0,iconSrc:te,size:`md`}),(0,W.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:O})]}),(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[D?(0,W.jsx)(J,{}):null,o?(0,W.jsx)(st,{external:T}):null]})]}),o?.description?(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:o.description}):null]}),o?(0,W.jsx)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:(0,W.jsx)(it,{plugin:o,drift:s,enabled:a,onToggle:()=>ee(t,!a),isToggling:S===t,onInstall:u,onRemove:d,onUpgrade:f,isInstalling:m,isRemoving:g,isUpgrading:_,hasLocalEdits:x})}):null,(v||y||b)&&(0,W.jsx)(`div`,{className:`mt-3`,children:(0,W.jsx)(ot,{isInstallError:v,isRemoveError:y,isUpgradeError:b})}),(0,W.jsx)(p.Root,{asChild:!0,noPadding:!0,children:(0,W.jsx)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4`,children:c?(0,W.jsx)(at,{}):l||!o?(0,W.jsx)(q,{}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(K,{plugin:o,surfaces:s?.surfaces??null}),o.readme?(0,W.jsx)(pe,{content:o.readme}):(0,W.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`This plugin doesn't ship a README.`})]})})})})]});return C?(0,mt.createPortal)(ne,C):ne}function gt({assistantId:e,item:t,drift:n,onSelect:r,onInstall:a,onRemove:o,onUpgrade:s,isInstalling:c=!1,isRemoving:l=!1,isUpgrading:u=!1}){let d=t.status===`available`,f=n?.status===`update-available`,m=t.enabled!==void 0,h=t.enabled===!1,g=X(e,t.name,t.hasIcon,t.iconVersion);return(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:r,onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,W.jsx)(G,{size:`sm`,external:t.external,icon:t.icon,iconSrc:g,className:h?`opacity-50`:void 0}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:h?`var(--content-tertiary)`:`var(--content-emphasised)`},children:t.name}),t.version?(0,W.jsxs)(`span`,{className:`shrink-0 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[`v`,t.version]}):null,(0,W.jsx)(N,{tone:`neutral`,leftIcon:(0,W.jsx)(ae,{"aria-hidden":!0}),children:`Plugin`}),f?(0,W.jsx)(J,{onClick:s,isUpgrading:u}):null]}),(0,W.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description??`No description provided.`}),t.issues&&t.issues.length>0?(0,W.jsxs)(`p`,{className:`mt-1 truncate text-body-small-default`,style:{color:`var(--content-warning, var(--content-tertiary))`},title:t.issues.join(`; `),children:[t.issues[0],t.issues.length>1?` (+${t.issues.length-1} more)`:``]}):null]}),d?c?(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),a?.()},disabled:!a,"aria-label":`Install plugin`,expandOnMobile:!1}):(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m?(0,W.jsx)(N,{tone:t.enabled?`positive`:`neutral`,children:t.enabled?`Enabled`:`Disabled`}):null,(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:l?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),o?.()},disabled:l||u||!o,"aria-label":`Remove plugin`,expandOnMobile:!1})]})]})})}var _t={mail:ze,calendar:C,"message-circle":Be,globe:ie,zap:z,code:te,mic:M,"shopping-cart":Pe,palette:We,heart:B,settings:w,"link-2":A};function vt(e){return _t[e]}function yt({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a,ariaLabel:o=`Skill categories`}){let s=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,W.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":o,children:[(0,W.jsx)(bt,{icon:R,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),s.map(r=>(0,W.jsx)(bt,{icon:vt(r.icon)??R,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function bt({icon:e,label:t,count:n,isActive:r,showCount:a,onClick:o}){return(0,W.jsxs)(i,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,W.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),a&&(0,W.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}function xt({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:a=!1,isRemoving:o=!1}){let s=b(e),c=Ve(e);return(0,W.jsx)(p.Root,{asChild:!0,children:(0,W.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,W.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,W.jsx)(y,{skill:e,className:`h-7 w-7`})}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,W.jsx)(g,{origin:e.origin})]}),(0,W.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?a?(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,iconOnly:(0,W.jsx)(I,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,W.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,W.jsx)(j,{className:`animate-spin`,"aria-hidden":!0}):(0,W.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}var St=[{value:`all`,label:`All`,icon:R},{value:`installed`,label:`Installed`,icon:Le},{value:`available`,label:`Available`,icon:I}],Ct=[{value:`skills`,label:`Skills`,icon:z},{value:`plugins`,label:`Plugins`,icon:ae}],wt=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:ie},{value:`skillssh`,label:`skills.sh`,icon:je},{value:`custom`,label:`Custom`,icon:L},{value:`assistant-memory`,label:`Assistant's Memory`,icon:S}];function Tt({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,W.jsx)(ue,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search superpowers`,"aria-label":`Search superpowers`,leftIcon:(0,W.jsx)(Re,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,W.jsx)(j,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,W.jsx)(Et,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u,pluginsSupported:d})]})}function Et(e){let t=Ae(),[n,r]=(0,U.useState)(!1),a=(0,W.jsx)(i,{type:`button`,variant:`outlined`,iconOnly:(0,W.jsx)(Ue,{"aria-hidden":!0}),"aria-label":`Filter superpowers`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});if(t)return(0,W.jsx)(Dt,{...e,open:n,onOpenChange:r,trigger:a});let o=t=>{e.onFilterChange(t),r(!1)};return(0,W.jsxs)(le.Root,{open:n,onOpenChange:r,children:[(0,W.jsx)(le.Trigger,{asChild:!0,children:a}),(0,W.jsx)(le.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,W.jsxs)(`ul`,{role:`listbox`,children:[(0,W.jsx)(kt,{label:`Status`,options:St,selected:e.filter,onSelect:o}),e.pluginsSupported&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,W.jsx)(kt,{label:`Type`,options:Ct,selected:e.filter,onSelect:o})]}),(0,W.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,W.jsx)(kt,{label:`Source`,options:wt,selected:e.filter,onSelect:o})]})})]})}function Dt({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,pluginsSupported:l,open:u,onOpenChange:d,trigger:f}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,W.jsxs)(E.Root,{open:u,onOpenChange:d,children:[(0,W.jsx)(E.Trigger,{asChild:!0,children:f}),(0,W.jsxs)(E.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,W.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,W.jsx)(E.Header,{children:(0,W.jsx)(E.Title,{children:`Filters`})}),(0,W.jsxs)(E.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,W.jsx)(Ot,{label:`Status`,children:St.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),l&&(0,W.jsx)(Ot,{label:`Type`,children:Ct.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,W.jsx)(Ot,{label:`Source`,children:wt.map(n=>(0,W.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,W.jsxs)(Ot,{label:`Categories`,children:[(0,W.jsx)($,{icon:R,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>a(null)}),p.map(e=>(0,W.jsx)($,{icon:vt(e.icon)??R,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,W.jsx)(E.Footer,{children:(0,W.jsx)(i,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>d(!1),children:`Done`})})]})]})}function Ot({label:e,children:t}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,W.jsx)(D,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,W.jsx)(T,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function kt({label:e,options:t,selected:n,onSelect:r}){return(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,W.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,W.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,W.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,W.jsx)(Le,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}var At=300*1e3,jt=[],Mt=[];async function Nt(e,t,n){let r=await ge({path:{assistant_id:e},query:{q:void 0,category:t},signal:n,throwOnError:!1});if(r.response?.status===404)return{plugins:[]};if(!r.response?.ok)throw Error(`Failed to load plugins`);return r.data??{plugins:[]}}function Pt(e,t){let[n,r]=(0,U.useState)({assistantId:e,latched:!1}),i=n.assistantId===e?n.latched:!1;return n.assistantId!==e&&r({assistantId:e,latched:!1}),(0,U.useEffect)(()=>{t&&r(t=>t.assistantId===e&&t.latched?t:{assistantId:e,latched:!0})},[e,t]),i||t}function Ft(e,t=null,n=!0){let r=t??void 0,i=u({queryKey:we({path:{assistant_id:e},query:{q:void 0,category:r}}),queryFn:({signal:t})=>Nt(e,r,t),enabled:!!e&&n,staleTime:At}),a=u({...Fe(e),enabled:!!e&&n&&t!==null}),o=u({...be({path:{assistant_id:e},query:{q:void 0}}),enabled:!!e&&n,staleTime:At}),s=(0,U.useMemo)(()=>{let e=t===null?i.data?.plugins:a.data?.plugins??i.data?.plugins;return new Set((e??jt).map(e=>e.name))},[t,a.data?.plugins,i.data?.plugins]),c=(0,U.useMemo)(()=>{let e=i.data?.plugins??jt,n=o.data?.matches??Mt;return tt($e(e,(t===null?n:n.filter(e=>(e.category??`system`)===t)).filter(e=>!s.has(e.name))))},[i.data?.plugins,o.data?.matches,t,s]),d=t===null?i.data:a.data,f=Pt(e,d?.categoryCounts!==void 0),p=Pt(e,(d?.plugins??jt).some(e=>e.enabled!==void 0)),m=l(),h=(0,U.useRef)(null);return(0,U.useEffect)(()=>{if(h.current===e||!o.isSuccess)return;let t=d?.plugins;if(!t?.length)return;let n=new Map((o.data?.matches??Mt).map(e=>[e.name,e.category]));t.some(e=>{let t=n.get(e.name);return t!=null&&t!==`system`&&(e.category??`system`)===`system`})&&(h.current=e,m.invalidateQueries({queryKey:we({path:{assistant_id:e},query:{q:void 0}})}))},[e,o.isSuccess,o.data?.matches,d?.plugins,m]),{items:c,isLoading:i.isLoading,catalogLoading:o.isLoading,isError:i.isError,isFetching:i.isFetching||o.isFetching,catalogError:o.isError,categorySupported:f,pluginToggleSupported:p,installedCategoryCounts:d?.categoryCounts,installedPlugins:d?.plugins??jt,installedTotal:d?.totalCount,catalogMatches:o.data?.matches??Mt,unfilteredInstalledNames:s}}function It(e){return u({...Te({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}var Lt=new Set([`all`,`installed`,`available`,`skills`,`plugins`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function Rt(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:Vt(t)?t:`all`,category:n||null}}function zt(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Bt(n,`q`,t.q.trim()||null),t.filter!==void 0&&Bt(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Bt(n,`category`,t.category),n}function Bt(e,t,n){n===null?e.delete(t):e.set(t,n)}function Vt(e){return e!==null&&Lt.has(e)}function Ht(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function Ut(e){return e!==`plugins`}function Wt(e){return e===`all`||e===`installed`||e===`available`||e===`plugins`}function Gt(e){switch(e){case`installed`:return`installed`;case`available`:return`available`;default:return`all`}}function Kt(e,t){let[n,r]=(0,U.useState)(e);return(0,U.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var qt=300,Jt=`vellum:superpowers:tipDismissed`;function Yt(e){return[...e].sort((e,t)=>e.installed===t.installed?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):e.installed?-1:1)}function Xt({assistantId:e}){let r=c(),i=o(),a=l(),d=Ae(),f=Ee.use.version(),p=Ie(),[m,h]=s(),{q:g,filter:v,category:y}=(0,U.useMemo)(()=>Rt(m),[m]),b=m.get(`plugin`),x=(0,U.useCallback)(e=>{h(t=>zt(t,e),{replace:!0})},[h]),S=m.get(`success`),C=(0,U.useRef)(!1);(0,U.useEffect)(()=>{S!==`true`||C.current||(C.current=!0,b&&P.success(`Installed ${b}`),h(e=>{let t=new URLSearchParams(e);return t.delete(`success`),t},{replace:!0}))},[S,b,h]);let[w,T]=(0,U.useState)(g),E=Kt(w.trim(),qt),D=(0,U.useRef)(g);(0,U.useEffect)(()=>{if(g!==D.current&&(D.current=g,g!==w.trim())){T(g);return}E!==g&&E===w.trim()&&(D.current=E,x({q:E}))},[E,g,w,x]);let O=(0,U.useCallback)(e=>x({filter:e}),[x]),te=(0,U.useCallback)(e=>x({category:e}),[x]),[ne,re]=(0,U.useState)(()=>n(Jt,!1)),ie=(0,U.useCallback)(()=>{re(!0),t(Jt,!0)},[]),k=!p&&v===`plugins`?`all`:v,A=Ut(k),j=p&&Wt(k),M=Gt(k),{handleInstall:ae,handleRemove:oe,isInstallingSkill:se,isRemovingSkill:ce,skillPendingRemoval:N,confirmRemove:le,cancelRemove:ue}=ee(e),{data:de=[]}=It(e),{origin:pe,kind:me}=(0,U.useMemo)(()=>Ht(k),[k]),F=u({..._e({path:{assistant_id:e},query:{include:`catalog`,origin:pe,kind:me,q:E||void 0,category:y??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&A}),he=u({..._e({path:{assistant_id:e},query:{include:`catalog`,origin:pe,kind:me,q:E||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&A&&y!==null}),{items:ge,isLoading:ye,catalogLoading:be,isError:Ce,isFetching:we,catalogError:Te,categorySupported:De,installedCategoryCounts:ke,installedPlugins:je,installedTotal:Ne,catalogMatches:Pe,unfilteredInstalledNames:I}=Ft(e,y,p),L=j&&(y===null||De),Fe=(0,U.useCallback)(t=>Me(a,e,t),[e,a]),[Le,Re]=(0,U.useState)(null),[ze,R]=(0,U.useState)(null),[z,Be]=(0,U.useState)(null),[B,V]=(0,U.useState)(null),[H,Ve]=(0,U.useState)(null),Ue=ve({onMutate:e=>Re(e.body.name),onSuccess:(e,t)=>P.success(`Installed ${t.body.name}`),onError:()=>P.error(Ye),onSettled:(e,t,n)=>{Re(null),Fe(n.body.name)}}),We=Se({onMutate:e=>R(e.path.name),onSuccess:(e,t)=>P.success(`Removed ${t.path.name}`),onError:()=>P.error(Xe),onSettled:(e,t,n)=>{R(null),Fe(n.path.name)}}),Ge=xe({onMutate:e=>Be(e.path.name),onSuccess:(e,t)=>P.success(e.outcome===`already-up-to-date`?`${t.path.name} is already up to date`:`Upgraded ${t.path.name} to ${rt(e.toCommit)}`),onError:()=>P.error(Ze),onSettled:(e,t,n)=>{Be(null),Fe(n.path.name)}}),G=(0,U.useCallback)(e=>h(t=>{let n=new URLSearchParams(t);return n.set(`plugin`,e.name),n}),[h]),Qe=(0,U.useCallback)(()=>h(e=>{let t=new URLSearchParams(e);return t.delete(`plugin`),t},{replace:!0}),[h]),$e=(0,U.useCallback)(t=>{Ue.mutate({path:{assistant_id:e},body:{name:t.name}})},[e,Ue]),tt=(0,U.useCallback)(()=>{B&&(We.mutate({path:{assistant_id:e,name:B.name}}),V(null))},[e,B,We]),K=(0,U.useCallback)(t=>{Ge.mutate({path:{assistant_id:e,name:t},body:{}})},[e,Ge]),it=(0,U.useCallback)(()=>{H&&(K(H.name),Ve(null))},[H,K]),at=(0,U.useCallback)((e,t)=>{if(lt(t)){Ve(e);return}K(e.name)},[K]),q=(0,U.useMemo)(()=>A?F.data?.skills??[]:[],[A,F.data?.skills]),ot=(0,U.useMemo)(()=>L?nt(ge,M).filter(e=>et(e,E)):[],[L,ge,M,E]),st=(0,U.useMemo)(()=>Yt([...q.map(e=>({type:`skill`,key:`skill:${e.id}`,name:e.name,installed:_(e),skill:e})),...ot.map(e=>({type:`plugin`,key:`plugin:${e.name}`,name:e.name,installed:e.status===`installed`,item:e}))]),[q,ot]),J=y===null?F.data:he.data,ct=Zt(A,J?.skills??q,J?.categoryCounts,J?.totalCount),Y=Qt(j&&De,ke,je,Ne,Pe,I,M),{counts:ut,totalCount:dt}=(0,U.useMemo)(()=>{let e={...ct.counts};for(let[t,n]of Object.entries(Y.counts))e[t]=(e[t]??0)+n;return{counts:e,totalCount:ct.totalCount+Y.totalCount}},[ct,Y]),ft=A&&F.isLoading,X=A&&F.isError,Z=L&&ye,Q=L&&Ce,mt=(X||!A)&&(Q||!L)&&(X||Q),_t=ft||Z,vt=!!E&&(A&&F.isFetching||L&&we&&!ye),bt=w.trim().length>0;if(b&&!p&&f===null)return null;if(b&&p){let t=ge.find(e=>e.name===b),n={assistantId:e,name:b,externalHint:t?.external,enabled:t?.enabled,onBack:Qe};return d?(0,W.jsx)(ht,{...n}):(0,W.jsx)(pt,{...n})}let St=(0,W.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:_t?(0,W.jsx)(nn,{}):mt?(0,W.jsx)(rn,{}):st.length===0?L&&be&&M!==`installed`?(0,W.jsx)(nn,{}):(0,W.jsx)(an,{filter:k,category:y}):(0,W.jsx)(`ul`,{className:`flex flex-col gap-2`,children:st.map(t=>(0,W.jsx)(`li`,{children:t.type===`skill`?(0,W.jsx)(xt,{skill:t.skill,onSelect:()=>r(Oe.skills.detail(t.skill.id),{state:{listSearch:i.search}}),onInstall:()=>ae(t.skill),onRemove:()=>oe(t.skill),isInstalling:se(t.skill),isRemoving:ce(t.skill)}):t.installed?(0,W.jsx)($t,{assistantId:e,item:t.item,onSelect:()=>G(t.item),onRemove:()=>V(t.item),onUpgrade:e=>at(t.item,e),isRemoving:ze===t.item.name,isUpgrading:z===t.item.name}):(0,W.jsx)(gt,{assistantId:e,item:t.item,onSelect:()=>G(t.item),onInstall:()=>$e(t.item),isInstalling:Le===t.item.name})},t.key))})});return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!ne&&(0,W.jsx)(en,{onDismiss:ie}),(0,W.jsx)(Tt,{search:w,onSearchChange:T,filter:k,onFilterChange:O,isSearching:vt,categories:de,category:y,onCategoryChange:te,counts:ut,totalCount:dt,showCounts:!bt,pluginsSupported:p}),!_t&&!mt&&X?(0,W.jsx)(tn,{text:`Skills are temporarily unavailable. Plugins are still listed below.`}):null,!_t&&!mt&&Q?(0,W.jsx)(tn,{text:`Plugins are temporarily unavailable. Skills are still listed below.`}):null,L&&Te&&!Z&&!Q?(0,W.jsx)(tn,{text:`Plugin catalog browsing is temporarily unavailable. Installed plugins are still listed below.`}):null,(0,W.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,W.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,W.jsx)(yt,{ariaLabel:`Superpower categories`,selected:y,onSelect:te,counts:ut,totalCount:dt,showCounts:!bt,categories:de})}),St]}),(0,W.jsx)(He,{skillName:N?.name??null,onConfirm:le,onCancel:ue}),(0,W.jsx)(fe,{open:B!==null,title:`Remove plugin`,message:B?Ke(B.name):``,confirmLabel:`Remove`,destructive:!0,onConfirm:tt,onCancel:()=>V(null)}),(0,W.jsx)(fe,{open:H!==null,title:`Upgrade plugin`,message:H?qe(H.name):``,confirmLabel:Je,destructive:!0,onConfirm:it,onCancel:()=>Ve(null)})]})}function Zt(e,t,n,r){return(0,U.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};if(n&&Object.keys(n).length>0)return{counts:n,totalCount:r??t.length};let i={};for(let e of t){let t=e.category??`system`;i[t]=(i[t]??0)+1}return{counts:i,totalCount:r??t.length}},[e,t,n,r])}function Qt(e,t,n,r,i,a,o){return(0,U.useMemo)(()=>{if(!e)return{counts:{},totalCount:0};let s={},c=o!==`available`,l=o===`all`||o===`available`;if(c)if(t&&Object.keys(t).length>0)Object.assign(s,t);else for(let e of n){let t=e.category??`system`;s[t]=(s[t]??0)+1}let u=0;if(l)for(let e of i){if(a.has(e.name))continue;let t=e.category??`system`;s[t]=(s[t]??0)+1,u+=1}let d=r??n.length;return{counts:s,totalCount:(c?d:0)+u}},[e,t,n,r,i,a,o])}function $t({assistantId:e,item:t,onSelect:n,onRemove:r,onUpgrade:i,isRemoving:a,isUpgrading:o}){let s=Y({assistantId:e,name:t.name}).data;return(0,W.jsx)(gt,{assistantId:e,item:t,drift:s,onSelect:n,onRemove:r,onUpgrade:()=>i(s),isRemoving:a,isUpgrading:o})}function en({onDismiss:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,W.jsx)(oe,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,W.jsx)(`p`,{className:`flex-1`,children:`Create a new custom skill by describing what you want in chat, or install plugins to extend your assistant.`}),(0,W.jsx)(i,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,W.jsx)(ce,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function tn({text:e}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,W.jsx)(O,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,W.jsx)(`p`,{className:`flex-1`,children:e})]})}function nn(){return(0,W.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,W.jsx)(j,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function rn(){return(0,W.jsx)(p.Root,{children:(0,W.jsxs)(p.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,W.jsx)(se,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,W.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load superpowers`}),(0,W.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function an({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=on(e,t);return(0,W.jsx)(v,{icon:i,title:n,subtitle:r})}function on(e,t){if(t)return{title:`Nothing in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:R};switch(e){case`installed`:return{title:`No Superpowers Installed`,subtitle:`Ask your assistant in chat to search for and install new skills and plugins.`,Icon:z};case`available`:return{title:`Nothing Left to Install`,subtitle:`All available skills and plugins are installed.`,Icon:Le};case`skills`:return{title:`No Skills Found`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:z};case`plugins`:return{title:`No Plugins Found`,subtitle:`Browse the catalog to install plugins that extend your assistant.`,Icon:ae};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:z};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:z};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:z};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:z};case`assistant-memory`:return{title:`No Skills From Memory`,subtitle:`Skills your assistant authors from past conversations will appear here.`,Icon:z};default:return{title:`No Superpowers Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:O}}}function sn(){return(0,W.jsx)(Xt,{assistantId:Ne()})}export{sn as SuperpowersPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./createLucideIcon-Bjb-Kuq7.js";import{t as l}from"./cpu-DuPtXZt_.js";import{t as u}from"./hard-drive-DVmyHlZR.js";import{t as d}from"./info-CqgkBvyS.js";import{t as f}from"./loader-circle-Ck8fq3yv.js";import{a as ee,c as te,i as p,n as m,r as h,t as ne}from"./resize-errors-ORrW5M6r.js";import{t as g}from"./triangle-alert-CnjNKhNx.js";import{t as _}from"./notice-DkAWz47A.js";import{t as v}from"./modal-BtcwNEBj.js";import{n as y}from"./toast-Be8FEQ-I.js";import{t as b}from"./dropdown-BxYrCXBS.js";import{t as x}from"./is-electron-y5bNUVyG.js";import{t as S}from"./dist-DyRKd0bN2.js";import{n as C}from"./browser-CUpmd8oz.js";import{t as w}from"./misc-D0u5tzSd.js";import{Bi as T,Gi as E,Hr as re,Li as D,Wi as ie,Ws as O,fa as ae,qi as k,vt as A,yt as j}from"./index-BTyMkqXw.js";var oe=c(`computer`,[[`rect`,{width:`14`,height:`8`,x:`5`,y:`2`,rx:`2`,key:`wc9tft`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,key:`w68u3i`}],[`path`,{d:`M6 18h2`,key:`rwmk9e`}],[`path`,{d:`M12 18h6`,key:`aqd8w3`}]]),M=`vellum.pro-checkout-intent`,se=1800*1e3;function ce(e){try{sessionStorage.setItem(M,JSON.stringify({...e,savedAt:Date.now()}))}catch{}}function le(){if(typeof sessionStorage>`u`)return null;let e=null;try{e=sessionStorage.getItem(M)}catch{return null}if(!e)return null;let t;try{t=JSON.parse(e)}catch{return N(),null}return!ue(t)||Date.now()-t.savedAt>se?(N(),null):t}function N(){try{sessionStorage.removeItem(M)}catch{}}function ue(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.savedAt==`number`?t.kind===`package`?typeof t.packageKey==`string`:t.kind===`custom`:!1}var P=e(t(),1),F=o(),de=1e3,fe=1e4,pe=3e4,I=9e4,me=I*2/3,L=2500,R=2e3,z=[`machine_size`,`subdomain`,`non_field_errors`],he={subdomain_taken:`That subdomain is already taken. Try another.`,assistant_already_has_domain:`Your assistant already has a custom domain.`,no_assistant_to_attach_domain:`We couldn't find an assistant to attach this domain to.`,exceeds_machine_tier:`That machine size isn't available on your plan.`,provisioning_submission_failed:`We couldn't queue your upgrade just now. Try again in a moment.`,no_active_pro:`We couldn't confirm your Pro plan yet. Try again in a moment.`};function B(e,t){if(e&&typeof e==`object`){let t=e;if(typeof t.error==`string`){let e=he[t.error];if(e)return e}for(let e of z){let n=t[e];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(typeof t.detail==`string`)return t.detail}return t}var ge=`We couldn't finish your machine upgrade automatically. Apply it now to finish — your assistant will briefly restart.`;function _e({action:e,buttonTestId:t,className:r}){return(0,F.jsxs)(`div`,{className:w(`flex flex-col items-center gap-2`,r),children:[(0,F.jsx)(_,{tone:`warning`,className:`w-full text-left`,children:ge}),e.error!=null&&(0,F.jsx)(_,{tone:`error`,className:`w-full text-left`,children:B(e.error,`Couldn't apply changes. Please try again.`)}),(0,F.jsx)(n,{variant:`outlined`,"data-testid":t,disabled:e.pending,onClick:e.onApply,children:`Apply & Restart`})]})}function ve({icon:e}){return(0,F.jsx)(`span`,{className:`flex h-11 w-11 items-center justify-center rounded-full`,style:{backgroundColor:`color-mix(in oklab, var(--system-negative-strong) 12%, transparent)`},children:(0,F.jsx)(e,{className:`h-5 w-5`,style:{color:`var(--system-negative-strong)`},"aria-hidden":`true`})})}function V({icon:e,label:t,from:n,fromDetail:r,to:i,toDetail:a}){return(0,F.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,F.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,style:{backgroundColor:`color-mix(in oklab, var(--system-positive-strong) 10%, transparent)`},children:(0,F.jsx)(e,{className:`h-4 w-4 text-[var(--system-positive-strong)]`})}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:t}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)] line-through`,children:n}),r&&(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)] line-through`,children:r})]}),(0,F.jsx)(O,{className:`h-3 w-3 shrink-0 text-[var(--content-tertiary)]`}),(0,F.jsxs)(`div`,{className:`flex flex-col`,children:[(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:i}),a&&(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:a})]})]})]})]})}var H={fontFamily:`var(--font-serif)`,fontSize:`32px`,fontWeight:400,lineHeight:1.2,letterSpacing:`0.64px`};function ye({title:e,subtitle:t}){return(0,F.jsxs)(`header`,{className:`flex flex-col items-center gap-2 pt-12 text-center`,children:[(0,F.jsx)(`h2`,{className:`text-[var(--content-emphasised)]`,style:H,children:e}),t&&(0,F.jsx)(`p`,{className:`text-[14px] font-normal text-[var(--content-secondary)]`,children:t})]})}var be=[{bodyShape:`blob`,eyeStyle:`goofy`,color:`green`,size:56,position:`-left-4 -top-6`,rotate:-12},{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`,size:48,position:`left-1/2 -top-8 -translate-x-1/2`,rotate:6},{bodyShape:`urchin`,eyeStyle:`surprised`,color:`teal`,size:56,position:`-right-4 -top-6`,rotate:14},{bodyShape:`star`,eyeStyle:`gentle`,color:`purple`,size:44,position:`-left-6 top-1/2 -translate-y-1/2`,rotate:-20},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`pink`,size:44,position:`-right-6 top-1/2 -translate-y-1/2`,rotate:18},{bodyShape:`flower`,eyeStyle:`quirky`,color:`yellow`,size:52,position:`left-1/2 -bottom-8 -translate-x-1/2`,rotate:-8}],xe=[{bodyShape:`star`,eyeStyle:`gentle`,color:`yellow`,size:76,position:`-left-6 -top-7`,rotate:180},{bodyShape:`urchin`,eyeStyle:`curious`,color:`orange`,size:72,position:`left-[58%] -top-12 -translate-x-1/2`,rotate:-8},{bodyShape:`blob`,eyeStyle:`gentle`,color:`green`,size:60,position:`-right-4 top-11`,rotate:1}];function Se({variant:e=`full`}){let t=A();return t?(0,F.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`creature-corners`,className:`pointer-events-none absolute inset-0 select-none`,children:(e===`top`?xe:be).map((e,n)=>(0,F.jsx)(`span`,{className:`absolute ${e.position}`,style:{rotate:`${e.rotate}deg`},children:(0,F.jsx)(j,{components:t,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:e.size})},n))}):null}function Ce(){return x()||S.isNativePlatform()?`native`:`web`}function U(e){let t=e/100;return Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`}function W(e){return`${U(e)}/mo`}function G(e){return`${e>0?`+`:`−`}${U(Math.abs(e))}/mo`}function K(e){return e.disabled===!0}function we({machineTiers:e,storageTiers:t,selectedMachineTier:n,selectedStorageTier:r,onMachineTierChange:i,onStorageTierChange:a,currentMachinePriceCents:o,currentStoragePriceCents:c}){let l=(0,P.useMemo)(()=>e.map(e=>{let t=m[e.tier]??e.label,n=o==null?`+${W(e.price_cents)}`:e.price_cents===o?`(${W(e.price_cents)}, current)`:G(e.price_cents-o);return{value:e.tier,label:`${t} ${n}`,disabled:K(e)}}),[e,o]),u=(0,P.useMemo)(()=>t.map(e=>{let t=c==null?`+${W(e.price_cents)}`:e.price_cents===c?`(${W(e.price_cents)}, current)`:G(e.price_cents-c);return{value:e.tier,label:`${e.storage_gib} GB ${t}`,disabled:K(e)}}),[t,c]);return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(s,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Machine`}),(0,F.jsx)(`span`,{title:`Determines the CPU and memory allocated to your assistant`,children:(0,F.jsx)(d,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,F.jsx)(b,{"aria-label":`Machine tier`,placeholder:`Select a machine tier`,value:n??``,onChange:i,options:l})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,F.jsx)(s,{as:`p`,variant:`label-small-default`,className:`text-[var(--content-secondary)]`,children:`Storage`}),(0,F.jsx)(`span`,{title:`Persistent disk space for your assistant's files and data`,children:(0,F.jsx)(d,{className:`h-3 w-3 text-[var(--content-tertiary)]`})})]}),(0,F.jsx)(b,{"aria-label":`Storage tier`,placeholder:`Select a storage tier`,value:r??``,onChange:a,options:u})]})]})}var q=new Set([`active`,`trialing`,`past_due`]);function Te(e){return e.plan_id!==`base`&&e.package!=null&&!e.package.customized&&e.cancel_at_period_end!==!0&&!e.cancel_at&&e.status!=null&&q.has(e.status)}var Ee=[`target_plan_id`,`confirm`,`machine_tier`,`storage_tier`,`credit_tier`,`package`,`non_field_errors`];function J(e,t){if(e&&typeof e==`object`){for(let t of Ee)if(t in e){let n=e[t];if(Array.isArray(n)&&typeof n[0]==`string`)return n[0]}if(`detail`in e&&typeof e.detail==`string`)return e.detail}return t}function De(e,t){let n=e.filter(e=>!K(e));return t!==null&&n.some(e=>e.tier===t)?t:n[0]?.tier??null}function Oe(e,t,n){return t===void 0?n:t!==null&&(t===n||e.some(e=>e.tier===t))?t:null}function ke(e){return e.length?Math.min(...e.map(e=>e.price_cents)):0}var Y=[`mighty`,`super`,`ultra`],Ae=[`free`,...Y];function X(e){return Ae.indexOf(e)}function je(e,t){if(e===null)return`upgrade`;let n=X(e),r=X(t);return n===-1||r===-1?`upgrade`:r===n?`current`:r<n?`downgrade`:`upgrade`}function Me(e,t){if(e.length===0)return null;let n=[...e].sort((e,t)=>Y.indexOf(e.key)-Y.indexOf(t.key));if(!t)return n[0];let r=n.findIndex(e=>e.key===t);return r===-1?n[0]:r>=n.length-1?null:n[r+1]}function Ne(){let e=r(),t=a(T());return{changePackage:async n=>{try{let r=await t.mutateAsync({body:{package:n}});return await Promise.all([e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:D()}),e.invalidateQueries({queryKey:E()})]),r}catch(e){return y.error(J(e,`Failed to change your plan. Please try again.`)),null}},isPending:t.isPending}}var Pe={free:{tagline:`Get to know your assistant`,cta:`Start Free`,priceCaption:`Forever`},mighty:{tagline:`Empower your assistant to level you up.`,cta:`Power Up`,priceCaption:`Billed monthly`},super:{tagline:`Give your assistant real muscle to help you grow`,cta:`Go Super`,priceCaption:`Billed monthly`,mostPopular:!0,extraFeatures:[`Assistant email and subdomain`]},ultra:{tagline:`Our most powerful assistant. There's nothing you can't tackle together`,cta:`Unleash Ultra`,priceCaption:`Billed monthly`,extraFeatures:[`Assistant email and subdomain`]}};function Fe(e){return Pe[e]}function Z(e){return`Downgrade to ${e}`}var Q=`Your machine downsizes now and your storage stays. No refund — a prorated credit applies to your next invoice.`,Ie=`You'll be charged the prorated difference now.`;function Le({open:e,relation:t,packageName:r,pending:i,onCancel:a,onConfirm:o}){let c=t===`downgrade`;return(0,F.jsx)(v.Root,{open:e,onOpenChange:e=>{!e&&!i&&a()},children:(0,F.jsxs)(v.Content,{size:`md`,hideCloseButton:!0,children:[(0,F.jsx)(v.Header,{children:(0,F.jsx)(v.Title,{icon:c?g:void 0,children:c?`Downgrade to ${r}?`:`Upgrade to ${r}?`})}),(0,F.jsx)(v.Body,{children:(0,F.jsx)(s,{as:`p`,variant:`body-medium-default`,className:`text-(--content-secondary)`,children:c?Q:Ie})}),(0,F.jsxs)(v.Footer,{children:[(0,F.jsx)(n,{variant:`outlined`,onClick:a,disabled:i,children:`Cancel`}),(0,F.jsx)(n,{variant:c?`danger`:`primary`,onClick:o,disabled:i,"data-testid":`confirm-package-switch-button`,children:c?Z(r):`Switch to ${r}`})]})]})})}var Re={free:`#E9C91A`,mighty:`#4C9B50`,super:`#0E9B8B`,ultra:`#EF4300`},$={free:{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},mighty:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`green`},super:{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},ultra:{bodyShape:`sprout`,eyeStyle:`curious`,color:`orange`}};function ze({tier:e,size:t=40}){let n=$[e]??$.free,r=A();return(0,F.jsx)(`div`,{"aria-hidden":!0,className:`inline-flex shrink-0`,children:r?(0,F.jsx)(j,{components:r,bodyShapeId:n.bodyShape,eyeStyleId:n.eyeStyle,colorId:n.color,size:t}):(0,F.jsx)(`div`,{style:{width:t,height:t}})})}function Be(){let e=r();(0,P.useEffect)(()=>C(()=>{e.invalidateQueries({queryKey:k()}),e.invalidateQueries({queryKey:D()}),e.invalidateQueries({queryKey:E()})}),[e])}function Ve({open:e,onClose:t}){let r=i({...re(),enabled:e}),a=i({...ie(),enabled:e}),o=r.data,s=o?.machine_size||`small`,c=o?.provisioned_storage_gib??null,d=a.data?.max_machine_tier??null,m=a.data?.selected_storage_gib??null,g=ee(d),b=g.length>0?g[g.length-1]:s,x=b!==s,S=m!=null&&(c==null||c<m),C=x||S,[w,T]=(0,P.useState)(null),E=ae({onSuccess:()=>{y.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),T(null),t()},onError:e=>{T(ne(e,`Failed to resize assistant. Please try again.`))}}),D=E.isPending,O=r.isLoading||a.isLoading;return(0,F.jsx)(v.Root,{open:e,onOpenChange:e=>{e||(T(null),t())},children:(0,F.jsxs)(v.Content,{size:`sm`,children:[(0,F.jsxs)(v.Header,{children:[(0,F.jsx)(v.Title,{icon:te,children:`Plan Updated`}),(0,F.jsx)(v.Description,{children:`Your new resources are ready. Apply them now to resize your assistant — it will briefly restart.`})]}),(0,F.jsxs)(v.Body,{children:[O?(0,F.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,F.jsx)(f,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):C?(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[x&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(V,{icon:l,label:`Machine`,from:p[s],to:p[b]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:`CPU`}),(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:h[b].split(`,`)[0].trim()})]}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 rounded-lg bg-[var(--surface-base)] px-3 py-2.5`,children:[(0,F.jsx)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:`Memory`}),(0,F.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-default)]`,children:h[b].split(`,`)[1].trim()})]})]})]}),S&&(0,F.jsx)(V,{icon:u,label:`Storage`,from:c==null?`—`:`${c} GB`,to:`${m} GB`})]}):(0,F.jsx)(_,{tone:`neutral`,children:`Your assistant is already running at the maximum size for your plan.`}),w&&(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(_,{tone:`error`,children:w})})]}),(0,F.jsxs)(v.Footer,{children:[(0,F.jsx)(n,{variant:`ghost`,onClick:()=>{T(null),t()},children:`Do Later`}),(0,F.jsx)(n,{disabled:O||!C||D||!o?.id,leftIcon:D?(0,F.jsx)(f,{className:`animate-spin`}):void 0,onClick:()=>{if(!o?.id)return;T(null);let e={};x&&(e.machine_size=b),S&&m!=null&&(e.storage_gib=m),E.mutate({path:{id:o.id},body:e})},children:w?`Retry`:`Apply & Restart`})]})]})})}export{me as A,oe as B,Ce as C,_e as D,H as E,fe as F,B as I,N as L,I as M,pe as N,ye as O,de as P,le as R,W as S,ve as T,De as _,Le as a,G as b,Ne as c,je as d,q as f,Oe as g,ke as h,Re as i,L as j,R as k,Y as l,Te as m,Be as n,Z as o,J as p,ze as r,Fe as s,Ve as t,Me as u,we as v,Se as w,U as x,K as y,ce as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{P as n}from"./button-BQVYX8n_.js";var r=e(t(),1),i={"title-large":`text-title-large`,"title-medium":`text-title-medium`,"title-small":`text-title-small`,"body-large-lighter":`text-body-large-lighter`,"body-large-default":`text-body-large-default`,"body-medium-lighter":`text-body-medium-lighter`,"body-medium-default":`text-body-medium-default`,"body-small-default":`text-body-small-default`,"body-small-emphasised":`text-body-small-emphasised`,"label-medium-default":`text-label-medium-default`,"label-small-default":`text-label-small-default`,chat:`text-chat`};function a({variant:e,as:t=`span`,className:a,children:o,ref:s,...c}){return(0,r.createElement)(t,{...c,ref:s,"data-slot":`typography`,className:n(i[e],a)},o)}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{n as r}from"./QueryClientProvider-DKhXIxGb.js";import{t as i}from"./useQuery-B45lW1Kk.js";import{t as a}from"./useMutation-Lj4VunQV.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-Cqi8q9o7.js";import{t as c}from"./check-wF3S-AV4.js";import{o as l}from"./list-row-CFyYr-FU.js";import{t as u}from"./link-2-B9c5ZsFq.js";import{t as d}from"./loader-circle-Ck8fq3yv.js";import{t as f}from"./input-ZpyYt_a0.js";import{t as p}from"./modal-BtcwNEBj.js";import{Jt as m,Qt as h,en as g}from"./sdk.gen-BR-xXIZm.js";import{G as _,K as v,U as y,W as b,o as x,s as S,x as C}from"./react-query.gen-DfzfX_Jv.js";import{r as w}from"./utils-DvUW9GK8.js";import{n as T,r as E,t as D}from"./api-errors-CoE1wFl2.js";import{n as O}from"./sdk.gen-BhtkuoSl.js";import{t as k}from"./assistant-feature-flag-store-DuuDCLuS.js";import{Bt as A,C as j,Ca as M,S as ee,Sa as N,Vt as P,b as te,x as ne}from"./index-BTyMkqXw.js";import{t as F}from"./mutation-error-C9sr8Rue.js";import{t as I}from"./a2a-invite-VS3p3CfD.js";function L(e){return e?.trim()||`your assistant`}var R=e(t(),1),z=o(),B=[`no_one`,`guardian_only`,`trusted_contacts`,`any_contact`,`strangers`],V=`trusted_contacts`,H=new Set([`platform`,`a2a`]),U=new Set([`vellum`,`whatsapp`]);function W(e){return U.has(e)}var G={no_one:`No one`,guardian_only:`Only you`,trusted_contacts:`Verified contacts`,any_contact:`Any contact`,strangers:`Strangers`};function K(e){return{no_one:`No one can message ${e} on this channel — every message is blocked, including yours.`,guardian_only:`Only you can message ${e}. Everyone else is turned away.`,trusted_contacts:`You and the people you’ve verified can message ${e}. Anyone else is asked to verify first, and you’re notified.`,any_contact:`You and any known contact can message ${e}, including contacts you haven’t verified yet. Strangers are asked to verify first.`,strangers:`Anyone can message ${e}, including complete strangers.`}}function q(e){let t=e-Date.now();if(t<=0)return`Expired`;let n=Math.ceil(t/(1e3*60*60*24));return n===1?`Expires in 1 day`:`Expires in ${n} days`}function J({open:e,assistantId:t,onClose:r}){let[i,o]=(0,R.useState)(!1),u=(0,R.useRef)(null),m=(0,R.useRef)(!1),h=a({...y({path:{assistant_id:t}})}),g=(0,R.useRef)(h.mutate);(0,R.useLayoutEffect)(()=>{g.current=h.mutate});let _=(0,R.useRef)(h.reset);(0,R.useLayoutEffect)(()=>{_.current=h.reset}),(0,R.useEffect)(()=>{e&&!m.current&&g.current({path:{assistant_id:t}}),m.current=e},[e,t]),(0,R.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let v=(0,R.useCallback)(()=>{_.current(),o(!1),u.current&&=(clearTimeout(u.current),null),r()},[r]),b=(0,R.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{o(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(!1),2e3)})},[]),x=h.isSuccess&&h.data.token?I({senderAssistantId:t,token:h.data.token}):``;return(0,z.jsx)(p.Root,{open:e,onOpenChange:e=>{e||v()},children:(0,z.jsxs)(p.Content,{size:`sm`,children:[(0,z.jsx)(p.Header,{children:(0,z.jsx)(p.Title,{children:`Share Connection Link`})}),(0,z.jsx)(p.Body,{children:h.isPending?(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,z.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Creating invite link…`]}):h.isError?(0,z.jsxs)(`div`,{className:`space-y-3`,children:[(0,z.jsx)(`p`,{role:`alert`,className:`!m-0 text-body-medium-lighter`,style:{color:`var(--system-negative-strong)`},children:`Failed to create invite link. Make sure A2A is enabled for your assistant.`}),(0,z.jsx)(n,{variant:`outlined`,onClick:()=>h.mutate({path:{assistant_id:t}}),children:`Try Again`})]}):h.isSuccess?(0,z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,z.jsx)(s,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Share this link with another assistant owner to establish a connection.`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(f,{type:`text`,readOnly:!0,value:x,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,z.jsx)(`button`,{type:`button`,onClick:()=>b(x),"aria-label":`Copy invite link`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-[var(--border-base)] hover:bg-[var(--surface-hover)]`,children:i?(0,z.jsx)(c,{className:`h-4 w-4`}):(0,z.jsx)(l,{className:`h-4 w-4`})})]}),h.data.expiresAt!=null&&(0,z.jsx)(s,{variant:`body-small-default`,style:{color:`var(--content-tertiary)`},children:q(h.data.expiresAt)})]}):null}),(0,z.jsx)(p.Footer,{children:(0,z.jsx)(n,{variant:`outlined`,onClick:v,children:`Done`})})]})})}function Y({onClick:e}){return(0,z.jsx)(n,{variant:`outlined`,size:`compact`,leftIcon:(0,z.jsx)(u,{className:`h-3.5 w-3.5`}),onClick:e,children:`Share Connection Link`})}function X(e){return typeof e==`string`&&B.includes(e)}function Z(e){return H.has(e)}function Q(e){return(e?.policies??[]).filter(e=>!Z(e.channelType)&&!W(e.channelType)).map(e=>({...e,policy:X(e.policy)?e.policy:`trusted_contacts`}))}async function re(e,t,n,r){if(Z(t))throw new D(403,`Channel "${t}" is internal and is not user-configurable.`);let{data:i,error:a,response:o}=await O({path:{assistant_id:e,channel_type:t},body:{policy:n,note:r??null},throwOnError:!1});if(T(o,a,`Failed to save channel policy.`),!o.ok)throw new D(o.status,E(a,o,`Failed to save channel policy.`));if(!i?.policy)throw new D(500,`Gateway returned no policy in response.`);return i.policy}var ie=`0.10.0`;function $(){return w(ie)}function ae(e){let t=r(),n=k.use.channelTrustFloors(),o=$(),s=n&&o,c=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),l=(0,R.useMemo)(()=>M(c),[c]),u=i({...N(c),enabled:s,select:Q}),d=(0,R.useMemo)(()=>{let e={};for(let t of u.data??[])P(t.channelType)&&(e[t.channelType]=t.policy);return e},[u.data]),f=a({mutationFn:({channelKey:t,policy:n})=>re(e,t,n),onSuccess:()=>t.invalidateQueries({queryKey:l}),onError:F(`Failed to save channel policy`)}),p=(0,R.useCallback)((e,t)=>{f.mutate({channelKey:e,policy:t})},[f]);return s?{policies:d,savingKey:f.isPending?f.variables?.channelKey??null:null,isLoading:u.isPending,isError:u.isError,onChange:p}:{policies:void 0,savingKey:null,isLoading:!1,isError:!1,onChange:void 0}}var oe={slack:`I want to reach you on Slack. Let's set it up.`,telegram:`I want to reach you on Telegram. Let's set it up.`,phone:`I want to be able to call you. Let's set you up with a phone number.`},se=15e3;function ce({assistantId:e,onStartSetupConversation:t}){let n=r(),o=(0,R.useMemo)(()=>({path:{assistant_id:e}}),[e]),s=(0,R.useMemo)(()=>S(o),[o]),c=i({...x(o),enabled:!!e,refetchInterval:se,select:e=>e.snapshots}),l=(0,R.useMemo)(()=>le(c.data??[]),[c.data]),u=l.some(e=>e.key===`slack`&&e.status===`ready`),d=i({...b(o),enabled:u,select:e=>e.threadMode}),f=ae(e),p=(0,R.useCallback)(()=>n.invalidateQueries({queryKey:s}),[n,s]),y=a({mutationFn:async t=>{let n={path:{assistant_id:e},throwOnError:!0};t===`slack`?await m(n):t===`telegram`?await h(n):t===`phone`&&await g(n)},onSettled:(t,r,i)=>{p(),i===`slack`&&j(n,e)}}),C=ne({assistantId:e}),w=ee({assistantId:e}),T=te({assistantId:e}),E=a({...v(),onSuccess:()=>{n.invalidateQueries({queryKey:_(o)})}}),D=C.mutateAsync,O=(0,R.useCallback)(async e=>{await D(e)},[D]),k=w.mutate,A=(0,R.useCallback)((e,t)=>{k({botToken:e,appToken:t})},[k]),M=E.mutate,N=(0,R.useCallback)(t=>{M({path:{assistant_id:e},body:{threadMode:t}})},[M,e]),P=T.mutateAsync,F=(0,R.useCallback)(async(e,t)=>{await P({accountSid:e,authToken:t})},[P]),I=(0,R.useCallback)(e=>{t&&t(oe[e])},[t]),L=y.mutate,z=(0,R.useCallback)(e=>{L(e)},[L]);return{channels:l,pendingChannelKey:y.isPending?y.variables??null:null,slackThreadMode:d.data,slackThreadModePending:E.isPending,channelPolicies:f.policies,policySavingKey:f.savingKey,policiesLoading:f.isLoading,policiesError:f.isError,onChannelPolicyChange:f.onChange,onSetup:t?I:void 0,onDisconnect:z,onSaveTelegramToken:O,onSaveSlackConfig:A,slackSaveStatus:w.status,slackSaveError:w.error?.message??null,onSlackThreadModeChange:N,onSaveTwilioCredentials:F}}function le(e){let t=new Map;for(let n of e)t.set(n.channel,n);return A.map(e=>{let n=t.get(e);return{key:e,status:ue(n),address:n?.channelHandle??void 0}})}function ue(e){return e?e.ready||e.setupStatus===`ready`?`ready`:e.setupStatus===`incomplete`?`incomplete`:`not_configured`:`not_configured`}function de(e){let t=r(),[n,i]=(0,R.useState)(!1);return{isOpen:n,open:(0,R.useCallback)(()=>{i(!0)},[]),close:(0,R.useCallback)(()=>{i(!1),t.invalidateQueries({queryKey:C({path:{assistant_id:e}})})},[t,e])}}export{Y as a,B as c,L as d,Q as i,G as l,ce as n,J as o,$ as r,V as s,de as t,K as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e,T as t,i as n}from"./auth-store-DmFYd_Lh.js";function r(){let r=e.use.currentOrganizationId();return e.use.status(),n()?r!=null||t()!=null:!0}export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,c as n,i as r}from"./local-settings-C-dW2vkq.js";import{t as i}from"./react-DJZBPgpf.js";import{t as a}from"./button-BQVYX8n_.js";import{m as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-D8zyWtZh.js";import{t as f}from"./chevron-down-DpYf9Gwq.js";import{n as p}from"./list-row-CFyYr-FU.js";import{t as m}from"./info-CqgkBvyS.js";import{j as h,k as g}from"./src-BNYQ8guL.js";import{t as _}from"./toggle-QSEiPr3k.js";import{t as v}from"./dropdown-BxYrCXBS.js";import{At as y,Mt as b,Nt as x,Ot as S}from"./react-query.gen-DfzfX_Jv.js";import{a as C,i as w,n as T,r as ee,t as E}from"./sound-manager-DHHv5UT4.js";import{$o as D,Fr as O,Ir as k,J as A,U as j,W as M,_r as te,an as N,br as ne,dr as re,fr as ie,gr as P,hr as F,in as ae,mr as I,pr as L,vr as oe,yr as se,zo as ce}from"./index-BTyMkqXw.js";import{t as R}from"./detail-card-BXVPDa5J.js";import{r as le,t as z}from"./shared-ui-BQzVwlXn.js";var B=e(i(),1),V=u();function H({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,V.jsx)(_,{checked:n,disabled:r,onChange:i,label:e})]})}function U(){return(0,V.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function W({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:s}){let[c,l]=(0,B.useState)(!1),u=n.filter(e=>!t.sounds.includes(e.filename)),d=n.length>0&&u.length===0;return(0,V.jsxs)(`div`,{className:`py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:T[e]}),(0,V.jsx)(_,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${T[e]}`})]}),t.enabled&&(0,V.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:C(e)}),(0,V.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,V.jsx)(D,{className:`h-3 w-3`})}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,V.jsx)(ce,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,V.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):d?(0,V.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,V.jsxs)(`div`,{className:`relative inline-block`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,V.jsx)(f,{className:`h-3 w-3`})]}),c&&(0,V.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>l(!1),children:u.map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),l(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function ue(){let e=s(),t=A(),n=(0,B.useMemo)(()=>y({path:{assistant_id:t}}),[t]),r=(0,B.useMemo)(()=>S({path:{assistant_id:t}}),[t]),{data:i}=c(n),{data:a}=c(r),o=i??w(),u=a?.sounds??[],f=(0,B.useMemo)(()=>({path:{assistant_id:t}}),[t]),p=l({...x(f),onMutate:async t=>{await e.cancelQueries({queryKey:n.queryKey});let r=e.getQueryData(n.queryKey);return b(e,f,t.body),{previous:r}},onError:(t,n,r)=>{r?.previous!==void 0&&b(e,f,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:n.queryKey})}}),m=(0,B.useCallback)(r=>{let i=r(e.getQueryData(n.queryKey)??w());p.mutate({path:{assistant_id:t},body:i})},[t,n.queryKey,e,p]),h=e=>{m(t=>({...t,globalEnabled:e}))},g=e=>{m(t=>({...t,volume:e}))},[_,v]=(0,B.useState)(null),C=_??o.volume,T=(e,t)=>{m(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},O=(e,t)=>{m(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},k=(e,t)=>{m(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},j=()=>{E().previewFallbackBlip(o.volume)},M=e=>{E().previewSound(e,o.volume)};return(0,V.jsxs)(`div`,{className:`space-y-6`,children:[(0,V.jsxs)(d,{children:[(0,V.jsx)(H,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:o.globalEnabled,onChange:h}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,V.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:C,onChange:e=>v(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);v(null),t!==o.volume&&g(t)},className:`h-1 w-48 cursor-pointer`,disabled:!o.globalEnabled,"aria-label":`Sound effect volume`}),(0,V.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(C*100),`%`]})]}),(0,V.jsx)(U,{}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,V.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,V.jsxs)(`button`,{type:`button`,onClick:j,disabled:!o.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,V.jsx)(D,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,V.jsxs)(d,{children:[(0,V.jsxs)(`div`,{className:`pb-2`,children:[(0,V.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,V.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,V.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:ee.map(e=>(0,V.jsx)(W,{event:e,eventConfig:o.events[e]??{enabled:!1,sounds:[]},availableSounds:u,globalEnabled:o.globalEnabled,onToggle:t=>T(e,t),onAddSound:t=>O(e,t),onRemoveSound:t=>k(e,t),onPreview:e=>M(e)},e))})]})]})}function de(){return(0,V.jsx)(z,{title:`Text-to-Speech`,subtitle:`Configure how your assistant speaks`,children:(0,V.jsx)(j,{})})}function fe(){return(0,V.jsx)(z,{title:`Speech-to-Text`,subtitle:`Configure how your assistant transcribes speech`,children:(0,V.jsx)(M,{})})}var pe=[{prefKey:`showUserTranscript`,label:`Show the words you say`,description:`Live transcription while you speak.`},{prefKey:`showAssistantTranscript`,label:`Show the words the assistant says`,description:`Text alongside the spoken response.`}],me=`We recommend keeping both off to start. It feels more like a real conversation.`;function he(){return(0,V.jsx)(`span`,{className:`shrink-0 rounded-full bg-[var(--surface-active)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Recommended off`})}function ge({label:e,description:t,showBadge:n,checked:r,onChange:i}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e}),n?(0,V.jsx)(he,{}):null]}),t?(0,V.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t}):null]}),(0,V.jsx)(_,{checked:r,onChange:i,"aria-label":e})]})}function _e({showDescription:e=!1,showRecommendedBadge:t=!1}){let n=N.use.showUserTranscript(),r=N.use.showAssistantTranscript(),i=N.use.setShowUserTranscript(),a=N.use.setShowAssistantTranscript(),o={showUserTranscript:{checked:n,onChange:i},showAssistantTranscript:{checked:r,onChange:a}};return(0,V.jsx)(V.Fragment,{children:pe.map(n=>{let r=o[n.prefKey];return(0,V.jsx)(ge,{label:n.label,description:e?n.description:void 0,showBadge:t,checked:r.checked,onChange:r.onChange},n.prefKey)})})}var G=`vellum:voice:conversationTimeoutSeconds`,K=[{label:`Ctrl`,activator:{kind:`modifierOnly`,modifiers:[`control`]}},{label:`Alt`,activator:{kind:`modifierOnly`,modifiers:[`option`]}},{label:`Ctrl+Shift`,activator:{kind:`modifierOnly`,modifiers:[`control`,`shift`]}}],q={label:`Fn`,activator:L},J=[{label:`5 seconds`,value:`5`},{label:`10 seconds`,value:`10`},{label:`15 seconds`,value:`15`},{label:`30 seconds`,value:`30`},{label:`60 seconds`,value:`60`}],Y=`30`,X=`text-body-small-default text-[var(--content-tertiary)]`,ve=[`voice`,`services`,`sounds`];function ye(e){return ve.includes(e)}function be(){let[e,t]=o(),n=e.get(`tab`),r=ye(n)?n:`voice`;return(0,V.jsx)(`div`,{className:`space-y-6`,children:(0,V.jsxs)(p.Root,{value:r,onValueChange:n=>{let r=new URLSearchParams(e);n===`voice`?r.delete(`tab`):r.set(`tab`,n),t(r,{replace:!0})},children:[(0,V.jsxs)(p.List,{children:[(0,V.jsx)(p.Trigger,{value:`voice`,children:`Voice`}),(0,V.jsx)(p.Trigger,{value:`services`,children:`Services`}),(0,V.jsx)(p.Trigger,{value:`sounds`,children:`Sounds`})]}),(0,V.jsx)(p.Panel,{value:`voice`,className:`pt-4`,children:(0,V.jsx)(Se,{})}),(0,V.jsx)(p.Panel,{value:`services`,className:`pt-4`,children:(0,V.jsx)(xe,{})}),(0,V.jsx)(p.Panel,{value:`sounds`,className:`pt-4`,children:(0,V.jsx)(ue,{})})]})})}function xe(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,V.jsx)(le,{}),(0,V.jsx)(de,{}),(0,V.jsx)(fe,{})]})}function Se(){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,V.jsx)(Ce,{}),(0,V.jsx)(we,{}),(0,V.jsx)(Te,{}),(0,V.jsx)(De,{}),(0,V.jsx)(Oe,{}),(0,V.jsx)(Z,{})]})}function Z(){return(0,V.jsx)(R,{title:`Transcription`,subtitle:`Show live text of what you and the assistant say during a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(_e,{showDescription:!0}),(0,V.jsx)(`p`,{className:`${X} pt-1`,children:me})]})})}var Q=``;function Ce(){let[e,r]=(0,B.useState)([]),[i,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(()=>k()),l=(0,B.useCallback)(async()=>{if(navigator.mediaDevices?.enumerateDevices)try{let e=(await navigator.mediaDevices.enumerateDevices()).filter(e=>e.kind===`audioinput`);o(e.length>0&&e.every(e=>!e.label)),r(e.filter(e=>e.deviceId!==``&&e.deviceId!==`default`&&e.deviceId!==`communications`))}catch{r([]),o(!1)}},[]),u=(0,B.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop()}catch{}l()},[l]);(0,B.useEffect)(()=>{l();let e=navigator.mediaDevices;if(!e?.addEventListener)return;let t=()=>void l();return e.addEventListener(`devicechange`,t),()=>e.removeEventListener(`devicechange`,t)},[l]);let d=(0,B.useMemo)(()=>[{value:Q,label:`System Default`},...e.map((e,t)=>({value:e.deviceId,label:e.label||`Microphone ${t+1}`}))],[e]),f=(0,B.useCallback)(e=>{c(e),e===Q?t(O):n(O,e)},[]);return(0,V.jsx)(R,{title:`Microphone`,subtitle:`Which input device is used for dictation and voice conversations.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(v,{options:d,value:d.some(e=>e.value===s)?s:Q,onChange:f,"aria-label":`Microphone`})}),i&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(a,{variant:`outlined`,onClick:u,children:`Allow Microphone Access`}),(0,V.jsx)(`span`,{className:X,children:`Grant microphone access to list your available input devices.`})]})]})})}function we(){let e=re(),[t,i]=(0,B.useState)(()=>{let t=r(I,``);return t?oe(t,{preserveFunction:e}):e?q.activator:{kind:`off`}}),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)([]),l=(0,B.useRef)(null),u=(0,B.useRef)(!1),d=(0,B.useMemo)(()=>e?[q,...K]:K,[e]),f=t.kind!==`off`,p=f&&!e,h=(0,B.useCallback)(e=>{i(e),n(I,se(e)),o(!1),c([])},[]),g=(0,B.useCallback)(()=>{o(!0),c([]),u.current=!1,requestAnimationFrame(()=>{l.current?.focus()})},[]),v=(0,B.useCallback)(()=>{o(!1),c([]),u.current=!1},[]),y=(0,B.useCallback)(t=>{let n=[];return e&&t.getModifierState(`Fn`)&&n.push(`function`),t.ctrlKey&&n.push(`control`),t.altKey&&n.push(`option`),t.shiftKey&&n.push(`shift`),t.metaKey&&n.push(`command`),n},[e]),b=(0,B.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){v();return}let t=y(e),n=e.key;if(n===`Control`||n===`Alt`||n===`Shift`||n===`Meta`||n===`Fn`){c(t.includes(`function`)?L.modifiers:ne(t));return}if(t.includes(`function`)){h(L);return}u.current=!0,h({kind:`key`,label:n.length===1?n.toUpperCase():n,modifiers:t})},[v,y,h]),x=(0,B.useCallback)(e=>{if(!a)return;e.preventDefault(),e.stopPropagation();let t=e.key;if(t===`Control`||t===`Alt`||t===`Shift`||t===`Meta`||t===`Fn`){if(u.current){u.current=!1,c([]);return}y(e).length===0&&s.length>0&&h({kind:`modifierOnly`,modifiers:s})}},[y,a,s,h]);(0,B.useEffect)(()=>{if(!a)return;let e=e=>{l.current&&!l.current.contains(e.target)&&v()};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,a]);let S=f&&!d.some(e=>P(e.activator,t));return(0,V.jsx)(R,{title:`Push to Talk`,subtitle:`Hold the activation key to dictate text or start a voice conversation.`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(_,{checked:f,onChange:n=>{n?t.kind===`off`&&h(e?q.activator:ie):h({kind:`off`})},label:`Enable Push to Talk`}),f&&(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`span`,{className:X,children:`Activation Key:`}),(0,V.jsxs)(`div`,{ref:l,tabIndex:a?0:-1,onKeyDown:a?b:void 0,onKeyUp:a?x:void 0,className:`flex flex-wrap items-center gap-2 focus:outline-none`,children:[d.map(e=>{let n=P(e.activator,t);return(0,V.jsx)($,{label:e.label,selected:n,onClick:()=>h(e.activator)},e.label)}),a?(0,V.jsx)($,{label:s.length>0?te(s):`Press any key…`,selected:!0,recording:!0,onClick:v}):(0,V.jsx)($,{label:S?F(t):`Custom`,selected:S,onClick:g})]}),p&&(0,V.jsxs)(`div`,{className:`flex items-start gap-1 pt-1 text-body-small-default text-[var(--content-quiet)]`,children:[(0,V.jsx)(m,{className:`mt-0.5 h-3 w-3 shrink-0`}),(0,V.jsx)(`span`,{children:`Push-to-Talk only works while this tab is focused, and browsers may intercept some shortcuts (e.g. Ctrl+T) before the page can see them. For always-on PTT, use the Vellum desktop app.`})]})]})]})})}function $({label:e,selected:t,recording:n=!1,onClick:r}){return(0,V.jsxs)(`button`,{type:`button`,onClick:r,className:[`inline-flex items-center gap-2 rounded-lg border px-3 py-1.5 text-body-medium-lighter transition-colors`,`border-[var(--border-subtle)]`,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-lift)] hover:bg-[var(--surface-hover)]`,n?`animate-pulse`:``].filter(Boolean).join(` `),children:[(0,V.jsx)(`span`,{className:[`inline-block h-2.5 w-2.5 rounded-full border`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)]`].join(` `)}),(0,V.jsx)(`span`,{className:`text-[var(--content-default)]`,children:e})]})}function Te(){let[e,t]=(0,B.useState)(()=>{let e=r(G,Y);return J.find(t=>t.value===e)?.value??Y});return(0,V.jsx)(R,{title:`Conversation Timeout`,subtitle:`How long the assistant waits for you to start speaking before ending a voice conversation turn.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(v,{options:J,value:e,onChange:(0,B.useCallback)(e=>{t(e),n(G,e)},[]),"aria-label":`Conversation timeout`})})})}var Ee=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}];function De(){let e=N.use.pauseBeforeReplyMs(),t=N.use.setPauseBeforeReplyMs();return(0,V.jsx)(R,{title:`Pause before reply`,subtitle:`How long the assistant waits after you stop speaking before it replies. A longer pause lets you gather your thoughts mid-sentence without being cut off.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(g,{value:(e??1200)/1e3,onValueChange:e=>{typeof e==`number`&&t(Math.round(e*1e3))},min:500/1e3,max:ae/1e3,step:.1,showValue:!0,formatValue:e=>`${(typeof e==`number`?e:e[0]).toFixed(1)}s`,"aria-label":`Pause before reply`})})})}function Oe(){let e=N.use.interruptSensitivity(),t=N.use.setInterruptSensitivity();return(0,V.jsx)(R,{title:`Interrupt sensitivity`,subtitle:`How easily talking over the assistant interrupts it. Lower it if the assistant cuts itself off on background noise or filler words; raise it to interrupt more quickly.`,children:(0,V.jsx)(`div`,{className:`max-w-xs`,children:(0,V.jsx)(h,{items:Ee,value:e??`medium`,onChange:t,ariaLabel:`Interrupt sensitivity`})})})}export{be as VoicePage};
|