@vellumai/web 0.11.9-staging.1 → 0.11.9-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{a2a-invite-B9jqmgbB.js → a2a-invite-BmopEUuc.js} +1 -1
- package/dist/assets/{about-page-B9eULV1f.js → about-page-jeGmoRA9.js} +1 -1
- package/dist/assets/{account-page-CZSO-AlP.js → account-page-JdskrJ78.js} +1 -1
- package/dist/assets/{account-shell-DgHv1A1w.js → account-shell-pvaSOGcE.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-CNvbVyVw.js → acp-run-detail-panel-By-l4zoq.js} +1 -1
- package/dist/assets/{activity-redirect-page-CwgTPGTG.js → activity-redirect-page-BFBKktry.js} +1 -1
- package/dist/assets/{activity-steps-panel-zky0cnuk.js → activity-steps-panel-cif0uZ12.js} +1 -1
- package/dist/assets/{add-credits-modal-Dx0fdWm5.js → add-credits-modal-NBoCa1j3.js} +1 -1
- package/dist/assets/{ai-page-Czt1hbgM.js → ai-page-CS3Z6MrX.js} +1 -1
- package/dist/assets/{android-billing-handoff-BJxquTxv.js → android-billing-handoff-B8rC7eeV.js} +1 -1
- package/dist/assets/{api-key-screen-BIiNVLmB.js → api-key-screen-C2s4sMm1.js} +1 -1
- package/dist/assets/{app-info-DdWNjeN2.js → app-info-WxnSkFp1.js} +1 -1
- package/dist/assets/archive-redirect-page-B5G-WDp0.js +1 -0
- package/dist/assets/{assistant-status-panel-eeZDx5Ef.js → assistant-status-panel-qlWNpUbQ.js} +1 -1
- package/dist/assets/{auth-welcome-screen-B5i9VCDX.js → auth-welcome-screen-D20mVl5R.js} +1 -1
- package/dist/assets/{avatar-bundled-components-X6uhm3sR.js → avatar-bundled-components-Bdw589VI.js} +1 -1
- package/dist/assets/{avatar-random-mKQpdYRU.js → avatar-random-B3jE15Y7.js} +2 -2
- package/dist/assets/{await-org-header-settled-3RjHs2p_.js → await-org-header-settled-DcAqEzY1.js} +1 -1
- package/dist/assets/{background-task-detail-panel-D-5wO1mD.js → background-task-detail-panel-CXD0nKQP.js} +1 -1
- package/dist/assets/{billing-page-BEx67_Vu.js → billing-page-DjpHOzD6.js} +3 -3
- package/dist/assets/{billing-redirect-page-DGi9rWvB.js → billing-redirect-page-Ca7pWbvL.js} +1 -1
- package/dist/assets/{bookmarks-page-vDGPyme6.js → bookmarks-page-B4Bj_NZ1.js} +1 -1
- package/dist/assets/{bundle-confirm-page-CLqCqvDN.js → bundle-confirm-page-CjvXenWx.js} +1 -1
- package/dist/assets/{channel-transcript-panel-C4lFREze.js → channel-transcript-panel-Bupj5L4O.js} +1 -1
- package/dist/assets/{channels-page-route-Cb0pntjc.js → channels-page-route-CSFzQtEJ.js} +1 -1
- package/dist/assets/{checkout-continuation-B6h2u8bW.js → checkout-continuation-BBasTGr1.js} +1 -1
- package/dist/assets/{checkout-page-BOd355tP.js → checkout-page-QfqxmVX3.js} +1 -1
- package/dist/assets/checkout-return-target-DRW4Fb93.js +1 -0
- package/dist/assets/{command-palette-B64x_N5e.js → command-palette-CsWImGc1.js} +1 -1
- package/dist/assets/{command-palette-window-page-BnnVhvV6.js → command-palette-window-page-Dm2bWRPF.js} +1 -1
- package/dist/assets/{community-page-BqfWeHrB.js → community-page-DG_go-bx.js} +1 -1
- package/dist/assets/companion-accent-Dhs0VHm8.js +1 -0
- package/dist/assets/{companion-layout-BWgLSvze.js → companion-layout-CU_fQwBX.js} +1 -1
- package/dist/assets/companion-surface-page-CUmDLt1d.js +1 -0
- package/dist/assets/{companion-watch-glow-page-CQT0SvDE.js → companion-watch-glow-page-DPah9dl8.js} +1 -1
- package/dist/assets/{connect-page-BEb1oXUc.js → connect-page-BAugVlOG.js} +1 -1
- package/dist/assets/{consent-controls-B1AnYj9V.js → consent-controls-BBOL1pVX.js} +1 -1
- package/dist/assets/{contacts-gateway-Cqy42w-P.js → contacts-gateway-_5gWCO5M.js} +1 -1
- package/dist/assets/{contacts-page-route-1biY-ppa.js → contacts-page-route-cNZg-y2G.js} +1 -1
- package/dist/assets/{credential-entry-page-Dp8ZvJCL.js → credential-entry-page-CG0pMgbA.js} +1 -1
- package/dist/assets/{credentials-page-DWCvFFiI.js → credentials-page-D8hdCncX.js} +1 -1
- package/dist/assets/{csv-preview-DfcTYrC2.js → csv-preview-BZResk4J.js} +1 -1
- package/dist/assets/danger-zone-redirect-page-CwAiH6Ly.js +1 -0
- package/dist/assets/{debug-page-KIzcZW4r.js → debug-page-DuHowSZO.js} +1 -1
- package/dist/assets/{deploy-dialogs-CC6DQ0vu.js → deploy-dialogs-CXykRB7L.js} +1 -1
- package/dist/assets/{detail-card-BXhwux_c.js → detail-card-sxGt13nZ.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-3gCSXBXB.js → detail-panel-stop-button-BhBUIYrN.js} +1 -1
- package/dist/assets/{developer-page-DWZTB0CS.js → developer-page-Xok7vdls.js} +1 -1
- package/dist/assets/devices-redirect-page-Bn8l0NbB.js +1 -0
- package/dist/assets/{dictation-overlay-page-C_LaA2sN.js → dictation-overlay-page-faR6ZD05.js} +1 -1
- package/dist/assets/{document-viewer-page-UQ_WQgfz.js → document-viewer-page-CICQK2iT.js} +1 -1
- package/dist/assets/{emails-page-DbvNvgv2.js → emails-page-ChkgqqfV.js} +1 -1
- package/dist/assets/{environment-store-Dkn0BKG2.js → environment-store-DbxWXxoY.js} +1 -1
- package/dist/assets/{file-editor-C7Um2GrG.js → file-editor-BcG_sR-r.js} +1 -1
- package/dist/assets/{general-page-CavuxYdx.js → general-page-BbkJBzvT.js} +1 -1
- package/dist/assets/{hatching-screen-ChUtQw8W.js → hatching-screen-jX7krI2v.js} +1 -1
- package/dist/assets/{hosting-screen-9TLoyimY.js → hosting-screen-BsNV_ReB.js} +1 -1
- package/dist/assets/{identity-page-route-D7W7YrE3.js → identity-page-route-aHYnV_jN.js} +1 -1
- package/dist/assets/index-BUt2OH6r.css +2 -0
- package/dist/assets/{index-BVVp210p.js → index-b_IQShc9.js} +9 -9
- package/dist/assets/{inspect-page-DbB0qA0t.js → inspect-page-HI841yUu.js} +3 -3
- package/dist/assets/{integrations-page-DfLlnJon.js → integrations-page-BmMDMgFU.js} +1 -1
- package/dist/assets/{intelligence-layout-CNhNn2l4.js → intelligence-layout-CLPUS0ap.js} +1 -1
- package/dist/assets/keyboard-shortcuts-redirect-page-DDGnWlyz.js +1 -0
- package/dist/assets/{latest-assistant-text-QBDnPUy-.js → latest-assistant-text-DAXhdhSY.js} +1 -1
- package/dist/assets/{library-detail-page-BzJfzbC3.js → library-detail-page-43KAFuJi.js} +1 -1
- package/dist/assets/{library-page-v3XsOgxI.js → library-page-CDLs7xOE.js} +1 -1
- package/dist/assets/{login-page-1BkkzrgT.js → login-page-GVnmapVt.js} +1 -1
- package/dist/assets/{logout-page-CnlDy9lt.js → logout-page-Bz-a8xjH.js} +1 -1
- package/dist/assets/{logs-layout-DDdSW282.js → logs-layout-_NfJqBwz.js} +1 -1
- package/dist/assets/{markdown-preview-DNH9WsbV.js → markdown-preview-c_WsdpT0.js} +1 -1
- package/dist/assets/{media-preview-BePTwtIU.js → media-preview-D7AavJf-.js} +1 -1
- package/dist/assets/{memory-page-route-BTPvwnHF.js → memory-page-route-Csfkb0fE.js} +1 -1
- package/dist/assets/{memory-router-playground-page-DQzcoSy8.js → memory-router-playground-page-B_TvYode.js} +1 -1
- package/dist/assets/{message-files-panel-BXc-fblZ.js → message-files-panel-Q_w3u4r6.js} +1 -1
- package/dist/assets/{metric-card-DxpIyY0z.js → metric-card-XbeSP_dF.js} +1 -1
- package/dist/assets/{notifications-page-BNgPGEQb.js → notifications-page-BCo_g_9g.js} +1 -1
- package/dist/assets/{oauth-complete-page-DqZtiKH-.js → oauth-complete-page-D0_ddx3s.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BDfhFWci.js → oauth-popup-complete-page-DR-OaEn7.js} +1 -1
- package/dist/assets/{page-shell-Dlsn8wyt.js → page-shell-D1-wKbPX.js} +1 -1
- package/dist/assets/{pairing-page-CWoinj-Z.js → pairing-page-CFi0G2Xh.js} +1 -1
- package/dist/assets/password-reset-page-DdG-gDUR.js +1 -0
- package/dist/assets/{pdf-file-preview-CJ6geQeY.js → pdf-file-preview-QWR5YVZp.js} +1 -1
- package/dist/assets/{personality-page-C9p1PiOn.js → personality-page-D4oROOvq.js} +1 -1
- package/dist/assets/{plans-page-BNi_MgUe.js → plans-page-BAgmH1pe.js} +1 -1
- package/dist/assets/{platform-loopback-page-_NLrjsOR.js → platform-loopback-page-hfwG6N6r.js} +1 -1
- package/dist/assets/{plugin-detail-page-DIOu3ao3.js → plugin-detail-page-JFE-PjTL.js} +1 -1
- package/dist/assets/{plugins-page-LBod4Ue5.js → plugins-page-PjMDyM4p.js} +1 -1
- package/dist/assets/{preview-error-kO-J66Zv.js → preview-error-BLcNtS5K.js} +1 -1
- package/dist/assets/{privacy-page-CEt-Gr-k.js → privacy-page-BBlgcXb0.js} +1 -1
- package/dist/assets/{privacy-screen-Dr2tpwgO.js → privacy-screen-DMC-z5IT.js} +1 -1
- package/dist/assets/{provider-callback-page-aJ_6i4xK.js → provider-callback-page-CuAY1_4R.js} +1 -1
- package/dist/assets/{provider-key-PAmg3XjL.js → provider-key-CNHs7dwm.js} +1 -1
- package/dist/assets/{provider-signup-page-BCUoHgWf.js → provider-signup-page-DjNpFmgq.js} +1 -1
- package/dist/assets/{quick-input-page-C8AjTd-X.js → quick-input-page-CMM22KVb.js} +1 -1
- package/dist/assets/{research-mock-page-CGOcSvcT.js → research-mock-page-ClUeMeQm.js} +1 -1
- package/dist/assets/{research-onboarding-route-DBZhQhpw.js → research-onboarding-route-BCNagFK9.js} +1 -1
- package/dist/assets/{review-terms-screen-DsxPDq8C.js → review-terms-screen-LYu2oH8u.js} +1 -1
- package/dist/assets/{schedules-CiQRct_v.js → schedules-jQA-lEXD.js} +1 -1
- package/dist/assets/{schedules-page-DY4qoW1Q.js → schedules-page-y5DMdtSF.js} +1 -1
- package/dist/assets/security-redirect-page-Cso7bCn1.js +1 -0
- package/dist/assets/{select-assistant-screen-DY2bsToS.js → select-assistant-screen-DTrNJM_L.js} +1 -1
- package/dist/assets/{self-hosted-servers-Ck45Ce7U.js → self-hosted-servers-CE0-6fMf.js} +1 -1
- package/dist/assets/{service-form-controls-BrAek3O9.js → service-form-controls-CmKM2qps.js} +1 -1
- package/dist/assets/{setting-row-D7b4t29_.js → setting-row-JfvUWIUE.js} +1 -1
- package/dist/assets/{settings-divider-DOmdsd_b.js → settings-divider-BDaGinDZ.js} +1 -1
- package/dist/assets/{settings-layout-DyxqBBfM.js → settings-layout-BSPQuLG_.js} +1 -1
- package/dist/assets/{share-feedback-modal-DQkZsb9S.js → share-feedback-modal-C-9w9Qun.js} +1 -1
- package/dist/assets/{sidebar-tree-cUpG2j7M.js → sidebar-tree-B_7TxIfc.js} +1 -1
- package/dist/assets/{signup-page-BS3key1b.js → signup-page-Up3lhxjE.js} +1 -1
- package/dist/assets/{signup-shell-CJkXiLFK.js → signup-shell-Cz7nHsiG.js} +1 -1
- package/dist/assets/{skill-detail-page-Ctdu9URX.js → skill-detail-page-CcD41B-N.js} +1 -1
- package/dist/assets/{skill-detail-panel-pSGqD5fk.js → skill-detail-panel-COgbn-zN.js} +1 -1
- package/dist/assets/{skill-removal-dialog-BAZKh1bp.js → skill-removal-dialog-IZ80QFym.js} +1 -1
- package/dist/assets/{skills-page-C3fYc9yk.js → skills-page-9DYmyfOw.js} +1 -1
- package/dist/assets/{sounds-page-DzAbysBF.js → sounds-page-DzCV0GMu.js} +1 -1
- package/dist/assets/{start-screen-BZJCt4uO.js → start-screen-De2GtK4A.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-3JHZ7KRr.js → stt-language-picker-modal-CLsnI2Yz.js} +1 -1
- package/dist/assets/{subagent-detail-panel-C-id-gz6.js → subagent-detail-panel-Bx-nrZRA.js} +1 -1
- package/dist/assets/{superpowers-page-ByqWgwxm.js → superpowers-page-BZXp-HPn.js} +1 -1
- package/dist/assets/{system-events-page-Drm8odGD.js → system-events-page-CdnLtW07.js} +1 -1
- package/dist/assets/system-events-redirect-page-8K7jp-vf.js +1 -0
- package/dist/assets/{text-preview-DQo_wIE1.js → text-preview-CzBwTE6l.js} +1 -1
- package/dist/assets/{theme-stage-page-BW7WXz7Y.js → theme-stage-page-DFM8cSRo.js} +1 -1
- package/dist/assets/{tiptap-document-editor-B5NBtP2i.js → tiptap-document-editor-DiMEXCfY.js} +1 -1
- package/dist/assets/{tool-detail-panel-s9N8-rpr.js → tool-detail-panel-C-r8dnRp.js} +1 -1
- package/dist/assets/{trait-cycle-row-DIN6r7YK.js → trait-cycle-row-C2Icx-67.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-Dc8GuuuI.js → upgrade-cancel-page-Bi8uWXPd.js} +1 -1
- package/dist/assets/{upgrade-success-page-Ba2I2Zur.js → upgrade-success-page-BkEgh_vv.js} +1 -1
- package/dist/assets/{usage-redirect-page-zIF77c7V.js → usage-redirect-page-kNuqbUkh.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-D9qdC7Cd.js → use-assistant-identity-details-BHiN3OAl.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-BwscoYFU.js → use-checkout-dismiss-refresh-DOJD5kF-.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-CJNLwmcm.js → use-edge-swipe-back-BO9Eg7fg.js} +2 -2
- package/dist/assets/{use-hotkey-recorder-BpZ2ce5P.js → use-hotkey-recorder-CSRkbNLq.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-Ho7FM83m.js → use-invite-link-dialog-D8k7P63J.js} +1 -1
- package/dist/assets/{use-platform-assistant-id-CupaRcFg.js → use-platform-assistant-id-C6Npjvje.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-DrqtvQUp.js → use-return-to-short-circuit-qAmnQhhd.js} +1 -1
- package/dist/assets/{use-side-list-room-DT90pjIs.js → use-side-list-room-wi1Z0sax.js} +1 -1
- package/dist/assets/{use-skill-actions-tfxzxIKS.js → use-skill-actions-Cenw6B7x.js} +1 -1
- package/dist/assets/{use-skill-detail-files-CaKc2HWM.js → use-skill-detail-files-BMTlfXyu.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-BbVrMmw2.js +1 -0
- package/dist/assets/use-transcript-message-by-id-BAc4xz_C.js +1 -0
- package/dist/assets/{voice-page-B9hAlvd7.js → voice-page-Cno795eb.js} +1 -1
- package/dist/assets/{weather-forecast-display-BJes18_s.js → weather-forecast-display-Bq7Ktxyw.js} +1 -1
- package/dist/assets/{welcome-screen-CrXclfuA.js → welcome-screen-CipRXBbr.js} +1 -1
- package/dist/assets/{workflow-detail-panel-FJt7O7DN.js → workflow-detail-panel-B4pwzq2k.js} +1 -1
- package/dist/assets/{workspace-page-maAwyAnK.js → workspace-page-B_ntO4pT.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/archive-redirect-page-Bahth1ou.js +0 -1
- package/dist/assets/checkout-return-target-DEiJUksg.js +0 -1
- package/dist/assets/companion-accent-D98A6fdt.js +0 -1
- package/dist/assets/companion-surface-page-BYlBiFag.js +0 -1
- package/dist/assets/danger-zone-redirect-page-BbvorzSo.js +0 -1
- package/dist/assets/devices-redirect-page-MeFP2iGe.js +0 -1
- package/dist/assets/index-ChmqERCm.css +0 -2
- package/dist/assets/keyboard-shortcuts-redirect-page-CX6auuC3.js +0 -1
- package/dist/assets/password-reset-page-Cv3_LjgI.js +0 -1
- package/dist/assets/security-redirect-page-Be_N1V2t.js +0 -1
- package/dist/assets/system-events-redirect-page-D4uO9zjA.js +0 -1
- package/dist/assets/use-supports-credentials-settings-BsoxGpqB.js +0 -1
- package/dist/assets/use-transcript-message-by-id-2x4qzE7s.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CYfJo8gP.js";import{b as n,d as r,f as i,i as a,t as o}from"./react-DPM_L_aA.js";import{Qt as s,Zt as c}from"./icons-CSdHOix6.js";import{Ai as l,Ep as u,If as d,Mf as f,Uo as p,Wt as m,Yn as h,_u as g,au as _,dv as v,h_ as y,ko as b}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CYfJo8gP.js";import{b as n,d as r,f as i,i as a,t as o}from"./react-DPM_L_aA.js";import{Qt as s,Zt as c}from"./icons-CSdHOix6.js";import{Ai as l,Ep as u,If as d,Mf as f,Uo as p,Wt as m,Yn as h,_u as g,au as _,dv as v,h_ as y,ko as b}from"./index-b_IQShc9.js";import{n as x,t as S}from"./sidebar-tree-B_7TxIfc.js";import{t as C}from"./use-supports-credentials-settings-BbVrMmw2.js";var w=e(n(),1),T=o();function E(){let e=g.use.settingsDeveloperNav(),n=_.use.setWindowsMenuBarSuppressed();(0,w.useEffect)(()=>(n(!0),()=>n(!1)),[n]);let{t:o}=t(`settings`),E=u(),D=y.use.activeAssistantId(),O=m(D),k=C(D),A=l(),j=f(),{pathname:M}=r(),N=i(),P=d(),{login:F}=b(),I=(0,w.useCallback)((e,t)=>{switch(e){case`assistant-status`:return o(`sidebar.general`,`General`);case`model`:return o(`sidebar.model`,`Models & Services`);case`integrations`:return o(`sidebar.integrations`,`Integrations`);case`credentials`:return o(`sidebar.credentials`,`Credentials`);case`notifications`:return o(`sidebar.notifications`,`Notifications`);case`voice`:return o(`sidebar.voice`,`Voice`);case`sounds`:return o(`sidebar.sounds`,`Sounds`);case`privacy`:return o(`sidebar.privacy`,`Permissions & Privacy`);case`bookmarks`:return o(`sidebar.bookmarks`,`Bookmarks`);case`billing`:return j===`full`?o(`sidebar.billingUsage`,`Billing & Usage`):o(`sidebar.usage`,`Usage`);case`community`:return o(`sidebar.community`,`Community`);case`debug`:return o(`sidebar.debug`,`Debug`);case`developer`:return o(`sidebar.developer`,`Developer`);default:return t}},[o,j]),L=(0,w.useMemo)(()=>h.filter(e=>!(e.id===`notifications`&&!E||e.id===`bookmarks`&&(!O||!A)||e.id===`credentials`&&!k||e.id===`developer`)).map(e=>({...e,label:I(e.id,e.label)})),[E,O,A,k,I]),R=(0,w.useMemo)(()=>{let t=[];return e&&t.push(...h.filter(e=>e.id===`developer`).map(e=>({...e,label:I(e.id,e.label)}))),t.push(P?{id:`logout`,label:o(`sidebar.logout`,`Log Out`),icon:c,onSelect:()=>void p(N)}:{id:`login`,label:o(`sidebar.login`,`Log In`),icon:s,onSelect:()=>void F()}),t},[e,P,N,F,o,I]),z=(0,w.useMemo)(()=>{if(M===v.settings.root)return o(`sidebar.title`,`Settings`);let e=h.find(e=>M===e.href||M.startsWith(e.href+`/`));return e?I(e.id,e.label):o(`sidebar.title`,`Settings`)},[M,o,I]);return(0,T.jsx)(x,{backHref:v.assistant,sidebar:(0,T.jsx)(S,{items:L,bottomItems:R,indexPath:v.settings.root}),title:z,children:(0,T.jsx)(a,{})})}export{E as SettingsLayout};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/esm-fvefH7qR.js","assets/react-DPM_L_aA.js","assets/rolldown-runtime-BM3Ffeng.js","assets/vendor-CYfJo8gP.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,r as t}from"./rolldown-runtime-BM3Ffeng.js";import{E as n,Jn as r,N as i,j as a}from"./vendor-CYfJo8gP.js";import{_ as o,b as s,t as c,y as l}from"./react-DPM_L_aA.js";import{Ht as u,Jt as ee,Yr as d,Zn as te,bt as f,i as p,mn as ne,q as re,sn as m,tn as ie}from"./icons-CSdHOix6.js";import{Dy as h,Il as g,Li as _,Oy as v,Pf as ae,Qv as y,Z_ as b,_y as x,cr as oe,fv as S,gh as C,jc as se,vy as ce,wy as le,yy as ue}from"./index-BVVp210p.js";var w=e(s(),1),de=e(l(),1),T=`vellum:debug:`;function fe(){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(T))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function E(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:b()},overrides:fe()}}var D=t({ShareFeedbackModal:()=>U,dedupeAgainstClientMessages:()=>B,stripBulkBase64:()=>z}),O=c(),pe=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,me=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,he={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},k=[{value:`bug_report`,icon:d,includesLogsByDefault:!0},{value:`feature_request`,icon:m,includesLogsByDefault:!1},{value:`other`,icon:u,includesLogsByDefault:!1}],A=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],j=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),M=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),N=10,P=50*1024*1024,ge={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function _e(){if(S())return`electron`;let e=n.getPlatform();return e===`ios`||e===`android`?e:`web`}function ve(e){return typeof e==`object`&&!!e&&`client`in e}function ye(e){if(e.size>P)return!1;if(e.type&&j.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?M.has(t):!1}return!1}var F=8192,I=/^data:([^;,]+);base64,/i,L=/^[A-Za-z0-9+/]+={0,2}$/;function R(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>R(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=R(a,t,n);i=r}return n.delete(e),i}function z(e){return R(e,e=>{if(typeof e!=`string`)return null;let t=I.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=F&&L.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function B(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),R(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function V(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 H(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 C({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 be(){if(!n.isNativePlatform())return null;try{let{App:e}=await o(async()=>{let{App:e}=await import(`./esm-fvefH7qR.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function xe(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=A.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,ee=u==null?null:new Date(u).toISOString(),d=null;try{d=i?.()??null}catch{d=null}let te=g(d),f={collected_at:s.toISOString(),time_range:e,cutoff:ee,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await be(),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},p=new TextEncoder,ne=p.encode(JSON.stringify(f,null,2)),re=p.encode(JSON.stringify(te,null,2)),m=[V(`web-client-context.json`,ne),V(`web-chat-diagnostics.json`,re)],ie=new TextEncoder().encode(JSON.stringify(E(),null,2));m.push(V(`web-debug-flags.json`,ie));for(let e of o){let t=e.contents.trim();t&&m.push(V(e.filename,p.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:B(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(z(n),null,2));m.push(V(`web-chat-debug-api-triage.json`,r))}}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(z(t),null,2));m.push(V(`web-sse-liveness-triage.json`,n))}}catch{}if(S()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));m.push(V(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);m.push(V(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await H(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&m.push(V(`platform-logs.tar.gz`,e))}m.push(new Uint8Array(1024));let h=m.reduce((e,t)=>e+t.length,0),_=new Uint8Array(h),v=0;for(let e of m)_.set(e,v),v+=e.length;let ae=new Blob([_.buffer]),y=await new Response(ae.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([y],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function U({open:e,onClose:t,initialReason:n,initialMessage:o,onSubmitted:s,assistantId:c,assistantVersion:l,activeConversationId:u,doctorSessionId:d,doctorSessionLog:m,getDiagnosticsSnapshot:g}){let{t:b}=a(),C=ae.use.user(),T=C?.email,fe=C?.isStaff??!1,E=(0,w.useId)(),D=(0,w.useRef)(null),A=(0,w.useRef)(null),j=(0,w.useRef)(null),M=(0,w.useRef)(null),P=(0,w.useMemo)(()=>[{value:`past_hour`,label:b(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:b(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:b(`shareFeedbackModal.timeRangeAllTime`)}],[b]),[F,I]=(0,w.useState)(n??`bug_report`),[L,R]=(0,w.useState)(``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(k.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[be,U]=(0,w.useState)(!1),[W,G]=(0,w.useState)(`past_hour`),[K,q]=(0,w.useState)([]),[we,J]=(0,w.useState)(null),[Te,Y]=(0,w.useState)(!1),[Ee,De]=(0,w.useState)(!1),[X,Oe]=(0,w.useState)(!1),Z=r(se()),[ke,Q]=(0,w.useState)(!1),$=Z.isPending||ke,Ae=!T,je=(0,w.useMemo)(()=>L.trim().length>0&&z.trim().length>0,[L,z]);(0,w.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),R(o??``),B(T??``),H(k.find(e=>e.value===t)?.includesLogsByDefault??!0),U(!1),G(`past_hour`),q([]),De(!1),Oe(!1),J(null),Q(!1),Z.reset();let r=setTimeout(()=>{T?j.current?.focus():M.current?.focus()},50);return()=>clearTimeout(r)},[e]),_(e);let Me=e=>{I(e),be||H(k.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ne=()=>{H(e=>!e),U(!0)},Pe=m?.trim()?[{filename:`doctor-session.txt`,contents:m}]:[],Fe=(0,w.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),t())},[t,$]),Ie=(0,w.useCallback)(e=>{e.target===D.current&&!$&&t()},[t,$]),Le=(0,w.useCallback)(e=>{q(t=>{let n=N-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(!ye(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Re=e=>{e.target.files&&Le(Array.from(e.target.files)),e.target.value=``},ze=e=>{e.preventDefault(),Y(!1),e.dataTransfer.files?.length&&Le(Array.from(e.dataTransfer.files))},Be=e=>{e.preventDefault(),Y(!0)},Ve=e=>{e.preventDefault(),e.currentTarget===e.target&&Y(!1)},He=e=>{q(t=>t.filter((t,n)=>n!==e))};return e?(0,de.createPortal)((0,O.jsx)(`div`,{ref:D,role:`dialog`,"aria-modal":`true`,"aria-labelledby":E,className:pe,onKeyDown:Fe,onClick:Ie,onDrop:ze,onDragOver:Be,onDragLeave:Ve,children:(0,O.jsxs)(`div`,{className:me,style:he,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,O.jsx)(`h2`,{id:E,className:`!m-0 text-title-small text-[var(--content-default)]`,children:b(`shareFeedbackModal.title`)}),(0,O.jsx)(h,{variant:`ghost`,iconOnly:(0,O.jsx)(p,{}),onClick:t,disabled:$,"aria-label":b(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[fe&&(0,O.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,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,O.jsx)(x,{checked:X,onChange:()=>Oe(e=>!e),"aria-label":b(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:b(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:b(`shareFeedbackModal.adminOnlyHint`)})]}),X?(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:b(`shareFeedbackModal.timeRange`)}),(0,O.jsx)(y,{options:P,value:W,onChange:G,"aria-label":b(`shareFeedbackModal.timeRangeAria`)})]}):(0,O.jsxs)(O.Fragment,{children:[Ae&&(0,O.jsx)(ce,{id:`${E}-email`,ref:M,label:b(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:z,onChange:e=>B(e.target.value),leftIcon:(0,O.jsx)(ee,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:b(`shareFeedbackModal.category`)}),(0,O.jsx)(`div`,{className:`flex gap-2`,children:k.map(e=>(0,O.jsx)(Se,{option:e,isSelected:F===e.value,onSelect:()=>Me(e.value)},e.value))})]}),(0,O.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,O.jsx)(le,{tone:`info`,children:(0,O.jsx)(i,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,O.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),F===`feature_request`&&(0,O.jsx)(le,{tone:`info`,children:(0,O.jsx)(i,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,O.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),(0,O.jsx)(ue,{id:`${E}-message`,ref:j,label:b(F===`bug_report`?`shareFeedbackModal.messageLabelBug`:F===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:b(F===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:F===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:L,onChange:e=>R(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,O.jsx)(x,{checked:V,onChange:Ne,"aria-label":b(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:b(`shareFeedbackModal.includeDiagnostics`)})]}),(0,O.jsx)(v,{content:b(`shareFeedbackModal.diagnosticsTooltip`),children:(0,O.jsx)(`button`,{type:`button`,"aria-label":b(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,O.jsx)(ne,{className:`h-3.5 w-3.5`})})})]}),V&&(0,O.jsx)(y,{options:P,value:W,onChange:G,"aria-label":b(`shareFeedbackModal.timeRangeAria`)})]}),S()&&u&&F!==`feature_request`&&(0,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,O.jsx)(x,{checked:Ee,onChange:()=>De(e=>!e),"aria-label":b(`shareFeedbackModal.includeConversationAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:b(`shareFeedbackModal.includeConversation`)})]}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[b(`shareFeedbackModal.attachments`),K.length>0&&(0,O.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,K.length,`/`,N]})]}),(0,O.jsx)(h,{variant:`outlined`,size:`compact`,leftIcon:(0,O.jsx)(f,{}),onClick:()=>A.current?.click(),disabled:K.length>=N,children:b(`shareFeedbackModal.addFiles`)}),(0,O.jsx)(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Re,className:`hidden`})]}),K.length>0&&(0,O.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:K.map((e,t)=>(0,O.jsx)(Ce,{file:e,onRemove:()=>He(t)},`${e.name}-${t}`))}),Te&&(0,O.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:b(`shareFeedbackModal.dropFiles`)})]})]}),we&&(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:we})]}),(0,O.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,O.jsx)(ie,{className:`h-4 w-4 animate-spin`}),b(X?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(h,{variant:`ghost`,onClick:t,children:b(`shareFeedbackModal.cancel`)}),X?(0,O.jsx)(h,{variant:`primary`,leftIcon:(0,O.jsx)(te,{}),onClick:async()=>{if(!$){J(null),Q(!0);try{let e=await xe(W,c??null,S()?Ee?u??null:null:u??null,{diagnosticsProvider:g,doctorSessionId:d,extraLogFiles:Pe});if(!e){J(`Diagnostics export isn't supported in this browser.`);return}await oe(e,e.name),t()}catch(e){J(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:b(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,O.jsx)(h,{variant:`primary`,leftIcon:(0,O.jsx)(re,{}),onClick:async()=>{if(!(!je||$)){J(null),Q(!0);try{let e=V&&F!==`feature_request`?await xe(W,c??null,S()?Ee?u??null:null:u??null,{diagnosticsProvider:g,doctorSessionId:d,extraLogFiles:Pe}):null,n=_e(),r;if(n===`electron`)try{r=(await window.vellum?.app.versionInfo())?.version??r}catch{}let i=t=>Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ge[F],email:z.trim(),client:t,client_version:r,...c?{assistant_id:c}:{},...l?{assistant_version:l}:{},...d?{doctor_session_id:d}:{},...e?{logs_file:e}:{},...K.length?{attachments:K}:{}},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}});try{await i(n)}catch(e){if(n!==`android`||!ve(e))throw e;await i(`web`)}s?.(),t()}catch(e){J(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!je,children:b(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function Se({option:e,isSelected:t,onSelect:n}){let{t:r}=a(),i=e.icon,o=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,O.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,O.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,O.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:o})]})}function Ce({file:e,onRemove:t}){let{t:n}=a(),r=e.type.startsWith(`image/`),i=(0,w.useMemo)(()=>r?URL.createObjectURL(e):null,[e,r]);return(0,w.useEffect)(()=>{if(i)return()=>URL.revokeObjectURL(i)},[i]),(0,O.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:[r&&i?(0,O.jsx)(`img`,{src:i,alt:e.name,className:`h-full w-full object-cover`}):(0,O.jsx)(f,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,O.jsx)(h,{variant:`ghost`,size:`compact`,iconOnly:(0,O.jsx)(p,{}),onClick:t,"aria-label":n(`shareFeedbackModal.removeAttachmentAria`,{name: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{D as n,U as t};
|
|
2
|
+
import{o as e,r as t}from"./rolldown-runtime-BM3Ffeng.js";import{E as n,Jn as r,N as i,j as a}from"./vendor-CYfJo8gP.js";import{_ as o,b as s,t as c,y as l}from"./react-DPM_L_aA.js";import{Ht as u,Jt as ee,Yr as d,Zn as te,bt as f,i as p,mn as ne,q as re,sn as m,tn as ie}from"./icons-CSdHOix6.js";import{Dy as h,Il as g,Li as _,Oy as v,Pf as ae,Qv as y,Z_ as b,_y as x,cr as oe,fv as S,gh as C,jc as se,vy as ce,wy as le,yy as ue}from"./index-b_IQShc9.js";var w=e(s(),1),de=e(l(),1),T=`vellum:debug:`;function fe(){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(T))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function E(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:b()},overrides:fe()}}var D=t({ShareFeedbackModal:()=>U,dedupeAgainstClientMessages:()=>B,stripBulkBase64:()=>z}),O=c(),pe=`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,me=`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,he={backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},k=[{value:`bug_report`,icon:d,includesLogsByDefault:!0},{value:`feature_request`,icon:m,includesLogsByDefault:!1},{value:`other`,icon:u,includesLogsByDefault:!1}],A=[{value:`past_hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,cutoffMs:1440*60*1e3},{value:`all_time`,cutoffMs:null}],j=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),M=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),N=10,P=50*1024*1024,ge={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function _e(){if(S())return`electron`;let e=n.getPlatform();return e===`ios`||e===`android`?e:`web`}function ve(e){return typeof e==`object`&&!!e&&`client`in e}function ye(e){if(e.size>P)return!1;if(e.type&&j.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?M.has(t):!1}return!1}var F=8192,I=/^data:([^;,]+);base64,/i,L=/^[A-Za-z0-9+/]+={0,2}$/;function R(e,t,n=new WeakSet){let r=t(e);if(r)return r.replacement;if(typeof e!=`object`||!e)return e;if(n.has(e))return`[cyclic]`;n.add(e);let i;if(Array.isArray(e))i=e.map(e=>R(e,t,n));else{let r={};for(let[i,a]of Object.entries(e))r[i]=R(a,t,n);i=r}return n.delete(e),i}function z(e){return R(e,e=>{if(typeof e!=`string`)return null;let t=I.exec(e);return t?{replacement:`[stripped data URI ${t[1]}, ${e.length} chars]`}:e.length>=F&&L.test(e)?{replacement:`[stripped base64, ${e.length} chars]`}:null})}function B(e,t){if(!Array.isArray(t))return e;let n=new Map;return t.forEach((e,t)=>{if(e&&typeof e==`object`){let r=e.id;n.set(e,typeof r==`string`?r:`index ${t}`)}}),R(e,e=>{if(typeof e!=`object`||!e)return null;let t=n.get(e);return t===void 0?null:{replacement:`[deduplicated: see clientMessages ${t}]`}})}function V(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 H(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 C({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 be(){if(!n.isNativePlatform())return null;try{let{App:e}=await o(async()=>{let{App:e}=await import(`./esm-fvefH7qR.js`);return{App:e}},__vite__mapDeps([0,1,2,3])),{id:t,name:n,version:r,build:i}=await e.getInfo();return{id:t,name:n,version:r,build:i}}catch{return null}}async function xe(e,t,n,r={}){if(typeof CompressionStream>`u`)return null;let{diagnosticsProvider:i,doctorSessionId:a,extraLogFiles:o=[]}=r,s=new Date,c=A.find(t=>t.value===e),l=s.getTime(),u=c?.cutoffMs==null?null:l-c.cutoffMs,ee=u==null?null:new Date(u).toISOString(),d=null;try{d=i?.()??null}catch{d=null}let te=g(d),f={collected_at:s.toISOString(),time_range:e,cutoff:ee,log_window:{start_time_ms:u,end_time_ms:l},assistant_id:t,active_conversation_id:n,doctor_session_id:a??null,client_version:null,native_app:await be(),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},p=new TextEncoder,ne=p.encode(JSON.stringify(f,null,2)),re=p.encode(JSON.stringify(te,null,2)),m=[V(`web-client-context.json`,ne),V(`web-chat-diagnostics.json`,re)],ie=new TextEncoder().encode(JSON.stringify(E(),null,2));m.push(V(`web-debug-flags.json`,ie));for(let e of o){let t=e.contents.trim();t&&m.push(V(e.filename,p.encode(t)))}try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t=e.getClientMessages?.()??null,n={clientMessages:t,transcriptItems:B(e.getTranscriptItems?.()??null,t),pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},r=new TextEncoder().encode(JSON.stringify(z(n),null,2));m.push(V(`web-chat-debug-api-triage.json`,r))}}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(z(t),null,2));m.push(V(`web-sse-liveness-triage.json`,n))}}catch{}if(S()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));m.push(V(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);m.push(V(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await H(t,{window:{startTime:u,endTime:l},activeConversationId:n});e&&m.push(V(`platform-logs.tar.gz`,e))}m.push(new Uint8Array(1024));let h=m.reduce((e,t)=>e+t.length,0),_=new Uint8Array(h),v=0;for(let e of m)_.set(e,v),v+=e.length;let ae=new Blob([_.buffer]),y=await new Response(ae.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([y],`web-client-logs-${s.getTime()}.tar.gz`,{type:`application/gzip`})}function U({open:e,onClose:t,initialReason:n,initialMessage:o,onSubmitted:s,assistantId:c,assistantVersion:l,activeConversationId:u,doctorSessionId:d,doctorSessionLog:m,getDiagnosticsSnapshot:g}){let{t:b}=a(),C=ae.use.user(),T=C?.email,fe=C?.isStaff??!1,E=(0,w.useId)(),D=(0,w.useRef)(null),A=(0,w.useRef)(null),j=(0,w.useRef)(null),M=(0,w.useRef)(null),P=(0,w.useMemo)(()=>[{value:`past_hour`,label:b(`shareFeedbackModal.timeRangePastHour`)},{value:`past_24_hours`,label:b(`shareFeedbackModal.timeRangePast24Hours`)},{value:`all_time`,label:b(`shareFeedbackModal.timeRangeAllTime`)}],[b]),[F,I]=(0,w.useState)(n??`bug_report`),[L,R]=(0,w.useState)(``),[z,B]=(0,w.useState)(``),[V,H]=(0,w.useState)(k.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[be,U]=(0,w.useState)(!1),[W,G]=(0,w.useState)(`past_hour`),[K,q]=(0,w.useState)([]),[we,J]=(0,w.useState)(null),[Te,Y]=(0,w.useState)(!1),[Ee,De]=(0,w.useState)(!1),[X,Oe]=(0,w.useState)(!1),Z=r(se()),[ke,Q]=(0,w.useState)(!1),$=Z.isPending||ke,Ae=!T,je=(0,w.useMemo)(()=>L.trim().length>0&&z.trim().length>0,[L,z]);(0,w.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;I(t),R(o??``),B(T??``),H(k.find(e=>e.value===t)?.includesLogsByDefault??!0),U(!1),G(`past_hour`),q([]),De(!1),Oe(!1),J(null),Q(!1),Z.reset();let r=setTimeout(()=>{T?j.current?.focus():M.current?.focus()},50);return()=>clearTimeout(r)},[e]),_(e);let Me=e=>{I(e),be||H(k.find(t=>t.value===e)?.includesLogsByDefault??!1)},Ne=()=>{H(e=>!e),U(!0)},Pe=m?.trim()?[{filename:`doctor-session.txt`,contents:m}]:[],Fe=(0,w.useCallback)(e=>{e.key===`Escape`&&!e.defaultPrevented&&!$&&(e.preventDefault(),t())},[t,$]),Ie=(0,w.useCallback)(e=>{e.target===D.current&&!$&&t()},[t,$]),Le=(0,w.useCallback)(e=>{q(t=>{let n=N-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(!ye(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),Re=e=>{e.target.files&&Le(Array.from(e.target.files)),e.target.value=``},ze=e=>{e.preventDefault(),Y(!1),e.dataTransfer.files?.length&&Le(Array.from(e.dataTransfer.files))},Be=e=>{e.preventDefault(),Y(!0)},Ve=e=>{e.preventDefault(),e.currentTarget===e.target&&Y(!1)},He=e=>{q(t=>t.filter((t,n)=>n!==e))};return e?(0,de.createPortal)((0,O.jsx)(`div`,{ref:D,role:`dialog`,"aria-modal":`true`,"aria-labelledby":E,className:pe,onKeyDown:Fe,onClick:Ie,onDrop:ze,onDragOver:Be,onDragLeave:Ve,children:(0,O.jsxs)(`div`,{className:me,style:he,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,O.jsx)(`h2`,{id:E,className:`!m-0 text-title-small text-[var(--content-default)]`,children:b(`shareFeedbackModal.title`)}),(0,O.jsx)(h,{variant:`ghost`,iconOnly:(0,O.jsx)(p,{}),onClick:t,disabled:$,"aria-label":b(`shareFeedbackModal.closeAria`),tintColor:`var(--content-secondary)`})]}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${$?`pointer-events-none opacity-60`:``}`,children:[fe&&(0,O.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,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3`,children:[(0,O.jsx)(x,{checked:X,onChange:()=>Oe(e=>!e),"aria-label":b(`shareFeedbackModal.downloadDiagnosticsAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:b(`shareFeedbackModal.downloadDiagnostics`)})]}),(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:b(`shareFeedbackModal.adminOnlyHint`)})]}),X?(0,O.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:b(`shareFeedbackModal.timeRange`)}),(0,O.jsx)(y,{options:P,value:W,onChange:G,"aria-label":b(`shareFeedbackModal.timeRangeAria`)})]}):(0,O.jsxs)(O.Fragment,{children:[Ae&&(0,O.jsx)(ce,{id:`${E}-email`,ref:M,label:b(`shareFeedbackModal.email`),type:`email`,placeholder:`you@example.com`,value:z,onChange:e=>B(e.target.value),leftIcon:(0,O.jsx)(ee,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,O.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:b(`shareFeedbackModal.category`)}),(0,O.jsx)(`div`,{className:`flex gap-2`,children:k.map(e=>(0,O.jsx)(Se,{option:e,isSelected:F===e.value,onSelect:()=>Me(e.value)},e.value))})]}),(0,O.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),F===`bug_report`&&(0,O.jsx)(le,{tone:`info`,children:(0,O.jsx)(i,{ns:`common`,i18nKey:`shareFeedbackModal.bugTip`,components:{discordLink:(0,O.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),F===`feature_request`&&(0,O.jsx)(le,{tone:`info`,children:(0,O.jsx)(i,{ns:`common`,i18nKey:`shareFeedbackModal.featureTip`,components:{roadmapLink:(0,O.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`})}})}),(0,O.jsx)(ue,{id:`${E}-message`,ref:j,label:b(F===`bug_report`?`shareFeedbackModal.messageLabelBug`:F===`feature_request`?`shareFeedbackModal.messageLabelFeature`:`shareFeedbackModal.messageLabelOther`),rows:3,placeholder:b(F===`bug_report`?`shareFeedbackModal.messagePlaceholderBug`:F===`feature_request`?`shareFeedbackModal.messagePlaceholderFeature`:`shareFeedbackModal.messagePlaceholderOther`),value:L,onChange:e=>R(e.target.value),fullWidth:!0}),F!==`feature_request`&&(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,O.jsx)(x,{checked:V,onChange:Ne,"aria-label":b(`shareFeedbackModal.includeDiagnosticsAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:b(`shareFeedbackModal.includeDiagnostics`)})]}),(0,O.jsx)(v,{content:b(`shareFeedbackModal.diagnosticsTooltip`),children:(0,O.jsx)(`button`,{type:`button`,"aria-label":b(`shareFeedbackModal.aboutDiagnosticsAria`),className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,O.jsx)(ne,{className:`h-3.5 w-3.5`})})})]}),V&&(0,O.jsx)(y,{options:P,value:W,onChange:G,"aria-label":b(`shareFeedbackModal.timeRangeAria`)})]}),S()&&u&&F!==`feature_request`&&(0,O.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,O.jsx)(x,{checked:Ee,onChange:()=>De(e=>!e),"aria-label":b(`shareFeedbackModal.includeConversationAria`)}),(0,O.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:b(`shareFeedbackModal.includeConversation`)})]}),(0,O.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,O.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[b(`shareFeedbackModal.attachments`),K.length>0&&(0,O.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,K.length,`/`,N]})]}),(0,O.jsx)(h,{variant:`outlined`,size:`compact`,leftIcon:(0,O.jsx)(f,{}),onClick:()=>A.current?.click(),disabled:K.length>=N,children:b(`shareFeedbackModal.addFiles`)}),(0,O.jsx)(`input`,{ref:A,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:Re,className:`hidden`})]}),K.length>0&&(0,O.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:K.map((e,t)=>(0,O.jsx)(Ce,{file:e,onRemove:()=>He(t)},`${e.name}-${t}`))}),Te&&(0,O.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:b(`shareFeedbackModal.dropFiles`)})]})]}),we&&(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:we})]}),(0,O.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:$?(0,O.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,O.jsx)(ie,{className:`h-4 w-4 animate-spin`}),b(X?`shareFeedbackModal.preparingDiagnostics`:`shareFeedbackModal.sendingFeedback`)]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(h,{variant:`ghost`,onClick:t,children:b(`shareFeedbackModal.cancel`)}),X?(0,O.jsx)(h,{variant:`primary`,leftIcon:(0,O.jsx)(te,{}),onClick:async()=>{if(!$){J(null),Q(!0);try{let e=await xe(W,c??null,S()?Ee?u??null:null:u??null,{diagnosticsProvider:g,doctorSessionId:d,extraLogFiles:Pe});if(!e){J(`Diagnostics export isn't supported in this browser.`);return}await oe(e,e.name),t()}catch(e){J(e instanceof Error?e.message:`Failed to build diagnostics. Please try again.`)}finally{Q(!1)}}},children:b(`shareFeedbackModal.downloadDiagnosticsButton`)}):(0,O.jsx)(h,{variant:`primary`,leftIcon:(0,O.jsx)(re,{}),onClick:async()=>{if(!(!je||$)){J(null),Q(!0);try{let e=V&&F!==`feature_request`?await xe(W,c??null,S()?Ee?u??null:null:u??null,{diagnosticsProvider:g,doctorSessionId:d,extraLogFiles:Pe}):null,n=_e(),r;if(n===`electron`)try{r=(await window.vellum?.app.versionInfo())?.version??r}catch{}let i=t=>Z.mutateAsync({headers:{"Content-Type":null},body:{message:L.trim(),classification:ge[F],email:z.trim(),client:t,client_version:r,...c?{assistant_id:c}:{},...l?{assistant_version:l}:{},...d?{doctor_session_id:d}:{},...e?{logs_file:e}:{},...K.length?{attachments:K}:{}},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}});try{await i(n)}catch(e){if(n!==`android`||!ve(e))throw e;await i(`web`)}s?.(),t()}catch(e){J(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Q(!1)}}},disabled:!je,children:b(`shareFeedbackModal.submit`)})]})})]})}),document.body):null}function Se({option:e,isSelected:t,onSelect:n}){let{t:r}=a(),i=e.icon,o=e.value===`bug_report`?r(`shareFeedbackModal.reasonBugReport`):e.value===`feature_request`?r(`shareFeedbackModal.reasonFeatureRequest`):r(`shareFeedbackModal.reasonOther`);return(0,O.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,O.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,O.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:o})]})}function Ce({file:e,onRemove:t}){let{t:n}=a(),r=e.type.startsWith(`image/`),i=(0,w.useMemo)(()=>r?URL.createObjectURL(e):null,[e,r]);return(0,w.useEffect)(()=>{if(i)return()=>URL.revokeObjectURL(i)},[i]),(0,O.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:[r&&i?(0,O.jsx)(`img`,{src:i,alt:e.name,className:`h-full w-full object-cover`}):(0,O.jsx)(f,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,O.jsx)(h,{variant:`ghost`,size:`compact`,iconOnly:(0,O.jsx)(p,{}),onClick:t,"aria-label":n(`shareFeedbackModal.removeAttachmentAria`,{name: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{D as n,U as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CYfJo8gP.js";import{b as n,d as r,f as i,n as a,t as o}from"./react-DPM_L_aA.js";import{Lr as s,pi as c}from"./icons-CSdHOix6.js";import{Dy as l,Ey as u,Kv as d,bp as f,dv as p,fv as m,ra as h,wi as g,xs as _}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{j as t}from"./vendor-CYfJo8gP.js";import{b as n,d as r,f as i,n as a,t as o}from"./react-DPM_L_aA.js";import{Lr as s,pi as c}from"./icons-CSdHOix6.js";import{Dy as l,Ey as u,Kv as d,bp as f,dv as p,fv as m,ra as h,wi as g,xs as _}from"./index-b_IQShc9.js";import{t as v}from"./use-edge-swipe-back-BO9Eg7fg.js";import{t as y}from"./link-click-OFMduoc0.js";var b=e(n(),1),x=`data-page-transition`,S=400,C;function w(){return typeof document<`u`&&typeof document.startViewTransition==`function`}function T(){return f()&&w()}function E(e,t,n,r){if(!T()){e(t,r);return}document.documentElement.setAttribute(x,n),C!==void 0&&clearTimeout(C),C=setTimeout(()=>{C=void 0,document.documentElement.removeAttribute(x)},S),e(t,{...r,viewTransition:!0})}var D=o();function O({sidebar:e,children:n,actions:o,backHref:s,title:d=`Settings`,menuRoute:f=p.settings.root}){let{t:y}=t(),{pathname:x}=r(),S=i(),C=x===f,w=_(),T=(0,b.useRef)(null),O=(0,b.useRef)(null);(0,b.useLayoutEffect)(()=>{O.current?.scrollTo(0,0)},[x]);let k=C?s:f;v({containerRef:T,onBack:(0,b.useCallback)(()=>{S(k)},[S,k]),enabled:w,navKey:x,prefetchHref:k});let A=m(),j=y(C?`sidebarShell.backFrom`:`sidebarShell.backToMenu`,{title:d}),M=(0,D.jsx)(l,{variant:`ghost`,iconOnly:(0,D.jsx)(c,{}),"aria-label":j,tintColor:`var(--content-secondary)`,onClick:()=>E(S,k,`pop`)}),N=(0,D.jsx)(l,{asChild:!0,variant:`outlined`,"aria-label":y(`sidebarShell.backFrom`,{title:d}),className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,D.jsx)(a,{to:s,className:`flex items-center justify-center no-underline`,children:(0,D.jsx)(c,{size:16,"aria-hidden":`true`})})});return(0,D.jsxs)(`div`,{ref:T,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:A?`3.75rem`:`1rem`},children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[M,(0,D.jsx)(u,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:d}),(0,D.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),A?(0,D.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,D.jsx)(h,{placement:`electron`,className:`px-0 pt-0`}),(0,D.jsx)(g,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,D.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[N,(0,D.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,D.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,D.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":y(`sidebarShell.navigationAria`,{title:d}),children:e}),C?(0,D.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pb-6 md:hidden`,children:e}):null,(0,D.jsx)(`main`,{ref:O,className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto overflow-x-hidden pb-6 md:flex md:px-6 md:pt-0 ${C?`hidden`:`flex`}`,children:n})]})]})]})}function k({items:e,bottomItems:n,indexPath:a}){let{t:o}=t(),{pathname:c}=r(),l=i(),u=_(),f=(e,t,n)=>{let{href:r,onSelect:i}=e,o=r!=null&&(c===r||c.startsWith(r+`/`)||!u&&n&&a!=null&&c===a);return(0,D.jsxs)(b.Fragment,{children:[(0,D.jsx)(d.Item,{icon:e.icon,label:e.label,active:o,trailingIcon:r==null?void 0:s,trailingIconClassName:r==null?void 0:`md:hidden`,href:r,onSelect:i,onClick:r==null?void 0:e=>{y(e)||(e.preventDefault(),E(l,r,`push`))}}),!t&&(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,D.jsxs)(`nav`,{"aria-label":o(`sidebarTree.ariaLabel`),className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((t,r)=>f(t,r===e.length-1&&!n?.length,r===0)),n&&n.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`div`,{className:`flex-1`}),(0,D.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),n.map((e,t)=>f(e,t===n.length-1,!1))]})]})}export{O as n,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{N as t,_ as n,g as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{Io as s,Lo as c,Yt as l,lg as u}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{N as t,_ as n,g as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{Io as s,Lo as c,Yt as l,lg as u}from"./index-b_IQShc9.js";import{n as d,t as f}from"./use-return-to-short-circuit-qAmnQhhd.js";import{t as p}from"./signup-shell-Cz7nHsiG.js";var m=e(a(),1),h=o();function g({words:e}){let[t,i]=(0,m.useState)(0),a=(0,m.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,m.useEffect)(()=>{let t=setInterval(()=>{i(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,h.jsxs)(`span`,{className:`signup__rotating`,children:[(0,h.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[a,`.`]}),(0,h.jsx)(n,{mode:`wait`,children:(0,h.jsxs)(r.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var _=[`signupScreen.headlineRoles.personalIntelligence`,`signupScreen.headlineRoles.softwareEngineer`,`signupScreen.headlineRoles.financeOps`,`signupScreen.headlineRoles.householdManager`,`signupScreen.headlineRoles.gtmEngineer`,`signupScreen.headlineRoles.productLead`];function v({returnTo:e}){let{t:n}=i(`account`),r=(0,m.useMemo)(()=>_.map(e=>n(e)),[n]),[a,o]=(0,m.useState)(null),[d,f]=(0,m.useState)(!1),v=(t,r)=>{o(null),f(!0),u(s,c(e,{authIntent:t}),{returnTo:e,intent:t}).catch(e=>{console.error(r,e),o(n(`authErrors.genericFailure`))}).finally(()=>{f(!1)})};return(0,h.jsxs)(p,{children:[(0,h.jsxs)(`h1`,{className:`signup__title`,children:[n(`signupScreen.headlineLead`),(0,h.jsx)(`br`,{}),(0,h.jsx)(g,{words:r})]}),(0,h.jsx)(`p`,{className:`signup__subtitle`,children:n(`signupScreen.subtitle`)}),(0,h.jsx)(`div`,{className:`signup__buttons`,children:(0,h.jsx)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>{v(`signup`,`[signup] auth flow failed:`)},disabled:d,children:n(`signupScreen.continue`)})}),a&&(0,h.jsx)(`p`,{className:`signup__error`,children:a}),(0,h.jsx)(`p`,{className:`signup__footer`,children:(0,h.jsx)(t,{i18nKey:`signupScreen.haveAccountPrompt`,ns:`account`,components:{signIn:(0,h.jsx)(`button`,{type:`button`,className:`signup__link`,onClick:()=>{v(void 0,`[signup] sign-in flow failed:`)},disabled:d})}})}),(0,h.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,h.jsx)(l,{size:16}),n(`signupScreen.downloadMac`)]})]})}function y(){let e=f();return e.kind===`wait`?(0,h.jsx)(p,{children:(0,h.jsx)(d,{})}):e.kind===`redirect`?e.node:(0,h.jsx)(v,{returnTo:e.returnTo})}export{y as SignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{jr as n}from"./index-
|
|
1
|
+
import{g as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{jr as n}from"./index-b_IQShc9.js";var r=t();function i({children:t}){return(0,r.jsxs)(e.div,{"data-theme":`dark`,className:`signup`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,r.jsxs)(`div`,{className:`signup__left`,children:[(0,r.jsx)(`div`,{className:`signup__logo`,children:(0,r.jsx)(`img`,{src:n(`/vellum-logo-white.svg`),alt:`Vellum`,width:82,height:25})}),(0,r.jsx)(`div`,{className:`signup__form`,children:t})]}),(0,r.jsx)(e.div,{className:`signup__right`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.6,delay:.15},"aria-hidden":!0,children:(0,r.jsx)(`video`,{className:`signup__video`,src:n(`/vellum-scene-cut.mp4`),autoPlay:!0,loop:!0,muted:!0,playsInline:!0})})]})}export{i as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CYfJo8gP.js";import{b as i,d as a,f as o,g as s,m as c,r as l,t as u,y as d}from"./react-DPM_L_aA.js";import{Gn as f,In as p,Lr as m,On as h,gi as g,or as _,pi as v,qn as y,tn as b,v as x,x as S,xi as C,zr as w}from"./icons-CSdHOix6.js";import{a as T,n as E,r as D,t as O}from"./use-skill-actions-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CYfJo8gP.js";import{b as i,d as a,f as o,g as s,m as c,r as l,t as u,y as d}from"./react-DPM_L_aA.js";import{Gn as f,In as p,Lr as m,On as h,gi as g,or as _,pi as v,qn as y,tn as b,v as x,x as S,xi as C,zr as w}from"./icons-CSdHOix6.js";import{a as T,n as E,r as D,t as O}from"./use-skill-actions-Cenw6B7x.js";import{Dv as k,Dy as A,Ft as j,Pt as M,Rd as N,Ty as P,Vd as F,Vh as I,Wv as L,Y as R,a as z,an as B,bo as V,dv as H,fy as ee,gf as U,i as te,in as ne,py as W,ry as G,xs as re,yv as ie,zd as ae}from"./index-b_IQShc9.js";import{t as oe}from"./diff-rows-w3WozbDH.js";import{t as K}from"./skill-icon-DjGUr_AF.js";import{n as q,t as J}from"./use-skill-detail-files-BMTlfXyu.js";import{t as se}from"./skill-removal-dialog-IZ80QFym.js";import{t as ce}from"./use-edge-swipe-back-BO9Eg7fg.js";import{i as le,n as ue,r as de,t as Y}from"./file-editor-BcG_sR-r.js";var fe=C(`search-x`,[[`path`,{d:`m13.5 8.5-5 5`,key:`1cs55j`}],[`path`,{d:`m8.5 8.5 5 5`,key:`a8mexj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),X=e(i(),1),Z=u();function Q(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(b,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}var pe=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,me=/^diff --git a\/(.+) b\/\1$/;function he(e,t){let n=e.replace(/^[ab]\//,``),r=`skills/${t}/`;return n.startsWith(r)?n.slice(r.length):n}function ge(e){let t=e.slice(4).replace(/\t$/,``);return t===`/dev/null`?null:t}function _e(e,t){let n=[],r=null,i=0,a=0,o=!1,s=!1;for(let c of e.split(`
|
|
2
2
|
`)){if(c.startsWith(`diff --git `)){r={path:he(me.exec(c)?.[1]??(c.split(` `).slice(3).join(` `)||``),t),rows:[],added:0,removed:0},n.push(r),i=0,a=0,o=!1,s=!1;continue}if(!r)continue;let e=pe.exec(c);if(e){i=Number(e[1]),a=Number(e[2]),o=!0,r.rows.length>0&&r.rows.push({type:`meta`,text:c});continue}if(!c.startsWith(`\\ No newline`)){if(!o&&(c.startsWith(`+++ `)||c.startsWith(`--- `))){let e=ge(c);e!==null&&(c.startsWith(`+++ `)||!s)&&(r.path=he(e,t),s=c.startsWith(`+++ `));continue}!o&&(c.startsWith(`index `)||c.startsWith(`new file mode `)||c.startsWith(`deleted file mode `)||c.startsWith(`similarity index `)||c.startsWith(`rename `)||c.startsWith(`old mode `)||c.startsWith(`new mode `)||c.startsWith(`Binary files `))||(c.startsWith(`+`)?(r.rows.push({type:`add`,text:c.slice(1),newNo:a}),r.added+=1,a+=1):c.startsWith(`-`)?(r.rows.push({type:`del`,text:c.slice(1),oldNo:i}),r.removed+=1,i+=1):c.startsWith(` `)&&(r.rows.push({type:`ctx`,text:c.slice(1),oldNo:i,newNo:a}),i+=1,a+=1))}}return{files:n,added:n.reduce((e,t)=>e+t.added,0),removed:n.reduce((e,t)=>e+t.removed,0)}}async function ve(e,t,n){let{data:r,error:i,response:a}=await I({path:{assistant_id:e,id:t},throwOnError:!1,signal:n});if(!a||!a.ok){if(a?.status===404)return null;throw a?k(i,a):i??Error(`Failed to fetch skill history.`)}return r??null}function ye(e){return e.isLoading?!1:e.isError||e.revisionCount>0}function be(e,n){let r=!!(e&&n),i=t({queryKey:ae({path:{assistant_id:e??``,id:n}}),queryFn:({signal:t})=>ve(e??``,n,t),enabled:r,refetchOnWindowFocus:!1});return{history:i.data??null,revisions:i.data?.revisions??[],truncatedByCompaction:i.data?.truncatedByCompaction??!1,isLoading:i.isLoading,isError:i.isError}}function xe({assistantId:e,skillId:t}){let{t:n}=r(`intelligence`),{revisions:i,truncatedByCompaction:a,isLoading:o,isError:s}=be(e,t);return o?(0,Z.jsx)(Q,{}):s?(0,Z.jsx)(Ce,{children:n(`skillRevisionHistory.loadError`)}):(0,Z.jsx)(Se,{skillId:t,revisions:i,truncatedByCompaction:a})}function Se({skillId:e,revisions:t,truncatedByCompaction:n}){let{t:i}=r(`intelligence`);return t.length===0?(0,Z.jsx)(Ce,{children:i(`skillRevisionHistory.noChanges`)}):(0,Z.jsxs)(L.Root,{type:`multiple`,className:`flex flex-col gap-2 p-3`,children:[t.map(t=>(0,Z.jsx)(we,{revision:t,skillId:e},t.id)),n&&(0,Z.jsx)(`p`,{className:`px-1 pt-1 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:i(`skillRevisionHistory.truncatedNotice`)})]})}function Ce({children:e}){return(0,Z.jsx)(`p`,{className:`px-3 py-10 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e})}function we({revision:e,skillId:t}){let{t:n}=r(`intelligence`),i=(0,X.useMemo)(()=>_e(e.diff,t),[e.diff,t]);return(0,Z.jsxs)(L.Item,{value:e.id,className:`overflow-hidden rounded-md border`,style:{borderColor:`var(--border-base)`},children:[(0,Z.jsxs)(L.Trigger,{className:`group flex w-full items-center gap-3 px-3 py-2.5 text-left transition-colors hover:bg-[var(--surface-hover)]`,children:[(0,Z.jsx)(m,{className:`h-4 w-4 shrink-0 transition-transform group-data-[state=open]:rotate-90`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`block truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:z(e.changedAt)}),(0,Z.jsx)(`span`,{className:`mt-0.5 block truncate text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:e.files.join(` · `)})]}),i.added>0&&(0,Z.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-positive-strong)`},children:[`+`,i.added]}),i.removed>0&&(0,Z.jsxs)(`span`,{className:`shrink-0 text-body-small-default tabular-nums`,style:{color:`var(--system-negative-strong)`},children:[`−`,i.removed]})]}),(0,Z.jsxs)(L.Content,{className:`border-t`,style:{borderColor:`var(--border-base)`},children:[(0,Z.jsx)(`p`,{className:`px-3 py-2 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:te(e.changedAt)}),i.files.length===0?(0,Z.jsx)(`p`,{className:`px-3 pb-3 text-body-small-lighter`,style:{color:`var(--content-tertiary)`},children:n(`skillRevisionHistory.noPreviewForChange`)}):i.files.map(e=>(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`p`,{className:`border-t px-3 py-1.5 font-mono text-body-small-default`,style:{borderColor:`var(--border-base)`,backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:e.path}),(0,Z.jsx)(`div`,{className:`py-1`,children:(0,Z.jsx)(oe,{rows:e.rows})})]},e.path))]})]})}function Te(e){return e===`history`?`history`:`files`}function Ee({assistantId:e,skill:t,tab:n,onTabChange:i,onBack:a,backToConversation:o=!1,onInstall:s,onRemove:c,isInstalling:l=!1,isRemoving:u=!1,sourceConversationId:d}){let{t:f}=r(`intelligence`),m=D(t),_=j(t),{fileEntries:y,setSelectedPath:x,activePath:C,activeFile:w,isFilesLoading:E,fileContent:O,isBinary:k,isContentLoading:M}=J(e,t.id),{revisions:N,isLoading:F,isError:I}=be(e,t.id),L=ye({isLoading:F,isError:I,revisionCount:N.length}),R=L?n:`files`,z=(0,Z.jsxs)(`div`,{className:`mb-4 flex items-start gap-3`,children:[(0,Z.jsx)(A,{type:`button`,variant:`ghost`,iconOnly:(0,Z.jsx)(v,{"aria-hidden":!0}),"aria-label":f(o?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:a}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 sm:flex-row sm:items-center`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,Z.jsx)(K,{skill:t,className:`h-8 w-8 text-3xl`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Z.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:t.name}),(0,Z.jsx)(T,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:t.description}),(0,Z.jsx)(q,{skill:{origin:t.origin,sourceConversationId:d},className:`mt-1`})]})]}),m?l?(0,Z.jsx)(`div`,{className:`flex h-9 items-center px-3`,children:(0,Z.jsx)(b,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):(0,Z.jsx)(A,{type:`button`,onClick:s,disabled:!s,leftIcon:(0,Z.jsx)(g,{"aria-hidden":!0}),children:f(`skillDetail.install`)}):(0,Z.jsx)(A,{type:`button`,variant:_?`dangerOutline`:`outlined`,onClick:c,disabled:!_||u||!c,leftIcon:u?(0,Z.jsx)(b,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(S,{"aria-hidden":!0}),children:f(`skillDetail.remove`)})]})]}),B=(0,Z.jsx)(P.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden sm:grid`,style:{gridTemplateColumns:`240px 1fr`},children:[(0,Z.jsx)(`div`,{className:`max-h-40 shrink-0 overflow-y-auto border-b p-2 sm:max-h-none sm:border-b-0 sm:border-r`,style:{borderColor:`var(--border-base)`},children:E?(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,Z.jsx)(b,{className:`h-4 w-4 animate-spin`,style:{color:`var(--content-tertiary)`}})}):y.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-4 text-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:f(`skillDetail.noFilesAvailable`)}):y.map(e=>{let t=C===e.path,n=(e.mimeType??``).endsWith(`/directory`);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>x(e.path),className:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:t?`var(--primary-base)`:`var(--content-default)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:void 0},children:[n?(0,Z.jsx)(h,{className:`h-4 w-4 shrink-0`,style:{color:`var(--system-mid-strong)`}}):(0,Z.jsx)(p,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.name})]},e.path)})}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:M?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(b,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):w?(0,Z.jsx)(De,{assistantId:e,skillId:t.id,fileName:w.name,filePath:w.path,content:O,isBinary:k,editable:t.kind===`installed`},`${t.id}/${w.path}`):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:f(`skillDetail.selectFilePrompt`)})})]})});return(0,Z.jsxs)(`div`,{className:`flex h-[calc(100vh-14rem)] flex-col`,children:[z,(0,Z.jsxs)(W.Root,{value:R,onValueChange:e=>i(Te(e)),className:`flex min-h-0 flex-1 flex-col`,children:[L&&(0,Z.jsxs)(W.List,{className:`mb-3`,children:[(0,Z.jsx)(W.Trigger,{value:`files`,children:f(`skillDetail.filesTab`)}),(0,Z.jsx)(W.Trigger,{value:`history`,children:f(`skillDetail.historyTab`)})]}),(0,Z.jsx)(W.Panel,{value:`files`,forceMount:!0,className:`min-h-0 flex-1 flex-col`,style:{display:R===`files`?`flex`:`none`},children:B}),L&&(0,Z.jsx)(W.Panel,{value:`history`,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(P.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,Z.jsx)(xe,{assistantId:e,skillId:t.id})})})})]})]})}function De({assistantId:e,skillId:t,fileName:i,filePath:a,content:o,isBinary:s,editable:c}){let{t:l}=r(`intelligence`),u=n(),[d,f]=(0,X.useState)(!1),[p,m]=(0,X.useState)(``),h=`skills/${t}/${a}`,g=U({onSuccess:()=>{f(!1),m(``),u.invalidateQueries({queryKey:[{_id:`skillsByIdFilesContentGet`}]}),u.invalidateQueries({queryKey:[{_id:`skillsByIdFilesGet`}]}),u.invalidateQueries({queryKey:[{_id:`skillsByIdHistoryGet`}]}),a===`SKILL.md`&&M(u,e)},onError:e=>{ie(e,{context:`skill-file-save`,bestEffort:!0})}}),_=d&&p!==(o??``),v=(0,X.useCallback)(()=>{!_||g.isPending||g.mutate({path:{assistant_id:e},body:{path:h,content:p,encoding:`utf8`}})},[_,g,e,h,p]),b=(0,X.useCallback)(()=>{f(!0),m(o??``),g.reset()},[o,g]),x=(0,X.useCallback)(()=>{f(!1),m(``),g.reset()},[g]);if(s)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:l(`skillFileContent.binaryFile`)});if(o===null)return(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:l(`skillFileContent.noPreviewAvailable`,{fileName:i})});let S=c?(0,Z.jsx)(A,{variant:`ghost`,size:`regular`,iconOnly:(0,Z.jsx)(y,{"aria-hidden":!0}),onClick:()=>void V(h),"aria-label":l(`skillDetail.openInWorkspaceAriaLabel`),className:`hover:bg-[var(--surface-base)]`}):void 0;return B(i,void 0)&&!d?(0,Z.jsx)(`div`,{className:`relative flex h-full flex-col`,children:(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:[(0,Z.jsx)(Y,{content:o,fileName:i,showEdit:c,isEditing:!1,onToggleEdit:b,extraActions:S}),(0,Z.jsx)(ne,{content:o})]})}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Z.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[(0,Z.jsx)(Y,{content:d?p:o,fileName:i,showEdit:c,isEditing:d,onToggleEdit:()=>d?x():b(),extraActions:S}),d?(0,Z.jsx)(de,{value:p,onChange:m,onSave:v}):(0,Z.jsx)(le,{content:o,readOnly:!c,onStartEdit:b})]}),d&&(0,Z.jsx)(ue,{isDirty:_,isSaving:g.isPending,error:g.isError?l(`skillDetail.saveFailed`):null,onSave:v,onDiscard:x})]})}var Oe=e(d(),1);function ke({fileName:e,content:t,isBinary:n,viewMode:i=`preview`}){let{t:a}=r(`intelligence`);return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:a(`skillFileContent.binaryFile`)}):t===null?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:a(`skillFileContent.noPreviewAvailable`,{fileName:e})}):B(e,void 0)&&i===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(ne,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Ae({assistantId:e,skill:t,onBack:n,backToConversation:i=!1,onInstall:a,onRemove:o,isInstalling:s=!1,isRemoving:c=!1,swipeContainerRef:l,sourceConversationId:u}){let{t:d}=r(`intelligence`),p=D(t),m=j(t),{fileEntries:h,setSelectedPath:g,activePath:y,activeFile:x,isFilesLoading:S,fileContent:C,isBinary:w,isContentLoading:E}=J(e,t.id),[O,k]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{k(`preview`)},[y]);let[M,N]=(0,X.useState)(null);(0,X.useEffect)(()=>{N(document.getElementById(`viewport-overlays`))},[]);let F=x?B(x.name,void 0):!1,I=F?O:`raw`,L=(0,Z.jsxs)(`div`,{ref:l,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,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(A,{variant:`ghost`,iconOnly:(0,Z.jsx)(v,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":d(i?`skillDetail.backToConversationAriaLabel`:`skillDetail.backToSkillsAriaLabel`),onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(je,{available:p,removable:m,isInstalling:s,isRemoving:c,onInstall:a,onRemove:o})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(K,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(T,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description}),(0,Z.jsx)(q,{skill:{origin:t.origin,sourceConversationId:u}})]}),(0,Z.jsx)(P.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`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,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(Ne,{fileEntries:h,activePath:y,activeName:x?.name??null,onSelect:g}),(0,Z.jsx)(ee,{iconOnly:!0,ariaLabel:d(`skillDetail.fileViewModeAriaLabel`),value:I,onChange:k,items:[{value:`preview`,label:d(`skillDetail.preview`),icon:(0,Z.jsx)(f,{"aria-hidden":!0}),disabled:!F},{value:`raw`,label:d(`skillDetail.source`),icon:(0,Z.jsx)(_,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:S||E?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(b,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):x?(0,Z.jsx)(ke,{fileName:x.name,content:C,isBinary:w,viewMode:I}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:d(`skillDetail.selectFilePrompt`)})})]})})]});return M?(0,Oe.createPortal)(L,M):L}function je({available:e,removable:t,isInstalling:n,isRemoving:i,onInstall:a,onRemove:o}){let{t:s}=r(`intelligence`);return n||i?(0,Z.jsx)(A,{variant:`ghost`,iconOnly:(0,Z.jsx)(b,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":s(`skillDetail.pendingAriaLabel`),className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(A,{variant:`ghost`,iconOnly:(0,Z.jsx)(g,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.installSkillAriaLabel`),onClick:a,disabled:!a,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(A,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(S,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":s(`skillRow.removeSkillAriaLabel`),onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(A,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(S,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:s(`skillRow.bundledSkillsCannotBeRemoved`),"aria-label":s(`skillRow.bundledSkillCannotBeRemovedAriaLabel`),className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Me(e){return(e??``).endsWith(`/directory`)}function Ne({fileEntries:e,activePath:t,activeName:n,onSelect:i}){let{t:a}=r(`intelligence`),o=n??a(`skillDetail.selectAFile`);return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:o})]}):(0,Z.jsxs)(G.Root,{children:[(0,Z.jsx)(G.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)($,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:o}),(0,Z.jsx)(w,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(G.Content,{align:`start`,children:e.map(e=>{let n=Me(e.mimeType);return(0,Z.jsx)(G.Item,{onSelect:()=>i(e.path),leftIcon:n?(0,Z.jsx)(h,{}):(0,Z.jsx)(p,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function $(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(p,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}function Pe(){let{t:e}=r(`intelligence`);return(0,Z.jsx)(E,{icon:x,iconColor:`var(--system-danger)`,title:e(`skillsErrorState.title`),subtitle:e(`skillsErrorState.subtitle`)})}function Fe(){let{t:e}=r(`intelligence`),n=R(),{skillId:i}=c(),u=o(),d=a(),{pathname:f}=d,p=re(),m=(0,X.useRef)(null),h=d.state,g=typeof h?.listSearch==`string`?h.listSearch:``,_=typeof h?.backTo==`string`&&h.backTo.startsWith(`/`)&&!h.backTo.startsWith(`//`)?h.backTo:null,[y,b]=s(),x=Te(y.get(`tab`)),S=(0,X.useCallback)(e=>{let t=new URLSearchParams(y);e===`history`?t.set(`tab`,`history`):t.delete(`tab`),b(t,{replace:!0,state:d.state})},[y,b,d.state]),C=t({...F({path:{assistant_id:n},query:{include:`catalog`}}),select:e=>e.skills,refetchOnMount:`always`}),w=_??`${H.superpowers}${g}`,T=(0,X.useCallback)(()=>{u(w)},[u,w]),D=(0,X.useCallback)(()=>{u(w,{replace:!0})},[u,w]);ce({containerRef:m,onBack:T,enabled:p,navKey:f,prefetchHref:w.split(`?`)[0]??w});let{handleInstall:k,handleRemove:j,isInstallingSkill:M,isRemovingSkill:P,skillPendingRemoval:I,confirmRemove:L,cancelRemove:z}=O(n,{onRemoved:D}),B=C.data,V=(0,X.useMemo)(()=>B?.find(e=>e.id===i)??null,[B,i]),ee=t({...N({path:{assistant_id:n,id:i??``}}),enabled:!!i&&V?.origin===`assistant-memory`,select:e=>e.skill.origin===`assistant-memory`?e.skill.sourceConversationId??null:null});if(!i)return(0,Z.jsx)(l,{to:H.superpowers,replace:!0});if(C.isLoading)return(0,Z.jsx)(Q,{});if(C.isError&&!V)return(0,Z.jsx)(Pe,{});if(!V&&C.isFetching)return(0,Z.jsx)(Q,{});if(!V)return(0,Z.jsx)(E,{icon:fe,title:e(`skillDetailPage.notFoundTitle`),subtitle:e(`skillDetailPage.notFoundSubtitle`),children:(0,Z.jsx)(A,{type:`button`,variant:`outlined`,className:`mt-4`,leftIcon:(0,Z.jsx)(v,{"aria-hidden":!0}),onClick:T,children:e(_?`skillDetailPage.backToConversation`:`skillDetailPage.backToSuperpowers`)})});let U={assistantId:n,skill:V,onBack:T,backToConversation:_!==null,onInstall:()=>k(V),onRemove:()=>j(V),isInstalling:M(V),isRemoving:P(V),sourceConversationId:ee.data??void 0};return(0,Z.jsxs)(Z.Fragment,{children:[p?(0,Z.jsx)(Ae,{...U,swipeContainerRef:m}):(0,Z.jsx)(Ee,{...U,tab:x,onTabChange:S}),(0,Z.jsx)(se,{skillName:I?.name??null,onConfirm:L,onCancel:z})]})}export{Fe as SkillDetailPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CYfJo8gP.js";import{b as i,d as a,f as o,t as s}from"./react-DPM_L_aA.js";import{Yn as c,Zr as l,tn as u,x as d}from"./icons-CSdHOix6.js";import{Dy as f,Ey as p,Ft as m,It as h,Pt as g,Rd as _,_ as v,dv as y,h_ as b,hf as x,in as S,ry as C,yv as w}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Zn as t,er as n,j as r}from"./vendor-CYfJo8gP.js";import{b as i,d as a,f as o,t as s}from"./react-DPM_L_aA.js";import{Yn as c,Zr as l,tn as u,x as d}from"./icons-CSdHOix6.js";import{Dy as f,Ey as p,Ft as m,It as h,Pt as g,Rd as _,_ as v,dv as y,h_ as b,hf as x,in as S,ry as C,yv as w}from"./index-b_IQShc9.js";import{n as T,t as E}from"./use-skill-detail-files-BMTlfXyu.js";import{t as D}from"./skill-removal-dialog-IZ80QFym.js";var O=e(i(),1),k=s();function A({skillId:e,onClose:i}){let{t:s}=r(`chat`),A=o(),j=a(),M=n(),N=b.use.activeAssistantId(),[P,F]=(0,O.useState)(!1),I=t({..._({path:{assistant_id:N??``,id:e}}),select:e=>e.skill,enabled:!!N}),L=I.data,{skillMd:R,fileContent:z,isFilesPending:B,isContentPending:V}=E(N,e),H=x({onSuccess:()=>{N&&g(M,N),i()},onError:e=>{w(e,{context:`skill-detail-panel-remove`})}}),U=()=>{N&&(H.mutate({path:{assistant_id:N,id:e}}),F(!1))},W=I.isPending||B||R!=null&&V,G=L!=null&&m(L);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(v,{icon:L?.emoji?(0,k.jsx)(`span`,{className:`text-xl leading-none`,"aria-hidden":!0,children:L.emoji}):void 0,Glyph:l,title:L?.name??s(`skillDetailPanel.titleFallback`),closeLabel:s(`skillDetailPanel.closeDetails`),onClose:i,headerActions:G?(0,k.jsxs)(C.Root,{children:[(0,k.jsx)(C.Trigger,{asChild:!0,children:(0,k.jsx)(f,{variant:`outlined`,iconOnly:(0,k.jsx)(c,{}),"aria-label":s(`skillDetailPanel.actionsAria`),tooltip:s(`skillDetailPanel.moreTooltip`),className:`shrink-0`})}),(0,k.jsx)(C.Content,{side:`bottom`,align:`end`,children:(0,k.jsx)(C.Item,{leftIcon:(0,k.jsx)(d,{size:14}),onSelect:()=>F(!0),children:s(`skillDetailPanel.removeSkill`)})})]}):void 0,footer:(0,k.jsx)(`div`,{className:`flex justify-end`,children:(0,k.jsx)(f,{onClick:()=>{i(),A(y.skills.detail(e),{state:h(j)})},children:s(`skillDetailPanel.goToSkill`)})}),children:I.isError&&!L?(0,k.jsx)(p,{variant:`body-medium-lighter`,as:`p`,className:`py-8 text-center text-[var(--content-tertiary)]`,children:s(`skillDetailPanel.loadError`)}):W?(0,k.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,k.jsx)(u,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,k.jsxs)(k.Fragment,{children:[L?.description&&(0,k.jsx)(p,{variant:`body-medium-lighter`,as:`p`,className:`mb-4 text-[var(--content-secondary)]`,children:L.description}),L&&(0,k.jsx)(T,{skill:L,className:`mb-4`,onNavigate:i}),z&&(0,k.jsx)(S,{content:z})]})}),(0,k.jsx)(D,{skillName:P&&L?L.name:null,onConfirm:U,onCancel:()=>F(!1)})]})}export{A as SkillDetailPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{sy as n}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{sy as n}from"./index-b_IQShc9.js";var r=t();function i({skillName:t,onConfirm:i,onCancel:a}){let{t:o}=e();return(0,r.jsx)(n,{open:t!==null,title:o(`skillRemovalDialog.title`),message:t?o(`skillRemovalDialog.message`,{name:t}):``,confirmLabel:o(`skillRemovalDialog.remove`),destructive:!0,onConfirm:i,onCancel:a})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,r as t,t as n}from"./react-DPM_L_aA.js";import{dv as r}from"./index-
|
|
1
|
+
import{g as e,r as t,t as n}from"./react-DPM_L_aA.js";import{dv as r}from"./index-b_IQShc9.js";var i=n();function a(){let[n]=e(),a=n.get(`skill`);if(a)return(0,i.jsx)(t,{to:r.skills.detail(a),replace:!0});let o=n.toString();return(0,i.jsx)(t,{to:`${r.superpowers}${o?`?${o}`:``}`,replace:!0})}export{a as SkillsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jn as t,Zn as n,er as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{lt as s,x as c,zr as l}from"./icons-CSdHOix6.js";import{Cs as u,Gd as d,Hd as f,Ss as p,Ts as m,Ty as h,Ud as g,Wd as _,Y as v,_y as y,ws as b}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{Jn as t,Zn as n,er as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{lt as s,x as c,zr as l}from"./icons-CSdHOix6.js";import{Cs as u,Gd as d,Hd as f,Ss as p,Ts as m,Ty as h,Ud as g,Wd as _,Y as v,_y as y,ws as b}from"./index-b_IQShc9.js";var x=e(a(),1),S=o(),C={task_complete:`soundsSections.soundEventTaskComplete`,needs_input:`soundsSections.soundEventNeedsInput`,task_failed:`soundsSections.soundEventTaskFailed`,notification:`soundsSections.soundEventNotification`,new_conversation:`soundsSections.soundEventNewConversation`,message_sent:`soundsSections.soundEventMessageSent`,character_poke:`soundsSections.soundEventCharacterPoke`,random:`soundsSections.soundEventRandom`};function w(e,t){return t(C[e])}function T({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(y,{checked:n,disabled:r,onChange:i,label:e})]})}function E(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function D({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:u,t:d}){let[f,p]=(0,x.useState)(!1),h=w(e,d),g=n.filter(e=>!t.sounds.includes(e.filename)),_=n.length>0&&g.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:h}),(0,S.jsx)(y,{checked:t.enabled,disabled:!r,onChange:i,label:d(`soundsSections.enableEvent`,{eventName:h})})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:d(`soundsSections.defaultBlip`)}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:m(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>u(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":d(`soundsSections.previewSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(s,{className:`h-3 w-3`})}),(0,S.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":d(`soundsSections.removeSoundAriaLabel`,{filename:e}),children:(0,S.jsx)(c,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:d(`soundsSections.noSoundFiles`)}):_?(0,S.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:d(`soundsSections.allSoundsAdded`)}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>p(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:[d(`soundsSections.addSound`),(0,S.jsx)(l,{className:`h-3 w-3`})]}),f&&(0,S.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:()=>p(!1),children:g.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),p(!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 O(){let{t:e}=i(`settings`),a=r(),o=v(),c=(0,x.useMemo)(()=>g({path:{assistant_id:o}}),[o]),l=(0,x.useMemo)(()=>f({path:{assistant_id:o}}),[o]),{data:m}=n(c),{data:y}=n(l),C=m??b(),w=y?.sounds??[],O=(0,x.useMemo)(()=>({path:{assistant_id:o}}),[o]),k=t({...d(O),onMutate:async e=>{await a.cancelQueries({queryKey:c.queryKey});let t=a.getQueryData(c.queryKey);return _(a,O,e.body),{previous:t}},onError:(e,t,n)=>{n?.previous!==void 0&&_(a,O,n.previous)},onSettled:()=>{a.invalidateQueries({queryKey:c.queryKey})}}),A=(0,x.useCallback)(e=>{let t=e(a.getQueryData(c.queryKey)??b());k.mutate({path:{assistant_id:o},body:t})},[o,c.queryKey,a,k]),j=e=>{A(t=>({...t,globalEnabled:e}))},M=e=>{A(t=>({...t,volume:e}))},[N,P]=(0,x.useState)(null),F=N??C.volume,I=(e,t)=>{A(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},L=(e,t)=>{A(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]}}}})},R=(e,t)=>{A(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},z=()=>{p().previewFallbackBlip(C.volume)},B=e=>{p().previewSound(e,C.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(T,{label:e(`soundsSections.enableSoundEffects`),description:e(`soundsSections.enableSoundEffectsDescription`),checked:C.globalEnabled,onChange:j}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.volume`)}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:F,onChange:e=>P(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);P(null),t!==C.volume&&M(t)},className:`h-1 w-48 cursor-pointer`,disabled:!C.globalEnabled,"aria-label":e(`soundsSections.volumeAriaLabel`)}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(F*100),`%`]})]}),(0,S.jsx)(E,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e(`soundsSections.previewDefaultBlip`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:z,disabled:!C.globalEnabled,className:`inline-flex cursor-pointer 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)] transition-colors hover:bg-[var(--surface-hover)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(s,{className:`h-3.5 w-3.5`}),e(`soundsSections.preview`)]})]})]}),(0,S.jsxs)(h,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:e(`soundsSections.soundEventsTitle`)}),(0,S.jsx)(`p`,{className:`text-body-small-lighter text-[var(--content-tertiary)]`,children:e(`soundsSections.soundEventsDescription`)})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:u.map(t=>(0,S.jsx)(D,{event:t,eventConfig:C.events[t]??{enabled:!1,sounds:[]},availableSounds:w,globalEnabled:C.globalEnabled,onToggle:e=>I(t,e),onAddSound:e=>L(t,e),onRemoveSound:e=>R(t,e),onPreview:e=>B(e),t:e},t))})]})]})}function k(){return(0,S.jsx)(O,{})}export{k as SoundsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-CYfJo8gP.js";import{f as t,t as n}from"./react-DPM_L_aA.js";import{Ar as r,Dy as i,Eg as a,Pr as o,dv as s}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-CYfJo8gP.js";import{f as t,t as n}from"./react-DPM_L_aA.js";import{Ar as r,Dy as i,Eg as a,Pr as o,dv as s}from"./index-b_IQShc9.js";var c=n();function l(){let{t:n}=e(`onboarding`),l=t();return(0,c.jsx)(r,{avatarWave:`around`,children:(0,c.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 md:min-h-full md:pb-6 text-[var(--content-default)]`,children:(0,c.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center`,children:[(0,c.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:n(`welcome.title`)}),(0,c.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:n(`welcome.body`)}),(0,c.jsx)(`div`,{className:`mt-10 flex w-full max-w-sm flex-col`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,c.jsx)(i,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>void l(`${s.onboarding.privacy}?${a}=1`,o),children:n(`startScreen.createAssistant`)})})]})})})}export{l as StartScreen};
|
package/dist/assets/{stt-language-picker-modal-3JHZ7KRr.js → stt-language-picker-modal-CLsnI2Yz.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{Q as n,uy as r}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-CYfJo8gP.js";import{t}from"./react-DPM_L_aA.js";import{Q as n,uy as r}from"./index-b_IQShc9.js";var i=t();function a({open:t,onOpenChange:a,title:o,currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d}){let{t:f}=e();return(0,i.jsx)(r.Root,{open:t,onOpenChange:a,children:(0,i.jsxs)(r.Content,{size:`sm`,onOpenAutoFocus:e=>{e.preventDefault(),e.target?.querySelector(`input[role="combobox"]`)?.focus()},children:[(0,i.jsxs)(r.Header,{children:[(0,i.jsx)(r.Title,{children:o}),(0,i.jsx)(r.Description,{children:f(`sttLanguagePickerModal.description`)})]}),(0,i.jsx)(r.Body,{children:(0,i.jsx)(n,{currentCode:s,configuredProviderId:c,suggestedCode:l,selectLanguage:u,selecting:d,onDone:()=>a(!1)})})]})})}export{a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{_ as t,f as n,g as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{Cn as s,Lr as c,Rr as l,Zr as u,gi as d,ti as f,zr as p}from"./icons-CSdHOix6.js";import{n as m,r as h,t as g}from"./metric-card-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{_ as t,f as n,g as r,j as i}from"./vendor-CYfJo8gP.js";import{b as a,t as o}from"./react-DPM_L_aA.js";import{Cn as s,Lr as c,Rr as l,Zr as u,gi as d,ti as f,zr as p}from"./icons-CSdHOix6.js";import{n as m,r as h,t as g}from"./metric-card-XbeSP_dF.js";import{Cn as _,Dy as v,Ey as y,Hs as b,Nr as x,Sn as S,Us as C,Vs as w,Ws as T,_ as E,_n as D,_t as O,at as k,cn as A,ct as j,dn as M,ft as N,gn as P,gt as F,hn as I,ht as L,ia as R,ln as z,lt as B,mt as V,ot as H,pt as U,st as W,tn as G,ut as K,vt as q,wn as J,xn as ee}from"./index-b_IQShc9.js";import{t as te}from"./detail-panel-stop-button-BhBUIYrN.js";import{t as ne}from"./status-badge-pill-DsYKTPMw.js";import{CodeBlock as Y,ToolDetailBody as re,toolDetailHeaderTitle as ie}from"./tool-detail-panel-C-r8dnRp.js";var X=e(a(),1),Z=o();function ae({status:e}){return(0,Z.jsx)(ne,{color:C(e),label:T(e)})}function oe(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?F(n,t):``}`}function se(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function ce(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function le(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function ue(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return P(n.text)}}function Q(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function de({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,X.useState)(new Set),s=n??a,c=(0,X.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,X.useMemo)(()=>V(e),[e]);return l.length===0?null:(0,Z.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=oe(e,n),a=n===l.length-1;return(0,Z.jsx)(fe,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var fe=(0,X.memo)(function({section:e,isLast:a,isActiveTail:o,expanded:c,sectionKeyValue:l,onToggle:d,onStepDetailClick:f}){let{t:p}=i(`chat`),m=n(),h=L(e.steps),g=h===`running`&&!o?`completed`:h,_=g===`running`||o,v=e.steps[0]?.kind===`thinking`,b=e.steps.length,x=e.label===`Searching the web`,S=x?le(e):void 0,C=b>=2,w=e.steps.some(e=>O(e)||!!f&&!!Q(e)),T=g===`running`?``:q(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),E=g===`running`?se(e):void 0,D=g===`running`&&!x?ce(E,e.label):``,k=x&&(g===`running`||!!S),A=S??e.label,M=v&&_,I=M?ue(e)??e.label:void 0,V=g===`running`||k||M||!!T,G=`${b} step${b===1?``:`s`}`;return(0,Z.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:R(`relative flex flex-col gap-2`,!a&&`pb-4`),children:[!a&&(0,Z.jsx)(N,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!w,onClick:w?()=>d(l):void 0,className:R(`flex h-[22px] w-full items-center gap-2 text-left`,w&&`cursor-pointer`),children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,Z.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,Z.jsx)(U,{status:_?`running`:g,isThinking:v&&!_}),(0,Z.jsx)(y,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),V&&(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),k?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(s,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(z,{currentStepTitle:``,currentStepInfo:A})]}):M?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(u,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(z,{currentStepTitle:``,currentStepInfo:I??e.label})]}):g===`running`?(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,Z.jsx)(u,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,Z.jsx)(z,{currentStepTitle:``,currentStepInfo:D})]}):T?(0,Z.jsx)(y,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:p(`subagentPhaseTimeline.workedFor`,{duration:T})}):null,w&&C&&(0,Z.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,Z.jsx)(y,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:G})})]}),(0,Z.jsx)(t,{initial:!1,children:w&&c&&(0,Z.jsx)(r.div,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:m?{duration:0}:{duration:.25,ease:[.16,1,.3,1]},className:`overflow-hidden`,children:(0,Z.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=f?Q(e):void 0;if(n&&f){if(e.kind===`tool`)return(0,Z.jsx)(j,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,ariaLabel:p(`subagentPhaseTimeline.viewToolDetails`),onClick:()=>f(n)},F(e,t));if(e.kind===`thinking`)return(0,Z.jsx)(j,{variant:`tool`,iconName:`brain`,label:P(e.text),ariaLabel:p(`subagentPhaseTimeline.viewReasoning`),onClick:()=>f(n)},F(e,t));if(e.kind===`web_search`)return(0,Z.jsx)(j,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:p(`subagentPhaseTimeline.viewSearchDetails`),onClick:()=>f(n)},F(e,t));if(e.kind===`web_search_error`)return(0,Z.jsx)(j,{variant:`tool`,iconName:`globe`,label:e.errorMessage,ariaLabel:p(`subagentPhaseTimeline.viewSearchError`),onClick:()=>f(n)},F(e,t))}return e.kind===`web_search`?(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,Z.jsx)(y,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,Z.jsx)(W,{step:e})]},F(e,t)):e.kind===`web_search_error`?(0,Z.jsx)(H,{step:e},F(e,t)):(0,Z.jsx)(B,{step:e},F(e,t))})})},`phase-steps`)})]})}),pe=`
|
|
2
2
|
Content:
|
|
3
3
|
`;function me(e){return I(e)||e}function he(e,t){let n=e??``,r=n.indexOf(pe),i=r>=0?n.slice(0,r):``,a=r>=0?n.slice(r+10):n,o=e=>{let t=i.match(RegExp(`^${e}:[ \\t]*(.+)$`,`m`));return t?t[1].trim():null},s=[],c=i.indexOf(`Notices:`);if(c>=0)for(let e of i.slice(c).split(`
|
|
4
4
|
`)){let t=e.match(/^\s*-\s+(.*)$/);t&&t[1].trim()&&s.push(t[1].trim())}a=a.trim();let l=null,u=a.match(/^<external_content\b([^>]*)>\s*/);if(u){let e=u[1].match(/origin="([^"]+)"/);e&&(l=e[1]),a=a.slice(u[0].length).replace(/\s*<\/external_content>\s*$/,``)}return{url:o(`Final URL`)||o(`Requested URL`)||l||t||null,status:o(`Status`),notices:s,content:a.trim()}}function ge({url:e,status:t}){let n=me(e),r=t?/^\s*2\d\d/.test(t):!1;return(0,Z.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 transition-colors hover:border-[var(--border-hover)]`,children:[(0,Z.jsx)(k,{domain:n,title:n}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,Z.jsx)(y,{variant:`body-medium-default`,as:`span`,className:`truncate text-[var(--content-default)]`,children:n}),(0,Z.jsx)(y,{variant:`body-small-default`,as:`span`,className:`truncate text-[var(--content-tertiary)]`,children:e})]}),t&&(0,Z.jsx)(`span`,{className:`shrink-0 rounded-[6px] px-2 py-0.5 text-body-small-emphasised ${r?`text-[var(--system-positive-strong)]`:`text-[var(--content-tertiary)]`}`,children:t})]})}function _e({detail:e}){let{t}=i(`chat`),[n,r]=(0,X.useState)(!1),a=typeof e.input?.url==`string`?e.input.url:void 0,o=(0,X.useMemo)(()=>he(e.result??``,a),[e.result,a]);return e.status===`error`?(0,Z.jsx)(Y,{text:e.result??t(`webFetchDetailView.fetchFailed`)}):(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[o.url&&(0,Z.jsx)(ge,{url:o.url,status:o.status}),o.notices.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:o.notices.map((e,t)=>(0,Z.jsx)(y,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:e},t))}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(y,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:t(n?`webFetchDetailView.rawResult`:`webFetchDetailView.content`)}),e.result&&(0,Z.jsx)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`cursor-pointer text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:(0,Z.jsx)(y,{variant:`label-small-default`,as:`span`,children:t(n?`webFetchDetailView.viewExtracted`:`webFetchDetailView.viewRaw`)})})]}),n?(0,Z.jsx)(Y,{text:e.result??``}):o.content?(0,Z.jsx)(G,{content:o.content}):(0,Z.jsx)(y,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e.status===`running`?t(`webFetchDetailView.fetching`):t(`webFetchDetailView.noContent`)})]})]})}function ve({detail:e}){let{t}=i(`chat`),n=e.searchQuery??``,r=e.searchResults??[];return(0,Z.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[n?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(y,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:t(`webSearchDetailView.query`)}),(0,Z.jsx)(y,{variant:`body-medium-lighter`,as:`p`,className:`break-words leading-relaxed text-[var(--content-default)]`,children:`"${n}"`})]}):null,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(y,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:r.length>0?t(`webSearchDetailView.sourcesWithCount`,{count:r.length}):t(`webSearchDetailView.sources`)}),r.length>0?(0,Z.jsx)(W,{step:{kind:`web_search`,title:`Searched the web`,durationLabel:``,linkCount:r.length,results:r}}):(0,Z.jsx)(y,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:t(`webSearchDetailView.noSources`)})]})]})}function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function ye(e=M){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let s=S(t,o);switch(s.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,c=n.slice(),l=r.slice();for(let t=s.from;t<a;t++)e(c,l,o[t]);return t=o,n=c,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function be(e){let t=(0,X.useRef)(null);return t.current??=ye(),t.current.project(e)}function xe(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:D(e.toolName,e.input).iconName}function Se({detail:e}){return e.status===`running`?(0,Z.jsx)(A,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,Z.jsx)(K[xe(e)]??f,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function Ce({entry:e,onClose:t,onStop:a,onRequestDetail:o,assistantId:s}){let{t:u}=i(`chat`),f=b(e.status),S=n(),C=x(),T=(0,X.useMemo)(()=>_(e.subagentId),[e.subagentId]),{steps:D}=ee(e.events),O=be(e.events),[k,A]=(0,X.useState)(null),j=(0,X.useRef)(O);j.current=O;let M=(0,X.useCallback)(e=>{j.current.has(e)&&A(e)},[]),[N,P]=(0,X.useState)(new Set),[F,I]=(0,X.useState)(!1),[L,R]=(0,X.useState)(!1),z=(0,X.useRef)(null),[B,V]=(0,X.useState)(e.subagentId);B!==e.subagentId&&(V(e.subagentId),I(!1),R(!1),A(null),P(new Set)),(0,X.useLayoutEffect)(()=>{if(F)return;let e=z.current;e&&R(e.scrollHeight>e.clientHeight)},[e.subagentId,e.objective,F]);let H=w(e);(0,X.useEffect)(()=>{o&&H&&e.events.length===0&&o(e.subagentId)},[e.subagentId,H,e.events.length,o]);let U=k?O.get(k):void 0,W=(0,X.useCallback)(()=>A(null),[]),K=U?ie(U):``,q=U?K:e.label;return(0,Z.jsx)(E,{headerAbove:U&&(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,Z.jsx)(v,{variant:`link`,onClick:W,title:e.label,className:`inline-flex min-w-0 shrink border-0 text-left text-[color:var(--content-default)]`,children:(0,Z.jsx)(y,{variant:`body-small-default`,as:`span`,className:`min-w-0 truncate`,children:e.label})}),(0,Z.jsx)(c,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,Z.jsx)(y,{variant:`body-small-default`,as:`span`,title:K,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:K})]}),icon:(0,Z.jsxs)(Z.Fragment,{children:[U&&(0,Z.jsx)(v,{variant:`outlined`,iconOnly:(0,Z.jsx)(l,{}),onClick:W,"aria-label":u(`subagentDetailPanel.backToTimelineAria`),tooltip:u(`subagentDetailPanel.backTooltip`),className:`shrink-0`}),U?(0,Z.jsx)(Se,{detail:U}):C?(0,Z.jsx)(J,{components:C,bodyShapeId:T.bodyShape,eyeStyleId:T.eyeStyle,colorId:T.color,size:32}):(0,Z.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0})]}),title:q,headerTrailing:(0,Z.jsx)(ae,{status:e.status}),headerActions:f&&a?(0,Z.jsx)(te,{onStop:()=>a(e.subagentId),ariaLabel:u(`subagentDetailPanel.stopSubagentAria`)}):void 0,closeLabel:u(`subagentDetailPanel.closeDetail`),onClose:t,children:(0,Z.jsx)(r.div,{initial:{opacity:0},animate:{opacity:1},transition:S?{duration:0}:{duration:.18,ease:[.16,1,.3,1]},children:U?(0,Z.jsx)(Z.Fragment,{children:U.kind===`thinking`?(0,Z.jsx)(G,{content:U.thinkingText??``,hardLineBreaks:!0,assistantId:s}):U.kind===`web_search`&&U.status!==`error`?(0,Z.jsx)(ve,{detail:U}):U.toolName===`web_fetch`?(0,Z.jsx)(_e,{detail:U}):(0,Z.jsx)(re,{detail:U,assistantId:s})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,Z.jsx)(g,{icon:(0,Z.jsx)(d,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>m(Math.round(e)),label:u(`subagentDetailPanel.input`)}),(0,Z.jsx)(g,{icon:(0,Z.jsx)(h,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>m(Math.round(e)),label:u(`subagentDetailPanel.output`)})]}),e.objective&&(0,Z.jsxs)(`div`,{className:`mb-5`,children:[(0,Z.jsx)(y,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:u(`subagentDetailPanel.objective`)}),(0,Z.jsx)(y,{ref:z,variant:`body-medium-lighter`,as:`p`,tabIndex:F?0:void 0,role:F?`region`:void 0,"aria-label":F?u(`subagentDetailPanel.objective`):void 0,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)] ${F?`max-h-[280px] overflow-y-auto`:`line-clamp-5`}`,children:e.objective}),L&&(0,Z.jsx)(v,{variant:`link`,onClick:()=>I(e=>!e),"aria-expanded":F,rightIcon:(0,Z.jsx)(p,{className:`h-3.5 w-3.5 transition-transform ${F?`rotate-180`:``}`,"aria-hidden":!0}),className:`mt-1.5 inline-flex gap-1 border-0 text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)] hover:no-underline`,children:(0,Z.jsx)(y,{variant:`label-small-default`,children:u(F?`subagentDetailPanel.showLess`:`subagentDetailPanel.showMore`)})}),(0,Z.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(y,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:u(`subagentDetailPanel.timeline`)}),e.events.length>0?(0,Z.jsx)(de,{steps:D,expandedKeys:N,onExpandedKeysChange:P,onStepDetailClick:M,isRunning:f},e.subagentId):(0,Z.jsx)(y,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:u(`subagentDetailPanel.noEventsYet`)})]})]})},U?`detail`:`list`)})}export{Ce as SubagentDetailPanel};
|