@vellumai/web 0.8.9-staging.2 → 0.8.9-staging.3
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/{BundleConfirmPage-B3awgY58.js → BundleConfirmPage-CkmGRzTV.js} +1 -1
- package/dist/assets/account-page-JOmrd7O5.js +1 -0
- package/dist/assets/{account-shell-Cocs5HAw.js → account-shell-qQqbocXz.js} +1 -1
- package/dist/assets/add-credits-modal-D1PUmkv8.js +1 -0
- package/dist/assets/{advanced-page-DCLclsA0.js → advanced-page-DfQKcHki.js} +1 -1
- package/dist/assets/ai-page-BHdzWA1C.js +1 -0
- package/dist/assets/{api-BI71B-Uu.js → api-DEEx3e9R.js} +1 -1
- package/dist/assets/{api-key-screen-CUWb6IS5.js → api-key-screen-BFaPTjaE.js} +1 -1
- package/dist/assets/{archive-page-BKyeIPgD.js → archive-page-BA9_f8tE.js} +1 -1
- package/dist/assets/assistant-feature-flag-store-0382ImYF.js +1 -0
- package/dist/assets/{assistant-status-panel-C6vrL0c9.js → assistant-status-panel-B2a_ey3l.js} +1 -1
- package/dist/assets/auth-store-oleg80LZ.js +6 -0
- package/dist/assets/{avatar-api-DfOXK3fL.js → avatar-api-BwHmtSnS.js} +1 -1
- package/dist/assets/billing-page-BtGA4D1N.js +34 -0
- package/dist/assets/{capture-error-CHS1NpKj.js → capture-error-CZsNGL6n.js} +1 -1
- package/dist/assets/{command-palette-Dtg298nL.js → command-palette-BiZB4OSo.js} +1 -1
- package/dist/assets/{community-page-a5s8WDjn.js → community-page-j-8N5lFa.js} +1 -1
- package/dist/assets/{confirm-dialog-DsrjEJ8n.js → confirm-dialog-NYG-K9zN.js} +1 -1
- package/dist/assets/{connect-page-DdXFLONh.js → connect-page-zFzMI9NA.js} +1 -1
- package/dist/assets/{contacts-gateway-DMN8Ph61.js → contacts-gateway-DjUsIJ09.js} +1 -1
- package/dist/assets/{contacts-page-route-Cq6lJQbs.js → contacts-page-route-CIhz_sJO.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-C1n72GAh.js → danger-zone-redirect-page-BOK4eL8M.js} +1 -1
- package/dist/assets/debug-page-EPqbjJSc.js +3 -0
- package/dist/assets/{deploy-dialogs-DDSVO63U.js → deploy-dialogs-DlIjxp-4.js} +1 -1
- package/dist/assets/{detail-card-p3YdFOs0.js → detail-card-B5j4Rqau.js} +1 -1
- package/dist/assets/developer-page-CZfUJHd7.js +1 -0
- package/dist/assets/{devices-page-DPmzgLsB.js → devices-page-CjKo24zw.js} +1 -1
- package/dist/assets/{document-viewer-page-BpM5LHph.js → document-viewer-page-DP01_kUJ.js} +1 -1
- package/dist/assets/{earn-credits-modal-BSS3nmKO.js → earn-credits-modal-QwO92K15.js} +1 -1
- package/dist/assets/{emails-page-Bk0vj0fq.js → emails-page-Bqv0y6Lp.js} +1 -1
- package/dist/assets/{esm-Cq8mDp1x.js → esm-BfiJ42Ad.js} +2 -2
- package/dist/assets/esm-CautLOfa.js +2 -0
- package/dist/assets/esm-DTgeUUet.js +2 -0
- package/dist/assets/esm-DZPMmLdo.js +2 -0
- package/dist/assets/esm-D_HYq01-.js +2 -0
- package/dist/assets/feature-flag-catalog-D6XoH2hm.js +1 -0
- package/dist/assets/format-file-size-Cx-rVS-D.js +1 -0
- package/dist/assets/general-page-BSf6qSem.js +1 -0
- package/dist/assets/{hatching-screen-Bt99zUZJ.js → hatching-screen-B8RlGI3J.js} +1 -1
- package/dist/assets/{home-page-route-D3TUK4jV.js → home-page-route-D3PEij2C.js} +1 -1
- package/dist/assets/{hosting-screen-p6SpMEAP.js → hosting-screen-DoltpG5X.js} +1 -1
- package/dist/assets/identity-page-route-MDSvMuG9.js +1 -0
- package/dist/assets/index-D3Lqh6yW.css +2 -0
- package/dist/assets/index-DM63H2B6.js +124 -0
- package/dist/assets/{inspect-page-BjByL85Y.js → inspect-page-Dmp2FUpn.js} +2 -2
- package/dist/assets/{install-D1sXGhtS.js → install-Db4K638M.js} +1 -1
- package/dist/assets/integrations-page-DKhH4frU.js +1 -0
- package/dist/assets/{intelligence-layout-D6eECwXX.js → intelligence-layout-D96EIdSw.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-BhhPJPUZ.js → keyboard-shortcuts-page-LBckCCBl.js} +1 -1
- package/dist/assets/{library-detail-page-Dd8De1-U.js → library-detail-page-T4MedcS4.js} +1 -1
- package/dist/assets/{library-page-C8dQhgrB.js → library-page-RtbQs7L5.js} +1 -1
- package/dist/assets/{login-flow-Cuwt4mrG.js → login-flow-CaZb4l04.js} +1 -1
- package/dist/assets/{login-page-BguNHtTH.js → login-page-C-HGOjOK.js} +1 -1
- package/dist/assets/{logout-page-CtDodoJu.js → logout-page-Dl5euYyX.js} +1 -1
- package/dist/assets/{logs-layout-B_84Z561.js → logs-layout-BTlzvT2f.js} +1 -1
- package/dist/assets/{memory-router-playground-page-CPs-DoJJ.js → memory-router-playground-page-BBlTxde7.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-BBBoMNDQ.js → mobile-sidebar-drawer-9EUmVwhv.js} +1 -1
- package/dist/assets/modal-BYMhDpQo.js +1 -0
- package/dist/assets/{native-file-DGi6pF3I.js → native-file-CS-pobfT.js} +2 -2
- package/dist/assets/{notifications-page-CSruNOwo.js → notifications-page-DlDftqR1.js} +1 -1
- package/dist/assets/{oauth-complete-page-Dv5sEaYc.js → oauth-complete-page-AZTJJBVl.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-DqhxXOCy.js → oauth-popup-complete-page-CzA0WXr4.js} +2 -2
- package/dist/assets/{onboarding-layout-nxxfibR6.js → onboarding-layout-BIVa2BnX.js} +1 -1
- package/dist/assets/{page-shell-BvU7-SpG.js → page-shell-CYsp3hSr.js} +1 -1
- package/dist/assets/{password-reset-page-CITHzWIy.js → password-reset-page-DyimUxBH.js} +1 -1
- package/dist/assets/{platform-loopback-page-0hrfUaHR.js → platform-loopback-page-CNTdcgsZ.js} +1 -1
- package/dist/assets/{plugin-detail-page-D7g58Res.js → plugin-detail-page-CS_wmEDi.js} +1 -1
- package/dist/assets/{plugins-page-DhaomETq.js → plugins-page-CRtYNHW4.js} +1 -1
- package/dist/assets/pre-chat-flow-BDhreJ7B.js +1 -0
- package/dist/assets/privacy-page-C1kpEJg_.js +1 -0
- package/dist/assets/privacy-screen-qeQ2XoHu.js +1 -0
- package/dist/assets/{provider-callback-page-wX355rfV.js → provider-callback-page-C87AasMA.js} +1 -1
- package/dist/assets/{provider-signup-page-hIJUJSSj.js → provider-signup-page-CfbGs1zY.js} +1 -1
- package/dist/assets/{resize-errors-Bo2cfbax.js → resize-errors-DejLlS-b.js} +1 -1
- package/dist/assets/{resolved-assistants-store-BPUbuIhU.js → resolved-assistants-store-ub66utfl.js} +1 -1
- package/dist/assets/review-terms-screen-BnGyRURw.js +1 -0
- package/dist/assets/routes-DMbyM_oF.js +1 -0
- package/dist/assets/{schedules-BF9QTfJF.js → schedules-BJAra2Ob.js} +1 -1
- package/dist/assets/{schedules-page-BUe5podp.js → schedules-page-DL7EfeDQ.js} +1 -1
- package/dist/assets/{sdk.gen-DyGxpG-m.js → sdk.gen-BO4vbMAj.js} +1 -1
- package/dist/assets/select-assistant-screen-BGPc4tCz.js +1 -0
- package/dist/assets/settings-layout-Ce4VYURq.js +1 -0
- package/dist/assets/share-feedback-modal-le4GoR2Z.js +1 -0
- package/dist/assets/sidebar-tree-DyEHuZeN.js +1 -0
- package/dist/assets/{signup-page-C1mPrkCl.js → signup-page-BTfxDffn.js} +1 -1
- package/dist/assets/skills-page-D_8aU82C.js +1 -0
- package/dist/assets/{sounds-page-BdseS_eV.js → sounds-page-CkLyWMqe.js} +1 -1
- package/dist/assets/{src-Bb-Updum.js → src-hn7lwVCD.js} +1 -1
- package/dist/assets/{step-indicator-dots-DdSrkrW1.js → step-indicator-dots-BjA1nnWA.js} +1 -1
- package/dist/assets/{subagent-detail-panel-B-8VytBJ.js → subagent-detail-panel-4B8mdN25.js} +2 -2
- package/dist/assets/{system-events-page-CiJEKEpf.js → system-events-page-BuSkwmMl.js} +1 -1
- package/dist/assets/{system-events-redirect-page-D8VaQd_Y.js → system-events-redirect-page-Dq56rHVE.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DSz9Muk5.js → tiptap-document-editor-D_JJ-i8w.js} +2 -2
- package/dist/assets/{tool-detail-panel-BuGhhRkJ.js → tool-detail-panel-WvA0b4nW.js} +1 -1
- package/dist/assets/trace-page-Ckyukuwf.js +1 -0
- package/dist/assets/{upgrade-cancel-page-J6RxeCJF.js → upgrade-cancel-page-C_KXGnp0.js} +1 -1
- package/dist/assets/{upgrade-success-page-DWRG6dph.js → upgrade-success-page-yvoI0p_k.js} +1 -1
- package/dist/assets/{usage-page-Ct7wtgvo.js → usage-page-DTCDhatY.js} +1 -1
- package/dist/assets/{use-active-assistant-id-DpqDbjpv.js → use-active-assistant-id-BIhArlF_.js} +1 -1
- package/dist/assets/{use-bus-subscription-BI50lMh8.js → use-bus-subscription-BuU6xaZz.js} +1 -1
- package/dist/assets/{use-current-platform-assistant-DqEaNqDa.js → use-current-platform-assistant-4FcCb-TC.js} +1 -1
- package/dist/assets/use-is-org-ready-tTrrZoWV.js +1 -0
- package/dist/assets/{use-oauth-complete-deep-link-listener-zk0Iiz2U.js → use-oauth-complete-deep-link-listener-DODuMYm6.js} +1 -1
- package/dist/assets/{use-onboarding-login-5pXYUom8.js → use-onboarding-login-CEqnm099.js} +1 -1
- package/dist/assets/{viewer-store-CYMgwLgL.js → viewer-store-Cc5YI5ay.js} +1 -1
- package/dist/assets/voice-page-pG9E3NoZ.js +1 -0
- package/dist/assets/{weather-forecast-display-gXPyN50a.js → weather-forecast-display-CEt-zNG2.js} +1 -1
- package/dist/assets/{web-DXzLDFAU.js → web-Cue81zTY.js} +1 -1
- package/dist/assets/{web-BlSJr8aG.js → web-DgJRXlLM.js} +1 -1
- package/dist/assets/{web-DKAZspRj.js → web-MavgiYAR.js} +1 -1
- package/dist/assets/{web-B68nJ7ai.js → web-XRhV1FIb.js} +1 -1
- package/dist/assets/{web-81P05QJK.js → web-hjMLFqJn.js} +1 -1
- package/dist/assets/{web-CfwMwwrz.js → web-m17sEkBA.js} +1 -1
- package/dist/assets/{web-DlmN0_gd.js → web-oH2q0g1D.js} +1 -1
- package/dist/assets/{welcome-screen-D8nrJg_G.js → welcome-screen-3Gi6zm9f.js} +1 -1
- package/dist/assets/{workspace-page-PLWAlvDU.js → workspace-page-DNw6D4Sj.js} +1 -1
- package/dist/index.html +23 -23
- package/package.json +1 -1
- package/dist/assets/account-page-CdFdV8y0.js +0 -1
- package/dist/assets/add-credits-modal-BVq_qeCW.js +0 -1
- package/dist/assets/ai-page-CLoNGPb4.js +0 -1
- package/dist/assets/assistant-feature-flag-store-DKlK50CB.js +0 -1
- package/dist/assets/auth-store-B42fGh_X.js +0 -6
- package/dist/assets/billing-page-BD0CrsQe.js +0 -34
- package/dist/assets/debug-page-BocDY1ql.js +0 -3
- package/dist/assets/developer-page-XjghwOa3.js +0 -1
- package/dist/assets/esm-1cyO_Dwe.js +0 -2
- package/dist/assets/esm-BEOtDID8.js +0 -2
- package/dist/assets/esm-CKnKNlq7.js +0 -2
- package/dist/assets/esm-D_q0hXcE.js +0 -2
- package/dist/assets/feature-flag-catalog-DRHAOQnq.js +0 -1
- package/dist/assets/format-file-size-DoJEps-h.js +0 -1
- package/dist/assets/general-page-D3j594Oo.js +0 -1
- package/dist/assets/identity-page-route-DJlcDHiO.js +0 -1
- package/dist/assets/index-BKvehXUt.css +0 -2
- package/dist/assets/index-huyA6GAA.js +0 -124
- package/dist/assets/integrations-page-B8sn6FwZ.js +0 -1
- package/dist/assets/modal-BhuCoLJX.js +0 -1
- package/dist/assets/pre-chat-flow-BGFr092Z.js +0 -1
- package/dist/assets/privacy-page-ClS4RliD.js +0 -1
- package/dist/assets/privacy-screen-C1f6uXlf.js +0 -1
- package/dist/assets/routes-DC3Pv2Da.js +0 -1
- package/dist/assets/select-assistant-screen-NkZxtTj0.js +0 -1
- package/dist/assets/settings-layout-DLZ0sfT0.js +0 -1
- package/dist/assets/share-feedback-modal-Jrjiyv4t.js +0 -1
- package/dist/assets/sidebar-tree-DP2ML6Hm.js +0 -1
- package/dist/assets/skills-page-CZ8ZrRO2.js +0 -1
- package/dist/assets/trace-page-D0oeulsA.js +0 -1
- package/dist/assets/use-is-org-ready-gL2RDSDC.js +0 -1
- package/dist/assets/voice-page-BeQ1jrbT.js +0 -1
- /package/dist/assets/{api-errors-D7n5QJzS.js → api-errors-ChauV4ed.js} +0 -0
- /package/dist/assets/{client.gen-NLWYTfk-.js → client.gen-BKAMS0D0.js} +0 -0
- /package/dist/assets/{dist-tjvu6D4z.js → dist-B4KYfSON.js} +0 -0
- /package/dist/assets/{event-bus-Dz-RECxQ.js → event-bus-CMBsMREI.js} +0 -0
- /package/dist/assets/{query-tags-C5nJRH2G.js → query-tags-Cez88bzY.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./button-DdEh-9f_.js";import{t as a}from"./typography-Czgs_2w_.js";import"./src-
|
|
1
|
+
import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./button-DdEh-9f_.js";import{t as a}from"./typography-Czgs_2w_.js";import"./src-hn7lwVCD.js";import{t as o}from"./confirm-dialog-NYG-K9zN.js";import{t as s}from"./input-Cu3PPVCq.js";import{t as c}from"./modal-BYMhDpQo.js";import{n as l}from"./toast-DU1nH33j.js";import{t as u}from"./loader-circle-BSAFLoPH.js";import{Lt as d}from"./sdk.gen-AJllUeDf.js";import{ot as f}from"./index-DM63H2B6.js";var p=e(n(),1),m=r();function h({open:e,onOpenChange:t,assistantId:n,onTokenSaved:r}){let[o,f]=(0,p.useState)(``),[h,g]=(0,p.useState)(!1),[_,v]=(0,p.useState)(null),y=(0,p.useCallback)(async()=>{if(o.trim()){g(!0),v(null);try{await d({path:{assistant_id:n},body:{action:`set`,apiToken:o.trim()},throwOnError:!0}),f(``),r()}catch(e){let t=e instanceof Error?e.message:`Failed to save Vercel token.`;v(t),l.error(t)}finally{g(!1)}}},[n,o,r]);return(0,m.jsx)(c.Root,{open:e,onOpenChange:t,children:(0,m.jsxs)(c.Content,{size:`sm`,children:[(0,m.jsx)(c.Header,{children:(0,m.jsx)(c.Title,{children:`Connect Vercel`})}),(0,m.jsx)(c.Body,{children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,m.jsx)(a,{as:`p`,variant:`body-medium-lighter`,className:`text-(--content-secondary)`,children:`Enter your Vercel API token to deploy apps as static pages.`}),(0,m.jsx)(`a`,{href:`https://vercel.com/account/tokens`,target:`_blank`,rel:`noopener noreferrer`,className:`text-body-medium-default text-(--primary-base) hover:underline`,children:`Create a token on Vercel →`}),(0,m.jsx)(s,{type:`password`,placeholder:`Vercel API token`,value:o,onChange:e=>f(e.target.value),label:`API Token`,fullWidth:!0,errorText:_,disabled:h})]})}),(0,m.jsxs)(c.Footer,{children:[(0,m.jsx)(c.Close,{asChild:!0,children:(0,m.jsx)(i,{variant:`outlined`,disabled:h,children:`Cancel`})}),(0,m.jsx)(i,{variant:`primary`,onClick:y,disabled:h||!o.trim(),leftIcon:h?(0,m.jsx)(u,{className:`animate-spin`}):void 0,children:h?`Saving…`:`Save`})]})]})})}var g=t({DeployDialogs:()=>_});function _({assistantId:e,assistantName:t,onStartConversation:n}){let r=f.use.isTokenDialogOpen(),i=f.use.complexDeployApp();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(h,{open:r,onOpenChange:e=>{e||f.getState().hideTokenDialog()},assistantId:e,onTokenSaved:()=>{f.getState().deployAfterTokenSaved(e)}}),(0,m.jsx)(o,{open:i!==null,title:`This app needs a full deploy`,message:`"${i?.name??``}" uses backend services that won't work on a static Vercel page. ${t??`Your assistant`} can deploy it properly with serverless functions.`,confirmLabel:`Let ${t??`your assistant`} handle it`,onConfirm:()=>{let e=f.getState().complexDeployApp?.name??`this app`;f.getState().setComplexDeployApp(null),n?.(`Deploy my app "${e}" to Vercel. It uses backend services that need serverless functions — please use the deploy-fullstack-vercel skill to handle it properly.`)},onCancel:()=>f.getState().setComplexDeployApp(null)})]})}export{g as n,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./cn-DFqQkJlk.js";import{t as n}from"./card-CL5iEMJO.js";import"./src-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./cn-DFqQkJlk.js";import{t as n}from"./card-CL5iEMJO.js";import"./src-hn7lwVCD.js";var r=e();function i({id:e,title:i,subtitle:a,accessory:o,compactAccessory:s=!1,children:c,showBorder:l=!0,variant:u=`default`,className:d}){let f=!!(i||a||o),p=(0,r.jsxs)(r.Fragment,{children:[f&&(0,r.jsxs)(`div`,{className:s?`flex flex-row items-start justify-between gap-4`:`flex flex-col items-start gap-3 md:flex-row md:items-start md:justify-between md:gap-4`,children:[(0,r.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[i&&(0,r.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:i}),a&&(0,r.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:a})]}),o&&(0,r.jsx)(`div`,{className:`shrink-0`,children:o})]}),c!=null&&(0,r.jsx)(`div`,{className:f?`mt-4`:``,children:c})]});return l?(0,r.jsx)(n,{asChild:!0,className:t(u===`danger`&&`border-[var(--system-negative-weak)] bg-[var(--surface-lift)]`,d),children:(0,r.jsx)(`section`,{id:e,children:p})}):(0,r.jsx)(`section`,{id:e,className:t(`space-y-4`,d),children:p})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,m as n,o as r}from"./capture-error-CZsNGL6n.js";import{t as i}from"./react-DJZBPgpf.js";import{m as a,r as o}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as s}from"./QueryClientProvider-DNHWXaGq.js";import{t as c}from"./useQuery-D2zf6Uhu.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./cn-DFqQkJlk.js";import{t as d}from"./button-DdEh-9f_.js";import{t as f}from"./dropdown-CocFV5yi.js";import"./src-hn7lwVCD.js";import{t as p}from"./confirm-dialog-NYG-K9zN.js";import{t as m}from"./tag-Ccr7Quy6.js";import{t as h}from"./toggle-CEm3M86o.js";import{n as g}from"./toast-DU1nH33j.js";import{b as _,f as v}from"./resolved-assistants-store-ub66utfl.js";import{t as y}from"./createLucideIcon-D6d6iDdi.js";import{t as ee}from"./bug-DDEBp29t.js";import{t as b}from"./loader-circle-BSAFLoPH.js";import{c as x,o as S}from"./api-DEEx3e9R.js";import{t as C}from"./client.gen-BKAMS0D0.js";import{i as w}from"./routes-DMbyM_oF.js";import{t as T}from"./use-is-org-ready-tTrrZoWV.js";import{i as E}from"./query-tags-Cez88bzY.js";import{a as D,c as O,o as te}from"./feature-flag-catalog-D6XoH2hm.js";import{t as k}from"./assistant-feature-flag-store-0382ImYF.js";import{t as ne}from"./misc-MEUnNRwX.js";import{$n as re,Ai as ie,At as A,Ea as j,Ji as M,er as N,fr as P,ht as F,ir as I,oo as L}from"./index-DM63H2B6.js";import{t as R}from"./detail-card-B5j4Rqau.js";var z=y(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),B=y(`timer`,[[`line`,{x1:`10`,x2:`14`,y1:`2`,y2:`2`,key:`14vaq8`}],[`line`,{x1:`12`,x2:`15`,y1:`14`,y2:`11`,key:`17fdiu`}],[`circle`,{cx:`12`,cy:`14`,r:`8`,key:`1e1u0o`}]]),V=e(i(),1),H=l();function U(){let e=s(),[t,n]=(0,V.useState)(!1),[r,i]=(0,V.useState)(!1),{data:a,isLoading:o}=c(F()),{data:l,isLoading:u}=c(A({query:{hosting:`all`}})),f=o||u,m=l?.results??[];return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(W,{assistant:a??null,loading:f}),(0,H.jsx)(G,{assistants:m,activeAssistantId:a?.id??null,loading:f}),(0,H.jsxs)(R,{title:`Hatch New Assistant`,subtitle:`Create a new assistant instance.`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Provision a new assistant. This may take a moment.`}),(0,H.jsx)(d,{variant:`outlined`,leftIcon:t?(0,H.jsx)(b,{className:`animate-spin`}):void 0,onClick:()=>i(!0),disabled:t,className:`shrink-0`,children:`Hatch`})]}),(0,H.jsx)(p,{open:r,title:`Hatch New Assistant`,message:`Are you sure you want to create a new assistant? This will provision new infrastructure.`,confirmLabel:`Hatch`,onConfirm:async()=>{i(!1),n(!0);try{let t=await S(void 0,`create`);if(t.ok){if(v())try{let e=await x();e.ok&&await _(e.data)}catch{}g.success(t.status===201?`New assistant hatched successfully.`:`Returned your existing assistant — no new one was created.`),e.invalidateQueries({queryKey:F().queryKey}),e.invalidateQueries({queryKey:A({query:{hosting:`all`}}).queryKey})}else{let e=typeof t.error?.detail==`string`?t.error.detail:`Failed to hatch assistant.`;g.error(e)}}catch{g.error(`Failed to hatch assistant.`)}finally{n(!1)}},onCancel:()=>i(!1)})]})]})}function W({assistant:e,loading:t}){return t?(0,H.jsx)(R,{title:`Assistant Info`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,H.jsx)(b,{className:`h-4 w-4 animate-spin`}),`Loading assistant info...`]})}):e?(0,H.jsx)(R,{title:`Assistant Info`,subtitle:`Current assistant details.`,children:(0,H.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,H.jsx)(K,{children:`Name`}),(0,H.jsx)(q,{children:e.name??`Unnamed`}),(0,H.jsx)(K,{children:`Status`}),(0,H.jsx)(`div`,{children:(0,H.jsx)(m,{tone:e.status===`active`?`positive`:`neutral`,children:e.status})}),(0,H.jsx)(K,{children:`Assistant ID`}),(0,H.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id}),e.machine_id&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{children:`Machine ID`}),(0,H.jsx)(`span`,{className:`break-all font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.machine_id})]}),(0,H.jsx)(K,{children:`Created`}),(0,H.jsx)(q,{children:new Date(e.created).toLocaleDateString()}),(0,H.jsx)(K,{children:`Last Modified`}),(0,H.jsx)(q,{children:new Date(e.modified).toLocaleDateString()}),e.current_release_version&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(K,{children:`Version`}),(0,H.jsx)(q,{children:e.current_release_version})]})]})}):(0,H.jsx)(R,{title:`Assistant Info`,children:(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No assistant found. Hatch an assistant to get started.`})})}function G({assistants:e,activeAssistantId:t,loading:n}){return n||e.length===0?null:(0,H.jsx)(R,{title:`All Assistants`,subtitle:`${e.length} assistant${e.length===1?``:`s`} found.`,children:(0,H.jsx)(`div`,{className:`max-h-[300px] space-y-2 overflow-y-auto`,children:e.map(e=>{let n=e.id===t;return(0,H.jsx)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e.name||`Unnamed`}),(0,H.jsx)(m,{tone:e.status===`active`?`positive`:`neutral`,children:e.status}),n&&(0,H.jsx)(m,{tone:`warning`,children:`Current`})]}),(0,H.jsx)(`span`,{className:`font-mono text-body-small-default text-[var(--content-tertiary)]`,children:e.id})]})},e.id)})})})}function K({children:e}){return(0,H.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:e})}function q({children:e}){return(0,H.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e})}function J(){let e=I.use.emailRootDomain(),t=I.use.isNonProduction(),n=I.use.setEnvironment();return(0,H.jsx)(R,{title:`Environment`,subtitle:`Environment configuration overrides for this session.`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,H.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,H.jsx)(h,{checked:t,onChange:e=>n({isNonProduction:e}),"aria-label":`Non-Production is ${t?`on`:`off`}`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Non-Production`}),(0,H.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Indicates a non-production environment. Enables dev-only UI surfaces and diagnostics.`})]})]}),(0,H.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,H.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,H.jsx)(m,{tone:`neutral`,children:e})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Email Root Domain`}),(0,H.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:`Root domain used for assistant email addresses (e.g. vellum.me).`})]})]})]})})}async function ae(){let{data:e,response:t}=await C.get({url:`/v1/feature-flags/`,throwOnError:!1});return t?.ok?e?.flags??[]:[]}var Y={client:`warning`,assistant:`positive`};function oe(){let{data:e}=c(F()),t=e?.id??null,n=N();c({queryKey:E(t),queryFn:()=>re(t),enabled:t!==null,...n,retry:1});let{data:r}=c({queryKey:[`feature-flag-definitions`],queryFn:ae,enabled:T(),staleTime:300*1e3}),i=(0,V.useMemo)(()=>{let e=new Map;if(!r)return e;for(let t of r)t.type===`string`&&t.values?.length&&e.set(t.key,t.values);return e},[r]),[a,o]=(0,V.useState)(``),s=P(),l=k(),u=(0,V.useMemo)(()=>{let e=[];for(let t of te){let n=D(t.key);if(typeof t.defaultEnabled==`boolean`){let r=s[n],i=l[n],a=t.scope===`both`?r===!0||i===!0:t.scope===`assistant`?i:r;if(typeof a!=`boolean`)continue;e.push({kind:`boolean`,storeKey:n,scope:t.scope,label:t.label,description:t.description,value:a,defaultValue:t.defaultEnabled})}else if(typeof t.defaultEnabled==`string`){let r=s.stringFlags?.[n],a=l.stringFlags?.[n],o=t.scope===`assistant`?a??t.defaultEnabled:r??t.defaultEnabled;e.push({kind:`string`,storeKey:n,scope:t.scope,label:t.label,description:t.description,value:o,defaultValue:t.defaultEnabled,values:i.get(t.key)??t.values})}}return e.sort((e,t)=>e.label.localeCompare(t.label,void 0,{sensitivity:`base`}))},[s,l,i]),d=(0,V.useMemo)(()=>{if(!a.trim())return u;let e=a.trim().toLowerCase();return u.filter(t=>t.label.toLowerCase().includes(e)||t.description.toLowerCase().includes(e)||t.storeKey.toLowerCase().includes(e)||t.scope.includes(e)||t.scope===`both`&&(`client`.includes(e)||`assistant`.includes(e)))},[u,a]);return(0,H.jsx)(R,{title:`Feature Flags`,subtitle:`Active feature flags evaluated for the current session.`,children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`relative`,children:[(0,H.jsx)(M,{className:`absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-[var(--content-tertiary)]`}),(0,H.jsx)(`input`,{type:`text`,placeholder:`Search flags...`,value:a,onChange:e=>o(e.target.value),className:`w-full rounded-lg border border-[var(--border-base)] bg-[var(--surface-default)] py-2 pl-9 pr-3 text-body-medium-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:border-[var(--border-focus)] focus:outline-none`})]}),d.length===0&&(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No matching flags.`}),d.length>0&&(0,H.jsx)(`div`,{className:`max-h-[500px] space-y-2 overflow-y-auto`,children:d.map(e=>(0,H.jsx)(Z,{flag:e,assistantId:t},e.storeKey))})]})})}function X({scope:e}){return e===`both`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(m,{tone:Y.client,children:`client`}),(0,H.jsx)(m,{tone:Y.assistant,children:`assistant`})]}):(0,H.jsx)(m,{tone:Y[e],children:e})}function se({flag:e,assistantId:t}){let n=P.use.setFlag(),r=k.use.setFlag();return(0,H.jsxs)(`div`,{className:`flex items-start gap-3 py-3`,children:[(0,H.jsx)(`div`,{className:`shrink-0 pt-0.5`,children:(0,H.jsx)(h,{checked:e.value,onChange:i=>{O(e.scope,`client`)&&n(e.storeKey,i),O(e.scope,`assistant`)&&r(e.storeKey,i,t)},"aria-label":`${e.label} is ${e.value?`on`:`off`}`})}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,H.jsx)(X,{scope:e.scope})]}),(0,H.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default:`}),(0,H.jsx)(m,{tone:`neutral`,children:e.defaultValue?`On`:`Off`})]})]})]})}function ce({flag:e,assistantId:t}){let n=P.use.setStringFlag(),r=k.use.setStringFlag(),[i,a]=(0,V.useState)(e.value);(0,V.useEffect)(()=>{a(e.value)},[e.value]);let o=i=>{i!==e.value&&(O(e.scope,`client`)&&n(e.storeKey,i),O(e.scope,`assistant`)&&r(e.storeKey,i,t))},s=i!==e.value,c=e.values&&e.values.length>0?e.values:null,l=s&&c!=null&&!c.includes(i),d=()=>{l||o(i)},p=e=>{e.key===`Enter`&&e.currentTarget.blur()},h=c!=null&&c.includes(e.value);return(0,H.jsx)(`div`,{className:`flex items-start gap-3 py-3`,children:(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),(0,H.jsx)(X,{scope:e.scope})]}),(0,H.jsx)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:e.description}),h?(0,H.jsx)(f,{value:e.value,onChange:e=>{a(e),o(e)},options:c.map(e=>({value:e,label:e})),className:`w-48`,"aria-label":`${e.label} value`}):(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),onBlur:d,onKeyDown:p,className:u(`w-full rounded-lg border bg-[var(--surface-default)] px-3 py-1.5 text-body-small-default text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] focus:outline-none`,l?`border-[var(--system-negative-strong)]`:`border-[var(--border-base)] focus:border-[var(--border-focus)]`),placeholder:e.defaultValue||`Enter value...`}),l&&(0,H.jsxs)(`span`,{className:`block text-body-small-default text-[var(--system-negative-strong)]`,children:[`Expected one of: `,c.join(`, `)]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default:`}),(0,H.jsx)(m,{tone:`neutral`,children:e.defaultValue||`(empty)`})]})]})})}function Z({flag:e,assistantId:t}){return e.kind===`string`?(0,H.jsx)(ce,{flag:e,assistantId:t}):(0,H.jsx)(se,{flag:e,assistantId:t})}function le(){let e=(0,V.useCallback)(()=>{t(Error(`[Dev Settings] Test error event`)),g.success(`Sentry error event sent.`)},[]),i=(0,V.useCallback)(()=>{r(`[Dev Settings] Test warning event`,`warning`),g.success(`Sentry warning event sent.`)},[]),a=(0,V.useCallback)(()=>{r(`[Dev Settings] Test info event`,`info`),g.success(`Sentry info event sent.`)},[]),o=(0,V.useCallback)(()=>{r(`[Dev Settings] Test fatal event`,`fatal`),g.success(`Sentry fatal event sent.`)},[]),s=(0,V.useCallback)(()=>{n({name:`[Dev Settings] Test transaction`,op:`test.transaction`,forceTransaction:!0}).end(),g.success(`Sentry performance transaction sent.`)},[]);return(0,H.jsx)(R,{title:`Sentry Testing`,subtitle:`Fire test events to verify Sentry integration is working.`,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(Q,{icon:(0,H.jsx)(z,{className:`h-4 w-4 text-[var(--system-negative-strong)]`}),label:`Fatal Event`,description:`Send a fatal-level event to Sentry.`,onClick:o}),(0,H.jsx)(Q,{icon:(0,H.jsx)(L,{className:`h-4 w-4 text-[var(--system-negative-default)]`}),label:`Error Event`,description:`Capture a test Error exception.`,onClick:e}),(0,H.jsx)(Q,{icon:(0,H.jsx)(ie,{className:`h-4 w-4 text-[var(--system-warning-default)]`}),label:`Warning Event`,description:`Send a warning-level message.`,onClick:i}),(0,H.jsx)(Q,{icon:(0,H.jsx)(j,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),label:`Info Event`,description:`Send an info-level message.`,onClick:a}),(0,H.jsx)(Q,{icon:(0,H.jsx)(B,{className:`h-4 w-4 text-[var(--system-positive-default)]`}),label:`Performance Transaction`,description:`Start and end a test transaction span.`,onClick:s})]})})}function Q({icon:e,label:t,description:n,onClick:r}){return(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-[var(--border-base)] px-4 py-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(`div`,{className:`shrink-0`,children:e}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:t}),(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]}),(0,H.jsxs)(d,{variant:`outlined`,size:`compact`,onClick:r,children:[(0,H.jsx)(ee,{className:`h-4 w-4`}),`Send`]})]})}var $=[{id:`feature-flags`,label:`Feature Flags`},{id:`lifecycle`,label:`Assistant Lifecycle`},{id:`sentry`,label:`Sentry Testing`}];function ue(){let[e,t]=a(),n=k.use.settingsDeveloperNav(),r=k.use.hasHydrated(),i=(0,V.useMemo)(()=>{let t=e.get(`tab`);return $.find(e=>e.id===t)?.id??`feature-flags`},[e]);if(r&&!n)return(0,H.jsx)(o,{replace:!0,to:w.settings.general});let s=n=>{let r=new URLSearchParams(e.toString());n===`feature-flags`?r.delete(`tab`):r.set(`tab`,n),t(r,{replace:!0})};return(0,H.jsxs)(`div`,{"data-slot":`developer-page`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(`div`,{role:`tablist`,"aria-label":`Developer sections`,className:`flex shrink-0 items-center gap-1 border-b border-[var(--border-base)]`,children:$.map(e=>{let t=e.id===i;return(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-controls":`developer-tab-panel-${e.id}`,id:`developer-tab-${e.id}`,onClick:()=>s(e.id),className:ne(`relative -mb-px cursor-pointer border-b-2 px-4 py-2 text-body-medium-default transition-colors`,t?`border-[var(--system-positive-strong)] text-[var(--system-positive-strong)]`:`border-transparent text-[var(--content-tertiary)] hover:text-[var(--content-default)] dark:text-[var(--content-disabled)] dark:hover:text-[var(--content-default)]`),children:e.label},e.id)})}),(0,H.jsxs)(`div`,{id:`developer-tab-panel-${i}`,role:`tabpanel`,"aria-labelledby":`developer-tab-${i}`,className:`flex min-h-0 flex-1 flex-col pt-6`,children:[i===`feature-flags`&&(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(oe,{}),(0,H.jsx)(J,{})]}),i===`lifecycle`&&(0,H.jsx)(U,{}),i===`sentry`&&(0,H.jsx)(le,{})]})]})}export{ue as DeveloperPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t}from"./useQuery-D2zf6Uhu.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./notice-CF2pptne.js";import{t as i}from"./loader-circle-BSAFLoPH.js";import{i as a}from"./routes-
|
|
1
|
+
import{r as e}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t}from"./useQuery-D2zf6Uhu.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./notice-CF2pptne.js";import{t as i}from"./loader-circle-BSAFLoPH.js";import{i as a}from"./routes-DMbyM_oF.js";import{At as o,Vi as s,dt as c,fa as l,ft as u,ut as d}from"./index-DM63H2B6.js";import{t as f}from"./detail-card-B5j4Rqau.js";var p=n();function m(e){return new Intl.DateTimeFormat(`en`,{month:`short`,day:`numeric`,year:`numeric`}).format(new Date(e))}function h({assistant:e}){let t=e,n=t.platform===`ios`,r=n?s:l,i=e.name||(n?`iOS Device`:t.hostname||`Unknown Device`);return(0,p.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--border-base)] px-4 py-3`,children:[(0,p.jsx)(r,{className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`div`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:i}),(0,p.jsxs)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[t.hostname&&(0,p.jsx)(`span`,{className:`mr-3`,children:t.hostname}),e.created&&(0,p.jsxs)(`span`,{children:[`Registered `,m(e.created)]})]})]})]})}function g(){let n=u({platformHostedOnly:!0}),s=d(),l=c(),{data:m,isLoading:g}=t({...o({query:{hosting:`local`}}),enabled:n===`full`&&s}),_=m?.results??[];return n===`gated`?(0,p.jsx)(e,{replace:!0,to:a.settings.general}):n===`disabled`?(0,p.jsx)(`div`,{className:`space-y-4`,children:(0,p.jsx)(r,{tone:`info`,children:`Log in to the Vellum platform to manage self-hosted assistants.`})}):l?(0,p.jsx)(`div`,{className:`space-y-4`,children:(0,p.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,p.jsx)(i,{className:`h-4 w-4 animate-spin`}),`Loading devices…`]})}):s?(0,p.jsx)(`div`,{className:`space-y-4`,children:(0,p.jsx)(f,{title:`Self-Hosted Assistants`,subtitle:`Self-hosted assistants registered with your Vellum account. Registration lets these assistants use Vellum managed services — inference, web search, integrations — so that you don't have to bring your own API keys.`,children:g?(0,p.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,p.jsx)(i,{className:`h-4 w-4 animate-spin`}),`Loading devices...`]}):_.length===0?(0,p.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No self-hosted assistants registered.`}):(0,p.jsx)(`div`,{className:`space-y-2`,children:_.map(e=>(0,p.jsx)(h,{assistant:e},e.id))})})}):(0,p.jsx)(`div`,{className:`space-y-4`,children:(0,p.jsx)(r,{tone:`warning`,children:`Self-hosted assistant management isn't available for the current assistant state.`})})}export{g as DevicesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,f as r}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-Czgs_2w_.js";import"./src-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,f as r}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-Czgs_2w_.js";import"./src-hn7lwVCD.js";import{t as o}from"./resolved-assistants-store-ub66utfl.js";import{t as s}from"./loader-circle-BSAFLoPH.js";import{at as c,it as l,rt as u}from"./sdk.gen-AJllUeDf.js";import{i as d}from"./routes-DMbyM_oF.js";import{t as f}from"./use-bus-subscription-BuU6xaZz.js";import{t as p}from"./viewer-store-Cc5YI5ay.js";import{r as m,t as h}from"./edit-chat-session-Cx2xnSSj.js";import{X as g}from"./index-DM63H2B6.js";var _=e(t(),1);function v({surfaceId:e,enabled:t,onCommentsChanged:n}){let r=(0,_.useRef)(n);return(0,_.useLayoutEffect)(()=>{r.current=n},[n]),(0,_.useCallback)(n=>{if(!t)return;let i=n.message;switch(i.type){case`document_comment_created`:case`document_comment_resolved`:case`document_comment_reopened`:case`document_comment_deleted`:i.surfaceId===e&&r.current();break;default:break}},[e,t])}var y=i();function b(){let{surfaceId:e}=r(),t=n(),i=o.use.activeAssistantId(),[b,x]=(0,_.useState)(null),[S,C]=(0,_.useState)(!0),[w,T]=(0,_.useState)(null),E=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!e){T(`No document ID provided.`),C(!1);return}if(!i)return;let t=!1;return(async()=>{try{let{data:n}=await l({path:{assistant_id:i,id:e},throwOnError:!0});if(t)return;x(n)}catch{t||T(`Failed to load document.`)}finally{t||C(!1)}})(),()=>{t=!0}},[e,i]);let D=(0,_.useCallback)(()=>{E.current?.refreshComments()},[]);f(`sse.event`,v({surfaceId:e??``,enabled:!!e,onCommentsChanged:D}));let O=(0,_.useCallback)(()=>{t(-1)},[t]),k=(0,_.useCallback)(async()=>{if(!b||!i||!e)return;let n=b.conversationId||h(i,e)||(typeof globalThis.crypto?.randomUUID==`function`?globalThis.crypto.randomUUID():`draft-${Date.now()}-${Math.random().toString(16).slice(2)}`);if(m(i,e,n),n!==b.conversationId)try{await u({path:{assistant_id:i,id:e},body:{conversationId:n},throwOnError:!0})}catch{}p.getState().openDocument(),p.getState().setLoadedDocument({surfaceId:b.surfaceId,conversationId:n,documentName:b.title,content:b.content});let r=`Please review and address my comments on "${b.title}".`;t(`${d.conversation(n)}?prompt=${encodeURIComponent(r)}`)},[b,i,e,t]),A=(0,_.useCallback)(async()=>{if(!b||!i)return;let{data:e,response:t}=await c({path:{assistant_id:i,id:b.surfaceId},throwOnError:!1,parseAs:`blob`});if(!t?.ok||!e)return;let n=URL.createObjectURL(e);Object.assign(document.createElement(`a`),{href:n,download:`${b.title||`document`}.pdf`}).click(),URL.revokeObjectURL(n)},[b,i]);return S?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(s,{size:24,className:`animate-spin`,style:{color:`var(--content-tertiary)`}})}):w||!b||!i?(0,y.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,y.jsx)(a,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:w??`Document not found.`})}):(0,y.jsx)(g,{surfaceId:b.surfaceId,assistantId:i,conversationId:b.conversationId,documentName:b.title,content:b.content,onClose:O,onExport:A,onSubmitFeedback:k,handleRef:E})}export{b as DocumentViewerPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./useQuery-D2zf6Uhu.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./button-DdEh-9f_.js";import"./src-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./useQuery-D2zf6Uhu.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./button-DdEh-9f_.js";import"./src-hn7lwVCD.js";import{t as a}from"./input-Cu3PPVCq.js";import{t as o}from"./modal-BYMhDpQo.js";import{t as s}from"./createLucideIcon-D6d6iDdi.js";import{t as c}from"./loader-circle-BSAFLoPH.js";import{Ei as l,Ga as u,On as d,ja as f,po as p,qa as m,yo as h}from"./index-DM63H2B6.js";var g=s(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),_=e(t(),1),v=r();function y(e){return e.replace(/\.00$/,``)}function b(e,t,n){let r=y(n),i=y(e),a=y(t);return i===a?`Share Vellum with friends — you'll each earn ${i} credits when they sign up, up to ${r} total.`:`Share Vellum with friends — you'll earn ${i} credits and they'll get ${a} when they sign up, up to ${r} total.`}function x({open:e,onClose:t}){return(0,v.jsx)(o.Root,{open:e,onOpenChange:e=>{e||t()},children:e?(0,v.jsx)(S,{}):null})}function S(){let[e,t]=(0,_.useState)(!1),[r,s]=(0,_.useState)(!1),{data:x,isLoading:S,isError:E,refetch:D,isFetching:O}=n(d()),k=(0,_.useCallback)(e=>{navigator.clipboard.writeText(e).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)})},[]),A=x?b(x.referrer_credit_amount,x.credit_amount,x.earning_cap):`Refer friends to earn free credits.`,j=x?y(x.earning_cap):``,M=r?`Referral Program Terms`:`Earn free credits`;return(0,v.jsxs)(o.Content,{size:`sm`,children:[(0,v.jsx)(o.Header,{children:(0,v.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r&&(0,v.jsx)(i,{variant:`ghost`,size:`compact`,iconOnly:(0,v.jsx)(h,{}),onClick:()=>s(!1),"aria-label":`Back`,className:`mt-0.5`,tintColor:`var(--content-secondary)`}),(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(o.Title,{children:M}),!r&&(0,v.jsx)(o.Description,{children:A})]})]})}),(0,v.jsx)(o.Body,{children:r&&x?(0,v.jsx)(T,{cap:j}):S?(0,v.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[(0,v.jsx)(c,{className:`h-4 w-4 animate-spin`}),`Loading referral information…`]}):E||!x?(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsx)(`p`,{className:`!m-0 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Failed to load referral information.`}),(0,v.jsx)(i,{variant:`outlined`,onClick:()=>void D(),disabled:O,children:O?`Retrying…`:`Try Again`})]}):(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`space-y-2`,children:[(0,v.jsx)(C,{icon:(0,v.jsx)(g,{className:`h-4 w-4`}),label:`Share your invite link`}),(0,v.jsx)(C,{icon:(0,v.jsx)(l,{className:`h-4 w-4`}),label:`They sign up`}),(0,v.jsx)(C,{icon:(0,v.jsx)(f,{className:`h-4 w-4`}),label:`You earn credits`})]}),(0,v.jsx)(`div`,{style:{borderTop:`1px solid var(--border-base)`}}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(a,{type:`text`,readOnly:!0,value:x.referral_url,fullWidth:!0,wrapperClassName:`flex-1`,className:`font-mono`,onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(i,{variant:`outlined`,iconOnly:e?(0,v.jsx)(p,{}):(0,v.jsx)(m,{}),onClick:()=>k(x.referral_url),"aria-label":`Copy referral link`,className:`h-9 w-9`})]}),(0,v.jsx)(`div`,{style:{borderTop:`1px solid var(--border-base)`}}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,v.jsx)(w,{icon:(0,v.jsx)(l,{className:`h-3.5 w-3.5`}),value:String(x.referred_count),label:`Friends Referred`}),(0,v.jsx)(w,{icon:(0,v.jsx)(u,{className:`h-3.5 w-3.5`}),value:y(x.total_earned),label:`Credits Earned`})]}),(0,v.jsx)(`div`,{style:{borderTop:`1px solid var(--border-base)`}}),(0,v.jsx)(i,{variant:`ghost`,size:`compact`,onClick:()=>s(!0),fullWidth:!0,className:`text-body-small-default`,tintColor:`var(--content-tertiary)`,children:`View Terms and Conditions`})]})})]})}function C({icon:e,label:t}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,v.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`,color:`var(--content-secondary)`},children:e}),(0,v.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:t})]})}function w({icon:e,value:t,label:n}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-1.5 text-body-medium-lighter`,children:[(0,v.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:e}),(0,v.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:t}),(0,v.jsx)(`span`,{style:{color:`var(--content-tertiary)`},children:n})]})}function T({cap:e}){return(0,v.jsx)(`ul`,{className:`!m-0 !list-none space-y-2 !p-0`,children:[`This promotion is available to new users who sign up through your referral link only.`,`Rewards are earned once your invitee completes the creation of their Vellum account.`,`You may earn up to ${e} free credits through the Referral Program. We may change this limit at any time.`,`We do not grant credits for disposable or high-risk email accounts.`,`Each new user can generate only one (1) reward. No stacking or loophole hunting.`,`Please avoid spamming or misusing your referral link. Our systems actively monitor referral engagement.`,`If we detect suspicious or non-compliant activity, we reserve the right to withhold rewards or deactivate your referral link.`,`We may update, pause, or discontinue this program at any time.`].map(e=>(0,v.jsxs)(`li`,{className:`flex items-start gap-2 text-body-medium-lighter`,style:{color:`var(--content-secondary)`},children:[(0,v.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5`,children:`•`}),(0,v.jsx)(`span`,{children:e})]},e))})}export{x as EarnCreditsModal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as n}from"./useQuery-D2zf6Uhu.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-
|
|
1
|
+
import{r as e,t}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as n}from"./useQuery-D2zf6Uhu.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-hn7lwVCD.js";import{t as i}from"./notice-CF2pptne.js";import{t as a}from"./tag-Ccr7Quy6.js";import{t as o}from"./loader-circle-BSAFLoPH.js";import{i as s}from"./routes-DMbyM_oF.js";import{Ai as c,Da as l,Dt as u,Tt as d,ft as f,io as p,kt as m,qi as h}from"./index-DM63H2B6.js";import{t as g}from"./use-current-platform-assistant-4FcCb-TC.js";var _=r();function v(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function y({title:e,children:t}){return(0,_.jsxs)(`div`,{className:`space-y-3`,children:[(0,_.jsx)(`h2`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:e}),t]})}function b({tone:e=`info`,children:t}){let n=e===`error`;return(0,_.jsx)(`div`,{className:`rounded-md border px-4 py-3 text-body-medium-lighter`,style:{background:n?`var(--surface-negative-subtle, var(--surface-lift))`:`var(--surface-lift)`,borderColor:n?`var(--border-negative, var(--border-base))`:`var(--border-base)`,color:n?`var(--content-negative, var(--content-default))`:`var(--content-default)`},children:(0,_.jsxs)(`div`,{className:`flex items-start gap-2`,children:[n&&(0,_.jsx)(c,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,_.jsx)(`div`,{className:`flex-1`,children:t})]})})}function x({message:e,onRetry:t,retrying:n}){return(0,_.jsx)(b,{tone:`error`,children:(0,_.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,_.jsx)(`span`,{children:e}),(0,_.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`text-body-small-default underline disabled:opacity-50`,style:{color:`var(--content-default)`},children:n?`Retrying…`:`Retry`})]})})}function S({label:e,value:t,sub:n}){return(0,_.jsxs)(`div`,{className:`rounded-xl border p-3`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,_.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e}),(0,_.jsx)(`p`,{className:`mt-1 text-title-large tabular-nums`,style:{color:`var(--content-default)`},children:t??`—`}),n&&(0,_.jsx)(`p`,{className:`text-body-small-default`,style:{color:`var(--content-disabled)`},children:n})]})}function C({email:e}){let t=e.direction===`inbound`;return(0,_.jsx)(`div`,{className:`rounded-xl border p-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,_.jsx)(a,{tone:t?`positive`:`neutral`,leftIcon:t?(0,_.jsx)(l,{}):(0,_.jsx)(h,{}),children:t?`Inbound`:`Outbound`}),(0,_.jsx)(`span`,{className:`truncate text-body-small-default`,style:{color:`var(--content-tertiary)`},children:e.from_address})]}),(0,_.jsx)(`p`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-default)`},children:e.subject||`(no subject)`})]}),(0,_.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,_.jsx)(p,{className:`h-3 w-3`}),(0,_.jsx)(`span`,{children:v(e.created_at)})]})]})})}function w({assistantId:e,platformGate:r}){let i=r===`full`,a=n({...d({path:{assistant_id:e}}),enabled:i}),c=a.data?.results?.[0],l=n({...u({path:{assistant_id:e,id:c?.id??``}}),enabled:i&&!!c?.id}),f=n({...m({path:{assistant_id:e},query:{limit:10}}),enabled:i}),p=l.data?.usage,h=f.data?.results??[];return a.isLoading?(0,_.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,_.jsx)(o,{className:`h-8 w-8 animate-spin`,style:{color:`var(--content-tertiary)`}})}):a.isError?(0,_.jsx)(x,{message:`Couldn't load email addresses.`,onRetry:()=>{a.refetch()},retrying:a.isFetching}):c?(0,_.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,_.jsx)(y,{title:`Totals`,children:(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-4`,children:[(0,_.jsx)(S,{label:`Sent today`,value:p?.sent_today,sub:p?`of ${p.daily_limit} daily limit`:void 0}),(0,_.jsx)(S,{label:`Received today`,value:p?.received_today}),(0,_.jsx)(S,{label:`Sent this month`,value:p?.sent_this_month}),(0,_.jsx)(S,{label:`Received this month`,value:p?.received_this_month})]})}),(0,_.jsx)(y,{title:`Recent Emails`,children:f.isLoading?(0,_.jsxs)(`div`,{className:`flex items-center gap-2 text-body-small-default`,style:{color:`var(--content-tertiary)`},children:[(0,_.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading…`]}):f.isError?(0,_.jsx)(x,{message:`Couldn't load recent emails.`,onRetry:()=>{f.refetch()},retrying:f.isFetching}):h.length===0?(0,_.jsx)(b,{children:`No emails yet.`}):(0,_.jsx)(`div`,{className:`space-y-2`,children:h.map(e=>(0,_.jsx)(C,{email:e},e.id))})})]}):(0,_.jsxs)(b,{children:[`No email address registered yet.`,` `,(0,_.jsx)(t,{to:s.settings.ai,className:`underline`,style:{color:`var(--content-tertiary)`},children:`Set one up in AI Settings → Email.`})]})}function T(){let t=f(),{assistantId:n}=g();return t===`gated`?(0,_.jsx)(e,{replace:!0,to:s.logs.root}):t===`disabled`?(0,_.jsx)(i,{tone:`info`,children:`Log in to the Vellum platform to view emails.`}):n?(0,_.jsx)(w,{assistantId:n,platformGate:t}):null}export{T as EmailsPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-
|
|
2
|
-
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-DgJRXlLM.js","assets/dist-B4KYfSON.js","assets/definitions-FC3DcvI3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-B4KYfSON.js";import{t as n}from"./definitions-FC3DcvI3.js";function r(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return new Proxy({},{get(t,r){return(t,i,a)=>{let o=e.Capacitor.Plugins[n];if(o===void 0){a(Error(`Capacitor plugin ${n} not found`));return}if(typeof o[r]!=`function`){a(Error(`Method ${r} not found in Capacitor plugin ${n}`));return}(async()=>{try{i(await o[r](t))}catch(e){a(e)}})()}}})}})}function i(e){e.CapacitorUtils.Synapse=new Proxy({},{get(t,n){return e.cordova.plugins[n]}})}function a(e=!1){typeof window>`u`||(window.CapacitorUtils=window.CapacitorUtils||{},window.Capacitor!==void 0&&!e?r(window):window.cordova!==void 0&&i(window))}var o=t(`Filesystem`,{web:()=>e(()=>import(`./web-DgJRXlLM.js`).then(e=>new e.FilesystemWeb),__vite__mapDeps([0,1,2]))});a();export{n as Directory,o as Filesystem};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-XRhV1FIb.js","assets/dist-B4KYfSON.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-B4KYfSON.js";var n;(function(e){e.Light=`light`,e.Dark=`dark`})(n||={});var r=t(`SafeArea`,{web:()=>e(()=>import(`./web-XRhV1FIb.js`).then(e=>new e.SafeAreaWeb),__vite__mapDeps([0,1]))});export{r as SafeArea};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-oH2q0g1D.js","assets/dist-B4KYfSON.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-B4KYfSON.js";var n=t(`Browser`,{web:()=>e(()=>import(`./web-oH2q0g1D.js`).then(e=>new e.BrowserWeb),__vite__mapDeps([0,1]))});export{n as Browser};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-Cue81zTY.js","assets/dist-B4KYfSON.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-B4KYfSON.js";var n=t(`App`,{web:()=>e(()=>import(`./web-Cue81zTY.js`).then(e=>new e.AppWeb),__vite__mapDeps([0,1]))});export{n as App};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/web-hjMLFqJn.js","assets/dist-B4KYfSON.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-BewR0kVT.js";import{i as t}from"./dist-B4KYfSON.js";var n=t(`Share`,{web:()=>e(()=>import(`./web-hjMLFqJn.js`).then(e=>new e.ShareWeb),__vite__mapDeps([0,1]))});export{n as Share};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={version:1,flags:[{id:`auto-analyze`,scope:`assistant`,key:`auto-analyze`,label:`Auto-analyze conversations`,description:`Automatically trigger conversation analysis on the same cadence as memory extraction (batch threshold, idle debounce, end-of-conversation). The analysis agent has full tool access and writes back to memory and skills without user approval.`,defaultEnabled:!1},{id:`memory-retrospective-fork`,scope:`assistant`,key:`memory-retrospective-fork`,label:`Fork-based memory retrospective`,description:`Fork the source conversation through its latest message for memory retrospectives, instead of rendering the slice into a transcript and waking an empty background conversation. Lets the retrospective hit the provider prompt cache and read compaction summary + tail messages natively.`,defaultEnabled:!1},{id:`user-hosted-enabled`,scope:`client`,key:`user-hosted-enabled`,label:`User Hosted Enabled`,description:`Enable user-hosted onboarding flow`,defaultEnabled:!1},{id:`pre-chat-onboarding-experiment-2026-06-06`,scope:`client`,key:`pre-chat-onboarding-experiment-2026-06-06`,label:`Pre-chat Onboarding Experiment 2026-06-06`,description:`Pre-chat onboarding experiment with control and variant-a arms. Control shows the full funnel; variant-a shows the condensed pared-down flow.`,defaultEnabled:`control`,values:[`control`,`variant-a`]},{id:`experiment-activation-flow-2026-06-03`,scope:`client`,key:`experiment-activation-flow-2026-06-03`,label:`Activation Flow Experiment 2026-06-03`,description:`Multivariate activation-flow experiment. control = standard flow; variant-a = activation rail. Targeted via LaunchDarkly.`,defaultEnabled:`control`,values:[`control`,`variant-a`]},{id:`local-docker-enabled`,scope:`client`,key:`local-docker-enabled`,label:`Local Docker Mode`,description:`When enabled, the Local hosting option uses Docker under the hood for sandboxed execution, hiding the separate Docker card`,defaultEnabled:!1},{id:`a2a-channel`,scope:`assistant`,key:`a2a-channel`,label:`A2A Channel`,description:`Enable the A2A (Agent-to-Agent) channel for inter-assistant communication via the open A2A protocol`,defaultEnabled:!1},{id:`settings-developer-nav`,scope:`assistant`,key:`settings-developer-nav`,label:`Settings Developer Nav`,description:`Control Developer nav visibility in macOS settings`,defaultEnabled:!1},{id:`system-schedule-toggles`,scope:`assistant`,key:`system-schedule-toggles`,label:`System Schedule Toggles`,description:`Show Heartbeat and Consolidation pause toggles on the schedules settings page. The toggles only pause automatic runs; manual Run now remains available.`,defaultEnabled:!1},{id:`developer-menu-items`,scope:`client`,key:`developer-menu-items`,label:`Developer Menu Items`,description:`Show Component Gallery and Replay Onboarding in the menu bar`,defaultEnabled:!1},{id:`ces-tools`,scope:`assistant`,key:`ces-tools`,label:`CES Tool Exposure`,description:`Register Credential Execution Service tools (credential-grant, credential-revoke, credential-list) in the agent loop`,defaultEnabled:!1},{id:`ces-shell-lockdown`,scope:`assistant`,key:`ces-shell-lockdown`,label:`CES Shell Lockdown`,description:`Enforce untrusted-agent shell lockdown when CES credentials are active, restricting direct shell access to credentialed services`,defaultEnabled:!1},{id:`ces-secure-install`,scope:`assistant`,key:`ces-secure-install`,label:`CES Secure Command Installation`,description:`Enable secure tool/command installation via CES instead of direct shell execution for untrusted agents`,defaultEnabled:!1},{id:`ces-grant-audit`,scope:`assistant`,key:`ces-grant-audit`,label:`CES Grant & Audit Inspection`,description:`Surface credential grant and audit inspection endpoints for reviewing active grants and access logs`,defaultEnabled:!1},{id:`chatgpt-subscription-auth`,scope:`assistant`,key:`chatgpt-subscription-auth`,label:`ChatGPT Subscription Auth`,description:`Enable ChatGPT subscription OAuth as a provider auth type for OpenAI models, using the Codex device-code flow.`,defaultEnabled:!1},{id:`deploy-to-vercel`,scope:`assistant`,key:`deploy-to-vercel`,label:`Deploy to Vercel`,description:`Enable the Deploy to Vercel / Publish option in the app workspace header share menu`,defaultEnabled:!1},{id:`settings-embedding-provider`,scope:`assistant`,key:`settings-embedding-provider`,label:`Embedding Provider Settings`,description:`Show the Embedding service card in Models & Services settings`,defaultEnabled:!1},{id:`multi-platform-assistant`,scope:`client`,key:`multi-platform-assistant`,label:`Multi-Platform Assistant Switcher`,description:`Enable the menu-bar assistant switcher for managing multiple platform-hosted assistants (new/switch/retire)`,defaultEnabled:!1},{id:`quick-input`,scope:`client`,key:`quick-input`,label:`Quick Input`,description:`Enable the Quick Input popover on right-click of the menu bar icon`,defaultEnabled:!1},{id:`expand-completed-steps`,scope:`client`,key:`expand-completed-steps`,label:`Expand Completed Steps`,description:`Auto-expand completed tool call step groups instead of showing them collapsed`,defaultEnabled:!1},{id:`sounds`,scope:`assistant`,key:`sounds`,label:`Sounds`,description:`Enable the Sounds tab in Settings and all app sound playback (event sounds, random ambient sounds)`,defaultEnabled:!1},{id:`message-tts`,scope:`assistant`,key:`message-tts`,label:`Message Text-to-Speech`,description:`Show a speaker button on assistant messages to generate and play the message as audio via Fish Audio TTS`,defaultEnabled:!1},{id:`openai-compatible-endpoints`,scope:`assistant`,key:`openai-compatible-endpoints`,label:`OpenAI-Compatible Endpoints`,description:`Enable user-configured OpenAI-compatible inference endpoints with custom base URLs and model identifiers`,defaultEnabled:!1},{id:`backward-releases`,scope:`assistant`,key:`backward-releases`,label:`Backward Releases`,description:`Show older versions in the version picker, allowing rollback to previous releases`,defaultEnabled:!1},{id:`voice-mode`,scope:`assistant`,key:`voice-mode`,label:`Voice Mode`,description:`Show the live voice conversation button in the composer`,defaultEnabled:!1},{id:`fast-mode`,scope:`assistant`,key:`fast-mode`,label:`Fast Mode`,description:`Enable Anthropic fast mode for Opus models (4.6, 4.7, 4.8), delivering up to 2.5x higher output tokens per second at premium pricing`,defaultEnabled:!1},{id:`conversation-groups-ui`,scope:`assistant`,key:`conversation-groups-ui`,label:`Conversation Groups`,description:`Enable custom conversation group creation, move-to-group, and group management in the sidebar`,defaultEnabled:!1},{id:`teleport`,scope:`client`,key:`teleport`,label:`Teleport`,description:`Enable teleport UI in General settings for moving assistants between hosting environments`,defaultEnabled:!1},{id:`apple-container`,scope:`client`,key:`apple-container`,label:`Apple Container`,description:`Enable assistant sandboxing via Apple Containers on macOS 26+, providing a lightweight native sandbox without third-party dependencies`,defaultEnabled:!1},{id:`managed-gemini-embeddings-enabled`,scope:`assistant`,key:`managed-gemini-embeddings-enabled`,label:`Managed Gemini Embeddings Enabled`,description:`Route embedding requests through the platform runtime proxy using Vellum-managed Gemini credentials when available`,defaultEnabled:!1},{id:`bookmarks`,scope:`client`,key:`bookmarks`,label:`Message Bookmarks`,description:`Show the bookmark icon on messages and enable the Bookmarks tab in Settings`,defaultEnabled:!1},{id:`fork-from-message`,scope:`client`,key:`fork-from-message`,label:`Fork from Message`,description:`Show the 'Fork from here' option in message overflow menus`,defaultEnabled:!1},{id:`home-tab`,scope:`client`,key:`home-tab`,label:`Home Tab`,description:`Replace the knowledge graph top-level tab with a new Home page showing relationship progression, facts, and capability tiers`,defaultEnabled:!1},{id:`meet`,scope:`assistant`,key:`meet`,label:`Google Meet`,description:`Enables the Google Meet joining bot and the meet-join skill.`,defaultEnabled:!1},{id:`scroll-debug-overlay`,scope:`client`,key:`scroll-debug-overlay`,label:`Scroll Debug Overlay`,description:`Show a live HUD in the top-right of the conversation with scroll geometry, velocity, update rate, and anchor-preserver activity. Developer diagnostic for investigating scroll jank.`,defaultEnabled:!1},{id:`coding-agents-panel`,scope:`client`,key:`coding-agents-panel`,label:`Coding Agents Panel`,description:`Gate native macOS Coding Agents panel entry points and inline ACP session deep links.`,defaultEnabled:!1},{id:`compaction-playground`,scope:`assistant`,key:`compaction-playground`,label:`Compaction Playground`,description:`Expose the developer-only Compaction Playground tab in macOS Settings and enable the /playground/* HTTP endpoints for exercising compaction conditions. Dev-only; default off.`,defaultEnabled:!1},{id:`account-deletion`,scope:`assistant`,key:`account-deletion`,label:`Account Deletion`,description:`Surfaces the user-initiated account deletion flow in client settings.`,defaultEnabled:!0},{id:`app-control`,scope:`assistant`,key:`app-control`,label:`App Control`,description:`Enable the app-control skill (per-app screenshot + raw input bypassing AX tree)`,defaultEnabled:!1},{id:`analyze-conversation`,scope:`assistant`,key:`analyze-conversation`,label:`Analyze Conversation`,description:`Show the 'Analyze' / 'Analyze conversation' option in conversation context menus and the conversation title actions dropdown.`,defaultEnabled:!1},{id:`external-plugins`,scope:`assistant`,key:`external-plugins`,label:`External Plugins`,description:"Enable the external-plugin install path: the `assistant plugins` CLI subcommand and the declarative external-plugin loader convention (`<workspaceDir>/plugins/<name>/` directories containing `package.json` plus interface dirs). Gates an unstable surface that may change shape before stabilizing.",defaultEnabled:!1},{id:`provider-zai`,scope:`assistant`,key:`provider-zai`,label:`z.ai Provider`,description:`Enable the z.ai (Zhipu AI) provider and its GLM models in the provider picker and model selection UI`,defaultEnabled:!1},{id:`velvet-theme`,scope:`client`,key:`velvet-theme`,label:`Velvet Theme`,description:`Show the Velvet theme option in the macOS appearance settings. Velvet is a dark-mode variant with red/pink accent colors.`,defaultEnabled:!1},{id:`query-complexity-routing`,scope:`assistant`,key:`query-complexity-routing`,label:`Query Complexity Routing`,description:`Automatically route user messages to the most appropriate inference profile based on query complexity. Simple queries use the speed profile, complex queries escalate to the quality profile. The user is notified of each switch and can opt out by pinning a profile on the conversation.`,defaultEnabled:!1},{id:`queue-steering`,scope:`assistant`,key:`queue-steering`,label:`Queue Steering`,description:`Enable the 'Push to agent' button on queued messages, allowing users to steer the assistant to a specific queued message by aborting the current generation and promoting the message to the head of the queue.`,defaultEnabled:!1},{id:`chat-pull-to-refresh-enabled`,scope:`client`,key:`chat-pull-to-refresh-enabled`,label:`Chat Pull to Refresh`,description:`Enable pull-to-refresh gesture in the chat view.`,defaultEnabled:!1},{id:`doctor`,scope:`client`,key:`doctor`,label:`Doctor`,description:`Enable the Doctor diagnostic tab in Debug settings.`,defaultEnabled:!1},{id:`home-page`,scope:`client`,key:`home-page`,label:`Home Page`,description:`Enable the Home page as the default landing view.`,defaultEnabled:!1},{id:`platform-notifications`,scope:`client`,key:`platform-notifications`,label:`Platform Notifications`,description:`Enable the Notifications tab in settings.`,defaultEnabled:!1},{id:`preview-channel`,scope:`client`,key:`preview-channel`,label:`Preview Channel`,description:`Enable user-facing Preview release channel controls in assistant settings.`,defaultEnabled:!1},{id:`rollback-enabled`,scope:`assistant`,key:`rollback-enabled`,label:`Rollback Enabled`,description:`Show older versions in the version picker, allowing rollback to previous releases.`,defaultEnabled:!1},{id:`self-hosted-assistant`,scope:`client`,key:`self-hosted-assistant`,label:`Self-Hosted Assistant`,description:`Enable self-hosted assistant configuration.`,defaultEnabled:!1},{id:`settings-sleep-policy`,scope:`assistant`,key:`settings-sleep-policy`,label:`Settings Sleep Policy`,description:`Enable sleep policy settings.`,defaultEnabled:!1},{id:`velvet`,scope:`client`,key:`velvet`,label:`Velvet`,description:`Enable the Velvet design theme.`,defaultEnabled:!1},{id:`memory-router-playground`,scope:`client`,key:`memory-router-playground`,label:`Memory Router Playground`,description:`Expose the developer-only Memory Router Playground tab in macOS Settings and the /assistant/memory-router-playground web page for dry-running v4 router config overrides against the live page index. Dev-only; default off.`,defaultEnabled:!1},{id:`platform-features-in-local-mode`,scope:`assistant`,key:`platform-features-in-local-mode`,label:`Platform Features in Local Mode`,description:`When enabled, the assistant can call the Vellum platform API from local mode. When disabled, all platform API clients in the daemon, gateway, CES, and web UI no-op with a debug log instead of making outbound requests.`,defaultEnabled:!0},{id:`memory-v3-shadow`,scope:`assistant`,key:`memory-v3-shadow`,label:`Memory v3 Shadow`,description:`When on, runs the new memory-v3 topic-tree retrieval alongside v2 in shadow mode: logs selections to memory_v3_selections, does not modify injected context. Off by default.`,defaultEnabled:!1},{id:`memory-v3-live`,scope:`assistant`,key:`memory-v3-live`,label:`Memory v3 Live`,description:`When on, memory-v3 topic-tree retrieval becomes the live injected memory source (suppressing v2 injection). Off by default; only enable after shadow telemetry validates the design.`,defaultEnabled:!1},{id:`empty-state-dynamic-greetings`,scope:`assistant`,key:`empty-state-dynamic-greetings`,label:`Dynamic Empty-State Greetings`,description:`Enable the empty new-chat screen to refresh cached greeting options via the empty-state greeting LLM call site. When off, the assistant serves workspace-authored greetings or static fallbacks only.`,defaultEnabled:!1},{id:`self-intro-greeting`,scope:`both`,key:`self-intro-greeting`,label:`Self-intro first message`,description:`On the first conversation, send a natural self-introduction (e.g. "Hi Vela, I'm alex. Nice to meet you.") on the user's behalf and route it through real LLM inference, instead of serving the canned first greeting. Names come from the onboarding context; falls back to the canned greeting when no name is known. Exposed to clients so pre-hatch onboarding can compute the source-of-truth initial message, and to the assistant so older clients can still be gated server-side. See assistant/src/daemon/first-greeting.ts (buildSelfIntroMessage).`,defaultEnabled:!1}]};function t(e,t){return e===t||e===`both`}var n=e.flags,r={"openai-compatible-endpoints":`openAICompatibleEndpoints`};function i(e){return r[e]||e.split(`-`).map((e,t)=>e===`ui`?`UI`:t===0?e:e[0].toUpperCase()+e.slice(1)).join(``)}function a(e){let r={};for(let a of n)typeof a.defaultEnabled==`boolean`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}function o(e){let r={};for(let a of n)typeof a.defaultEnabled==`string`&&t(a.scope,e)&&(r[i(a.key)]=a.defaultEnabled);return r}var s=a(`client`),c=a(`assistant`),l=o(`client`),u=o(`assistant`),d=new Map;for(let e of n)d.set(i(e.key),e);var f=new Map;for(let e of n)f.set(i(e.key),e.key);function p(e){return i(e)}function m(e){return f.get(e)}var h=`VITE_VELLUM_FLAG_`;function g(e){return e.toLowerCase().replace(/_/g,`-`)}var _=new Set([`true`,`1`,`yes`,`on`]),v=new Set([`false`,`0`,`no`,`off`]);function y(e){let t=e.toLowerCase();return _.has(t)?!0:v.has(t)?!1:e}function b(){if(typeof window<`u`&&window.__VELLUM_FLAG_OVERRIDES__!=null)return{...window.__VELLUM_FLAG_OVERRIDES__};let e={},t={BASE_URL:`/assistant/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_PLATFORM_MODE:`false`};for(let n of Object.keys(t))if(n.startsWith(h)){let r=g(n.slice(17)),i=t[n];i!=null&&(e[r]=y(i))}return e}var x=null;function S(){return x===null&&(x=b()),x}var C=new Map;for(let e of n)C.set(e.key,e);function w(e){let n=S(),r={},i={};for(let[a,o]of Object.entries(n)){let n=C.get(a);if(!n||!t(n.scope,e))continue;let s=p(a);typeof o==`boolean`?r[s]=o:i[s]=o}return{bool:r,str:i}}export{p as a,t as c,l as i,m as l,u as n,n as o,s as r,w as s,c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t=``){return e==null?t:e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:e>=100*1024*1024?`${(e/(1024*1024*1024)).toFixed(1)} GB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-C07QvMzm.js";import{t as o}from"./capture-error-CZsNGL6n.js";import{t as s}from"./react-DJZBPgpf.js";import{d as c,t as l}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as u}from"./QueryClientProvider-DNHWXaGq.js";import{t as d}from"./useQuery-D2zf6Uhu.js";import{t as f}from"./useMutation-BuofVRHk.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./cn-DFqQkJlk.js";import{t as h}from"./button-DdEh-9f_.js";import{t as g}from"./dropdown-CocFV5yi.js";import{c as _,n as v,s as y}from"./src-hn7lwVCD.js";import{t as b}from"./confirm-dialog-NYG-K9zN.js";import{t as x}from"./notice-CF2pptne.js";import{t as S}from"./tag-Ccr7Quy6.js";import{t as C}from"./input-Cu3PPVCq.js";import{t as w}from"./toggle-CEm3M86o.js";import{n as T}from"./stat-square-sRJmexc-.js";import{t as E}from"./modal-BYMhDpQo.js";import{n as D}from"./toast-DU1nH33j.js";import{d as O,f as k,l as A,t as j}from"./resolved-assistants-store-ub66utfl.js";import{t as M}from"./createLucideIcon-D6d6iDdi.js";import{t as N}from"./bell-C7RL04h4.js";import{t as P}from"./chevron-right-zTNPbA1m.js";import{t as F}from"./hard-drive-DKBjBUo8.js";import{t as I}from"./loader-circle-BSAFLoPH.js";import{a as ee,c as L,o as te,r as ne,s as re,t as ie}from"./resize-errors-DejLlS-b.js";import{n as R,r as z,t as B}from"./api-errors-ChauV4ed.js";import{_ as V,g as ae,h as H,i as oe,l as U,m as W,n as G,p as se}from"./auth-store-oleg80LZ.js";import{t as ce}from"./client.gen-BKAMS0D0.js";import{D as le,F as ue,U as de,y as fe}from"./sdk.gen-BO4vbMAj.js";import{i as K}from"./routes-DMbyM_oF.js";import{t as pe}from"./assistant-feature-flag-store-0382ImYF.js";import{n as q,t as me}from"./semver-Dd0ocNOn.js";import{n as he,t as ge}from"./use-reduced-motion-CZO_MWGV.js";import{$i as _e,Ai as ve,An as ye,Bt as be,Fi as xe,Gt as Se,Ht as Ce,It as we,Jn as Te,K as Ee,Lt as De,Mi as Oe,Qi as ke,Rt as Ae,Ut as je,Vi as Me,Vt as Ne,Wt as Pe,Y as Fe,Yn as Ie,Zi as Le,_ as Re,ar as ze,at as Be,bt as Ve,da as He,dr as Ue,dt as We,fa as Ge,fn as Ke,fo as qe,fr as J,ft as Je,h as Ye,ir as Xe,ka as Ze,kn as Qe,lr as $e,po as et,un as tt,uo as nt,ur as rt,ut as it,v as at,zi as ot,zt as st}from"./index-DM63H2B6.js";import{t as Y}from"./detail-card-B5j4Rqau.js";import{t as ct}from"./use-current-platform-assistant-4FcCb-TC.js";import{i as lt,n as X,r as ut,t as dt}from"./assistant-status-panel-B2a_ey3l.js";var ft=M(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),pt=M(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(s(),1),mt=se,ht=`Please choose a different handle.`;async function gt(e,t){let{data:n,error:r,response:i}=await le({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:z(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=V(r,`handle`,mt.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=V(r,`handle`,ht);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:z(r,i,`Failed to save handle.`)}}async function _t(e,t,n){let{data:r,error:i,response:a}=await fe({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(R(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new B(a.status,a.status===429?`Too many checks — try again in a moment.`:z(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function vt(e){return/\d{2,}$/.test(e)}var Q=p(),yt=300,bt=1400;function xt({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:s,fieldId:c}){let[l,u]=(0,Z.useState)(e),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=ge(),x=(0,Z.useRef)(null),S=(0,Z.useMemo)(()=>l.trim().toLowerCase(),[l]),w=S===e.toLowerCase();(0,Z.useEffect)(()=>{if(w||S.length===0){m(!1),x.current?.abort();return}let e=new AbortController;x.current?.abort(),x.current=e,m(!0);let t=window.setTimeout(async()=>{try{let t=await i(S,e.signal);e.signal.aborted||f(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||m(!1)}},yt);return()=>{window.clearTimeout(t),e.abort()}},[S,w,i]);let T=(()=>{if(v)return v;if(d&&!d.available){let e=d.code;return d.message??(e?mt[e]:`Please choose a different handle.`)}return null})(),E=T?n:w?r??null:p?`Checking availability…`:d?.available?`Available.`:null,O=!w&&!p&&d?.available!==!1&&g!==`saving`,k=(0,Z.useCallback)(async()=>{if(!O)return;_(`saving`),y(null);let e=await a(S);if(e.kind===`ok`){_(`saved`),o(e.data),D.success(s),window.setTimeout(()=>_(`idle`),bt);return}if(e.kind===`taken`){_(`idle`),f({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),f({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),D.error(e.message)},[O,S,o,a,s]),A=(()=>{if(w&&l.length>0||l.length===0)return null;let e=p?`checking`:d?.available?`available`:d?.available===!1?`invalid`:null;return e?(0,Q.jsx)(Fe,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(he.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(I,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(et,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(nt,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),j=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(I,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Saving…`]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(et,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Saved`]});default:return`Save`}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(C,{label:t,value:l,onChange:e=>{u(e.target.value.replace(/\s+/g,``)),f(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:A,errorText:T??void 0,helperText:E??void 0,"aria-invalid":!!T,fullWidth:!0,"data-testid":`${c}-input`}),(!w||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(h,{variant:`primary`,size:`compact`,onClick:k,disabled:!O,"aria-live":`polite`,"data-testid":`${c}-save`,children:j})})]})}function St({initial:e,onSaved:t}){let n=G.use.refreshSession(),r=vt(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await ae({username:e}),[]),a=(0,Z.useCallback)((e,t)=>W(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(xt,{initialHandle:e.username,inputLabel:`User handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:r,checkAvailable:a,save:i,onSaved:o,saveSuccessToast:`Profile updated.`,fieldId:`user-handle`})}function Ct({assistant:e,onSaved:t}){let n=e.handle??``,r=d({...Ve({path:{assistant_id:e.id}})}).data?.results?.[0],i=!!r&&r.subdomain.toLowerCase()===n.toLowerCase(),a=n.length===0?`Your assistant doesn't have a handle yet — claim one to make it mentionable.`:void 0,o=(0,Z.useCallback)(async t=>await gt(e.id,t),[e.id]),s=(0,Z.useCallback)((t,n)=>_t(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(C,{label:`Assistant handle`,value:n,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant's handle is locked because it's used as its email subdomain. To change it,`,` `,(0,Q.jsx)(l,{to:`${K.settings.ai}?release=1#email`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`release the subdomain`}),` `,`first.`]})]}):(0,Q.jsx)(xt,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:s,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function wt(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-3 w-72 animate-pulse rounded bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`div`,{className:`h-9 w-full animate-pulse rounded-md bg-[var(--surface-muted)]`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-3 w-60 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,Q.jsx)(`div`,{className:`h-7 w-16 animate-pulse rounded-md bg-[var(--surface-muted)]`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function Tt({assistant:e}={}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=ge(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return H().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),(0,Q.jsx)(Y,{title:`Profile`,subtitle:`Manage your user and assistant public handles.`,children:r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(he.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(St,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Ct,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(wt,{})})}function Et(){let{assistantId:e,isLoading:t,platformAssistants:n}=ct();return t||n.length<2?null:(0,Q.jsx)(Y,{title:`Switch Assistant`,subtitle:`Choose which assistant is active for this account.`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(t=>{let n=t.id===e;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(Ge,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:t.name||`Unnamed`}),t.status!==`active`&&(0,Q.jsx)(S,{tone:`warning`,children:t.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:n?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(et,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(h,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{Te(t.id),D.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var Dt=[{label:`Never`,seconds:0},{label:`5 min`,seconds:300,devOnly:!0},{label:`10 min`,seconds:600,devOnly:!0},{label:`1 hour`,seconds:3600},{label:`3 hours`,seconds:10800},{label:`1 day`,seconds:86400},{label:`3 days`,seconds:259200},{label:`7 days`,seconds:604800},{label:`14 days`,seconds:1209600},{label:`30 days`,seconds:2592e3}];function Ot(e){if(e===0)return`Never (sleep disabled)`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0&&n>0)return`${t}d ${n}h`;if(t>0)return`${t} day${t===1?``:`s`}`;if(n>0)return`${n} hour${n===1?``:`s`}`;let r=Math.floor(e/60);return r>0?`${r} minute${r===1?``:`s`}`:`${e}s`}function kt({assistantId:e}){let t=u(),n=Xe.use.isNonProduction(),r=(0,Z.useMemo)(()=>Dt.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:a,isError:o}=d(Pe({path:{id:e}})),s=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[c,l]=(0,Z.useState)(null),p=c??s,m=c!==null,g=f({...je(),onSuccess:()=>{D.success(`Sleep policy saved.`),l(null),t.invalidateQueries({queryKey:Se({path:{id:e}})})},onError:()=>{D.error(`Failed to save sleep policy. Please try again.`)}});return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(I,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load sleep policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Idle timeout`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`How long the assistant can be idle before it is put to sleep. "Never" disables idle sleep entirely.`}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:r.map(e=>(0,Q.jsx)(h,{variant:`outlined`,active:p===e.seconds,onClick:()=>l(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,Ot(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(h,{variant:`primary`,leftIcon:g.isPending?(0,Q.jsx)(I,{className:`animate-spin`}):void 0,onClick:()=>g.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:g.isPending,children:`Save`}),(0,Q.jsx)(h,{variant:`outlined`,onClick:()=>l(null),disabled:g.isPending,children:`Cancel`})]})]})}function At(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var jt=3e3;function Mt(e,t){return t&&e===`preview`?`preview`:`stable`}function Nt({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=pe.use.rollbackEnabled(),a=J.use.previewChannel(),o=u(),s=Mt(n,a),c=s===`preview`,[l,p]=(0,Z.useState)(!1),m=(0,Z.useRef)(null),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(!1),[w,T]=(0,Z.useState)(null),E=e=>e&&m.current&&e===m.current?(queueMicrotask(()=>{T(S?`Successfully rolled back to version ${m.current}.`:`Successfully updated to version ${m.current}.`),p(!1),m.current=null,v(null),D.success(S?`Rollback complete — assistant is healthy.`:`Update complete — assistant is healthy.`),r?.()}),!1):jt;d({...Ne({path:{id:e}}),refetchInterval:l?e=>E(e.state.data?.current_release_version):!1});let{data:O,isLoading:k}=d(Qe({query:{channel:s}})),A=O?.find(e=>e.is_stable!==!1)??O?.[0],j=_??A?.version??null,M=(0,Z.useMemo)(()=>{if(!i||!j||!t)return!1;let e=q(j),n=q(t);return!e||!n?!1:me(e,n)<0},[i,j,t]),N=(0,Z.useMemo)(()=>{if(!j)return!1;if(!t)return!0;let e=q(j),n=q(t);if(!e||!n)return j!==t;let r=me(e,n);return i?r!==0:r>0},[i,j,t]),P=f({mutationFn:async t=>{let{data:n}=await de({path:{id:e},body:t,throwOnError:!0});return n}}),F=f({mutationFn:async t=>{let{data:n}=await ue({path:{id:e},body:t,throwOnError:!0});return n}});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:t??`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:c?`Preview release`:N?M?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:k?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(I,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):O&&O.length>0?i?(0,Q.jsx)(g,{value:j??``,onChange:e=>v(e===A?.version?null:e),disabled:l||P.isPending||F.isPending,options:O.map(e=>({value:e.version,label:At(e,t,A?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:A?At(A,t,A.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(h,{variant:M?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:P.isPending||F.isPending||l?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(_e,{}),onClick:()=>x(!0),disabled:!N||P.isPending||F.isPending||l||k||!O?.length,children:l?S?`Rolling back...`:`Updating...`:M?`Rollback`:c?`Update preview`:`Update`}),c&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Using Preview releases.`,` `,(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`,children:`Switch back to Stable`})]}),!N&&t&&j&&!k&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:w??`You are already on this version.`}),(0,Q.jsx)(b,{open:y,title:M?`Rollback assistant`:c?`Update preview release`:`Update assistant`,message:M?`Rollback to version ${j??`unknown`}? The assistant will be briefly unavailable.`:c?`Update to preview version ${j??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${j??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:M?`Rollback`:c?`Update preview`:`Update`,onConfirm:async()=>{x(!1),T(null);let t=_??void 0;try{if(M){let e=await F.mutateAsync({version:t});m.current=e.version??t??null,D.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await P.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){D.warning(e.detail);return}m.current=e.version??t??null,D.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}C(M),p(!0),o.invalidateQueries({queryKey:Ce({path:{id:e}})})}catch{D.error(M?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>x(!1)})]})}function Pt(){let e=Je({platformHostedOnly:!0}),t=We(),n=G.use.user()?.id??null,r=G.use.logout(),[i,a]=(0,Z.useState)(!1),o=f({...ye(),onSuccess:async()=>{D.success(`Account deletion requested. You will be logged out shortly.`),U(n),await r(),ze(K.account.login)},onError:()=>{D.error(`Failed to request account deletion. Please try again.`)}}),s=e===`full`&&t;return(0,Z.useEffect)(()=>{s&&i&&a(!1)},[s,i]),e===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{title:`Delete Account`,subtitle:`Permanently delete your account and all associated data.`,variant:`danger`,children:e===`disabled`?(0,Q.jsx)(x,{tone:`info`,children:`Log in to the Vellum platform to delete your account.`}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(h,{variant:`dangerOutline`,onClick:()=>a(!0),disabled:o.isPending||s,className:`self-start`,children:`Delete My Account`}),s&&(0,Q.jsx)(I,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})}),(0,Q.jsx)(b,{open:i,title:`Delete Account`,message:`This will permanently delete your account and all associated data. This action cannot be undone.`,confirmLabel:`Delete Account`,destructive:!0,onConfirm:()=>{if(s){a(!1);return}a(!1),o.mutate({})},onCancel:()=>a(!1)})]})}function Ft({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(Y,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(h,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function It(){return at()?(0,Q.jsx)(Ft,{title:`Get the iOS App`,subtitle:`The Vellum iOS app gives you a native experience.`,benefits:[{icon:N,text:`Push notifications`},{icon:ft,text:`Biometric login`},{icon:pt,text:`Native haptics`},{icon:Me,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(Me,{size:16}),onAction:()=>{Re(),Ye()}}):null}function Lt({className:e}){return(0,Q.jsx)(`div`,{role:`presentation`,className:m(`h-px w-full bg-[var(--border-base)]`,e)})}var $=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Rt(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...$]}function zt(){return n(`mediaEmbedsEnabled`,!0)}function Bt(){let e=i(`mediaEmbedDomains`,``);return e?Rt(e):[...$]}function Vt(){let[e,n]=(0,Z.useState)(()=>zt()),[i,a]=(0,Z.useState)(()=>Bt()),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(``),u=(0,Z.useMemo)(()=>c.trim().toLowerCase(),[c]),d=e=>{n(e),t(`mediaEmbedsEnabled`,e)},f=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},p=()=>{if(u){if(i.includes(u)){l(``);return}f([...i,u]),l(``)}},m=e=>{f(i.filter(t=>t!==e))},g=()=>{f([...$])},_=i.length===$.length&&i.every((e,t)=>e===$[t]);return(0,Q.jsxs)(Y,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,Q.jsx)(w,{checked:e,onChange:d})]}),e&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Lt,{})}),(0,Q.jsxs)(h,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,Q.jsx)(qe,{className:`h-4 w-4`,"aria-hidden":!0}):(0,Q.jsx)(P,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,Q.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,Q.jsx)(C,{label:`Add Domain`,type:`text`,value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Q.jsx)(h,{variant:`primary`,size:`compact`,onClick:p,disabled:!u,children:`Add`})]}),i.length>0&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(h,{type:`button`,variant:`ghost`,size:`compact`,onClick:g,disabled:_,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,Q.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between rounded-md border border-[var(--border-base)] px-3 py-2 text-body-medium-lighter`,children:[(0,Q.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,Q.jsx)(h,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,Q.jsx)(Oe,{}),onClick:()=>m(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function Ht(e){return e===`preview`?`preview`:`stable`}function Ut(e){if(!e)return`Unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown`:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function Wt(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function Gt(e){return e.filter(e=>e.ready_to_use)}function Kt(e){return e?.feature_enabled===!1}function qt({assistantId:e,onComplete:t}){let n=J.use.previewChannel(),r=u(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=Ae({path:{assistant_id:e}}),y=st({path:{assistant_id:e}}),b=Ce({path:{id:e}}),{data:C,isLoading:w,isError:T}=d({..._,enabled:n,retry:!1}),E=C?.preview_backups??[],O=(0,Z.useMemo)(()=>Gt(E),[E]),k=O[0],A=O.find(e=>e.snapshot_name===h)??k,j=()=>{r.invalidateQueries({queryKey:y}),r.invalidateQueries({queryKey:b}),t?.()},M=f(we()),N=f(De()),P=Ht(C?.current_channel),F=M.isPending||N.isPending,ee=F||Kt(C)||!C?.latest_preview_release,L=p===`restore_backup`&&!A;if((0,Z.useEffect)(()=>{a(P===`preview`?`release-channel`:void 0)},[P]),!n)return null;let te=C?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(v.Root,{type:`single`,collapsible:!0,value:i,onValueChange:e=>a(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(v.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(v.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Release Channel`}),C&&(0,Q.jsx)(S,{tone:P===`preview`?`warning`:`neutral`,children:P===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(qe,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(v.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[w&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(I,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),T&&(0,Q.jsx)(x,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),C&&(0,Q.jsxs)(Q.Fragment,{children:[Kt(C)&&(0,Q.jsx)(x,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),P===`stable`?(0,Q.jsx)(Jt,{status:C,isChangingChannel:F,optInDisabled:ee,onOptIn:()=>s(!0)}):(0,Q.jsx)(Yt,{status:C,isChangingChannel:F,onOptOut:()=>{let e=k;g(e?.snapshot_name??``),m(e?`restore_backup`:te?`standard_upgrade`:`restore_backup`),l(!0)}})]})]})})]})}),(0,Q.jsx)(Zt,{open:o,isPending:M.isPending,previewVersion:C?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await M.mutateAsync({path:{assistant_id:e}});D.success(t.detail||`Preview channel enabled.`),s(!1),j()}catch(e){D.error(z(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(Qt,{open:c,backups:O,mode:p,selectedSnapshotName:A?.snapshot_name??``,isPending:N.isPending,restoreModeDisabled:L,standardUpgradeAvailable:te,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!L)try{let t=await N.mutateAsync({path:{assistant_id:e},body:p===`restore_backup`?{mode:`restore_backup`,snapshot_name:A?.snapshot_name}:{mode:`standard_upgrade`}});D.success(t.detail||`Stable channel enabled.`),l(!1),j()}catch(e){D.error(z(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>l(!1)})]})}function Jt({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Xt,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(x,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(h,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(ke,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function Yt({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(Xt,{status:e}),(0,Q.jsx)(h,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(Le,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function Xt({status:e}){return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Stable`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??`None`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Preview`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??`None`})]})]})}function Zt({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:ve,children:`Opt in to Preview`}),(0,Q.jsx)(E.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(x,{tone:`warning`,title:`Data loss may occur when returning to Stable`,children:`Preview data may not be compatible with the Stable channel. The safety backup lets you restore the Stable-channel data that existed before opt-in.`}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:`Create and verify a Preview safety backup.`}),(0,Q.jsxs)(`li`,{children:[`Switch to Preview image `,n??`latest`,`.`]}),(0,Q.jsx)(`li`,{children:`Run the normal upgrade path and wait for health.`})]})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(h,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(h,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(ke,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function Qt({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:s,onSnapshotChange:c,onConfirm:l,onCancel:u}){return(0,Q.jsx)(E.Root,{open:e,onOpenChange:e=>!e&&u(),children:(0,Q.jsxs)(E.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:ve,children:`Switch back to Stable`}),(0,Q.jsx)(E.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(_,{value:n,onValueChange:s,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(y,{value:`restore_backup`,disabled:t.length===0,label:`Restore safety backup`,helperText:`Return to the Stable-channel data captured before Preview opt-in.`}),(0,Q.jsx)(y,{value:`standard_upgrade`,disabled:!o,label:`Switch to Stable without restoring backup`,helperText:o?`Keep the current data and directly switch to the Stable image.`:`Unavailable because the latest Stable release is older than this assistant's Preview release.`})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[`Safety backup`,(0,Q.jsx)(g,{value:r,onChange:c,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${Wt(e)} - ${Ut(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(x,{tone:`error`,title:`Stable requires a safety backup`,children:`This Preview release is newer than the latest Stable release, so switching directly is blocked. Wait for a newer Stable release, or run Vellum Doctor if the safety backup is missing.`}),n===`standard_upgrade`&&(0,Q.jsx)(x,{tone:`error`,title:`Preview data may not survive this`,children:`Switching directly to the Stable image without restoring the safety backup may cause data loss or leave the assistant unusable if Preview data is incompatible with Stable.`})]})}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(h,{variant:`outlined`,disabled:i,onClick:u,children:`Cancel`}),(0,Q.jsx)(h,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(_e,{}),onClick:l,children:i?`Switching...`:`Switch to Stable`})]})]})})}function $t({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}){let o=c(),s=d(Ke()),u=s.data,p=!e.is_local,m=u?.plan_id===`pro`,_=d({...tt(),enabled:m}),v=e.machine_size||`small`,y=ee(_.data?.max_machine_tier??null),b=(0,Z.useMemo)(()=>te(y,v,(0,Q.jsx)(S,{tone:`positive`,children:`Current`})),[y,v]),C=_.data?.selected_storage_gib??null,[w,T]=(0,Z.useState)(!1),O=y.length>0?y[y.length-1]:null,[k,A]=(0,Z.useState)(null),j=k??O??v,[M,N]=(0,Z.useState)(null),[P,R]=(0,Z.useState)(null),z=f({...be(),onSuccess:(e,n)=>{D.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),R(null),A(null),T(!1),n.body?.machine_size==null?i():a(t)},onError:e=>{R(ie(e,`Failed to resize assistant. Please try again.`))}});if(s.isError&&u==null)return(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(x,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let B=m&&y.includes(j)&&j!==v?j:null,V=m&&C!=null&&!0,ae=m&&y.length>0&&re(v)<re(y[y.length-1]),H=z.isPending||r,oe=C==null?t?.disk?.totalMb??null:C*1024,U=t?.disk&&oe!=null?{value:t.disk.usedMb,max:oe,caption:`${X(t.disk.usedMb)} of ${X(oe)}`}:null,W=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,G=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${X(t.memory.currentMb)} of ${X(t.memory.maxMb)}`}:null,se=p?m?V?(0,Q.jsxs)(`button`,{type:`button`,disabled:H,onClick:()=>T(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(ot,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(h,{variant:`ghost`,size:`compact`,disabled:H,onClick:()=>T(!0),children:`Resize`}):(0,Q.jsx)(h,{variant:`ghost`,size:`compact`,onClick:()=>N(`storage`),children:`Resize`}):null,ce=p?m?ae?(0,Q.jsxs)(`button`,{type:`button`,disabled:H,onClick:()=>T(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(ot,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(h,{variant:`ghost`,size:`compact`,disabled:H,onClick:()=>T(!0),children:`Resize`}):(0,Q.jsx)(h,{variant:`ghost`,size:`compact`,onClick:()=>N(`machine`),children:`Resize`}):null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,compactAccessory:!0,accessory:(0,Q.jsx)(h,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(I,{className:`animate-spin`}):(0,Q.jsx)(_e,{}),tooltip:r?`Applying resize…`:`Refresh resource metrics`,"aria-label":`Refresh resource metrics`,disabled:n||r,onClick:()=>void i()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(F,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Disk`})]}),se]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Storage`}),U?(0,Q.jsx)(lt,{value:U.value,max:U.max,caption:U.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(I,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Unavailable`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Machine`}),(0,Q.jsx)(S,{tone:`neutral`,children:ne[v]})]}),ce]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`CPU`}),W?(0,Q.jsx)(lt,{value:W.value,max:W.max,caption:W.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(I,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Memory`}),G?(0,Q.jsx)(lt,{value:G.value,max:G.max,caption:G.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(I,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(E.Root,{open:M!=null,onOpenChange:e=>{e||N(null)},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{children:`Upgrade to Pro`}),(0,Q.jsx)(E.Description,{children:M===`storage`?`Upgrade to the Pro plan to increase your storage allocation and get more space for your assistant.`:`Upgrade to the Pro plan to unlock larger machine sizes with more CPU and memory for your assistant.`})]}),(0,Q.jsxs)(E.Footer,{children:[(0,Q.jsx)(h,{variant:`ghost`,onClick:()=>N(null),children:`Cancel`}),(0,Q.jsx)(h,{onClick:()=>{N(null),o(`${K.settings.billing}?adjust_plan=1`)},children:`Upgrade`})]})]})}),(0,Q.jsx)(E.Root,{open:w,onOpenChange:e=>{e||(T(!1),A(null),R(null))},children:(0,Q.jsxs)(E.Content,{size:`sm`,children:[(0,Q.jsxs)(E.Header,{children:[(0,Q.jsx)(E.Title,{icon:L,children:`Resize Assistant`}),(0,Q.jsx)(E.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(E.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[y.length===0?(0,Q.jsx)(x,{tone:`warning`,children:`No machine tier configured. Visit the community for help.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:`Machine Size`}),(0,Q.jsx)(g,{options:b,value:j,onChange:A,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),V?(0,Q.jsx)(x,{tone:`info`,children:`Storage will be expanded to ${C} GiB.`}):(0,Q.jsx)(x,{tone:`neutral`,children:`Storage will not change.`}),P&&(0,Q.jsx)(x,{tone:`error`,children:P})]})}),(0,Q.jsxs)(E.Footer,{className:`items-center justify-between`,children:[(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(l,{to:`${K.settings.billing}?adjust_plan=1`,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>T(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(h,{variant:`ghost`,onClick:()=>{T(!1),A(null),R(null)},children:`Cancel`}),(0,Q.jsx)(h,{disabled:B==null&&!V||H,leftIcon:H?(0,Q.jsx)(I,{className:`animate-spin`}):void 0,onClick:()=>{R(null);let t={};B!=null&&(t.machine_size=B),V&&C!=null&&(t.storage_gib=C),z.mutate({path:{id:e.id},body:t})},children:P?`Retry`:`Apply`})]})]})]})})]})}function en({assistantId:e}){let t=c(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(h,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(b,{open:n,title:`Retire Assistant`,message:`This will permanently retire this assistant and all of its data. You will need to go through the onboarding flow again to create a new one. This action cannot be undone.`,confirmLabel:`Retire`,destructive:!0,isPending:i,onConfirm:async()=>{a(!0);let n=await Ie(e);if(n.ok){r(!1),D.success(`Assistant retired.`),t(n.nextRoute,{replace:!0});return}D.error(n.error),a(!1),r(!1)},onCancel:()=>r(!1)})]})}var tn=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function nn(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...tn].sort()}function rn(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);if(n){let e=n[1]===`-`?-1:1,t=parseInt(n[2]??`0`,10),r=parseInt(n[3]??`0`,10);i=e*(t*60+r)}}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function an(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function on(e){if(!e)return`Not set`;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}function sn({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useMemo)(()=>nn().map(e=>rn(e)).filter(e=>e!==null),[]);(0,Z.useEffect)(()=>{let e=window.setTimeout(()=>{a(n.trim().toLowerCase())},200);return()=>window.clearTimeout(e)},[n]),(0,Z.useEffect)(()=>{if(!o)return;let e=e=>{c.current&&!c.current.contains(e.target)&&s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o]);let d=(0,Z.useMemo)(()=>i?u.filter(e=>e.city.toLowerCase().includes(i)||e.region.toLowerCase().includes(i)||e.offsetLabel.toLowerCase().includes(i)||e.identifier.toLowerCase().includes(i)):u,[u,i]),f=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]),p=e=>{t(e),r(``),s(!1),l.current?.blur()};return(0,Q.jsxs)(`div`,{ref:c,className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Closest city`}),(0,Q.jsxs)(`div`,{className:`relative w-full md:max-w-[280px]`,children:[(0,Q.jsx)(C,{ref:l,type:`text`,value:n,placeholder:f||`Search city or country...`,onChange:e=>{r(e.target.value),s(!0)},onFocus:()=>s(!0),onKeyDown:e=>{e.key===`Escape`&&(r(``),s(!1),l.current?.blur())},fullWidth:!0}),o&&d.length>0&&(0,Q.jsx)(`div`,{className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] overflow-y-auto rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,children:d.slice(0,200).map(t=>(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>p(t.identifier),className:`flex w-full cursor-pointer items-center justify-between gap-3 px-3 py-2 text-left text-body-medium-lighter transition-colors ${t.identifier===e?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-default)] hover:bg-[var(--surface-active)]`}`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:t.city}),t.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:t.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:an(t.identifier)}),(0,Q.jsx)(`span`,{children:t.offsetLabel})]})]},t.identifier))})]})]}),(0,Q.jsx)(Lt,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Time zone`}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:on(e)})]})]})}function cn(){let e=J.use.velvet(),[t,n]=(0,Z.useState)(()=>rt({velvetEnabled:e}));return(0,Z.useEffect)(()=>{n(rt({velvetEnabled:e}))},[e]),(0,Z.useEffect)(()=>a(`theme`,()=>{n(rt({velvetEnabled:e}))}),[e]),(0,Z.useEffect)(()=>{$e(t)},[t]),(0,Q.jsx)(Y,{title:`Theme`,children:(0,Q.jsx)(`div`,{className:`max-w-[360px]`,children:(0,Q.jsx)(T,{ariaLabel:`Theme`,value:t,onChange:e=>{n(e),Ue(e),$e(e)},items:[{value:`system`,label:`System`,icon:(0,Q.jsx)(Ge,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)(xe,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(He,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(Ze,{className:`h-4 w-4`})}]:[]]})})})}function ln(){let e=j.use.activeAssistantId(),[t,n]=(0,Z.useState)(()=>i(`timezone`,``)),a=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{a.current=e},[e]);let s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=e=>{if(s.current){c.current=e;return}let t=a.current;if(!t){c.current=null;return}s.current=!0,c.current=null,ce.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{o(e,{context:`settings-timezone-override`})}).finally(()=>{s.current=!1;let e=c.current;c.current=null,e!==null&&l.current(e)})};return(0,Z.useEffect)(()=>{l.current=u}),(0,Q.jsx)(Y,{title:`Timezone`,subtitle:`Used when displaying times and scheduling reminders.`,children:(0,Q.jsx)(sn,{value:t,onChange:e=>{n(e),r(`timezone`,e),u(e)}})})}function un(){let{assistant:e,assistantLoading:t,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}=ut(),s=pe.use.accountDeletion(),l=J.use.multiPlatformAssistant(),u=pe.use.settingsSleepPolicy(),d=oe(),f=c(),p=Je(),m=Je({platformHostedOnly:!0}),h=it(),g=Be({assistantId:e?.id??null,enabled:m===`full`&&h}),_=e?.is_local&&!k()?null:e,v=A(),y=k()&&!!e&&!!v&&O(v);return(0,Z.useEffect)(()=>{!e||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[e]),(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[g.status&&g.mode!==`inactive`&&(0,Q.jsx)(Ee,{status:g.status,mode:g.mode,isAcknowledging:g.isAcknowledging,acknowledgeError:g.acknowledgeError?.message??null,onAcknowledge:()=>void g.acknowledge(),onReviewWorkspaceData:()=>void f(K.workspace),onUpgradeStorage:m===`full`?()=>void f(`${K.settings.billing}?adjust_plan=1`):null}),(0,Q.jsx)(Y,{title:`General`,children:(0,Q.jsx)(dt,{assistant:_,assistantLoading:t,healthz:n,healthzLoading:r})}),d&&p===`full`&&(0,Q.jsx)(Tt,{assistant:_}),m===`full`&&e&&(0,Q.jsx)($t,{assistant:e,healthz:n,healthzLoading:r,healthzPolling:i,refetch:a,refetchUntilResized:o}),m===`disabled`&&(0,Q.jsx)(Y,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(x,{tone:`info`,children:`Log in to the Vellum platform to manage compute resources.`})}),(0,Q.jsx)(cn,{}),m===`full`&&_&&(0,Q.jsxs)(Y,{title:`Software Updates`,children:[(0,Q.jsx)(Nt,{assistantId:_.id,currentVersion:n?.version??_.current_release_version??null,releaseChannel:_.release_channel,onUpgradeComplete:()=>{a()}}),(0,Q.jsx)(qt,{assistantId:_.id,onComplete:()=>{a()}})]}),m===`disabled`&&(0,Q.jsx)(Y,{title:`Software Updates`,children:(0,Q.jsx)(x,{tone:`info`,children:`Log in to the Vellum platform to manage software updates.`})}),(0,Q.jsx)(It,{}),m===`full`&&_&&u&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(kt,{assistantId:_.id})}),m===`disabled`&&u&&(0,Q.jsx)(Y,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(x,{tone:`info`,children:`Log in to the Vellum platform to manage sleep policy.`})}),(0,Q.jsx)(ln,{}),(0,Q.jsx)(Vt,{}),l&&(0,Q.jsx)(Et,{}),(p===`full`||y)&&_&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(en,{assistantId:_.id})}),p===`disabled`&&!y&&(0,Q.jsx)(Y,{variant:`danger`,title:`Retire Assistant`,subtitle:`Permanently retire this assistant and delete all associated data.`,children:(0,Q.jsx)(x,{tone:`info`,children:`Log in to the Vellum platform to retire this assistant.`})}),s&&(0,Q.jsx)(Pt,{})]})}export{un as GeneralPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./capture-error-CZsNGL6n.js";import{t as r}from"./react-DJZBPgpf.js";import{d as i,m as a}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./button-DdEh-9f_.js";import{t as c}from"./progress-bar-BxeXgLhp.js";import{T as ee,_ as l,a as u,c as d,f,m as te,p as ne,x as p,y as m}from"./resolved-assistants-store-ub66utfl.js";import{r as h}from"./api-errors-ChauV4ed.js";import{B as g,G as re,J as ie,K as ae,T as oe,n as _,q as v}from"./auth-store-oleg80LZ.js";import{o as y,r as b}from"./api-DEEx3e9R.js";import{i as x}from"./routes-DMbyM_oF.js";import{a as S,i as se}from"./avatar-api-BwHmtSnS.js";import{t as C}from"./avatar-svg-compositor-krWs9LGY.js";import{Sr as ce,hr as w,pr as T,wr as E}from"./index-DM63H2B6.js";import{t as D}from"./onboarding-layout-BIVa2BnX.js";import{t as le}from"./provider-key-D_Hh-rHb.js";import{BUNDLED_COMPONENTS as O}from"./avatar-bundled-components-CrafToy8.js";var k=e(r(),1);function ue(e){let t=e=>e[Math.floor(Math.random()*e.length)];return{bodyShape:t(e.bodyShapes).id,eyeStyle:t(e.eyeStyles).id,color:t(e.colors).id}}var A=o(),j=3e3,M=800,N=3e5,P=null,F=null,I={initializing:0,provisioning:.33,connecting:.66,ready:1},L=1500,R={initializing:`Getting things ready…`,provisioning:`Setting up your assistant…`,connecting:`Connecting to your assistant…`,ready:`Ready`};function z(e,t,n){if(e>=t)return t;let r=1-(1-Math.min(1,n/L))**3;return e+(t-e)*r}function B(){let e=E(T(),{kind:`hatch-gate`});return e.action===`redirect`?{kind:`redirect`,to:e.to}:e.action===`wait`?{kind:`wait`}:{kind:`proceed`}}function V(){let e=i(),[r]=a(),o=r.get(`hosting`),T=f()&&o!==null&&o!==`vellum-cloud`,E=_.use.sessionStatus(),[L]=(0,k.useState)(()=>ue(O)),V=(0,k.useMemo)(()=>{let e=C(O,L.bodyShape,L.eyeStyle,L.color,320);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`},[L]),[H,U]=(0,k.useState)(`initializing`),[W,G]=(0,k.useState)(null),[de,K]=(0,k.useState)(!1),[fe,pe]=(0,k.useState)(0),[me,q]=(0,k.useState)(0),[he,J]=(0,k.useState)(0),Y=(0,k.useRef)(H),X=(0,k.useRef)(0),Z=(0,k.useRef)(0),Q=(0,k.useRef)(0),$=(0,k.useCallback)(e=>{X.current=Q.current,Z.current=Date.now(),Y.current=e,U(e),J(e=>e+1)},[]);return(0,k.useEffect)(()=>{let r=B();if(r.kind===`redirect`){e(r.to,{replace:!0});return}if(r.kind===`wait`)return;K(!1);let i=!1,a=null,s=null,c=null,_=Date.now(),C=w(),E=()=>{try{ce(``)}catch(e){n(e,{context:`onboarding_mark_completed`})}q(1),Q.current=1,X.current=1,U(`ready`),Y.current=`ready`,s=setTimeout(()=>{i||(async()=>{if(await g.checkAssistant(),!i){if(oe()){g.markExpectingFirstMessage(),e(`${x.assistant}?onboarding=1`,{replace:!0});return}e(x.onboarding.prechat,{replace:!0})}})()},M)},D=async()=>{if($(`provisioning`),!T){try{let e=await b();if(!i&&e.ok&&v(e).kind===`active`){f()&&l({assistantId:e.data.id,cloud:`vellum`,runtimeUrl:d(),hatchedAt:new Date().toISOString()}),E();return}}catch{}if(i)return}if(T){try{P||=p(void 0,o===`docker`?`docker`:void 0);let e=await P;if(P=null,i)return;if(!e.ok){G(e.error??`Failed to hatch local assistant.`);return}await ne(),e.assistantId&&m(e.assistantId),$(`connecting`);let t=!1;for(;!i&&!t;){let e=u();if(e)try{let n=await fetch(`${e}/readyz`);if(n.ok){let e=await n.json();if(e&&typeof e==`object`&&`status`in e&&e.status===`ok`){ee(),await te(),t=!0;break}}}catch{}if(Date.now()-_>=N){G(`Your assistant is taking longer than expected. Please try again.`);return}await new Promise(e=>{c=setTimeout(e,j)}),c=null}if(i)return;if(e.assistantId)try{await le(e.assistantId)}catch(e){n(e,{context:`onboarding_apply_provider_key`})}E()}catch{if(P=null,i)return;G(`Failed to hatch local assistant. Check CLI logs for details.`)}return}try{F||=y(C?{version:C}:void 0);let e=await F;if(F=null,i)return;if(!e.ok){if(t(`Onboarding hatch request failed`,{level:`warning`,extra:{status:e.status,error:e.error}}),ae(e.status,e.error)){G(re),K(!0);return}if(!ie(e.status)){G(h(e.error,void 0,`Failed to start your assistant. Please try again.`));return}}}catch(e){if(F=null,n(e,{context:`onboarding_hatch_assistant`}),i)return}O(0)},O=e=>{i||(a=setTimeout(k,e))},k=async()=>{if(!i){if(Date.now()-_>=N){t(`Onboarding hatch wait exceeded timeout`,{level:`warning`,extra:{maxWaitMs:N}}),G(`Your assistant is taking longer than expected. Please try again.`);return}try{let e=await b();if(i)return;let t=v(e);if(t.kind===`active`){if(e.ok){let t=e.data.id;se(t).then(e=>{if(!e)return S(t,L)}).catch(e=>{n(e,{context:`onboarding_avatar_sync`})}),f()&&l({assistantId:t,cloud:`vellum`,runtimeUrl:d(),hatchedAt:new Date().toISOString()})}E();return}if(t.kind===`error`){G(t.message);return}t.kind!==`auto_hatch`&&Y.current===`provisioning`&&$(`connecting`),O(j)}catch(e){if(n(e,{context:`onboarding_poll_assistant`}),i)return;O(j)}}};return D(),()=>{i=!0,a&&clearTimeout(a),s&&clearTimeout(s),c&&clearTimeout(c)}},[fe,L,E,e,$,T]),(0,k.useEffect)(()=>{Z.current===0&&(Z.current=Date.now());let e,t=()=>{let n=Date.now()-Z.current,r=I[Y.current],i=z(X.current,r,n);Q.current=i,q(i),r-i>1e-6&&(e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[he]),W?(0,A.jsx)(D,{children:(0,A.jsxs)(`div`,{role:`alert`,className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 pb-40 text-center text-[var(--content-default)]`,children:[(0,A.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:`Something went wrong`}),(0,A.jsx)(`p`,{className:`mt-4 text-body-medium-lighter text-[var(--content-tertiary)]`,children:W}),de&&(0,A.jsxs)(`div`,{className:`mt-6 flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,A.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Get started today with a local assistant`}),(0,A.jsx)(s,{asChild:!0,variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,children:(0,A.jsx)(`a`,{href:`${window.location.origin}/download`,children:`Download the macOS app`})})]}),(0,A.jsx)(`img`,{src:V,alt:``,width:160,height:160,className:`my-16 onboarding-avatar-failed`}),(0,A.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col gap-2`,children:[(0,A.jsx)(s,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{X.current=0,Z.current=Date.now(),Y.current=`initializing`,Q.current=0,U(`initializing`),q(0),J(e=>e+1),G(null),K(!1),pe(e=>e+1)},children:`Try again`}),(0,A.jsx)(s,{variant:`outlined`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>void e(T?x.onboarding.hosting:x.onboarding.privacy,{replace:!0}),children:`Back`})]})]})}):(0,A.jsx)(D,{children:(0,A.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 pb-40 text-center text-[var(--content-default)]`,children:[(0,A.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:H===`ready`?`Your assistant is ready!`:`Waking up…`}),H!==`ready`&&(0,A.jsx)(`p`,{className:`mt-4 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Hang tight — your assistant will have a few questions for you once it's up.`}),(0,A.jsx)(`img`,{src:V,alt:``,width:160,height:160,className:`my-16 ${H===`ready`?`onboarding-avatar-awake`:`onboarding-avatar-pulse`}`}),(0,A.jsx)(c,{value:me,height:6,className:`w-full max-w-sm`,"aria-label":`Assistant startup progress`}),(0,A.jsx)(`p`,{className:`mt-3 text-body-small-default text-[var(--content-tertiary)]`,children:R[H]})]})})}export{V as HatchingScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as r}from"./QueryClientProvider-DNHWXaGq.js";import{t as i}from"./useQuery-D2zf6Uhu.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DFqQkJlk.js";import{n as s,t as c}from"./button-DdEh-9f_.js";import{t as l}from"./typography-Czgs_2w_.js";import{t as u}from"./menu-B79-l6IU.js";import{l as d,n as f}from"./src-Bb-Updum.js";import{t as p}from"./tag-Ccr7Quy6.js";import{t as m}from"./createLucideIcon-D6d6iDdi.js";import{t as h}from"./bell-C7RL04h4.js";import{t as g}from"./calendar-CP_Q3Aw6.js";import{t as _}from"./chevron-right-zTNPbA1m.js";import{t as v}from"./ellipsis-vertical-Dxg526It.js";import{t as ee}from"./globe-ByNYDdSW.js";import{t as te}from"./pencil-BA9LOIzP.js";import{t as ne}from"./target-BMMY7Kql.js";import{t as re}from"./wand-sparkles-DL9Oe56R.js";import{t as y}from"./x-BDqbYVtS.js";import{b as ie,x as ae}from"./react-query.gen-B8xaBreR.js";import{y as oe}from"./auth-store-B42fGh_X.js";import{i as b}from"./routes-DC3Pv2Da.js";import{n as x}from"./use-is-mobile-D_xrnINF.js";import{t as S}from"./viewer-store-CYMgwLgL.js";import{t as C}from"./conversation-store-BEgf__eu.js";import{$n as se,Aa as ce,Ai as w,Bi as le,Da as ue,Fn as de,G as fe,Gi as pe,Hi as me,Ii as T,In as he,Ja as ge,Jn as _e,Ka as ve,Ki as ye,Li as E,Ln as be,Ma as D,Mi as O,Ni as k,Pa as A,Pi as j,Qi as M,Rn as N,Ui as xe,Wa as Se,Wi as P,Yi as F,Yn as I,Z as Ce,_a as L,_o as we,ba as Te,bi as Ee,ca as De,ea as Oe,fa as R,ga as ke,ia as Ae,io as je,ja as Me,ka as Ne,ki as Pe,kn as Fe,ma as Ie,na as Le,no as Re,sa as ze,wi as Be,xa as Ve,xi as He,ya as Ue,zn as We}from"./index-huyA6GAA.js";import{t as Ge}from"./use-active-assistant-id-DpqDbjpv.js";import{n as Ke,t as qe}from"./lib-B8eh8Q36.js";import{n as z,r as B}from"./format-date-lYqfuFdi.js";var Je=m(`alarm-clock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),Ye=m(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Xe=m(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Ze=m(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),Qe=m(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),V=m(`mail-open`,[[`path`,{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`,key:`1jhwl8`}],[`path`,{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`,key:`1qfld7`}]]),$e=m(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),et=m(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),H=e(t(),1),U=a(),W={security:{icon:me,strong:`var(--feed-nudge-strong)`,weak:`var(--feed-nudge-weak)`},email:{icon:L,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`},scheduling:{icon:Re,strong:`var(--feed-thread-strong)`,weak:`var(--feed-thread-weak)`},background:{icon:P,strong:`var(--system-info-strong)`,weak:`var(--system-info-weak)`},system:{icon:h,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`}},tt=[`security`,`email`,`scheduling`,`background`,`system`];function G({icon:e,iconColor:t,bgColor:n,isSelected:r,label:i,onClick:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,onClick:a,className:o(`flex shrink-0 cursor-pointer items-center justify-center rounded-full transition-opacity`,r?`opacity-100`:`opacity-50 hover:opacity-75`),style:{width:26,height:26,backgroundColor:n},children:(0,U.jsx)(e,{width:12,height:12,style:{color:t},"aria-hidden":`true`})})}function nt({categories:e,activeFilter:t,onFilterChange:n}){let r=tt.filter(t=>e.includes(t));return r.length<=1?null:(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)] overflow-x-auto`,children:[(0,U.jsx)(l,{variant:`body-small-default`,className:`shrink-0 text-[var(--content-tertiary)]`,children:`Filter:`}),(0,U.jsx)(G,{icon:Ue,iconColor:`var(--content-secondary)`,bgColor:`var(--surface-overlay)`,isSelected:t===null,label:`All`,onClick:()=>n(null)}),r.map(e=>{let r=W[e];return(0,U.jsx)(G,{icon:r.icon,iconColor:r.strong,bgColor:r.weak,isSelected:t===e,label:e.charAt(0).toUpperCase()+e.slice(1),onClick:()=>n(e)},e)})]})}function rt(e,t){!t||!oe()||(e.preventDefault(),Ce(t))}var it={p:({children:e})=>(0,U.jsx)(`p`,{className:`mb-2 text-body-medium-default last:mb-0`,style:{color:`var(--content-secondary)`},children:e}),strong:({children:e})=>(0,U.jsx)(`strong`,{style:{color:`var(--content-default)`},children:e}),em:({children:e})=>(0,U.jsx)(`em`,{style:{color:`var(--content-default)`},children:e}),a:({href:e,children:t})=>(0,U.jsx)(`a`,{href:e,className:`underline`,style:{color:`var(--content-link)`},target:`_blank`,rel:`noopener noreferrer`,onClick:t=>rt(t,e),children:t}),ul:({children:e})=>(0,U.jsx)(`ul`,{className:`mb-2 list-disc pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),ol:({children:e})=>(0,U.jsx)(`ol`,{className:`mb-2 list-decimal pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),li:({children:e})=>(0,U.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e})=>(0,U.jsx)(`code`,{className:`rounded px-1 py-0.5 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 8%, transparent)`,color:`var(--content-default)`},children:e}),pre:({children:e})=>(0,U.jsx)(`pre`,{className:`mb-2 overflow-x-auto rounded p-3 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`,color:`var(--content-default)`},children:e}),h1:({children:e})=>(0,U.jsx)(`h1`,{className:`mb-2 text-title-medium first:mt-0`,style:{color:`var(--content-default)`},children:e}),h2:({children:e})=>(0,U.jsx)(`h2`,{className:`mb-2 text-title-small first:mt-0`,style:{color:`var(--content-default)`},children:e}),h3:({children:e})=>(0,U.jsx)(`h3`,{className:`mb-1 text-body-medium-default first:mt-0`,style:{color:`var(--content-default)`},children:e}),blockquote:({children:e})=>(0,U.jsx)(`blockquote`,{className:`mb-2 border-l-2 pl-3 text-body-medium-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:e}),table:({children:e})=>(0,U.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,U.jsx)(`table`,{className:`w-full border-collapse text-body-small-default`,style:{color:`var(--content-secondary)`},children:e})}),thead:({children:e})=>(0,U.jsx)(`thead`,{style:{backgroundColor:`var(--surface-lift)`},children:e}),tbody:({children:e})=>(0,U.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,U.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:e}),th:({children:e})=>(0,U.jsx)(`th`,{className:`px-2 py-1.5 text-left font-semibold`,style:{color:`var(--content-default)`},children:e}),td:({children:e})=>(0,U.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:e})};function at({content:e,className:t}){return(0,U.jsx)(`div`,{className:o(`text-body-medium-default`,t),children:(0,U.jsx)(Ke,{remarkPlugins:[qe],components:it,children:e})})}function K({item:e}){return(0,U.jsx)(at,{content:e.summary})}function ot(e){switch(e){case`revoked`:case`expired`:return`var(--system-negative-strong)`;case`missing_scopes`:case`missing_token`:case`ping_failed`:return`var(--system-mid-strong)`;default:return`var(--content-disabled)`}}function st(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function q({item:e}){let t=e.metadata,n=t?.provider;if(!n)return(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:e.title??e.summary});let r=t?.accountInfo??null,i=t?.status??`unreachable`,a=t?.details??``,o=Array.isArray(t?.missingScopes)?t.missingScopes:[];return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(l,{variant:`title-small`,as:`h3`,children:n}),r?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:r}):null,(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[(0,U.jsx)(`span`,{className:`inline-block shrink-0 rounded-full`,style:{width:8,height:8,backgroundColor:ot(i)},"aria-hidden":`true`}),(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:st(i)})]}),a?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:a}):null,o.length>0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:[(0,U.jsx)(l,{variant:`body-small-emphasised`,className:`text-[var(--content-secondary)]`,children:`Missing scopes`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-[var(--app-spacing-xxs)] pl-[var(--app-spacing-lg)]`,children:o.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(l,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e})},e))})]}):null]})}function ct(e){return e&&W[e]?W[e]:W.system}function J({item:e,isMobile:t,validConversationIds:n,onClose:r,onGoToThread:i,onUpdateStatus:a,onDismiss:o}){if(!e)return null;let s=e.detailPanel?.kind,d=ct(e.category),f=d.icon,m=e.status===`new`,h=e.status===`dismissed`,g=!!e.conversationId&&n.has(e.conversationId);return t?(0,U.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)]`,children:[(0,U.jsxs)(`div`,{className:`relative flex shrink-0 items-center px-3 py-2`,children:[(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(we,{}),onClick:r,"aria-label":`Back`,tooltip:`Back`}),(0,U.jsx)(l,{variant:`body-medium-default`,className:`pointer-events-none absolute inset-x-0 text-center text-[var(--content-secondary)]`,children:`Details`}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,U.jsx)(c,{variant:`ghost`,iconOnly:m?(0,U.jsx)(V,{}):(0,U.jsx)(L,{}),onClick:()=>a(e.id,m?`seen`:`new`),"aria-label":m?`Mark as read`:`Mark as unread`,tooltip:m?`Mark as read`:`Mark as unread`}),h?(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(F,{}),onClick:()=>a(e.id,`seen`),"aria-label":`Restore`,tooltip:`Restore`}):(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(w,{}),onClick:()=>o(e.id),"aria-label":`Dismiss`,tooltip:`Dismiss`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:40,height:40,backgroundColor:d.weak},"aria-hidden":`true`,children:(0,U.jsx)(f,{width:18,height:18,style:{color:d.strong}})}),(0,U.jsx)(l,{variant:`title-small`,className:`min-w-0 text-[var(--content-default)]`,children:e.title??e.summary}),(0,U.jsx)(p,{tone:`neutral`,className:`shrink-0`,title:z(e.timestamp),children:B(e.timestamp)})]}),(0,U.jsx)(`div`,{className:`mx-4 border-b border-[var(--border-disabled)]`}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:s===`toolPermission`?(0,U.jsx)(q,{item:e}):(0,U.jsx)(K,{item:e})}),g?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-4 pt-2`,children:(0,U.jsx)(c,{variant:`primary`,fullWidth:!0,onClick:()=>i(e.conversationId),children:`Go to Conversation`})}):null]}):(0,U.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--radius-lg)] border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)] border-b border-[var(--border-base)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)]`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:28,height:28,backgroundColor:d.weak},"aria-hidden":`true`,children:(0,U.jsx)(f,{width:14,height:14,style:{color:d.strong}})}),(0,U.jsx)(l,{variant:`title-small`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:e.title??e.summary}),(0,U.jsx)(p,{tone:`neutral`,className:`shrink-0`,title:z(e.timestamp),children:B(e.timestamp)}),g?(0,U.jsx)(c,{variant:`outlined`,size:`compact`,onClick:()=>i(e.conversationId),children:`Go to Convo`}):null,(0,U.jsxs)(u.Root,{children:[(0,U.jsx)(u.Trigger,{children:(0,U.jsx)(c,{variant:`outlined`,size:`compact`,iconOnly:(0,U.jsx)(v,{}),"aria-label":`More actions`,tooltip:`More actions`})}),(0,U.jsx)(u.Content,{align:`end`,children:h?(0,U.jsx)(u.Item,{onSelect:()=>a(e.id,`seen`),leftIcon:(0,U.jsx)(F,{className:`size-4`}),children:`Restore`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(u.Item,{onSelect:()=>a(e.id,m?`seen`:`new`),leftIcon:m?(0,U.jsx)(V,{className:`size-4`}):(0,U.jsx)(L,{className:`size-4`}),children:m?`Mark as read`:`Mark as unread`}),(0,U.jsx)(u.Item,{onSelect:()=>o(e.id),leftIcon:(0,U.jsx)(je,{className:`size-4`}),children:`Dismiss`})]})})]}),(0,U.jsx)(c,{variant:`outlined`,size:`compact`,iconOnly:(0,U.jsx)(y,{}),onClick:r,"aria-label":`Close detail panel`,tooltip:`Close`})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-[var(--app-spacing-lg)]`,children:s===`toolPermission`?(0,U.jsx)(q,{item:e}):(0,U.jsx)(K,{item:e})})]})}function Y({label:e,onClick:t,className:n,children:r}){return(0,U.jsx)(s,{content:e,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":e,onClick:e=>{e.stopPropagation(),t()},className:o(`cursor-pointer text-[var(--content-disabled)] transition-colors hover:text-[var(--content-secondary)]`,n),children:r})})}function lt(e){return e&&W[e]?W[e]:W.system}function X({item:e,isActive:t=!1,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:a,onGoToThread:s,trailingAction:c=`dismiss`}){let[l,u]=(0,H.useState)(!1),d=lt(e.category),f=d.icon,p=e.status===`new`,m=c===`restore`;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:o(`flex w-full cursor-pointer items-center gap-[var(--app-spacing-sm)]`,`rounded-[var(--radius-md)] px-[var(--app-spacing-md)] py-[var(--app-spacing-sm)]`,`transition-[background-color,opacity] duration-150`,t?`bg-[var(--surface-active)]`:l?`bg-[var(--surface-lift)]`:`bg-[var(--surface-overlay)]`,!p&&!t&&`opacity-70`),children:[(0,U.jsxs)(`span`,{className:`relative shrink-0`,"aria-hidden":`true`,children:[(0,U.jsx)(`span`,{className:`flex items-center justify-center rounded-full`,style:{width:26,height:26,backgroundColor:d.weak},children:(0,U.jsx)(f,{width:12,height:12,style:{color:d.strong}})}),p&&(0,U.jsx)(`span`,{className:`absolute -left-0.5 -top-0.5 h-2 w-2 rounded-full bg-[var(--system-mid-strong)]`})]}),(0,U.jsx)(`span`,{className:o(`text-body-medium-default min-w-0 flex-1 truncate text-left`,`text-[var(--content-secondary)]`),children:e.title??e.summary}),l&&!m?(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-[var(--app-spacing-sm)]`,children:[a&&(0,U.jsx)(Y,{label:p?`Mark as read`:`Mark as unread`,onClick:()=>a(e.id,p?`seen`:`new`),children:p?(0,U.jsx)(V,{width:14,height:14}):(0,U.jsx)(L,{width:14,height:14})}),s&&e.conversationId&&(!n||n.has(e.conversationId))&&(0,U.jsx)(Y,{label:`Go to thread`,onClick:()=>{p&&a&&a(e.id,`seen`),s(e.conversationId)},children:(0,U.jsx)(R,{width:14,height:14})}),(0,U.jsx)(Y,{label:`Dismiss`,onClick:()=>i(e.id),children:(0,U.jsx)(w,{width:14,height:14})})]}):l&&m?(0,U.jsxs)(Y,{label:`Restore`,onClick:()=>i(e.id),className:`flex shrink-0 items-center gap-[var(--app-spacing-xs)]`,children:[(0,U.jsx)(F,{width:14,height:14,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`text-body-small-default`,children:`Restore`})]}):(0,U.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:B(e.timestamp)})]})}function ut(e){return[...e].sort((e,t)=>e.priority===t.priority?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():t.priority-e.priority)}function dt(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),i={today:[],yesterday:[],older:[]};for(let t of e){let e=new Date(t.createdAt);e>=n?i.today.push(t):e>=r?i.yesterday.push(t):i.older.push(t)}let a=new Map;return i.today.length>0&&a.set(`today`,i.today),i.yesterday.length>0&&a.set(`yesterday`,i.yesterday),i.older.length>0&&a.set(`older`,i.older),a}function ft(e,t){return t===null?e:e.filter(e=>(e.category??`system`)===t)}function pt(e){return e.filter(e=>e.urgency!==`high`&&e.urgency!==`critical`)}function mt(e){let t=new Set;for(let n of e)t.add(n.category??`system`);return[...t]}var ht={today:`Today`,yesterday:`Yesterday`,older:`Older`};function gt({items:e,selectedItemId:t,validConversationIds:n,onSelectItem:r,onDismissItem:i,onRestoreItem:a,onToggleRead:o,onGoToThread:s}){let[c,u]=(0,H.useState)(null),d=pt(e.filter(e=>e.status!==`dismissed`)),p=mt(d),m=c&&p.includes(c)?c:null;c!==m&&u(m);let h=dt(ut(ft(d,m))),g=e.filter(e=>e.status===`dismissed`).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-lg)]`,children:[(0,U.jsx)(nt,{categories:p,activeFilter:m,onFilterChange:u}),h.size===0?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`py-[var(--app-spacing-xl)] text-center text-[var(--content-disabled)]`,children:m?`No items match the selected filter.`:`No items to show.`}):[...h.entries()].map(([e,a])=>(0,U.jsxs)(`section`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(l,{variant:`body-small-default`,as:`h3`,className:`text-[var(--content-tertiary)]`,children:ht[e]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:a.map(e=>(0,U.jsx)(X,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})]},e)),g.length>0&&(0,U.jsx)(f.Root,{type:`single`,collapsible:!0,children:(0,U.jsxs)(f.Item,{value:`dismissed`,children:[(0,U.jsxs)(f.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,U.jsx)(_,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,U.jsxs)(`span`,{children:[`Dismissed (`,g.length,`)`]})]}),(0,U.jsx)(f.Content,{children:(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)] pt-[var(--app-spacing-sm)]`,children:g.map(e=>(0,U.jsx)(X,{item:e,onSelect:r,onDismiss:a,trailingAction:`restore`},e.id))})})]})})]})}function _t(e){let t=e.getHours();return t>=5&&t<12?`Good morning`:t>=12&&t<17?`Good afternoon`:t>=17&&t<22?`Good evening`:`Welcome back`}function vt({avatarComponents:e,avatarTraits:t,avatarImageUrl:n,greeting:r,isMobile:i,onStartNewChat:a}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-[var(--app-spacing-md)]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(fe,{components:e,traits:t,customImageUrl:n,size:36}),(0,U.jsx)(l,{variant:`title-large`,as:`h1`,className:`truncate`,children:r||_t(new Date)})]}),i?(0,U.jsx)(c,{variant:`primary`,iconOnly:(0,U.jsx)(T,{}),onClick:a,"aria-label":`New Chat`,tooltip:`New Chat`,className:`!rounded-full`}):(0,U.jsx)(c,{variant:`primary`,leftIcon:(0,U.jsx)(T,{}),onClick:a,children:`New Chat`})]})}var Z={AlarmClock:Je,Bell:h,BookOpen:Ye,Briefcase:Xe,Calendar:g,CheckSquare:et,Code:ge,Compass:ve,Cpu:Se,FileText:A,Flag:D,Folder:Me,Gamepad:ce,Gift:Ne,Globe:ee,GraduationCap:Ze,Heart:ue,Lightbulb:Ve,Link:Te,ListTodo:Qe,Mail:L,Map:ke,MessageCircle:Ie,MessageSquare:R,Music:De,Package:ze,Pencil:te,Phone:Ae,Pin:Le,Plane:$e,Plug:Oe,Puzzle:M,Search:ye,Send:pe,Settings:P,Share:xe,ShoppingCart:le,Sparkles:E,Star:j,Sun:k,Target:ne,Tag:O,TrendingUp:Pe,Users:Be,Wand2:re,Wrench:He,Zap:Ee};function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $(e){if(!e)return E;let t=Q(e);if(Z[t])return Z[t];let n=e.replace(/^lucide-/,``);if(n!==e){let e=Q(n);if(Z[e])return Z[e]}return E}function yt({suggestions:e,maxVisible:t=3,onSelect:n}){let[r,i]=(0,H.useState)(!1);if(r||e.length===0)return null;let a=e.slice(0,t);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)] rounded-2xl border border-[var(--border-disabled)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:`By the way, have you tried one of these:`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Dismiss suggestions`,className:`shrink-0 cursor-pointer text-[var(--content-disabled)] transition-colors hover:text-[var(--content-tertiary)]`,children:(0,U.jsx)(y,{className:`size-3.5`})})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-[var(--app-spacing-sm)]`,children:a.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`flex cursor-pointer items-center gap-[var(--app-spacing-xs)] rounded-full bg-[var(--surface-active)] py-1 pl-1 pr-3 text-[var(--content-default)] transition-colors hover:text-[var(--content-secondary)]`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full bg-[var(--surface-active)]`,style:{width:26,height:26},"aria-hidden":`true`,children:(0,U.jsx)($(e.icon),{className:`size-[18px]`})}),(0,U.jsx)(`span`,{className:`text-body-small-default`,children:e.label})]},e.id))})]})}function bt(e){let t=r(),n=(0,H.useMemo)(()=>ae({path:{assistant_id:e??``}}),[e]),a=i({...ie({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),o=(0,H.useCallback)(()=>{e&&t.invalidateQueries({queryKey:n})},[e,t,n]);return{...a,invalidate:o}}function xt(){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(`div`,{className:`size-9 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-7 w-64 animate-pulse rounded-md bg-[var(--surface-lift)]`})]}),(0,U.jsx)(`div`,{className:`h-9 w-28 animate-pulse rounded-md bg-[var(--surface-lift)]`})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`div`,{className:`h-8 w-36 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-8 w-28 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-8 w-32 animate-pulse rounded-full bg-[var(--surface-lift)]`})]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)]`,children:Array.from({length:4},(e,t)=>(0,U.jsx)(`div`,{className:`h-16 animate-pulse rounded-md bg-[var(--surface-lift)]`},t))})]})}function St({assistantId:e,validConversationIds:t,onStartNewChat:n,onOpenConversation:r,onSuggestionSelected:i}){let a=x(),o=_e(e),s=N(e);bt(e);let[c,l]=(0,H.useState)(null),u=(0,H.useCallback)(e=>{e.status===`new`?(l({...e,status:`seen`}),s.updateStatus.mutate({itemId:e.id,status:`seen`})):l(e)},[s.updateStatus]),f=(0,H.useCallback)(()=>{l(null)},[]),p=(0,H.useCallback)(e=>{s.updateStatus.mutate({itemId:e,status:`dismissed`}),c?.id===e&&l(null)},[s.updateStatus,c?.id]),m=(0,H.useCallback)(e=>{s.updateStatus.mutate({itemId:e,status:`seen`}),l(t=>t?.id===e?{...t,status:`seen`}:t)},[s.updateStatus]),h=(0,H.useCallback)((e,t)=>{s.updateStatus.mutate({itemId:e,status:t}),l(n=>n?.id===e?{...n,status:t}:n)},[s.updateStatus]),g=(0,H.useCallback)(e=>{l(null),r(e)},[r]),_=(0,H.useCallback)(e=>{i(e.prompt)},[i]),v=s.isLoading?(0,U.jsx)(xt,{}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(vt,{avatarComponents:o.components,avatarTraits:o.traits,avatarImageUrl:o.customImageUrl,greeting:s.data?.contextBanner?.greeting,isMobile:a,onStartNewChat:n}),s.isError?(0,U.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)] text-[var(--system-negative-strong)]`,children:[`Couldn't load home feed`,s.error instanceof Error?`: ${s.error.message}`:`.`]}):null,(0,U.jsx)(yt,{suggestions:s.data?.suggestedPrompts??[],maxVisible:a?2:3,onSelect:_}),(0,U.jsx)(gt,{items:s.data?.items??[],selectedItemId:c?.id,validConversationIds:t,onSelectItem:u,onDismissItem:p,onRestoreItem:m,onToggleRead:h,onGoToThread:g})]});return c&&a?(0,U.jsx)(`div`,{className:`fixed inset-0 z-30 bg-[var(--surface-overlay)]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`},children:(0,U.jsx)(J,{item:c,isMobile:!0,validConversationIds:t,onClose:f,onGoToThread:g,onUpdateStatus:h,onDismiss:p})}):c&&!a?(0,U.jsx)(d,{storageKey:`homeDetailPanelWidth`,defaultLeftPercent:50,minLeftWidth:400,minRightWidth:320,left:(0,U.jsx)(`div`,{className:`flex h-full flex-col gap-[var(--app-spacing-xl)] overflow-y-auto px-[var(--app-spacing-xl)] py-[var(--app-spacing-xxl)]`,children:v}),right:(0,U.jsx)(J,{item:c,validConversationIds:t,onClose:f,onGoToThread:g,onUpdateStatus:h,onDismiss:p})}):(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full max-w-[960px] px-[var(--app-spacing-xl)] py-[var(--app-spacing-xxl)]`,children:(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:v})})})}function Ct(){let e=n(),t=Ge(),r=We.use.setTopBarCenter(),i=x(),{conversations:a}=he(t),{conversations:o}=de(t,!0),{conversations:s}=be(t,!0),c=(0,H.useMemo)(()=>new Set(se(a,o,s).map(e=>e.conversationId)),[a,o,s]);return(0,H.useEffect)(()=>(r(i?(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:`Home`}):null),()=>{r(null)}),[i,r]),(0,U.jsx)(St,{assistantId:t,validConversationIds:c,onStartNewChat:()=>{S.getState().setMainView(`chat`);let t=I();C.getState().setActiveConversationId(t),e(b.conversation(t)),Fe()},onOpenConversation:t=>e(b.conversation(t)),onSuggestionSelected:t=>{S.getState().setMainView(`chat`);let n=I();C.getState().setActiveConversationId(n),e(`${b.conversation(n)}?prompt=${encodeURIComponent(t)}`)}})}export{Ct as HomePageRoute};
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{n as r}from"./QueryClientProvider-DNHWXaGq.js";import{t as i}from"./useQuery-D2zf6Uhu.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./cn-DFqQkJlk.js";import{n as s,t as c}from"./button-DdEh-9f_.js";import{t as l}from"./typography-Czgs_2w_.js";import{t as u}from"./menu-B79-l6IU.js";import{l as d,n as f}from"./src-hn7lwVCD.js";import{t as p}from"./tag-Ccr7Quy6.js";import{t as m}from"./createLucideIcon-D6d6iDdi.js";import{t as h}from"./bell-C7RL04h4.js";import{t as g}from"./calendar-CP_Q3Aw6.js";import{t as _}from"./chevron-right-zTNPbA1m.js";import{t as v}from"./ellipsis-vertical-Dxg526It.js";import{t as ee}from"./globe-ByNYDdSW.js";import{t as y}from"./pencil-BA9LOIzP.js";import{t as te}from"./target-BMMY7Kql.js";import{t as ne}from"./wand-sparkles-DL9Oe56R.js";import{t as b}from"./x-BDqbYVtS.js";import{b as re,x as ie}from"./react-query.gen-B8xaBreR.js";import{T as x}from"./auth-store-oleg80LZ.js";import{i as S}from"./routes-DMbyM_oF.js";import{n as C}from"./use-is-mobile-D_xrnINF.js";import{t as w}from"./viewer-store-Cc5YI5ay.js";import{t as T}from"./conversation-store-BEgf__eu.js";import{Bn as ae,Ca as oe,Ci as se,Ei as ce,Fi as le,Gi as ue,Hi as de,Hn as fe,Ia as pe,Ii as me,J as he,Ja as ge,Ji as _e,Ka as ve,Ki as E,Ma as ye,Mi as D,Mn as O,Na as k,Pa as A,Pi as j,Qn as M,Ri as N,Rn as P,Sa as be,Si as xe,Vn as Se,Wi as Ce,Xa as we,Zi as F,Zn as Te,ea as Ee,et as De,ga as Oe,ia as ke,io as Ae,ja as je,ji as Me,ka as Ne,la as Pe,ma as I,na as Fe,nr as Ie,oa as Le,oo as Re,qi as ze,ua as Be,va as Ve,xa as He,ya as L,yo as Ue,zi as R,zn as We}from"./index-DM63H2B6.js";import{t as Ge}from"./use-active-assistant-id-BIhArlF_.js";import{n as Ke,t as qe}from"./lib-B8eh8Q36.js";import{n as z,r as B}from"./format-date-lYqfuFdi.js";var Je=m(`alarm-clock`,[[`circle`,{cx:`12`,cy:`13`,r:`8`,key:`3y4lt7`}],[`path`,{d:`M12 9v4l2 2`,key:`1c63tq`}],[`path`,{d:`M5 3 2 6`,key:`18tl5t`}],[`path`,{d:`m22 6-3-3`,key:`1opdir`}],[`path`,{d:`M6.38 18.7 4 21`,key:`17xu3x`}],[`path`,{d:`M17.64 18.67 20 21`,key:`kv2oe2`}]]),Ye=m(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Xe=m(`briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Ze=m(`graduation-cap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),Qe=m(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),V=m(`mail-open`,[[`path`,{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`,key:`1jhwl8`}],[`path`,{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`,key:`1qfld7`}]]),$e=m(`plane`,[[`path`,{d:`M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z`,key:`1v9wt8`}]]),et=m(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),H=e(t(),1),U=a(),W={security:{icon:Ce,strong:`var(--feed-nudge-strong)`,weak:`var(--feed-nudge-weak)`},email:{icon:L,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`},scheduling:{icon:Ae,strong:`var(--feed-thread-strong)`,weak:`var(--feed-thread-weak)`},background:{icon:E,strong:`var(--system-info-strong)`,weak:`var(--system-info-weak)`},system:{icon:h,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`}},tt=[`security`,`email`,`scheduling`,`background`,`system`];function G({icon:e,iconColor:t,bgColor:n,isSelected:r,label:i,onClick:a}){return(0,U.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":r,onClick:a,className:o(`flex shrink-0 cursor-pointer items-center justify-center rounded-full transition-opacity`,r?`opacity-100`:`opacity-50 hover:opacity-75`),style:{width:26,height:26,backgroundColor:n},children:(0,U.jsx)(e,{width:12,height:12,style:{color:t},"aria-hidden":`true`})})}function nt({categories:e,activeFilter:t,onFilterChange:n}){let r=tt.filter(t=>e.includes(t));return r.length<=1?null:(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)] overflow-x-auto`,children:[(0,U.jsx)(l,{variant:`body-small-default`,className:`shrink-0 text-[var(--content-tertiary)]`,children:`Filter:`}),(0,U.jsx)(G,{icon:He,iconColor:`var(--content-secondary)`,bgColor:`var(--surface-overlay)`,isSelected:t===null,label:`All`,onClick:()=>n(null)}),r.map(e=>{let r=W[e];return(0,U.jsx)(G,{icon:r.icon,iconColor:r.strong,bgColor:r.weak,isSelected:t===e,label:e.charAt(0).toUpperCase()+e.slice(1),onClick:()=>n(e)},e)})]})}function rt(e,t){!t||!x()||(e.preventDefault(),De(t))}var it={p:({children:e})=>(0,U.jsx)(`p`,{className:`mb-2 text-body-medium-default last:mb-0`,style:{color:`var(--content-secondary)`},children:e}),strong:({children:e})=>(0,U.jsx)(`strong`,{style:{color:`var(--content-default)`},children:e}),em:({children:e})=>(0,U.jsx)(`em`,{style:{color:`var(--content-default)`},children:e}),a:({href:e,children:t})=>(0,U.jsx)(`a`,{href:e,className:`underline`,style:{color:`var(--content-link)`},target:`_blank`,rel:`noopener noreferrer`,onClick:t=>rt(t,e),children:t}),ul:({children:e})=>(0,U.jsx)(`ul`,{className:`mb-2 list-disc pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),ol:({children:e})=>(0,U.jsx)(`ol`,{className:`mb-2 list-decimal pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),li:({children:e})=>(0,U.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e})=>(0,U.jsx)(`code`,{className:`rounded px-1 py-0.5 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 8%, transparent)`,color:`var(--content-default)`},children:e}),pre:({children:e})=>(0,U.jsx)(`pre`,{className:`mb-2 overflow-x-auto rounded p-3 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`,color:`var(--content-default)`},children:e}),h1:({children:e})=>(0,U.jsx)(`h1`,{className:`mb-2 text-title-medium first:mt-0`,style:{color:`var(--content-default)`},children:e}),h2:({children:e})=>(0,U.jsx)(`h2`,{className:`mb-2 text-title-small first:mt-0`,style:{color:`var(--content-default)`},children:e}),h3:({children:e})=>(0,U.jsx)(`h3`,{className:`mb-1 text-body-medium-default first:mt-0`,style:{color:`var(--content-default)`},children:e}),blockquote:({children:e})=>(0,U.jsx)(`blockquote`,{className:`mb-2 border-l-2 pl-3 text-body-medium-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:e}),table:({children:e})=>(0,U.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,U.jsx)(`table`,{className:`w-full border-collapse text-body-small-default`,style:{color:`var(--content-secondary)`},children:e})}),thead:({children:e})=>(0,U.jsx)(`thead`,{style:{backgroundColor:`var(--surface-lift)`},children:e}),tbody:({children:e})=>(0,U.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,U.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:e}),th:({children:e})=>(0,U.jsx)(`th`,{className:`px-2 py-1.5 text-left font-semibold`,style:{color:`var(--content-default)`},children:e}),td:({children:e})=>(0,U.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:e})};function at({content:e,className:t}){return(0,U.jsx)(`div`,{className:o(`text-body-medium-default`,t),children:(0,U.jsx)(Ke,{remarkPlugins:[qe],components:it,children:e})})}function K({item:e}){return(0,U.jsx)(at,{content:e.summary})}function ot(e){switch(e){case`revoked`:case`expired`:return`var(--system-negative-strong)`;case`missing_scopes`:case`missing_token`:case`ping_failed`:return`var(--system-mid-strong)`;default:return`var(--content-disabled)`}}function st(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function q({item:e}){let t=e.metadata,n=t?.provider;if(!n)return(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:e.title??e.summary});let r=t?.accountInfo??null,i=t?.status??`unreachable`,a=t?.details??``,o=Array.isArray(t?.missingScopes)?t.missingScopes:[];return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(l,{variant:`title-small`,as:`h3`,children:n}),r?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:r}):null,(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[(0,U.jsx)(`span`,{className:`inline-block shrink-0 rounded-full`,style:{width:8,height:8,backgroundColor:ot(i)},"aria-hidden":`true`}),(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:st(i)})]}),a?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:a}):null,o.length>0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:[(0,U.jsx)(l,{variant:`body-small-emphasised`,className:`text-[var(--content-secondary)]`,children:`Missing scopes`}),(0,U.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-[var(--app-spacing-xxs)] pl-[var(--app-spacing-lg)]`,children:o.map(e=>(0,U.jsx)(`li`,{children:(0,U.jsx)(l,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e})},e))})]}):null]})}function ct(e){return e&&W[e]?W[e]:W.system}function J({item:e,isMobile:t,validConversationIds:n,onClose:r,onGoToThread:i,onUpdateStatus:a,onDismiss:o}){if(!e)return null;let s=e.detailPanel?.kind,d=ct(e.category),f=d.icon,m=e.status===`new`,h=e.status===`dismissed`,g=!!e.conversationId&&n.has(e.conversationId);return t?(0,U.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)]`,children:[(0,U.jsxs)(`div`,{className:`relative flex shrink-0 items-center px-3 py-2`,children:[(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(Ue,{}),onClick:r,"aria-label":`Back`,tooltip:`Back`}),(0,U.jsx)(l,{variant:`body-medium-default`,className:`pointer-events-none absolute inset-x-0 text-center text-[var(--content-secondary)]`,children:`Details`}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,U.jsx)(c,{variant:`ghost`,iconOnly:m?(0,U.jsx)(V,{}):(0,U.jsx)(L,{}),onClick:()=>a(e.id,m?`seen`:`new`),"aria-label":m?`Mark as read`:`Mark as unread`,tooltip:m?`Mark as read`:`Mark as unread`}),h?(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(F,{}),onClick:()=>a(e.id,`seen`),"aria-label":`Restore`,tooltip:`Restore`}):(0,U.jsx)(c,{variant:`ghost`,iconOnly:(0,U.jsx)(D,{}),onClick:()=>o(e.id),"aria-label":`Dismiss`,tooltip:`Dismiss`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:40,height:40,backgroundColor:d.weak},"aria-hidden":`true`,children:(0,U.jsx)(f,{width:18,height:18,style:{color:d.strong}})}),(0,U.jsx)(l,{variant:`title-small`,className:`min-w-0 text-[var(--content-default)]`,children:e.title??e.summary}),(0,U.jsx)(p,{tone:`neutral`,className:`shrink-0`,title:z(e.timestamp),children:B(e.timestamp)})]}),(0,U.jsx)(`div`,{className:`mx-4 border-b border-[var(--border-disabled)]`}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:s===`toolPermission`?(0,U.jsx)(q,{item:e}):(0,U.jsx)(K,{item:e})}),g?(0,U.jsx)(`div`,{className:`shrink-0 px-4 pb-4 pt-2`,children:(0,U.jsx)(c,{variant:`primary`,fullWidth:!0,onClick:()=>i(e.conversationId),children:`Go to Conversation`})}):null]}):(0,U.jsxs)(`div`,{className:`flex h-full flex-col rounded-[var(--radius-lg)] border border-[var(--border-base)] bg-[var(--surface-overlay)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)] border-b border-[var(--border-base)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)]`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:28,height:28,backgroundColor:d.weak},"aria-hidden":`true`,children:(0,U.jsx)(f,{width:14,height:14,style:{color:d.strong}})}),(0,U.jsx)(l,{variant:`title-small`,className:`min-w-0 flex-1 truncate text-[var(--content-default)]`,children:e.title??e.summary}),(0,U.jsx)(p,{tone:`neutral`,className:`shrink-0`,title:z(e.timestamp),children:B(e.timestamp)}),g?(0,U.jsx)(c,{variant:`outlined`,size:`compact`,onClick:()=>i(e.conversationId),children:`Go to Convo`}):null,(0,U.jsxs)(u.Root,{children:[(0,U.jsx)(u.Trigger,{children:(0,U.jsx)(c,{variant:`outlined`,size:`compact`,iconOnly:(0,U.jsx)(v,{}),"aria-label":`More actions`,tooltip:`More actions`})}),(0,U.jsx)(u.Content,{align:`end`,children:h?(0,U.jsx)(u.Item,{onSelect:()=>a(e.id,`seen`),leftIcon:(0,U.jsx)(F,{className:`size-4`}),children:`Restore`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(u.Item,{onSelect:()=>a(e.id,m?`seen`:`new`),leftIcon:m?(0,U.jsx)(V,{className:`size-4`}):(0,U.jsx)(L,{className:`size-4`}),children:m?`Mark as read`:`Mark as unread`}),(0,U.jsx)(u.Item,{onSelect:()=>o(e.id),leftIcon:(0,U.jsx)(Re,{className:`size-4`}),children:`Dismiss`})]})})]}),(0,U.jsx)(c,{variant:`outlined`,size:`compact`,iconOnly:(0,U.jsx)(b,{}),onClick:r,"aria-label":`Close detail panel`,tooltip:`Close`})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-[var(--app-spacing-lg)]`,children:s===`toolPermission`?(0,U.jsx)(q,{item:e}):(0,U.jsx)(K,{item:e})})]})}function Y({label:e,onClick:t,className:n,children:r}){return(0,U.jsx)(s,{content:e,children:(0,U.jsx)(`button`,{type:`button`,"aria-label":e,onClick:e=>{e.stopPropagation(),t()},className:o(`cursor-pointer text-[var(--content-disabled)] transition-colors hover:text-[var(--content-secondary)]`,n),children:r})})}function lt(e){return e&&W[e]?W[e]:W.system}function X({item:e,isActive:t=!1,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:a,onGoToThread:s,trailingAction:c=`dismiss`}){let[l,u]=(0,H.useState)(!1),d=lt(e.category),f=d.icon,p=e.status===`new`,m=c===`restore`;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(e),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:o(`flex w-full cursor-pointer items-center gap-[var(--app-spacing-sm)]`,`rounded-[var(--radius-md)] px-[var(--app-spacing-md)] py-[var(--app-spacing-sm)]`,`transition-[background-color,opacity] duration-150`,t?`bg-[var(--surface-active)]`:l?`bg-[var(--surface-lift)]`:`bg-[var(--surface-overlay)]`,!p&&!t&&`opacity-70`),children:[(0,U.jsxs)(`span`,{className:`relative shrink-0`,"aria-hidden":`true`,children:[(0,U.jsx)(`span`,{className:`flex items-center justify-center rounded-full`,style:{width:26,height:26,backgroundColor:d.weak},children:(0,U.jsx)(f,{width:12,height:12,style:{color:d.strong}})}),p&&(0,U.jsx)(`span`,{className:`absolute -left-0.5 -top-0.5 h-2 w-2 rounded-full bg-[var(--system-mid-strong)]`})]}),(0,U.jsx)(`span`,{className:o(`text-body-medium-default min-w-0 flex-1 truncate text-left`,`text-[var(--content-secondary)]`),children:e.title??e.summary}),l&&!m?(0,U.jsxs)(`span`,{className:`flex shrink-0 items-center gap-[var(--app-spacing-sm)]`,children:[a&&(0,U.jsx)(Y,{label:p?`Mark as read`:`Mark as unread`,onClick:()=>a(e.id,p?`seen`:`new`),children:p?(0,U.jsx)(V,{width:14,height:14}):(0,U.jsx)(L,{width:14,height:14})}),s&&e.conversationId&&(!n||n.has(e.conversationId))&&(0,U.jsx)(Y,{label:`Go to thread`,onClick:()=>{p&&a&&a(e.id,`seen`),s(e.conversationId)},children:(0,U.jsx)(I,{width:14,height:14})}),(0,U.jsx)(Y,{label:`Dismiss`,onClick:()=>i(e.id),children:(0,U.jsx)(D,{width:14,height:14})})]}):l&&m?(0,U.jsxs)(Y,{label:`Restore`,onClick:()=>i(e.id),className:`flex shrink-0 items-center gap-[var(--app-spacing-xs)]`,children:[(0,U.jsx)(F,{width:14,height:14,"aria-hidden":`true`}),(0,U.jsx)(`span`,{className:`text-body-small-default`,children:`Restore`})]}):(0,U.jsx)(`span`,{className:`shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:B(e.timestamp)})]})}function ut(e){return[...e].sort((e,t)=>e.priority===t.priority?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():t.priority-e.priority)}function dt(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),i={today:[],yesterday:[],older:[]};for(let t of e){let e=new Date(t.createdAt);e>=n?i.today.push(t):e>=r?i.yesterday.push(t):i.older.push(t)}let a=new Map;return i.today.length>0&&a.set(`today`,i.today),i.yesterday.length>0&&a.set(`yesterday`,i.yesterday),i.older.length>0&&a.set(`older`,i.older),a}function ft(e,t){return t===null?e:e.filter(e=>(e.category??`system`)===t)}function pt(e){return e.filter(e=>e.urgency!==`high`&&e.urgency!==`critical`)}function mt(e){let t=new Set;for(let n of e)t.add(n.category??`system`);return[...t]}var ht={today:`Today`,yesterday:`Yesterday`,older:`Older`};function gt({items:e,selectedItemId:t,validConversationIds:n,onSelectItem:r,onDismissItem:i,onRestoreItem:a,onToggleRead:o,onGoToThread:s}){let[c,u]=(0,H.useState)(null),d=pt(e.filter(e=>e.status!==`dismissed`)),p=mt(d),m=c&&p.includes(c)?c:null;c!==m&&u(m);let h=dt(ut(ft(d,m))),g=e.filter(e=>e.status===`dismissed`).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-lg)]`,children:[(0,U.jsx)(nt,{categories:p,activeFilter:m,onFilterChange:u}),h.size===0?(0,U.jsx)(l,{variant:`body-medium-lighter`,className:`py-[var(--app-spacing-xl)] text-center text-[var(--content-disabled)]`,children:m?`No items match the selected filter.`:`No items to show.`}):[...h.entries()].map(([e,a])=>(0,U.jsxs)(`section`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(l,{variant:`body-small-default`,as:`h3`,className:`text-[var(--content-tertiary)]`,children:ht[e]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:a.map(e=>(0,U.jsx)(X,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})]},e)),g.length>0&&(0,U.jsx)(f.Root,{type:`single`,collapsible:!0,children:(0,U.jsxs)(f.Item,{value:`dismissed`,children:[(0,U.jsxs)(f.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,U.jsx)(_,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,U.jsxs)(`span`,{children:[`Dismissed (`,g.length,`)`]})]}),(0,U.jsx)(f.Content,{children:(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)] pt-[var(--app-spacing-sm)]`,children:g.map(e=>(0,U.jsx)(X,{item:e,onSelect:r,onDismiss:a,trailingAction:`restore`},e.id))})})]})})]})}function _t(e){let t=e.getHours();return t>=5&&t<12?`Good morning`:t>=12&&t<17?`Good afternoon`:t>=17&&t<22?`Good evening`:`Welcome back`}function vt({avatarComponents:e,avatarTraits:t,avatarImageUrl:n,greeting:r,isMobile:i,onStartNewChat:a}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-[var(--app-spacing-md)]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(he,{components:e,traits:t,customImageUrl:n,size:36}),(0,U.jsx)(l,{variant:`title-large`,as:`h1`,className:`truncate`,children:r||_t(new Date)})]}),i?(0,U.jsx)(c,{variant:`primary`,iconOnly:(0,U.jsx)(N,{}),onClick:a,"aria-label":`New Chat`,tooltip:`New Chat`,className:`!rounded-full`}):(0,U.jsx)(c,{variant:`primary`,leftIcon:(0,U.jsx)(N,{}),onClick:a,children:`New Chat`})]})}var Z={AlarmClock:Je,Bell:h,BookOpen:Ye,Briefcase:Xe,Calendar:g,CheckSquare:et,Code:we,Compass:ge,Cpu:ve,FileText:pe,Flag:A,Folder:k,Gamepad:ye,Gift:je,Globe:ee,GraduationCap:Ze,Heart:Ne,Lightbulb:oe,Link:be,ListTodo:Qe,Mail:L,Map:Ve,MessageCircle:Oe,MessageSquare:I,Music:Be,Package:Pe,Pencil:y,Phone:Le,Pin:ke,Plane:$e,Plug:Fe,Puzzle:Ee,Search:_e,Send:ze,Settings:E,Share:ue,ShoppingCart:de,Sparkles:R,Star:me,Sun:le,Target:te,Tag:j,TrendingUp:Me,Users:ce,Wand2:ne,Wrench:se,Zap:xe};function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $(e){if(!e)return R;let t=Q(e);if(Z[t])return Z[t];let n=e.replace(/^lucide-/,``);if(n!==e){let e=Q(n);if(Z[e])return Z[e]}return R}function yt({suggestions:e,maxVisible:t=3,onSelect:n}){let[r,i]=(0,H.useState)(!1);if(r||e.length===0)return null;let a=e.slice(0,t);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)] rounded-2xl border border-[var(--border-disabled)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-tertiary)]`,children:`By the way, have you tried one of these:`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>i(!0),"aria-label":`Dismiss suggestions`,className:`shrink-0 cursor-pointer text-[var(--content-disabled)] transition-colors hover:text-[var(--content-tertiary)]`,children:(0,U.jsx)(b,{className:`size-3.5`})})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-[var(--app-spacing-sm)]`,children:a.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e),className:`flex cursor-pointer items-center gap-[var(--app-spacing-xs)] rounded-full bg-[var(--surface-active)] py-1 pl-1 pr-3 text-[var(--content-default)] transition-colors hover:text-[var(--content-secondary)]`,children:[(0,U.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full bg-[var(--surface-active)]`,style:{width:26,height:26},"aria-hidden":`true`,children:(0,U.jsx)($(e.icon),{className:`size-[18px]`})}),(0,U.jsx)(`span`,{className:`text-body-small-default`,children:e.label})]},e.id))})]})}function bt(e){let t=r(),n=(0,H.useMemo)(()=>ie({path:{assistant_id:e??``}}),[e]),a=i({...re({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),o=(0,H.useCallback)(()=>{e&&t.invalidateQueries({queryKey:n})},[e,t,n]);return{...a,invalidate:o}}function xt(){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-md)]`,children:[(0,U.jsx)(`div`,{className:`size-9 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-7 w-64 animate-pulse rounded-md bg-[var(--surface-lift)]`})]}),(0,U.jsx)(`div`,{className:`h-9 w-28 animate-pulse rounded-md bg-[var(--surface-lift)]`})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(`div`,{className:`h-8 w-36 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-8 w-28 animate-pulse rounded-full bg-[var(--surface-lift)]`}),(0,U.jsx)(`div`,{className:`h-8 w-32 animate-pulse rounded-full bg-[var(--surface-lift)]`})]}),(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)]`,children:Array.from({length:4},(e,t)=>(0,U.jsx)(`div`,{className:`h-16 animate-pulse rounded-md bg-[var(--surface-lift)]`},t))})]})}function St({assistantId:e,validConversationIds:t,onStartNewChat:n,onOpenConversation:r,onSuggestionSelected:i}){let a=C(),o=Te(e),s=Se(e);bt(e);let[c,l]=(0,H.useState)(null),u=(0,H.useCallback)(e=>{e.status===`new`?(l({...e,status:`seen`}),s.updateStatus.mutate({itemId:e.id,status:`seen`})):l(e)},[s.updateStatus]),f=(0,H.useCallback)(()=>{l(null)},[]),p=(0,H.useCallback)(e=>{s.updateStatus.mutate({itemId:e,status:`dismissed`}),c?.id===e&&l(null)},[s.updateStatus,c?.id]),m=(0,H.useCallback)(e=>{s.updateStatus.mutate({itemId:e,status:`seen`}),l(t=>t?.id===e?{...t,status:`seen`}:t)},[s.updateStatus]),h=(0,H.useCallback)((e,t)=>{s.updateStatus.mutate({itemId:e,status:t}),l(n=>n?.id===e?{...n,status:t}:n)},[s.updateStatus]),g=(0,H.useCallback)(e=>{l(null),r(e)},[r]),_=(0,H.useCallback)(e=>{i(e.prompt)},[i]),v=s.isLoading?(0,U.jsx)(xt,{}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(vt,{avatarComponents:o.components,avatarTraits:o.traits,avatarImageUrl:o.customImageUrl,greeting:s.data?.contextBanner?.greeting,isMobile:a,onStartNewChat:n}),s.isError?(0,U.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)] text-[var(--system-negative-strong)]`,children:[`Couldn't load home feed`,s.error instanceof Error?`: ${s.error.message}`:`.`]}):null,(0,U.jsx)(yt,{suggestions:s.data?.suggestedPrompts??[],maxVisible:a?2:3,onSelect:_}),(0,U.jsx)(gt,{items:s.data?.items??[],selectedItemId:c?.id,validConversationIds:t,onSelectItem:u,onDismissItem:p,onRestoreItem:m,onToggleRead:h,onGoToThread:g})]});return c&&a?(0,U.jsx)(`div`,{className:`fixed inset-0 z-30 bg-[var(--surface-overlay)]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`},children:(0,U.jsx)(J,{item:c,isMobile:!0,validConversationIds:t,onClose:f,onGoToThread:g,onUpdateStatus:h,onDismiss:p})}):c&&!a?(0,U.jsx)(d,{storageKey:`homeDetailPanelWidth`,defaultLeftPercent:50,minLeftWidth:400,minRightWidth:320,left:(0,U.jsx)(`div`,{className:`flex h-full flex-col gap-[var(--app-spacing-xl)] overflow-y-auto px-[var(--app-spacing-xl)] py-[var(--app-spacing-xxl)]`,children:v}),right:(0,U.jsx)(J,{item:c,validConversationIds:t,onClose:f,onGoToThread:g,onUpdateStatus:h,onDismiss:p})}):(0,U.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto`,children:(0,U.jsx)(`div`,{className:`mx-auto w-full max-w-[960px] px-[var(--app-spacing-xl)] py-[var(--app-spacing-xxl)]`,children:(0,U.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:v})})})}function Ct(){let e=n(),t=Ge(),r=fe.use.setTopBarCenter(),i=C(),{conversations:a}=We(t),{conversations:o}=P(t,!0),{conversations:s}=ae(t,!0),c=(0,H.useMemo)(()=>new Set(Ie(a,o,s).map(e=>e.conversationId)),[a,o,s]);return(0,H.useEffect)(()=>(r(i?(0,U.jsx)(l,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:`Home`}):null),()=>{r(null)}),[i,r]),(0,U.jsx)(St,{assistantId:t,validConversationIds:c,onStartNewChat:()=>{w.getState().setMainView(`chat`);let t=M();T.getState().setActiveConversationId(t),e(S.conversation(t)),O()},onOpenConversation:t=>e(S.conversation(t)),onSuggestionSelected:t=>{w.getState().setMainView(`chat`);let n=M();T.getState().setActiveConversationId(n),e(`${S.conversation(n)}?prompt=${encodeURIComponent(t)}`)}})}export{Ct as HomePageRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,m as r}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{T as o,t as s,w as c}from"./resolved-assistants-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,m as r}from"./chunk-5KNZJZUH-B4b1m-Ya.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./button-DdEh-9f_.js";import{T as o,t as s,w as c}from"./resolved-assistants-store-ub66utfl.js";import{r as l}from"./auth-store-oleg80LZ.js";import{i as u,n as d}from"./routes-DMbyM_oF.js";import{Ta as f,Za as p,fr as m,la as h}from"./index-DM63H2B6.js";import{t as g}from"./onboarding-layout-BIVa2BnX.js";import{r as _}from"./provider-key-D_Hh-rHb.js";import{t as v}from"./use-onboarding-login-CEqnm099.js";var y=e(t(),1),b=i(),x=`h-5 w-5 shrink-0 text-[var(--content-secondary)]`;function S(){let e=l(),t=m.use.multiPlatformAssistant(),n=s.use.assistants().some(e=>e.isPlatformHosted);return[{mode:`vellum-cloud`,label:`Vellum Cloud`,subtitle:`Always on, 24/7, even when your computer is off. Runs on Vellum's secure infrastructure.`,icon:(0,b.jsx)(p,{className:x}),...!e||!t&&n?{disabled:!0,badge:e?`Limit Reached`:`Requires Account`}:{}},{mode:`local`,label:`Local`,subtitle:`Runs directly on your machine. Your data never leaves your computer.`,icon:(0,b.jsx)(f,{className:x})},{mode:`docker`,label:`Docker`,subtitle:`Same privacy as local, but sandboxed using Docker for added isolation.`,icon:(0,b.jsx)(h,{className:x})}]}function C(){let e=n(),[t]=r(),i=t.get(`from`)===`select-assistant`,s=l(),f=S(),p=f.find(e=>e.mode===`vellum-cloud`)?.disabled,[m,h]=(0,y.useState)(s&&!p?`vellum-cloud`:`local`);(0,y.useEffect)(()=>{p&&m===`vellum-cloud`&&h(`local`)},[p,m]);let{loading:x,error:C,login:T,cancel:E}=v(`${u.onboarding.hosting}?from=select-assistant`),D=i&&!s;return(0,b.jsx)(g,{children:(0,b.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center px-6 pb-40 pt-16 text-[var(--content-default)]`,children:[(0,b.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Hosting`}),(0,b.jsx)(`p`,{className:`mt-3 text-body-medium-lighter text-[var(--content-tertiary)]`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Where do you want your assistant to live?`}),C&&(0,b.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:C}),(0,b.jsx)(`div`,{className:`mt-10 grid w-full auto-rows-fr gap-3`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:f.map(e=>(0,b.jsx)(w,{option:e,selected:m===e.mode,onSelect:()=>{e.disabled||h(e.mode)}},e.mode))}),(0,b.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[(0,b.jsx)(a,{variant:`primary`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{m===`vellum-cloud`?(o(),c(null),_(null),e(u.onboarding.privacy)):e(`${u.onboarding.apiKey}?hosting=${m}`)},children:`Continue`}),D&&(0,b.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:x?E:()=>void T(),children:x?`Cancel`:`Log In`}),(0,b.jsx)(a,{variant:`outlined`,size:`regular`,fullWidth:!0,className:`h-11 text-base`,onClick:()=>{e(i?u.onboarding.selectAssistant:u.onboarding.welcome)},disabled:x,children:`Back`})]}),(0,b.jsx)(`a`,{href:d(u.docs.hostingOptions),target:`_blank`,rel:`noreferrer`,className:`mt-6 text-body-medium-default text-[var(--content-default)] underline`,style:{animation:`fadeInUp 0.5s ease-out 0.6s both`},children:`Need help choosing?`})]})})}function w({option:e,selected:t,onSelect:n}){return(0,b.jsxs)(`button`,{type:`button`,onClick:n,disabled:e.disabled,className:`flex w-full items-center gap-4 rounded-xl border px-4 py-4 text-left transition-colors ${e.disabled?`cursor-not-allowed opacity-60`:`cursor-pointer`} ${t&&!e.disabled?`border-[var(--primary-base)] bg-[var(--primary-base)]/5`:`border-[var(--border-element)] bg-transparent`}`,children:[e.icon,(0,b.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.label}),e.badge&&(0,b.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:e.badge})]}),(0,b.jsx)(`span`,{className:`mt-0.5 line-clamp-2 text-body-small-default text-[var(--content-tertiary)]`,children:e.subtitle})]}),!e.disabled&&(0,b.jsx)(`div`,{className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 ${t?`border-[var(--primary-base)]`:`border-[var(--border-element)]`}`,children:t&&(0,b.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--primary-base)]`})})]})}export{C as HostingScreen};
|