@vellumai/web 0.10.10-staging.1 → 0.10.10-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-B8Z6QZKe.js → account-page-Cn_Ux2k8.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-DvbBzgps.js → acp-run-detail-panel-hdemc9Ns.js} +4 -4
- package/dist/assets/{activity-steps-panel-Cc6sOJ7O.js → activity-steps-panel-CJDoPVUC.js} +1 -1
- package/dist/assets/ai-page-DX1CAGiX.js +1 -0
- package/dist/assets/{api-key-screen-D7u7SPiq.js → api-key-screen-C0F9Kodk.js} +1 -1
- package/dist/assets/{background-task-detail-panel-BNb7N4q2.js → background-task-detail-panel-B3sQQ2WB.js} +1 -1
- package/dist/assets/{billing-page-QcfuHjR9.js → billing-page-DbgQl5CS.js} +2 -2
- package/dist/assets/{bookmarks-page-CRZqWo3d.js → bookmarks-page-Bg1kpqdy.js} +1 -1
- package/dist/assets/{channels-page-route-C_YBqGsE.js → channels-page-route-Cm7KQpHs.js} +2 -2
- package/dist/assets/{command-palette-y6-mfSgF.js → command-palette-B23DDF8y.js} +1 -1
- package/dist/assets/{command-palette-window-page-DUPyaVxH.js → command-palette-window-page-2gnvF4NV.js} +1 -1
- package/dist/assets/community-page-De9KLKyn.js +1 -0
- package/dist/assets/contacts-page-route-CZwZ6baw.js +1 -0
- package/dist/assets/{credentials-page-CvW82Tlz.js → credentials-page-st-zOas5.js} +1 -1
- package/dist/assets/{debug-page-CmPi5tnZ.js → debug-page-BhcVrLKj.js} +2 -2
- package/dist/assets/{deploy-dialogs-DaPjl9bW.js → deploy-dialogs-BJRrRbSc.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-DpEnEgJn.js → detail-panel-stop-button-c0oweWwM.js} +1 -1
- package/dist/assets/{developer-page-CV-CsA3N.js → developer-page-DRakR84C.js} +1 -1
- package/dist/assets/{dictation-overlay-page-g9BvDir_.js → dictation-overlay-page-jXIAQQGI.js} +1 -1
- package/dist/assets/{document-viewer-page-C5v8akIG.js → document-viewer-page-B6lpLvJw.js} +1 -1
- package/dist/assets/{emails-page-CtFCYDq9.js → emails-page-ChYRO5ST.js} +1 -1
- package/dist/assets/general-page-0F5njKZW.js +1 -0
- package/dist/assets/{hatching-screen-HNiZriOH.js → hatching-screen-CW3BRgRH.js} +1 -1
- package/dist/assets/home-page-route-D_8JCZ_Q.js +1 -0
- package/dist/assets/{hosting-screen-CkRQ1ibr.js → hosting-screen-DHETBcAy.js} +1 -1
- package/dist/assets/identity-page-route-B1o8eOMl.js +7 -0
- package/dist/assets/{index-CZVGv7Cn.js → index-CmaRQR9x.js} +28 -28
- package/dist/assets/index-yF00bLYk.css +2 -0
- package/dist/assets/{inspect-page-JQwJQ_Sl.js → inspect-page-Cj0WVion.js} +2 -2
- package/dist/assets/{integrations-page-FCrRTt2X.js → integrations-page-CH-pFd_e.js} +1 -1
- package/dist/assets/{intelligence-layout-AsbvHVqu.js → intelligence-layout-BHGZqgWE.js} +1 -1
- package/dist/assets/latest-assistant-text-DqYv-19M.js +24 -0
- package/dist/assets/{library-detail-page-Bcnsh9CI.js → library-detail-page-D1SaX446.js} +1 -1
- package/dist/assets/{library-page-DZduD_bA.js → library-page-CY_UIQ7K.js} +1 -1
- package/dist/assets/{logout-page-Buv0U8Wq.js → logout-page-BsVCSXLH.js} +1 -1
- package/dist/assets/{logs-layout-CaZNYn0T.js → logs-layout-D_7jq15m.js} +1 -1
- package/dist/assets/memory-page-route-BGWq_aq8.js +1 -0
- package/dist/assets/{memory-router-playground-page-CGIGEOgT.js → memory-router-playground-page-DThWyhXE.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-kwgBD2Oe.js → mobile-sidebar-drawer-XsUj_ej1.js} +1 -1
- package/dist/assets/{notifications-page-BhLbSbpe.js → notifications-page-4H3d3TVi.js} +1 -1
- package/dist/assets/{oauth-complete-page-Y9TaL3bP.js → oauth-complete-page-IYjT22S6.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-D9YtNVV9.js → oauth-popup-complete-page-B2tgdOeo.js} +1 -1
- package/dist/assets/{pairing-page-CYBL5nXH.js → pairing-page-BsGxP4RT.js} +1 -1
- package/dist/assets/personality-page-DWuNCYhT.js +1 -0
- package/dist/assets/{plugins-page-DtB-KvF9.js → plugins-page-O4J9g6Y8.js} +1 -1
- package/dist/assets/prechat-route-CoHHHLoD.js +1 -0
- package/dist/assets/privacy-page-DXHDyrXM.js +1 -0
- package/dist/assets/{privacy-screen-C4Y8Fzqr.js → privacy-screen-N6-nGjeG.js} +1 -1
- package/dist/assets/{provider-callback-page-DkUH2bax.js → provider-callback-page-B6zqXdPZ.js} +1 -1
- package/dist/assets/{quick-input-page--AKggGR2.js → quick-input-page-UeFQo32q.js} +1 -1
- package/dist/assets/{research-mock-page-DNVvgUNF.js → research-mock-page-DL9B4Lli.js} +1 -1
- package/dist/assets/research-onboarding-route-CEPszqjJ.js +42 -0
- package/dist/assets/{review-terms-screen-3Mt29KCp.js → review-terms-screen-CchSUndG.js} +1 -1
- package/dist/assets/schedules-page-Bj5HEJa-.js +1 -0
- package/dist/assets/{select-assistant-screen-DKEkfrzB.js → select-assistant-screen-BQLQKCB5.js} +1 -1
- package/dist/assets/{settings-layout-D5GIvMSd.js → settings-layout-Dr3LiWJ0.js} +1 -1
- package/dist/assets/{share-feedback-modal-Bns-AdW9.js → share-feedback-modal-DvC-1HRQ.js} +1 -1
- package/dist/assets/{sidebar-tree-DRAO8jjA.js → sidebar-tree-r9N8LP3u.js} +1 -1
- package/dist/assets/{signup-page-_JnnV0FO.js → signup-page-B7lZHfHL.js} +1 -1
- package/dist/assets/{skill-detail-page-DiV9u6T7.js → skill-detail-page-onU_WAHM.js} +1 -1
- package/dist/assets/{skill-detail-panel-Bevi3Lss.js → skill-detail-panel-r5S_O0rZ.js} +1 -1
- package/dist/assets/skills-page-Cf86q643.js +1 -0
- package/dist/assets/{start-screen-DfMdkCZZ.js → start-screen-kBX69v2m.js} +1 -1
- package/dist/assets/{subagent-detail-panel-B8XiU0Z-.js → subagent-detail-panel-D6oy2K_C.js} +2 -2
- package/dist/assets/{system-events-page-Bd7g4y5T.js → system-events-page-CXkh6imt.js} +1 -1
- package/dist/assets/{theme-stage-page-B72tB13w.js → theme-stage-page-B1KCcRzM.js} +1 -1
- package/dist/assets/{tiptap-document-editor-jTc6PPwp.js → tiptap-document-editor-BVFwGbyO.js} +1 -1
- package/dist/assets/{tool-detail-panel-DyCqe5Yq.js → tool-detail-panel-CI8Z5mU5.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CUl1Cass.js → upgrade-cancel-page-78mnz39g.js} +1 -1
- package/dist/assets/{upgrade-success-page-DKvgbJHK.js → upgrade-success-page-Dnqc4oxD.js} +1 -1
- package/dist/assets/use-assistant-identity-details-D0dDGwFZ.js +1 -0
- package/dist/assets/{use-edge-swipe-back-CaTk2Wz5.js → use-edge-swipe-back-CzIG6Agy.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-B6r6wWD7.js → use-invite-link-dialog-BLqplXYp.js} +1 -1
- package/dist/assets/{use-skill-actions-B443tGAI.js → use-skill-actions-B58D56j9.js} +1 -1
- package/dist/assets/{use-skill-categories-DsLNc-NO.js → use-skill-categories-BewT8dcB.js} +1 -1
- package/dist/assets/{use-skill-detail-files-BjQHazRM.js → use-skill-detail-files-S961Kf-o.js} +1 -1
- package/dist/assets/{voice-page-BiO7sMlu.js → voice-page-IaJC48fm.js} +1 -1
- package/dist/assets/{weather-forecast-display-CZLINMqN.js → weather-forecast-display-Cd2sZBmz.js} +1 -1
- package/dist/assets/{welcome-screen-CkOAvi7q.js → welcome-screen-CUTRt2OQ.js} +1 -1
- package/dist/assets/{workflow-detail-panel-PevRtp_O.js → workflow-detail-panel-BRYRq60N.js} +1 -1
- package/dist/assets/{workspace-page-D_ZIEJYY.js → workspace-page-DgDej6f2.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +1 -1
- package/dist/assets/ai-page-TYCxSdRA.js +0 -1
- package/dist/assets/community-page-JggT8MFi.js +0 -1
- package/dist/assets/contacts-page-route-q6JfNlkd.js +0 -1
- package/dist/assets/general-page-CBJ13Yzs.js +0 -1
- package/dist/assets/home-page-route-B5t1I9Kc.js +0 -1
- package/dist/assets/identity-page-route-BvdzgZ7m.js +0 -7
- package/dist/assets/index-BoLhUIgw.css +0 -2
- package/dist/assets/latest-assistant-text-BCjy0Q0O.js +0 -24
- package/dist/assets/memory-page-route-VwqOIgOs.js +0 -1
- package/dist/assets/personality-page-BuIF9LmP.js +0 -1
- package/dist/assets/prechat-route-Cn9TbGYd.js +0 -1
- package/dist/assets/privacy-page-wr_tX0w2.js +0 -1
- package/dist/assets/research-onboarding-route-CsLjEqSj.js +0 -42
- package/dist/assets/schedules-page-DWZ-lJ7j.js +0 -1
- package/dist/assets/skills-page-ano_t4YY.js +0 -1
- package/dist/assets/use-assistant-identity-details-CmAZ1Y2o.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-BQVYX8n_.js";import{m as r,u as i}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-D8zyWtZh.js";import{t as l}from"./check-wF3S-AV4.js";import{t as u}from"./chevron-left-B_RAz34t.js";import{t as d}from"./loader-circle-D57RZgLH.js";import{t as f}from"./pencil-DEevs4oD.js";import{t as p}from"./x-CswtfvgS.js";import{t as m}from"./input-ZpyYt_a0.js";import{l as h,p as g,s as _}from"./local-mode-hyYI6_OH.js";import{t as v}from"./is-electron-DBOtwp5h.js";import{n as y}from"./resolved-assistants-store-DdnJoLGS.js";import{A as b,S as x,a as S,k as C,n as w,o as T}from"./auth-store-B6EXnaee.js";import{t as E}from"./client.gen-DZZugzSk.js";import{m as ee}from"./native-biometric-gWkPFBiw.js";import{c as D}from"./routes-XPLb07Av.js";import{a as O,s as k}from"./prefs-wApndUEh.js";import{a as A}from"./platform-detection-1awANa55.js";import{t as j}from"./client-feature-flag-store-DeUwlUsr.js";import{n as te,t as M}from"./browser-JyOUYdam.js";import{c as N,l as ne,n as P,t as F}from"./prechat-P1y7ZM6C.js";import{Ct as re,b as ie,r as ae}from"./react-query.gen-BXPoln4i.js";import{t as I}from"./public-asset-Cr86Gucv.js";import{Dt as oe,M as se,N as L,Tt as R,_n as z,fn as ce,hn as B,it as le,j as ue,ka as V,mn as de,pn as fe,rt as pe,vn as H}from"./index-CZVGv7Cn.js";import{t as U}from"./onboarding-step-layout-2XcmxqFN.js";import{n as W,r as me}from"./prechat-names-clVy5Mee.js";import{t as G}from"./step-indicator-dots-D03TmFKG.js";var K=e(t(),1);async function he(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var q=s(),ge=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function _e({onComplete:e}){function t(){L(),ue(),e()}return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,q.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,q.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,q.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,q.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,q.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,q.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,q.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,q.jsx)(`ul`,{className:`space-y-4`,children:ge.map((e,t)=>(0,q.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,q.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,q.jsx)(l,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,q.jsxs)(`span`,{className:`text-left`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,q.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var J=`google`,ve=[{id:`gmail`,label:`Gmail`,logoSrc:I(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:I(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:I(`/images/integrations/google-drive.svg`)}];function ye({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=v(),c=a(),l=ee(),f=(0,K.useRef)(null),p=(0,K.useRef)(null),m=(0,K.useRef)(null),h=(0,K.useRef)(null),g=(0,K.useRef)(null),_=(0,K.useRef)(null),y=(0,K.useRef)(null),[b,S]=(0,K.useState)(!1),C=(0,K.useCallback)(()=>{p.current=null,S(!1)},[]),w=(0,K.useCallback)(()=>{g.current&&=(window.removeEventListener(`message`,g.current),null),_.current&&=(window.removeEventListener(`storage`,_.current),null)},[]),T=(0,K.useCallback)(()=>{f.current&&!f.current.closed&&f.current.close(),f.current=null,m.current&&=(clearInterval(m.current),null),h.current&&=(clearTimeout(h.current),null)},[]),E=re();(0,K.useEffect)(()=>()=>{m.current&&clearInterval(m.current),h.current&&clearTimeout(h.current),f.current&&!f.current.closed&&f.current.close(),g.current&&window.removeEventListener(`message`,g.current),_.current&&window.removeEventListener(`storage`,_.current),y.current&&=(y.current(),null)},[]);let O=(0,K.useCallback)(async e=>{try{return(await c.fetchQuery({...ie({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===J&&e.connected)??null}catch{return null}},[c]),k=(0,K.useCallback)(async()=>{let e=p.current?.platformAssistantId;T(),C(),r((e?await O(e):null)?.scopes_granted??[])},[C,T,O,r]),A=(0,K.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!p.current||e.requestId!==p.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,K.useCallback)(e=>{let t=p.current;if(!t)return;let n=ce(e,window.location.origin,t.requestId);n&&A(n)},[A]),N=(0,K.useCallback)(e=>{let t=p.current;if(!t)return;let n=fe(e,t.requestId);n&&(A(n),window.localStorage.removeItem(B(t.requestId)))},[A]);z((0,K.useCallback)(e=>{let t=p.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let ne=(0,K.useCallback)(()=>{let t=crypto.randomUUID();if(w(),g.current=j,_.current=N,l){S(!0),(async()=>{let n;try{n=await x(e)}catch{C();return}p.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:J},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){M(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,N),y.current&&y.current();let n=te(()=>{let e=p.current;if(!e){n(),y.current=null;return}(async()=>{let t=await O(e.platformAssistantId);p.current&&(t?await k():C(),w(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}f.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,N),m.current=setInterval(()=>{f.current&&f.current.closed&&p.current&&!h.current&&(h.current=setTimeout(async()=>{h.current=null;let e=p.current;if(!e)return;let t=window.localStorage.getItem(B(e.requestId));if(t)try{let n=JSON.parse(t);if(de(n,e.requestId)){A(n),window.localStorage.removeItem(B(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);p.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await x(e)}catch{T(),C(),w();return}p.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:J},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){f.current&&!f.current.closed?f.current.location.href=e.connect_url:p.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,N,k,l,w,E]),P=t||`your assistant`,F=t||`Your assistant`;return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${P} can use Gmail, Calendar, and Drive with your permission.`}),(0,q.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:ve.map(e=>(0,q.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,q.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,q.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${F} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,q.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:ne,disabled:b||E.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||E.isPending?(0,q.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,q.jsx)(d,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||E.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function be({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:d}){let f=v();return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,q.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}):null,(0,q.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,q.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,q.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(m,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:U,fullWidth:!0}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(m,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:U,fullWidth:!0}),(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,q.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,q.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:W.map(e=>(0,q.jsx)(xe,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,q.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function xe({group:e,isActive:t,onToggle:n}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,q.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function Se({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:d}){return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,q.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(u,{}),onClick:o,"aria-label":`Back`}):(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,q.jsx)(`div`,{className:`flex justify-center`,children:(0,q.jsx)(G,{current:l,total:d})}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,q.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,q.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,q.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(m,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:U,fullWidth:!0}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,q.jsx)(m,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:U,fullWidth:!0}),(0,q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,q.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,q.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Ce=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:I(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:I(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:I(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:I(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:I(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:I(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:I(`/images/prior-assistants/copilot.svg`)}];function we({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),[s,l]=(0,K.useState)(()=>Ee(e)),[d,h]=(0,K.useState)(()=>s.length>0),g=(0,K.useRef)(Y(e));(0,K.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=Ee(e);l(n),h(e=>e||n.length>0),g.current=t},[e]),(0,K.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Te(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,K.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,q.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ce.map(t=>(0,q.jsx)(De,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),d?null:(0,q.jsx)(X,{onClick:()=>h(!0)})]}),d?(0,q.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(f,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{h(!1),l(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,q.jsx)(m,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>l(e.target.value),helperText:`Separate multiple assistants with commas`,className:U,fullWidth:!0}),y.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,q.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Te(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ee(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function De({assistant:e,selected:t,onToggle:n}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(Oe,{assistant:e,size:32}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,q.jsx)(l,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function X({onClick:e}){return(0,q.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,q.jsx)(V,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Oe({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,q.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,q.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,q.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function ke({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,q.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:pe.map(t=>{let n=le[t.iconKey],r=e.has(t.id);return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,q.jsx)(n,{className:`h-4 w-4`}):null}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,q.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,q.jsx)(l,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Ae=new Set([`gmail`,`google-calendar`,`google-drive`]),Z=[{id:`gmail`,label:`Gmail`,logoSrc:I(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:I(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:I(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:I(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:I(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:I(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:I(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:I(`/images/integrations/github.svg`),logoSrcDark:I(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:I(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:I(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:I(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:I(`/images/integrations/apple-notes.svg`)}];function Q(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function je({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=v(),[s,l]=(0,K.useState)(()=>Me(e)),[d,h]=(0,K.useState)(()=>s.length>0),g=(0,K.useRef)(Ne(e));(0,K.useEffect)(()=>{let t=Ne(e);if(t===g.current)return;let n=Me(e);l(n),h(e=>e||n.length>0),g.current=t},[e]),(0,K.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}$(n,e)||(g.current=Ne(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},y=(0,K.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,q.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}):null,(0,q.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,q.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,q.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Z.map(t=>(0,q.jsx)(Pe,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),d?null:(0,q.jsx)(Fe,{onClick:()=>h(!0),electron:o})]}),d?(0,q.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,q.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(f,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>{h(!1),l(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,q.jsx)(p,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,q.jsx)(m,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>l(e.target.value),helperText:`Separate multiple tools with commas`,className:U,fullWidth:!0}),y.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(e=>(0,q.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,q.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function $(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Me(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Ne(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Pe({tool:e,selected:t,onToggle:n,electron:r}){return(0,q.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(Ie,{tool:e,size:32}),(0,q.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,q.jsx)(l,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Fe({onClick:e,electron:t}){return(0,q.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,q.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,q.jsx)(V,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,q.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ie({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,q.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,q.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,q.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,q.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,q.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Le({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,q.jsx)(H,{showCreatureFooter:!1,children:(0,q.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,q.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,q.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,q.jsx)(u,{}),onClick:r,"aria-label":`Back`}),(0,q.jsx)(`div`,{className:`flex justify-center`,children:(0,q.jsx)(G,{current:o,total:s})}),(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,q.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,q.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,q.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:W.map(n=>{let r=e===n.id;return(0,q.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,q.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,q.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,q.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,q.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Re(e){let[t,n]=(0,K.useState)(()=>(e??``).trim()),r=(0,K.useRef)(!1);return(0,K.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,K.useCallback)(e=>{r.current=!0,n(e)},[])}}var ze=`experiment-activation-flow-2026-06-03`,Be=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ve(e,t,n){return t?.initialMessage?t.initialMessage:n?P(e):F}function He(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:{tools:Q([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=ze,i.bootstrapTemplate=Be);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Q([...e.selectedPriorAssistants])),i.initialMessage=Ve(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Ue(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function We(e){return[{id:`name`,funnelStep:R.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:R.controlWorkType,enabled:!0},{id:`tools`,funnelStep:R.controlTools,enabled:!0},{id:`priorAssistants`,funnelStep:R.controlPriorAssistants,enabled:e.canOfferPriorAssistants},{id:`google`,funnelStep:R.controlGmailConnect,enabled:e.canOfferGoogleStep&&e.hasGoogleTool},{id:`iosApp`,funnelStep:R.controlGetApp,enabled:e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ge(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ke=`1`;function qe(e){return e===`nativeVibe`||e===Ke?`nativeVibe`:null}function Je(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function Ye(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function Xe(){let e=i(),t=ee(),n=k()&&O();return(0,K.useEffect)(()=>{!n&&!t&&e(D.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function Ze(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,K.useState)(()=>t?`nativeName`:`name`),a=(0,K.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,K.useLayoutEffect)(()=>{if(n)try{let e=qe(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,K.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,K.useCallback)(()=>{a(null)},[a])}}var Qe=3;function $e(){let e=h();return e?.cloud===`vellum`?e.assistantId:_()[0]?.assistantId??null}function et(){let e=i(),[t]=r(),n=t.get(`preview`)===`true`,a=w.use.user(),s=S(),c=T(),l=a?.id??null,u=a?.firstName??``,d=a?.lastName??``,f=ee(),p=y.use.activeAssistantId(),m=g(),h=A()&&!se(),_=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,v=j.use.selfIntroGreeting(),x=m?$e():null,E=Xe(),{currentStep:O,setCurrentStep:k,clearPersistedStep:te}=Ze(l,f),M=w.use.platformSession(),P=b(M),[F,re]=(0,K.useState)(()=>new Set),[ie,I]=(0,K.useState)(()=>new Set),[L,R]=(0,K.useState)(()=>new Set),{value:z,onChange:ce}=Re(m&&!P?``:u||d),[B,le]=(0,K.useState)(null),[ue]=(0,K.useState)(()=>me()),[V,de]=(0,K.useState)(``),[fe,pe]=(0,K.useState)(!1),[H,U]=(0,K.useState)([]),{data:W}=o({...ae(),enabled:!c&&s&&(!m||P)}),{data:G,isLoading:ge}=o({queryKey:[`onboarding-recipe`,l],queryFn:he,enabled:!c&&s&&!f&&!m,staleTime:1/0}),J=G??null,ve=W?.id??p??x,xe=Ue({localMode:m,platformSession:M,hasCachedPlatformAssistant:x!==null}),Ce=xe,Te=xe,Ee=async()=>{await C.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Y(e){n||oe(e,{userId:l})}let De=[...F].some(e=>Ae.has(e)),X=f?Ge():We({canOfferPriorAssistants:Te,canOfferGoogleStep:n?!1:Ce,hasGoogleTool:De,showIOSAppStep:h});function Oe(t){if(n){e(-1);return}ne(He({mode:f?`native`:`control`,recipe:f?null:J,selectedTools:F,selectedTasks:ie,selectedPriorAssistants:t?.selectedPriorAssistants??L,tone:B??J?.tone??`grounded`,userName:z,assistantName:V,selfIntroGreetingEnabled:v,activationFlowEnabled:f?void 0:_,googleConnected:fe,googleScopes:H,connectedScopes:t?.connectedScopes}));let r=V.trim();r&&N(r),f?(te(),e(D.onboarding.privacy)):(C.markExpectingFirstMessage(),Ee())}let Z=(e,t)=>{e.funnelStep&&Y(e.funnelStep);let n=Je(X,e.id);n?k(n):Oe(t)},Q=e=>{let t=Ye(X,e.id);t&&k(t)};if(!E||ge)return null;let $=X.find(e=>e.id===O)??X[0];return $?$.id===`nativeName`?(0,q.jsx)(Se,{userName:z,assistantName:V,displayedAssistantNames:ue,onUserNameChange:ce,onAssistantNameChange:de,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:Qe}):$.id===`nativeVibe`?(0,q.jsx)(Le,{selectedGroupId:B,onGroupChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:Qe}):$.id===`name`?(0,q.jsx)(be,{userName:z,assistantName:V,selectedGroupId:B,displayedAssistantNames:ue,onUserNameChange:ce,onAssistantNameChange:de,onGroupChange:le,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,q.jsx)(ke,{selectedTasks:ie,onChange:I,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,q.jsx)(je,{selectedTools:F,onChange:re,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,q.jsx)(we,{selectedAssistants:L,onChange:R,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;R(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?ve?(0,q.jsx)(ye,{assistantId:ve,assistantName:V,onConnect:e=>{pe(!0),U(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,q.jsx)(_e,{onComplete:()=>Z($)}):null:null}function tt(){return(0,q.jsx)(et,{})}export{tt as PreChatRoute};
|
|
@@ -1 +0,0 @@
|
|
|
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-DXp9L4iB.js";import{t as o}from"./react-DJZBPgpf.js";import{P as s,t as c,z as l}from"./button-BQVYX8n_.js";import{n as u}from"./QueryClientProvider-DKhXIxGb.js";import{t as d}from"./useQuery-B45lW1Kk.js";import{t as f}from"./useMutation-Lj4VunQV.js";import{t as p}from"./jsx-runtime-CVSDxk6A.js";import{t as m}from"./card-D8zyWtZh.js";import{t as h}from"./chevron-down-DpYf9Gwq.js";import{t as g}from"./chevron-right-jRymmL7S.js";import{t as _}from"./loader-circle-D57RZgLH.js";import{t as v}from"./pencil-DEevs4oD.js";import{t as y}from"./shield-check-BOKWBJve.js";import{t as b}from"./x-CswtfvgS.js";import{t as x}from"./notice-BylgS5W_.js";import{t as S}from"./tag-B6WeUtBW.js";import{t as C}from"./input-ZpyYt_a0.js";import{t as w}from"./toggle-QSEiPr3k.js";import{n as T}from"./toast-ZoZVyeDI.js";import{t as E}from"./confirm-dialog-CCrDkChx.js";import{t as D}from"./dropdown-BMNSccmo.js";import{f as O,n as k,r as A}from"./auth-store-B6EXnaee.js";import{t as j}from"./sdk.gen-BJsTUGAk.js";import{c as ee,i as te,m as ne,n as re,o as M,r as ie,s as ae,t as oe}from"./native-biometric-gWkPFBiw.js";import{c as se,s as ce}from"./routes-XPLb07Av.js";import{d as le,f as ue}from"./prefs-wApndUEh.js";import{n as de,t as fe}from"./react-query.gen-BXPoln4i.js";import{$n as pe,F as N,Hi as P,I as F,L as me,R as he,U as I,di as L,er as R,et as ge,fi as _e,nt as ve,pi as z,qn as ye,tr as be,tt as B}from"./index-CZVGv7Cn.js";import{t as V}from"./use-active-assistant-id-9rGx8kT9.js";import{t as H}from"./detail-card-CA8lPa5K.js";import{t as U}from"./setting-row-BoJnQfzh.js";import{t as xe}from"./settings-divider-Dk_uJxp_.js";var W=e(o(),1),G=p(),K=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],Se=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function Ce(){let[e,t]=(0,W.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function we(){let[e,r]=(0,W.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,W.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||ye(0)}]}function Te({row:e,onToggle:t}){return(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(w,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:s(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,G.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,G.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Ee(){return(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function De({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=be(),{pendingKind:o,run:s}=Ce(),[c,l]=we(),u=(0,W.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of K){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,W.useMemo)(()=>{let e=K.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=Se.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await pe(e.sourceKind):await R(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,G.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,G.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,G.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,G.jsx)(Ee,{}),`Checking permissions...`]}):(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,G.jsx)(Te,{row:e,onToggle:p},e.id))}),r&&(0,G.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Oe(){let e=z({platformHostedOnly:!0}),t=L(),n=_e(),r=u(),{data:i,isLoading:a,isError:o}=d({...fe(),enabled:e===`full`&&t}),s=f({mutationFn:async e=>{let{data:t}=await j({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{de(r,void 0,e),T.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{T.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,l=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,G.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,G.jsxs)(G.Fragment,{children:[(s.isPending||c)&&(0,G.jsx)(_,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,G.jsx)(w,{checked:l,disabled:p,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,G.jsx)(I,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function ke(){let e=ne(),[t,n]=(0,W.useState)(()=>te()),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(`Face ID`),[s,c]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{e&&(ie().then(i),re().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)M(!1),await oe(),n(!1);else{let e=ee();e&&await ae(e),M(!0),n(!0)}}finally{c(!1)}};return(0,G.jsx)(H,{title:`Security`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,G.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,a,` or your device passcode instead of signing in again.`]})]}),(0,G.jsx)(w,{checked:t,onChange:()=>void l(),disabled:s})]})})}var q=[`youtube.com`,`youtu.be`,`vimeo.com`,`loom.com`];function Ae(e){try{let t=JSON.parse(e);if(Array.isArray(t))return t.filter(e=>typeof e==`string`)}catch{}return[...q]}function je(){return n(`mediaEmbedsEnabled`,!0)}function Me(){let e=i(`mediaEmbedDomains`,``);return e?Ae(e):[...q]}function Ne(){let[e,n]=(0,W.useState)(()=>je()),[i,a]=(0,W.useState)(()=>Me()),[o,s]=(0,W.useState)(!1),[l,u]=(0,W.useState)(``),d=(0,W.useMemo)(()=>l.trim().toLowerCase(),[l]),f=e=>{n(e),t(`mediaEmbedsEnabled`,e)},p=e=>{a(e),r(`mediaEmbedDomains`,JSON.stringify(e))},m=()=>{if(d){if(i.includes(d)){u(``);return}p([...i,d]),u(``)}},_=e=>{p(i.filter(t=>t!==e))},v=()=>{p([...q])},y=i.length===q.length&&i.every((e,t)=>e===q[t]);return(0,G.jsxs)(H,{title:`Media Embeds`,subtitle:`Automatically embed images, videos, and other media shared in chat messages.`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Auto Media Embeds`}),(0,G.jsx)(w,{checked:e,onChange:f})]}),e&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`mt-4`,children:(0,G.jsx)(xe,{})}),(0,G.jsxs)(c,{type:`button`,variant:`ghost`,onClick:()=>s(e=>!e),className:`mt-4 w-full justify-between px-3`,"aria-expanded":o,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[o?(0,G.jsx)(h,{className:`h-4 w-4`,"aria-hidden":!0}):(0,G.jsx)(g,{className:`h-4 w-4`,"aria-hidden":!0}),`Video Domain Allowlist`]}),(0,G.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[i.length,` domain`,i.length===1?``:`s`]})]}),o&&(0,G.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,G.jsx)(C,{label:`Add Domain`,type:`text`,value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),m())},placeholder:`Add domain (e.g. example.com)`,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(c,{variant:`primary`,size:`compact`,onClick:m,disabled:!d,children:`Add`})]}),i.length>0&&(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsx)(c,{type:`button`,variant:`ghost`,size:`compact`,onClick:v,disabled:y,tintColor:`var(--content-tertiary)`,children:`Reset to Defaults`})}),i.length>0&&(0,G.jsx)(`ul`,{className:`space-y-2`,children:i.map(e=>(0,G.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,G.jsx)(`span`,{className:`font-mono text-[var(--content-default)]`,children:e}),(0,G.jsx)(c,{variant:`dangerGhost`,size:`compact`,iconOnly:(0,G.jsx)(P,{}),onClick:()=>_(e),"aria-label":`Remove ${e}`})]},e))})]})]})]})}function J(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=N.map(e=>({value:e.id,label:e.label,icon:(0,G.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Pe(){let e=V(),t=u(),{data:n,isError:r}=d({queryKey:[`thresholds`,e],queryFn:()=>me(e),staleTime:3e4}),[i,a]=(0,W.useState)(`relaxed`),[o,s]=(0,W.useState)(`conservative`),[c,l]=(0,W.useState)(`strict`),[f,p]=(0,W.useState)(!1),_=(0,W.useRef)(!1),[v,y]=(0,W.useState)(!1),b=(0,W.useRef)(null),x=(0,W.useRef)(null);(0,W.useEffect)(()=>{!n||_.current||(a(F(n.interactive).id),s(F(n.autonomous).id),l(F(n.headless).id),y(!0))},[n]),(0,W.useEffect)(()=>()=>{b.current!==null&&(clearTimeout(b.current),b.current=null,x.current?.(),x.current=null)},[]);let S=(0,W.useCallback)((n,r,i)=>{if(!e||!v)return;let a=N.find(e=>e.id===n)?.riskThreshold,o=N.find(e=>e.id===r)?.riskThreshold,s=N.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||he(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,v,t]),C=(0,W.useCallback)((e,t,n)=>{b.current!==null&&clearTimeout(b.current),x.current=()=>S(e,t,n),b.current=setTimeout(()=>{x.current?.(),b.current=null,x.current=null},500)},[S]),w=(0,W.useCallback)(e=>{_.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,W.useCallback)(e=>{_.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,W.useCallback)(e=>{_.current=!0,l(e),C(i,o,e)},[i,o,C]),O=N.find(e=>e.id===i),k=N.find(e=>e.id===o),A=N.find(e=>e.id===c),j=!e||!v;return(0,G.jsxs)(m,{children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,G.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:i,onChange:w,options:Y,disabled:j})}),O&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>p(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":f,children:[f?(0,G.jsx)(h,{className:`h-4 w-4`}):(0,G.jsx)(g,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,G.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:o,onChange:T,options:Y,disabled:j})}),k&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]}),(0,G.jsx)(J,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:c,onChange:E,options:Y,disabled:j})}),A&&(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:A.description})]})]})]})]})]})}var X=e(l(),1),Fe=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Ie=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Z({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,W.useRef)(null),[a,o]=(0,W.useState)(t.tool),[s,c]=(0,W.useState)(t.pattern),[l,u]=(0,W.useState)(t.risk),[d,f]=(0,W.useState)(t.description??``),[p,m]=(0,W.useState)(!1),[h,g]=(0,W.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,W.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await ve(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,X.createPortal)((0,G.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,W.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,G.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(b,{className:`h-4 w-4`})})]}),(0,G.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,G.jsx)(x,{tone:`error`,children:h}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,G.jsx)(`div`,{className:`mt-1`,children:(0,G.jsx)(D,{value:a,onChange:o,disabled:!0,options:Fe.map(e=>({value:e,label:e}))})})]}),(0,G.jsx)(C,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,G.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Ie.map(e=>(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{children:e.label}),(0,G.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,G.jsx)(C,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,G.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,G.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function Le(e){return e.origin===`default`&&!e.userModified}function Re(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function ze(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Be({assistantId:e,onClose:t}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)(!0),[s,l]=(0,W.useState)(null),[u,d]=(0,W.useState)(null),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)(!1),g=(0,W.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([B(e),B(e,{origin:`default`})]);return Re(t,n)}return B(e)},[e]),_=(0,W.useCallback)(async()=>{o(!0);try{i(await g(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[g,m]);(0,W.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await g(m);e||(i(t),l(null))}catch(t){e||l(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[g,m]);let b=(0,W.useCallback)(async()=>{if(f)try{await ge(e,f.id),_()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,_]);return(0,X.createPortal)((0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,W.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,W.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,G.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,G.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(w,{checked:m,onChange:h,label:`Show all defaults`}),(0,G.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,G.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,G.jsx)(`div`,{className:`mb-3`,children:(0,G.jsx)(x,{tone:`error`,children:s})}),a?(0,G.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,G.jsx)(y,{className:`h-8 w-8`}),(0,G.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,G.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=Le(e);return(0,G.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,G.jsx)(S,{tone:ze(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,G.jsx)(S,{tone:`neutral`,children:`Default`}),e.userModified&&(0,G.jsx)(S,{tone:`warning`,children:`Modified`})]}),(0,G.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,G.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,G.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>d(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,G.jsx)(v,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,G.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>p(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,G.jsx)(P,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,G.jsx)(Z,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),_()}}),(0,G.jsx)(E,{open:f!==null,title:`Delete Trust Rule?`,message:f?`Remove the ${Q(f.risk).toLowerCase()}-risk rule for ${f.tool} matching "${f.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void b(),onCancel:()=>p(null)})]}),document.body)}function Ve(){let e=V(),[t,n]=(0,W.useState)(!1);return(0,G.jsxs)(m,{children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(y,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,G.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,G.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,G.jsx)(Be,{assistantId:e,onClose:()=>n(!1)})]})}var He=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Ue=`thirtyDays`;function $(){return(0,G.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function We(){let e=z({platformHostedOnly:!0}),t=A(),n=t,a=k.use.user()?.id??null,[o]=le(),[s]=ue(),c=o??!0,l=s??!0,[u,d]=(0,W.useState)(()=>i(`llmLogRetention`,Ue));return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(ke,{}),(0,G.jsx)(De,{}),(0,G.jsx)(Ve,{}),(0,G.jsx)(Pe,{}),(0,G.jsx)(Ne,{}),(0,G.jsx)(H,{title:`Privacy`,subtitle:t?(0,G.jsxs)(G.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,G.jsx)(`a`,{href:ce(se.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,G.jsxs)(`div`,{className:`space-y-4`,children:[n&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(U,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:c,onChange:()=>{O(`share_analytics`,!c,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{}),(0,G.jsx)(U,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{O(`share_diagnostics`,!l,{userId:a,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,G.jsx)($,{})]}),(0,G.jsx)(Oe,{}),e!==`gated`&&(0,G.jsx)($,{}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,G.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,G.jsx)(D,{value:u,onChange:e=>{d(e),r(`llmLogRetention`,e)},options:He})}),(0,G.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{We as PrivacyPage};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{i as t}from"./local-settings-C-dW2vkq.js";import{t as n}from"./capture-error-BGD3-GQf.js";import{t as r}from"./react-DJZBPgpf.js";import{P as i,t as a}from"./button-BQVYX8n_.js";import{m as o,u as s}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as c}from"./QueryClientProvider-DKhXIxGb.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./arrow-left-C2re-gYj.js";import{t as d}from"./chevron-left-B_RAz34t.js";import{t as f}from"./chevron-right-jRymmL7S.js";import{n as p,t as m}from"./animated-avatar-CyIeKE-s.js";import{t as h}from"./loader-circle-D57RZgLH.js";import{t as g}from"./pencil-DEevs4oD.js";import{t as _}from"./plus-CQiIB1qS.js";import{t as v}from"./x-CswtfvgS.js";import{t as y}from"./tag-B6WeUtBW.js";import{t as b}from"./input-ZpyYt_a0.js";import{i as x,r as S,t as C}from"./dist-Cul7ysiV.js";import{n as w,t as T}from"./create-selectors-tFGOU7xo.js";import{b as E,ct as D,o as O,p as k}from"./local-mode-hyYI6_OH.js";import{Bn as A,V as j,Vn as M,_n as N,et as ee,gn as te,xr as ne}from"./sdk.gen-D_Qurj4O.js";import{r as re}from"./api-errors-CDe82ZvY.js";import{I as P,L as F,R as ie,k as ae,n as oe,z as I}from"./auth-store-B6EXnaee.js";import{a as se,o as ce,r as le}from"./api-BBMl4mW3.js";import{c as ue}from"./routes-XPLb07Av.js";import{n as L}from"./platform-detection-1awANa55.js";import{c as de,l as fe}from"./prechat-P1y7ZM6C.js";import{t as pe}from"./browser-timezone-2SnmKDjM.js";import{c as R}from"./conversation-list-fetchers-BOrVAREL.js";import{i as me,n as he,r as ge,t as _e}from"./research-onboarding-persistence-BLNrBZSe.js";import{A as ve,B as ye,C as be,D as xe,E as Se,F as Ce,I as we,L as Te,M as Ee,N as De,O as z,P as Oe,R as B,S as V,T as ke,V as Ae,a as je,d as Me,f as Ne,g as Pe,i as Fe,j as Ie,k as Le,m as Re,o as ze,p as Be,r as Ve,s as He,t as H,v as Ue,w as We,x as Ge,y as Ke}from"./proxy-BzlH_XAe.js";import{t as qe}from"./AnimatePresence-C8APSgIu.js";import{t as U}from"./use-reduced-motion-CcGT6CHV.js";import{$i as Je,An as Ye,Dn as Xe,En as Ze,Et as Qe,Ga as W,Ln as $e,Ot as et,Pr as tt,Tr as nt,bn as rt,cn as it,ht as G,kn as at,mt as ot,vn as st,xn as ct,yn as lt}from"./index-CZVGv7Cn.js";import{a as ut,i as dt,n as ft,r as pt,t as mt}from"./latest-assistant-text-BCjy0Q0O.js";import{n as ht,t as gt}from"./onboarding-step-layout-2XcmxqFN.js";import{t as _t}from"./prechat-names-clVy5Mee.js";var vt=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function yt(e,t){return Ee(e)?e[vt(0,e.length,t)]:e}var bt=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return xt(this.animations,`duration`)}get iterationDuration(){return xt(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function xt(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var St=class extends bt{then(e,t){return this.finished.finally(e).then(()=>{})}};function Ct(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=Se(i,a,o);return t?s(r):s}function wt(e,t){return e in t}var Tt=class extends He{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(wt(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Ne()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(r(),1);function Et(e){let t=Ae(()=>V(e)),{isStatic:n}=(0,K.useContext)(Ve);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function Dt(e,t){let n=Et(t()),r=()=>n.set(t());return r(),ye(()=>{let t=()=>Ie.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),ve(r)}}),n}function Ot(e){Ge.current=[],e();let t=Dt(Ge.current,e);return Ge.current=void 0,t}function kt(e,t,n,r){if(typeof e==`function`)return Ot(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return jt(e,t,n,r);let i=typeof t==`function`?t:Ct(t,n,r),a=Array.isArray(e)?At(e,i):At([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function At(e,t){let n=Ae(()=>[]);return Dt(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function jt(e,t,n,r){let i=Ae(()=>Object.keys(n)),a=Ae(()=>({}));for(let o of i)a[o]=kt(e,t,n[o],r);return a}function Mt(e){return typeof e==`object`&&!Array.isArray(e)}function Nt(e,t,n,r){return e==null?[]:typeof e==`string`&&Mt(t)?Pe(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function Pt(e,t,n){return e*(t+1)+n*t}function Ft(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function It(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(B(e,i),r--)}}function Lt(e,t,n,r,i,a){It(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Le(i,a,r[o]),easing:yt(n,o)})}function Rt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function zt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var Bt=`easeInOut`,Vt=20;function Ht(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,Ft(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=Ft(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Gt(e),{delay:l=0,times:u=We(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=be(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&Jt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oe(b));let r=z(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&ke(u,T),c.length===1&&c.unshift(null),m&&Te(m<Vt,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Vt} or apply repeat at the sequence level instead.`),m&&m<Vt){let e=b>0?_/b:0;b=Pt(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?De(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:yt(f,e-1))}Rt(u,m,e)}let E=w+b;Lt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Ke(p)){let e=Ut(p,s);_(m,h,Wt(`default`,e))}else{let e=Nt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Ut(r,s);for(let e in m)_(m[e],Kt(h,e),Wt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(zt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Ce(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(Bt)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function Ut(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Wt(e,t){return t[e]||(t[e]=[]),t[e]}function Gt(e){return Array.isArray(e)?e:[e]}function Kt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var qt=e=>typeof e==`number`,Jt=e=>e.every(qt);function Yt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Re(e)&&!Be(e)?new je(t):new ze(t);n.mount(e),Me.set(e,n)}function Xt(e){let t=new Tt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),Me.set(e,t)}function Zt(e,t){return Ke(e)||typeof e==`number`||typeof e==`string`&&!Mt(t)}function Qt(e,t,n,r){let i=[];if(Zt(e,t))i.push(Fe(e,Mt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=Nt(e,t,r),o=a.length;we(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Yt:Xt;Me.has(r)||s(r);let c=Me.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Ue(c,{...t,transition:l},{}))}}return i}function $t(e,t,n){let r=[];return Ht(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=V(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:xe}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Qt(n,e,t))}),r}function en(e){return Array.isArray(e)&&e.some(Array.isArray)}function tn(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),en(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=$t(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Qt(e,i,{...c,...r},t)}let l=new St(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{B(t.animations,l)})),l}return i}var nn=tn(),rn=12;function an(e,t){let n=e.slice(0,rn).map(e=>`- ${e.name} — ${e.description}`).join(`
|
|
2
|
-
`);return n?`
|
|
3
|
-
Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
|
|
4
|
-
${n}
|
|
5
|
-
|
|
6
|
-
Add a "plugins" array as the FIRST key in your JSON object, ${t?`before "claims" and "suggestions"`:`before "claims"`}: the 1-2 capabilities from the list above (exact names) that best fit who I am — judged by what you researched about my real role, stack, and day-to-day work. (Emit it first so setup can start while you finish the rest.) These get set up for me automatically as part of getting started, so pick by overall fit to ME, not to any single suggestion. Prefer fewer over forcing a match; use [] if nothing clearly fits. Example: "plugins": ["<exact name from the list above>"]. ${t?`Don't reference the setup in the claims or suggestions text.`:`Don't reference the setup in the claims text.`}
|
|
7
|
-
`:``}function on({firstName:e,lastName:t,occupation:n,hobbies:r,timezone:i},a=[],{includeSuggestions:o=!0}={}){let s=[e.trim(),t.trim()].filter(Boolean).join(` `),c=n.trim(),l=(r??[]).map(e=>e.trim()).filter(Boolean).join(`, `),u=i?.trim()??``,d=an(a,o),f=d?`"plugins": ["<exact name from the list above>"], `:``,p=[s?`My name is ${s}.`:``,c?`I work as ${c}.`:``,l?`My hobby is ${l}.`:``].filter(Boolean).join(` `),m=p?[p,u?`My timezone is ${u}.`:``].filter(Boolean).join(` `):`I'd like you to get to know me before we start working together.`,h=o?` "suggestions": [ { "suggestion": "I'll find the 3 newest arXiv eval papers worth your time", "prompt": "Find me the 3 newest arXiv eval papers worth reading." }, { "suggestion": "I'll draft a crisp summary of the latest model-serving trade-offs", "prompt": "Draft me a short summary of the latest model-serving trade-offs." }, { "suggestion": "Connect GitHub and I'll triage your stalest issues", "prompt": "Connect to GitHub and triage my oldest open issues." }, { "suggestion": "I'll plan a weekend climbing trip near Boulder", "prompt": "Plan me a weekend climbing trip near Boulder." } ]`:``,g=`{ ${f}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user", "https://example-infra.com/about"] }, { "claim": "Based in Boulder, CO", "confidence": "maybe", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Into climbing and the outdoors", "confidence": "guessing", "sources": [] } ]${h?`,${h}`:``} }`;return`${m}
|
|
8
|
-
|
|
9
|
-
Get to know me. Search the web for what's publicly known about me, and infer a handful of things about who I am: what I do, my role, where I'm based, what I'm into, anything that would help you assist me better. Prefer sources people author about themselves — LinkedIn, a personal site, GitHub, an employer's team page, published work, public social profiles. Never fetch or cite people-search or background-check aggregators (Instant Checkmate, Spokeo, BeenVerified, TruePeopleSearch, Whitepages, and similar); data-broker directories (ZoomInfo, RocketReach, Apollo) may corroborate another source but must never be a claim's only basis.
|
|
10
|
-
|
|
11
|
-
IDENTITY GATE — decide who a page is about before you use it: a name match alone is NEVER enough to attribute a page to me. Attribute it to me only when it also corroborates something I stated — my role, my hobby, or a location consistent with my timezone if I gave one. If several people share my name and none clears that bar, or you find no verifiable match at all, then I have no public profile you can use: return ONLY inferences from what I stated above, each labeled "guessing" with "sources": []. An honest near-empty card beats a stranger's biography. If my details above read as placeholder or joke input rather than a real identity, skip the web search and return an empty claims array.
|
|
12
|
-
|
|
13
|
-
Treat the name, role, and hobby I provided above as first-party context from me. Use public sources to enrich that context, not to override or correct it. If public sources use a different title or omit part of my stated role, do not frame my stated role as wrong; mention the public title only as supporting nuance when it is useful, and keep ${o?`claims and suggestions`:`claims`} aligned with my stated role.
|
|
14
|
-
|
|
15
|
-
CRITICAL: your final reply must be ONLY a JSON object. No preamble, no explanation, no prose, nothing before or after it. Do your thinking and searching, then respond with exactly this shape and nothing else:
|
|
16
|
-
|
|
17
|
-
${g}
|
|
18
|
-
|
|
19
|
-
Rules for "claims":
|
|
20
|
-
|
|
21
|
-
AT MOST 5 claims, typically 3 to 4. Never pad the list or inflate a confidence tier to seem thorough.
|
|
22
|
-
Phrase each claim in third person as a short headline ("Senior engineer at an AI infra startup", "Based in Boulder, CO", "Active climber on Mountain Project"). No multi-clause sentences, no em-dash asides, no explanations. Good: "Contributed to Chirps (vector-DB security)". Bad: "You've done real work in vector database security. You contributed to Chirps, a tool for scanning vector DBs for sensitive data".
|
|
23
|
-
Each claim must be independently true-or-false so I can remove the ones that are wrong.
|
|
24
|
-
Every specific in a claim (employer, title, publication, city) must appear in a source you actually fetched this turn — never synthesize or embellish specifics a source doesn't state.
|
|
25
|
-
"confidence" is earned per the identity gate: "confident" needs 2+ independent gate-passing sources, "maybe" needs exactly one, and a claim with no sources is an inference from my stated details and must be "guessing".
|
|
26
|
-
"sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
|
|
27
|
-
${o?`Rules for "suggestions":
|
|
28
|
-
|
|
29
|
-
Each suggestion is an object with two fields:
|
|
30
|
-
"suggestion": the offer in YOUR voice (the assistant), exactly as it appears on the clickable card — first-person "I" refers to you (whatever your name). Pattern: "I'll [verb] [specific artifact]" or "Connect me to [integration] and I'll [verb] [artifact]." Lead with the offer; no intake question in front of it — you gather the details in the follow-up conversation after the click.
|
|
31
|
-
"prompt": the same offer re-voiced as the message sent on the user's behalf when they click, in the USER's first person ("I"/"my" = the user) — what they'd say to take you up on it (suggestion "I'll find you 3 papers" → prompt "Find me 3 papers worth reading"). State the request; don't echo the assistant-voiced wording and don't ask a question back.
|
|
32
|
-
|
|
33
|
-
Generate EXACTLY 4 suggestions covering four DIFFERENT capabilities, each making me think "wait, you can do that?" Draw on your range — a quick researched answer, a recurring brief or monitor, a doc drafted in a live editor, an integration (GitHub, Gmail, Calendar, Slack, Linear) connected with a first action, or a hobby hook if research surfaced one — but pick what genuinely fits; don't force a fixed set.
|
|
34
|
-
Ground every suggestion in what you actually learned about me — my real role, stack, industry, and (if given) hobby. Specific to me, not generic assistant stuff; skip bare "summarize" or "draft a post."
|
|
35
|
-
CRITICAL: every suggestion must be a fast win you can deliver in the first reply, never a long-running build. NEVER suggest building an app, dashboard, tool, site, or tracker, or any multi-step "build me a ___" project — those kill the first impression. The ambitious build can come later in the conversation, never on the first card.
|
|
36
|
-
Keep each SHORT and skimmable: under 10 words, ONE clause, ONE artifact, no lists of three ("X, Y, and Z"). The reader scans four cards in seconds — a long line loses them.
|
|
37
|
-
`:``}${d}
|
|
38
|
-
${o?`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support, and lean on broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If the identity gate leaves you with very little, return only the honest "guessing" claims my stated details support.`}
|
|
39
|
-
Keep every string value simple so the JSON always parses: one line, no line breaks inside a value, and NO double-quote characters inside a value — use single quotes (or none) for emphasis, quoted names, or tool names. Output ONLY the JSON object. No code fence, no extra text.`}function sn({hostingParam:e,localMode:t,gatewayAuthSession:n}){return t?e===null?n:e!==`vellum-cloud`:!1}var cn=3e3,ln=3e5,un=`Failed to start your assistant. Please try again.`,dn=`Your assistant is taking longer than expected. Please try again.`,fn=e=>new Promise(t=>setTimeout(t,e));function pn({adoptExisting:e=!1,adoptAssistantId:t}={}){let[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),l=(0,K.useRef)(!1),u=(0,K.useRef)([]),d=(0,K.useRef)(null),f=(0,K.useCallback)(e=>{if(!d.current){d.current={kind:`ready`,id:e},i(!0);for(let t of u.current)t.resolve(e);u.current=[]}},[]),p=(0,K.useCallback)(e=>{if(d.current)return;d.current={kind:`error`,message:e},c(e);let t=Error(e);for(let e of u.current)e.reject(t);u.current=[]},[]);return{start:(0,K.useCallback)(()=>{if(l.current)return;l.current=!0;let r=Date.now(),i=()=>Date.now()-r>=ln;(async()=>{if(e&&t){let e=O(t);if(e){o(e.assistantId),f(e.assistantId);return}}let r=e?t:void 0;if(!e)try{let e=await ce();if(e.ok)r=e.data.id,o(e.data.id);else{if(F(e.status,e.error)){p(P);return}if(!I(e.status)){p(re(e.error,void 0,un));return}}}catch(e){n(e,{context:`research_background_hatch`})}let a;for(;!a;){if(i()){p(dn);return}try{let e=await le(r);r&&!e.ok&&e.status===404&&(r=void 0,e=await le());let t=ie(e);if(t.kind===`active`&&e.ok){a=e.data.id,o(a);break}if(t.kind===`error`){p(t.message);return}}catch(e){n(e,{context:`research_background_hatch_poll`})}await fn(cn)}if(e)for(;!await E();){if(i()){p(dn);return}await fn(cn)}else for(;;){try{if((await se(a)).ok)break}catch{}if(i()){p(dn);return}await fn(cn)}f(a)})()},[p,f,e,t]),ready:r,assistantId:a,error:s,awaitReady:(0,K.useCallback)(()=>{let e=d.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{u.current.push({resolve:e,reject:t})})},[])}}async function mn(e,t){try{await j({path:{assistant_id:e,id:t},throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_archive`})}}var hn=`vellum_pending_plugin_install`;function gn(){let e=t(hn,``);if(!e)return null;try{let t=JSON.parse(e);return typeof t?.pluginId!=`string`||!t.pluginId||typeof t.ts!=`number`||Date.now()-t.ts>36e5?null:t.pluginId}catch{return null}}function _n(){let e=gn();return e?[e]:[]}var vn=[`admin-copilot`],yn=[{plugin:`marketing-expert`,keywords:[`founder`,`cofounder`,`co founder`,`ceo`,`cmo`,`chief executive`,`chief marketing`,`entrepreneur`,`marketing`,`marketer`,`growth`,`brand`,`content`,`copywriter`,`copywriting`,`seo`,`demand gen`,`demand generation`,`sales`,`account executive`,`business development`,`creator`,`social media`,`community manager`]},{plugin:`git-workflow`,keywords:`developer.swe.programmer.coder.devops.dev ops.sre.site reliability.software engineer.software architect.backend engineer.back end engineer.frontend engineer.front end engineer.full stack engineer.fullstack engineer.platform engineer.infrastructure engineer.data engineer.machine learning engineer.ml engineer.qa engineer.embedded engineer.security engineer.staff engineer.principal engineer.solutions architect.tech lead.technical lead.engineering manager.engineering lead.head of engineering.director of engineering.vp of engineering.vp engineering.cto`.split(`.`)}];function bn(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function xn(e,t){return e.includes(` ${t} `)}function Sn(e){let t=bn(e),n=[];for(let{plugin:e,keywords:r}of yn)r.some(e=>xn(t,e))&&n.push(e);return n}function Cn(e,t){let n=[...vn,..._n(),...Sn(e)],r=new Set,i=[];for(let e of n)!t.has(e)||r.has(e)||(r.add(e),i.push(e));return i}var wn=1500,Tn=12e4,En=2;function Dn({complete:e,stableReads:t}){return e&&t>=En}function On({sawCompletePayload:e}){return e?`done`:`error`}function kn({sawCompletePayload:e}){return e}var An=`vellum-ai`,jn=new Set([`simple-memory`,`level-up`]);function Mn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function Nn(e){return e?.split(`/`)[0]?.trim()??``}function Pn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||Nn(r.source?.repo)===An&&(jn.has(e)||(n.add(e),t.push({name:e,description:Mn(i)})))}return{capabilities:t,validNames:n}}async function Fn(e){try{return Pn((await M({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return n(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function In(e,t){try{await A({path:{assistant_id:e},body:{name:t},throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_install`})}}var Ln=32;async function Rn({assistantId:e,conversationId:t,status:r,subject:i,claims:a,suggestions:o,plugins:s,installedPlugins:c}){try{await ne({path:{assistant_id:e},body:{conversation_id:t,status:r,self_reported_occupation:i.occupation,self_reported_hobbies:(i.hobbies??[]).slice(0,Ln),self_reported_timezone:i.timezone,claims:a,suggestions:o,plugins:s,installed_plugins:c},throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_telemetry`})}}var zn=e=>new Promise(t=>setTimeout(t,e));function Bn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...Cn(e,t),...n.filter(e=>t.has(e))])]}function Vn(){let[e,t]=(0,K.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,K.useRef)(0),i=(0,K.useRef)(null),a=(0,K.useRef)(new Map),o=(0,K.useRef)(Promise.resolve()),s=c(),l=(0,K.useCallback)(({awaitAssistantId:e,subject:c,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(c);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};o.current=new Promise(e=>{g=e}),a.current.clear(),t({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,o=!1;try{let n=await e();if(r=n,h())return;let{capabilities:s,validNames:p}=await Fn(n);if(h())return;let m=Object.fromEntries(s.map(e=>[e.name,e.description]));t(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=Cn(c.occupation,p);for(let e of v)_.has(e)||_.set(e,In(n,e));v.length>0&&t(e=>({...e,installedPlugins:v}));let y=async e=>{let t={conversationId:e,content:on(c,s,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:L(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(t.clientTimezone=e)}catch{}return!!(await N({path:{assistant_id:n},body:t,throwOnError:!1})).response?.ok},b=async()=>{let e=await ee({path:{assistant_id:n},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let t=e.data?.id;if(!(!e.response?.ok||!t))return d?.(t),t},x;if(u){let e=await te({path:{assistant_id:n},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){t(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){t(e=>({...e,status:`error`}));return}if(!await y(x)){t(e=>({...e,status:`error`}));return}if(h())return}let S=Date.now()+Tn,C=``,w=0,T=!1,E=[],D=[],O=[],k=v;for(;Date.now()<S;){if(await zn(wn),h())return;let e=await te({path:{assistant_id:n},query:{conversationId:x},throwOnError:!1});if(h())return;let r=mt(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:s,complete:l}=rt(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,In(n,e));s&&g();let d=Bn({role:c.occupation,validNames:p,modelPlugins:u});if(t({status:`running`,claims:e,suggestions:i,installedPlugins:d,pluginCatalog:m}),E=e,D=i,O=a,k=d,l&&(o=!0),l&&!T&&(T=!0,Rn({assistantId:n,conversationId:x,status:`done`,subject:c,claims:e,suggestions:i,plugins:a,installedPlugins:d})),w=r===C?w+1:0,C=r,Dn({complete:l,stableReads:w}))break}}if(h())return;T||(T=!0,Rn({assistantId:n,conversationId:x,status:`error`,subject:c,claims:E,suggestions:D,plugins:O,installedPlugins:k})),t(e=>({...e,status:On({sawCompletePayload:o})}))}catch(e){if(h())return;n(e,{context:`research_onboarding_runner`}),t(e=>({...e,status:`error`}))}finally{g(),kn({sawCompletePayload:o})&&r&&i&&(await mn(r,i),nt(s,r))}})()},[s]),u=(0,K.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,K.useCallback)((e,n)=>{if(r.current+=1,t(e),n&&e.installedPlugins.length>0){let t=a.current;t.clear();for(let r of e.installedPlugins)t.set(r,(async()=>{try{await In(await n(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function Hn({removedClaims:e,rejectedAll:t}){if(t)return[`Correction: none of what you found in that web search is actually me —`,`it looks like you matched someone else with a similar name. Please`,`disregard everything from that search and don't remember any of it as`,`true about me. We'll build up what you actually know about me from here,`,`as we talk.`].join(` `);let n=e.map(e=>e.trim()).filter(Boolean);return n.length===0?null:[`Quick correction on what you found about me — these aren't true, so please`,`disregard them and don't remember them as facts about me:`,``,...n.map(e=>`- ${e}`)].join(`
|
|
40
|
-
`)}async function Un({assistantId:e,conversationId:t,removedClaims:r,rejectedAll:i}){let a=Hn({removedClaims:r,rejectedAll:i});if(a){try{let n={conversationId:t,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:L(),clientMessageId:crypto.randomUUID()};await N({path:{assistant_id:e},body:n,throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_correction`})}await mn(e,t)}}var Wn=1500,Gn=12e4,Kn=e=>new Promise(t=>setTimeout(t,e));async function qn({awaitAssistantId:e,values:t,userName:r,assistantName:i}){let a,o;try{a=await e();let n=await ee({path:{assistant_id:a},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(o=n.data?.id,!n.response?.ok||!o)return;let s={conversationId:o,content:ft(t,r,i),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await N({path:{assistant_id:a},body:s,throwOnError:!1})).response?.ok)return;let c=Date.now()+Gn,l=``,u=0,d=!1;for(;Date.now()<c;){await Kn(Wn);let e=await te({path:{assistant_id:a},query:{conversationId:o},throwOnError:!1}),t=mt(e.data?.messages??[]);if(t&&(u=t===l?u+1:0,l=t),e.data?.processing===!0&&(d=!0),pt({processing:e.data?.processing,sawProcessing:d,hasReply:t.length>0,stableReads:u}))break}}catch(e){n(e,{context:`research_onboarding_personality`})}finally{if(a&&o)try{await j({path:{assistant_id:a,id:o},throwOnError:!1})}catch(e){n(e,{context:`research_onboarding_personality_archive`})}}}function Jn(e){let t=e?.trim();return`You're about to begin your first conversation.${t?`\nYour name is ${t} — introduce yourself as ${t}.`:``}
|
|
41
|
-
Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
|
|
42
|
-
Keep it short! For this opening greeting only, don't use \`recall\` or read any files — just say hello. (This applies to the greeting alone; use your tools normally for everything the user asks afterward.)`}function Yn(e,t){if(!e)return null;let n=new Date(e);if(Number.isNaN(n.getTime()))return null;try{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`,...t?{timeZone:t}:{}}).format(n)}catch{return new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(n)}}var q=l(),Xn=(0,K.createContext)(null);function Zn({size:e,children:t}){return(0,q.jsx)(Xn.Provider,{value:e,children:t})}function Qn(){let e=(0,K.useContext)(Xn),[t,n]=(0,K.useState)(()=>ut());return(0,K.useEffect)(()=>{if(e)return;let t=()=>n(ut());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var $n={x:.5,y:.4},er=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function tr(e){return er[e%er.length]??0}var nr=[1,0,1,0,1,0,1,0,1,0,0],rr=[.72,1],ir=[.4,1],ar=[10,20],or=50;function sr(e){return rr[nr[e]??1]??1}function cr(e){return ir[nr[e]??1]??1}function lr(e){return ar[nr[e]??1]??20}function ur(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function dr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function fr(e,t,n){let r=n*.4,i=n*.48;return[{x:i,y:i},{x:e*.3,y:r},{x:e*.72,y:r},{x:e-i,y:i},{x:e-r,y:t*.72},{x:e-i,y:t-i},{x:i,y:t-i},{x:r,y:t*.5},{x:e-r,y:t*.3},{x:e*.38,y:t-r},{x:e*.62,y:t-r}]}function pr(e,t,n,r,i){let a=e.x-t,o=e.y-n,s=Math.hypot(a,o)||1,c=Math.max(r,i);return{x:e.x+a/s*c,y:e.y+o/s*c}}function mr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Qn(),u=U(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),h=ur(c,l),g=h/2,_=h/2,v=dr(c,l)/h,y=dr(c,l),b=(0,K.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=$n.x*c,S=$n.y*l,C=x-g,w=S-g,T=(0,K.useMemo)(()=>fr(c,l,_),[c,l,_]);return(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,q.jsx)(`div`,{className:`absolute rounded-[50%] bg-[var(--aux-black,#000)] opacity-20 blur-md`,style:{width:y*.62,height:16,left:x-y*.31,top:S+y*.4}}),t.map((t,r)=>{let d=r===n,f=!u&&i?.char===r,_=!u&&a?.char===r;if(f){let n=T[i.fromSlot],a=pr(n,x,S,c,l),s=sr(i.fromSlot),u=cr(i.fromSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:or},initial:!1,animate:{x:[n.x-g,a.x-g,a.x-g,C,C,C],y:[n.y-g,a.y-g,a.y-g,w,w,w],scale:[s,s,s,v*.7,v*1.08,v],opacity:[u,u,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,q.jsx)(m,{components:e,traits:t,size:h})},r)}if(_){if(p(a.toSlot))return null;let n=T[a.toSlot],i=pr(n,x,S,c,l),o=sr(a.toSlot),s=cr(a.toSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:h,height:h,zIndex:lr(a.toSlot)},initial:!1,animate:{x:[C,C,i.x-g,i.x-g,n.x-g,n.x-g],y:[w,w,i.y-g,i.y-g,n.y-g,n.y-g],scale:[v,v*.6,o,o,o*1.1,o],opacity:[1,0,0,s,s,s]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${tr(a.toSlot)}deg)`},children:(0,q.jsx)(m,{components:e,traits:t,size:h,breathe:!1})})},r)}let y=b.get(r)??0;if(!d&&p(y))return null;let E=d?{x,y:S}:T[y];return(0,q.jsx)(H.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:h,height:h,zIndex:d?or:lr(y)},initial:!1,animate:{x:E.x-g,y:E.y-g,scale:d?v:sr(y),opacity:d?1:cr(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,q.jsx)(`div`,{style:{transform:d?void 0:`rotate(${tr(b.get(r)??0)}deg)`},children:(0,q.jsx)(m,{components:e,traits:t,size:h,breathe:d})})},r)})]})}var hr=[{bodyShape:`urchin`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`},{bodyShape:`star`,eyeStyle:`surprised`,color:`orange`},{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},{bodyShape:`ninja`,eyeStyle:`angry`,color:`yellow`},{bodyShape:`urchin`,eyeStyle:`curious`,color:`pink`},{bodyShape:`burst`,eyeStyle:`quirky`,color:`orange`},{bodyShape:`ghost`,eyeStyle:`bashful`,color:`green`},{bodyShape:`sprout`,eyeStyle:`dazed`,color:`orange`},{bodyShape:`star`,eyeStyle:`goofy`,color:`teal`},{bodyShape:`flower`,eyeStyle:`angry`,color:`pink`},{bodyShape:`cloud`,eyeStyle:`curious`,color:`yellow`}],J=T(w((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:hr,selectedIndex:0})},setSelectedIndex:t=>e({selectedIndex:t}),selectNext:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex+1)%e.characters.length})),selectPrev:()=>e(e=>({selectedIndex:e.characters.length===0?0:(e.selectedIndex-1+e.characters.length)%e.characters.length}))})));function gr(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function _r(){let e=G(),t=J.use.characters(),n=J.use.ensureGenerated(),r=U(),{w:i,h:a}=gr();(0,K.useEffect)(()=>{e&&n(e)},[e,n]);let o=ur(i,a),s=(0,K.useMemo)(()=>fr(i,a,o/2),[i,a,o]),c=i<640,l=new Set([4,7,8,9,10]);return!e||t.length===0?null:(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none fixed inset-0 z-0 overflow-hidden`,children:t.map((t,n)=>{if(n===0)return null;let i=n-1;if(c&&l.has(i))return null;let a=s[i];if(!a)return null;let u=er[i%er.length]??0,d=o*sr(i),f=cr(i),p=lr(i);return(0,q.jsx)(`div`,{className:`absolute`,style:{left:a.x-d/2,top:a.y-d/2,width:d,height:d,zIndex:p,animation:r?void 0:`character-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) ${.1+n*.05}s both`},children:(0,q.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,q.jsx)(m,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var vr=i(`flex w-full items-center gap-1.5 rounded-md border bg-[var(--field-bg)] px-3`,`border-[var(--field-border)] transition-[border-color,background-color] duration-150 ease-out`,`focus-within:border-[var(--border-active)]`),yr=i(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`,gt);function Y(e){return e.trim().toLowerCase()}function br(e,t,n=[],r=8){let i=Y(t),a=new Set(n.map(Y)),o=[];for(let t of e)if(!a.has(Y(t))&&((i.length===0||Y(t).includes(i))&&o.push(t),o.length>=r))break;return o}function xr({id:e,options:t,highlighted:n,showAddHint:r,onPick:a,onHover:o}){return(0,q.jsxs)(`ul`,{id:e,role:`listbox`,className:i(`absolute left-0 right-0 top-full z-50 mt-1.5 max-h-60 overflow-auto`,`rounded-lg bg-[var(--surface-lift)] p-1 shadow-[var(--shadow-popover)]`,`animate-[fadeInUp_0.12s_ease-out]`),children:[t.map((t,r)=>(0,q.jsx)(`li`,{id:`${e}-opt-${r}`,role:`option`,"aria-selected":r===n,onMouseDown:e=>{e.preventDefault(),a(t.value)},onMouseEnter:()=>o(r),className:i(`flex cursor-pointer items-center gap-2 rounded-md px-2.5 py-1.5`,`text-body-medium-lighter text-[var(--content-default)]`,r===n?`bg-[var(--surface-base)]`:`bg-transparent`),children:t.isAdd?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(_,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,q.jsx)(`span`,{className:`ml-auto shrink-0 text-body-small-default text-[var(--content-tertiary)]`,children:`↵ Enter`})]}):t.value},t.isAdd?`__add__${t.value}`:t.value)),r&&(0,q.jsx)(`li`,{role:`presentation`,className:`mt-0.5 border-t border-[var(--border-base)] px-2.5 pb-0.5 pt-1.5 text-body-small-default text-[var(--content-tertiary)]`,children:`Type anything and press ↵ to add your own`})]})}function Sr({htmlFor:e,required:t,children:n}){return(0,q.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function Cr(e,t){(0,K.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function wr({label:e,placeholder:t,values:n,onChange:r,suggestions:a}){let o=(0,K.useId)(),s=`tac-${o}`,c=`tac-list-${o}`,l=(0,K.useRef)(null),[u,d]=(0,K.useState)(``),[f,p]=(0,K.useState)(!1),[m,h]=(0,K.useState)(-1),g=(0,K.useMemo)(()=>br(a,u,n),[a,u,n]),_=u.trim(),v=(0,K.useMemo)(()=>{if(!_)return!1;let e=Y(_);return!(n.some(t=>Y(t)===e)||g.some(t=>Y(t)===e))},[_,n,g]),b=(0,K.useMemo)(()=>{let e=g.map(e=>({value:e,isAdd:!1}));return v?[...e,{value:_,isAdd:!0}]:e},[g,v,_]);Cr(l,()=>p(!1)),(0,K.useEffect)(()=>{h(e=>e>=b.length?b.length-1:e)},[b.length]);let x=f&&b.length>0,S=!v;function C(e){let t=e.trim();t&&(n.some(e=>Y(e)===Y(t))||r([...n,t]),d(``),h(-1))}function w(e){r(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),p(!0),h(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),h(e=>Math.max(e-1,0))):e.key===`Enter`?x&&m>=0?(e.preventDefault(),C(b[m].value)):u.trim()&&(e.preventDefault(),C(u)):e.key===`,`?(e.preventDefault(),C(u)):e.key===`Backspace`&&u.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&p(!1)}return(0,q.jsxs)(`div`,{ref:l,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(Sr,{htmlFor:s,children:e}),(0,q.jsxs)(`div`,{className:i(vr,`min-h-9 flex-wrap py-1.5`),children:[(0,q.jsx)(Je,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,q.jsx)(y,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,q.jsx)(`input`,{id:s,role:`combobox`,"aria-expanded":x,"aria-controls":c,"aria-autocomplete":`list`,"aria-activedescendant":m>=0?`${c}-opt-${m}`:void 0,autoComplete:`off`,className:i(yr,`h-6 w-24`),placeholder:n.length===0?t:``,value:u,onChange:e=>{d(e.target.value),p(!0)},onFocus:()=>p(!0),onKeyDown:T})]}),x&&(0,q.jsx)(xr,{id:c,options:b,highlighted:m,showAddHint:S,onPick:C,onHover:h})]})}var Tr=`Reading.Writing.Cooking.Baking.Gardening.Photography.Painting.Drawing.Hiking.Running.Cycling.Swimming.Yoga.Climbing.Weightlifting.Gaming.Board games.Chess.Traveling.Cars.Woodworking.Knitting.Playing guitar.Playing piano.Singing.Dancing.Fishing.Camping.Surfing.Skiing.Snowboarding.Coffee.Wine.Birdwatching.Pottery.Investing.Podcasts.Movies.Soccer.Basketball.Tennis.Golf.Meditation.Volunteering.Astronomy.3D printing`.split(`.`);function X(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function Er({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,i]=(0,K.useState)(e),[o,s]=(0,K.useState)(t),[c,l]=(0,K.useState)(``),[u,d]=(0,K.useState)([]),f=r.trim().length>0&&c.trim().length>0;function p(){f&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,q.jsxs)(st,{showCreatureFooter:!1,children:[(0,q.jsx)(_r,{}),(0,q.jsxs)(`form`,{className:`relative z-10 mx-auto flex min-h-screen w-full max-w-sm flex-col items-center justify-center px-6 py-16 text-[var(--content-default)]`,onSubmit:e=>{e.preventDefault(),p()},children:[(0,q.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:X(.05),children:`Let's start with you.`}),(0,q.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:X(.12),children:`A few details so I can get to know you.`}),(0,q.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,q.jsx)(`div`,{style:X(.2,40),children:(0,q.jsx)(b,{label:(0,q.jsxs)(q.Fragment,{children:[`What should I call you?`,(0,q.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`})]}),placeholder:`Your name`,value:r,onChange:e=>i(e.target.value),className:gt,autoFocus:!0,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.27,30),children:(0,q.jsx)(b,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),className:gt,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.34,20),children:(0,q.jsx)(b,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),className:gt,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.41,10),children:(0,q.jsx)(wr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:d,suggestions:Tr})})]}),(0,q.jsx)(`div`,{className:`mt-10 w-full`,style:X(.5),children:(0,q.jsx)(a,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),fullWidth:!0,disabled:!f,className:`h-11 text-base`,children:`Continue`})})]})]})})}function Dr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return(0,K.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return at(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=Dr(),i=n?n===`dark`?`#1A1A1A`:`#FFFFFF`:r.fg,a=n?n===`dark`?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`:r.wash;return(0,q.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:e,"aria-label":`Back`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(d,{className:`h-5 w-5`})}),t?(0,q.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Forward`,className:`flex cursor-pointer h-8 w-8 items-center justify-center rounded-md transition-colors duration-150`,style:{color:i},onMouseEnter:e=>e.currentTarget.style.backgroundColor=a,onMouseLeave:e=>e.currentTarget.style.backgroundColor=`transparent`,children:(0,q.jsx)(f,{className:`h-5 w-5`})}):null]})}var Or=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function kr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function Ar({onContinue:e,onBack:t,onForward:n}){let r=G(),i=J.use.characters(),o=J.use.ensureGenerated(),s=J.use.selectedIndex(),c=J.use.setSelectedIndex();(0,K.useEffect)(()=>{r&&o(r)},[r,o]);let l=i.length,[d,f]=(0,K.useState)(null),[m,h]=(0,K.useState)(``),[_,v]=(0,K.useState)(!1),y=(0,K.useRef)(!1),b=(0,K.useRef)(null),{ref:x,size:S}=dt(),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{l>0&&d===null&&f(kr(l,s))},[l,s,d]),(0,K.useEffect)(()=>{d&&c(d.centerChar)},[d,c]);let T=d?.centerChar;(0,K.useEffect)(()=>{T!=null&&!y.current&&h(Or[T%Or.length])},[T]),(0,K.useEffect)(()=>{_&&(b.current?.focus(),b.current?.select())},[_]);function E(e){if(!d||e===d.centerChar)return;let t=d.edgeOrder.indexOf(e);if(t<0)return;let n=[...d.edgeOrder];n[t]=d.centerChar,w({entering:{char:e,fromSlot:t},exiting:{char:d.centerChar,toSlot:t}}),f({centerChar:e,edgeOrder:n})}let D=()=>d&&E((d.centerChar+1)%l),O=()=>d&&E((d.centerChar-1+l)%l),k=(0,K.useMemo)(()=>d?i[d.centerChar]:void 0,[d,i]),A=!!r&&!!d&&!!k;function j(){k&&e({traits:k,name:m.trim()})}function M(){y.current=!0,h(e=>{let t=Or.filter(t=>t!==e),n=t.length>0?t:Or;return n[Math.floor(Math.random()*n.length)]})}let N=`pointer-events-auto z-10 flex cursor-pointer h-10 w-10 items-center justify-center rounded-full bg-[color-mix(in_srgb,var(--content-default)_10%,transparent)] text-[var(--content-default)] transition-colors duration-150 hover:bg-[color-mix(in_srgb,var(--content-default)_18%,transparent)]`;return(0,q.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,q.jsxs)(Zn,{size:S,children:[A&&(0,q.jsx)(mr,{components:r,characters:i,centerChar:d.centerChar,edgeOrder:d.edgeOrder,entering:C?.entering??null,exiting:C?.exiting??null,onEnterComplete:e=>w(t=>t?.entering.char===e?null:t),onSelectChar:E}),(0,q.jsx)(Z,{tone:`light`,onBack:t,onNext:n?j:void 0}),(0,q.jsx)(`h1`,{className:`absolute left-1/2 top-[19%] z-10 -translate-x-1/2 whitespace-nowrap text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.4s ease-out both`},children:`Give me a face and a name`}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Previous character`,onClick:O,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${N}`,children:(0,q.jsx)(u,{className:`h-4 w-4`})}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Next character`,onClick:D,className:`absolute right-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${N}`,children:(0,q.jsx)(W,{className:`h-4 w-4`})}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[51%] z-10 flex -translate-x-1/2 flex-col items-center gap-12`,children:[_?(0,q.jsx)(`input`,{ref:b,value:m,onChange:e=>{y.current=!0,h(e.target.value)},onBlur:()=>v(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),v(!1))},placeholder:`Name your assistant`,"aria-label":`Assistant name`,className:`w-[234px] rounded-2xl border border-[var(--border-element)] bg-transparent px-4 py-2.5 text-center text-lg text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none transition-colors duration-150 focus:border-[var(--border-active)]`}):(0,q.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,q.jsxs)(`button`,{type:`button`,onClick:()=>v(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,q.jsx)(`span`,{className:`text-3xl font-medium ${m?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:m||`Name your assistant`}),(0,q.jsx)(g,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,q.jsx)(`button`,{type:`button`,onClick:M,"aria-label":`Shuffle name`,title:`Shuffle name`,className:`cursor-pointer text-[var(--content-tertiary)] transition-[transform,color] duration-300 hover:rotate-180 hover:text-[var(--content-default)]`,children:(0,q.jsx)(p,{className:`h-5 w-5`})})]}),(0,q.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),disabled:!A,onClick:j,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var jr=.25,Mr=.46,Nr=.3,Pr=.85,Fr=40,Ir=14,Lr=8;function Rr({entrance:e=!1,entranceDelay:t=0,bumpNonce:n=0,settleBlink:r=!0}){let i=G(),a=J.use.characters(),o=J.use.selectedIndex(),s=U(),{w:c,h:l}=Qn(),[u,d]=(0,K.useState)({x:0,y:0});(0,K.useEffect)(()=>{if(s)return;let e=e=>{d({x:(e.clientX/window.innerWidth-.5)*2,y:(e.clientY/window.innerHeight-.5)*2})};return window.addEventListener(`mousemove`,e),()=>window.removeEventListener(`mousemove`,e)},[s]);let f=e&&!s,p=Ye();(0,K.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(!e);(0,K.useEffect)(()=>{if(s||!g)return;let e=!1,t,n=n=>{e||(h(!0),t=setTimeout(()=>{e||(h(!1),t=setTimeout(n,140))},140))},i=()=>{t=setTimeout(()=>n(i),2500+Math.random()*4e3)};return r?n(()=>n(i)):i(),()=>{e=!0,clearTimeout(t)}},[s,g,r]);let v=a.length>0?a[o]:void 0,y=(0,K.useMemo)(()=>{if(!i||!v)return null;let e=i.eyeStyles.find(e=>e.id===v.eyeStyle);return e?{paths:e.paths,bbox:Xe(e.paths.map(e=>Ze(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Pr,x=Math.min(Math.min(c,l)*Nr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-jr)*x,T=Fr/100*l-(w+x/2),E=(Mr-jr)*x,D=y.bbox.x+y.bbox.w/2,O=y.bbox.y+y.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[2]`,style:{left:C,top:w,width:S,height:x,transformOrigin:`center`},initial:f?{y:T,scale:.35}:!1,animate:f?{y:[T,E,0],scale:[.35,1,1]}:{y:0,scale:1},transition:f?{duration:1,delay:t,times:[0,.7,1],ease:`easeInOut`}:{duration:0},onAnimationComplete:()=>_(!0),children:(0,q.jsx)(H.div,{animate:p,children:(0,q.jsx)(`div`,{style:{transform:`translate(${u.x*Ir}px, ${u.y*Lr}px)`,transition:`transform 0.5s cubic-bezier(0.22, 1, 0.36, 1)`},children:(0,q.jsx)(`svg`,{viewBox:`${y.bbox.x} ${y.bbox.y} ${y.bbox.w} ${y.bbox.h}`,width:S,height:x,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:m?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${D}px ${O}px`,transition:`transform 0.14s ease-in-out`},children:y.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})})})}var zr=200,Br=40;function Vr({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:i}){let o=G(),s=J.use.characters(),c=J.use.selectedIndex(),l=U(),{ref:u,size:{w:d,h:f}}=dt(),p=Dr(),m=s.length>0?s[c]:void 0,h=(0,K.useMemo)(()=>{if(!o||!m)return null;let e=o.bodyShapes.find(e=>e.id===m.bodyShape),t=o.colors.find(e=>e.id===m.color);return!e||!t?null:{body:e,color:t.hex}},[o,m]),g=e.trim()?`Hey, ${e.trim()}!`:`Hey!`,_=t?.trim()?`I’m ${t.trim()}, your new AI assistant`:`I’m your new AI assistant`;if(!h)return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,style:{backgroundColor:`var(--surface-base)`}});let v=1.25*Math.max(d,f),y=v*h.body.viewBox.height/h.body.viewBox.width,b=(d-v)/2,x=(f-y)/2,S=zr/v,C=(Br/100-.5)*f;return(0,q.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,q.jsxs)(Zn,{size:{w:d,h:f},children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,style:{backgroundColor:h.color},initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.6,delay:.35}}),(0,q.jsx)(H.svg,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,viewBox:`0 0 ${h.body.viewBox.width} ${h.body.viewBox.height}`,width:v,height:y,style:{left:b,top:x,transformOrigin:`center`},initial:l?!1:{scale:S,y:C},animate:{scale:1,y:0},transition:l?{duration:0}:{type:`spring`,stiffness:78,damping:18,mass:1},children:(0,q.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,q.jsx)(Rr,{entrance:!0}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,q.jsx)(Z,{onBack:r,onNext:i})}),(0,q.jsxs)(`div`,{className:ht,children:[(0,q.jsxs)(H.h1,{className:`text-center leading-[1.05]`,style:{fontFamily:`var(--font-serif)`},initial:l?!1:{scale:.9,opacity:0},animate:{scale:1,opacity:1},transition:l?{duration:0}:{type:`spring`,stiffness:260,damping:11,delay:1},children:[(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,q.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,q.jsx)(H.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,q.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Hr=.3,Ur=.85,Wr=.25;function Gr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=Qn(),o=(0,K.useMemo)(()=>{if(!e||!r)return null;let t=e.eyeStyles.find(e=>e.id===r.eyeStyle);return t?{paths:t.paths,bbox:Xe(t.paths.map(e=>Ze(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Hr,i*Ur*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Wr*s,centerX:i/2,w:i,h:a}}function Kr({art:e,eyesW:t,eyesH:n,centerX:r,eyeCy:i,eyeScale:a,eyeX:o,blinking:s,className:c=`pointer-events-none absolute top-0 z-0`}){let l=kt(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:c,style:{left:r-t/2,top:0,x:o,y:l,width:t,height:n,scale:a,transformOrigin:`center`},children:(0,q.jsx)(`svg`,{viewBox:`${e.bbox.x} ${e.bbox.y} ${e.bbox.w} ${e.bbox.h}`,width:t,height:n,style:{overflow:`visible`,display:`block`},children:(0,q.jsx)(`g`,{style:{transform:s?`scaleY(0.1)`:`scaleY(1)`,transformOrigin:`${u}px ${d}px`,transition:`transform 0.13s ease-in-out`},children:e.paths.map((e,t)=>(0,q.jsx)(`path`,{d:e.svgPath,fill:e.color},t))})})})}var qr={green:[`pink`,`purple`,`orange`,`yellow`],orange:[`teal`,`purple`,`green`,`yellow`],pink:[`teal`,`green`,`yellow`,`purple`],purple:[`yellow`,`teal`,`green`,`orange`],teal:[`pink`,`orange`,`yellow`,`purple`],yellow:[`purple`,`teal`,`pink`,`green`]};function Jr(e,t){let n=qr[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Yr=new Set([`orange`,`pink`,`red`]);function Xr(e,t){return Yr.has(e)&&Yr.has(t)}function Zr(e,t,n){let r=Jr(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>Xr(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var Qr=`You’ve used AI that just answers questions`,$r=`The more I help`,ei=`I’m different`,ti=`The better I get`,ni=`and the less you have to do`,ri=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ii=290;function ai({firstH:e,secondH:t,color:n,firstText:r,secondText:i,revealed:a,carouseled:o,revealFrom:s,revealDuration:c,reduce:l}){let u=s===`bottom`?`inset(100% 0 0 0)`:`inset(0 0 100% 0)`;return!e||!t?null:(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,q.jsxs)(H.div,{className:`flex flex-col`,style:{color:n},initial:!1,animate:{y:o?-e:0},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:[(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:a?`inset(0% 0 0% 0)`:u},transition:l?{duration:0}:{duration:c,ease:`easeOut`},children:r})}),(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,q.jsx)(`span`,{className:`block`,children:i})})]})})}function oi({onContinue:e,onBack:t,onForward:n}){let r=Dr(),i=U(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Gr(),p=G(),h=J.use.characters(),g=J.use.selectedIndex(),_=h.length>0?h[g]:void 0,v=f>0&&f<=800,y=v?.17:.22,b=v?`top-[17%]`:`top-[22%]`,x=Et(0),S=Et(1),C=(0,K.useMemo)(()=>!p||!_?`orange`:Zr(_.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,_]),w=Math.min(220,Math.max(150,d*.16)),T=-w,E=-w*.4,D=Et(-220),O=(0,K.useMemo)(()=>!p||!_?[]:Zr(_.color,p.colors.map(e=>e.id),3),[p,_]),k=Math.max(.42,Math.min(d/1100,1)),A=Math.round(ii*k),j=-A*1.1,M=-A*.42,N=Et(-320),[ee,te]=(0,K.useState)(!!i),[ne,re]=(0,K.useState)(!!i),[P,F]=(0,K.useState)(!1),[ie,ae]=(0,K.useState)(!1),[oe,I]=(0,K.useState)(!1),[se,ce]=(0,K.useState)(!1),[le,ue]=(0,K.useState)(!!i),L=Math.min(d,768)-48,de=(0,K.useRef)(null),fe=(0,K.useRef)(null),pe=(0,K.useRef)(null),R=(0,K.useRef)(null),me=(0,K.useRef)(null),[he,ge]=(0,K.useState)(0),[_e,ve]=(0,K.useState)(0),[ye,be]=(0,K.useState)(0),[xe,Se]=(0,K.useState)(0),[Ce,we]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{de.current?.offsetHeight&&ge(de.current.offsetHeight),fe.current?.offsetHeight&&ve(fe.current.offsetHeight),pe.current?.offsetHeight&&be(pe.current.offsetHeight),R.current?.offsetHeight&&Se(R.current.offsetHeight),me.current?.offsetHeight&&we(me.current.offsetHeight)},[L]),(0,K.useEffect)(()=>{x.set(l),ce(!0)},[l,x]),(0,K.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>{F(!0),ae(!0),I(!0)},1400);return()=>clearTimeout(e)},[i]),(0,K.useEffect)(()=>{if(i||!o)return;x.set(l),S.set(1),D.set(T),N.set(j),te(!1),re(!1),F(!1),ae(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,a=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(te(!0),await Promise.all([a(nn(x,e,{duration:.55,ease:`easeOut`})),a(nn(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(re(!0),await Promise.all([a(nn(x,l,{type:`spring`,stiffness:210,damping:15})),a(nn(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(F(!0),ae(!0),await a(nn(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;I(!0);let t=a(nn(N,[j,M,M,j],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(ue(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[i,o,f,y,c,l,x,S,D,T,E,N,j,M]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:n}),(0,q.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none invisible absolute -left-[9999px] top-0 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{width:L,fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(`span`,{ref:de,className:`block`,children:Qr}),(0,q.jsx)(`span`,{ref:fe,className:`block`,children:$r}),(0,q.jsx)(`span`,{ref:pe,className:`block`,children:ei}),(0,q.jsx)(`span`,{ref:R,className:`block`,children:ti}),(0,q.jsx)(`span`,{ref:me,className:`block`,children:ni})]}),se&&o&&(0,q.jsx)(Kr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!i&&p&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{left:Math.max(16,d*.05),top:0,y:D,width:w,height:w},children:(0,q.jsx)(m,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!i&&p&&(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 top-0 z-[1] flex items-start`,style:{right:-Math.round(A*.12),y:N},children:ri.map((e,t)=>(0,q.jsx)(`div`,{style:{width:A,height:A,marginLeft:t===0?0:-A*.34,zIndex:ri.length-t},children:(0,q.jsx)(m,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:O[t]??`teal`},size:A,breathe:!1})},e.bodyShape))}),(0,q.jsxs)(`div`,{className:`${ht.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,q.jsxs)(`div`,{className:`flex w-full flex-col gap-3 text-[clamp(2.25rem,5.5vw,4.5rem)] leading-[1.15]`,style:{fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(ai,{firstH:he,secondH:_e,color:r.fgDeep,firstText:Qr,secondText:$r,revealed:ee,carouseled:P,revealFrom:`bottom`,revealDuration:.55,reduce:!!i}),(0,q.jsx)(ai,{firstH:ye,secondH:xe,color:r.fg,firstText:ei,secondText:ti,revealed:ne,carouseled:ie,revealFrom:`top`,revealDuration:.45,reduce:!!i}),(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:oe?Ce:0},transition:i?{duration:0}:{duration:.5,ease:`easeInOut`},children:Ce>0&&(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:Ce},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:oe?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:i?{duration:0}:{duration:.5,ease:`easeOut`},children:ni})})})]}),le&&(0,q.jsx)(H.div,{initial:i?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:i?{duration:0}:{duration:.4},children:(0,q.jsx)(a,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),onClick:e,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})}function si({idSuffix:e}){let t=`cf-${e}`,n=`cr-${e}`,r=`cg-${e}`,i=`cs-${e}`;return(0,q.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,q.jsxs)(`defs`,{children:[(0,q.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,q.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,q.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,q.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,q.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,q.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,q.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,q.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`45.5`,fill:`none`,stroke:`#FFF6CF`,strokeOpacity:`0.6`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeDasharray:`70 210`,transform:`rotate(-128 50 50)`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,q.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,q.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,q.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,q.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,q.jsx)(`ellipse`,{cx:`34`,cy:`24`,rx:`7`,ry:`4.5`,fill:`url(#${i})`})]})}function ci({size:e,tiltX:t=0,tiltY:n=0,shadow:r=!0,spinning:i=!1,className:a}){return(0,q.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,q.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,left:`50%`,bottom:-e*.14,width:e*.74,height:e*.16,transform:`translateX(-50%)`,background:`radial-gradient(ellipse at center, rgba(0,0,0,0.22), rgba(0,0,0,0) 70%)`,filter:`blur(2px)`}}),(0,q.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,q.jsxs)(H.div,{className:a,style:{width:e,height:e,position:`relative`,transformStyle:`preserve-3d`},initial:!1,animate:{rotateX:t,rotateY:i?[n,n+360,n+760,n+1180]:n},transition:i?{duration:.95,times:[0,.32,.62,1],ease:`easeInOut`}:{duration:0},children:[(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,q.jsx)(si,{idSuffix:`front`})}),(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,q.jsx)(si,{idSuffix:`back`})})]})})]})}var li=.3,ui=.95;function di({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=U(),a=Dr(),{h:o}=Qn(),[s,c]=(0,K.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,li*1e3)}}let u=o*.42,d=-o*.08,f=o*.9;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:n,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-full max-w-xl -translate-x-1/2 flex-col items-center gap-3 px-6 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,q.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,q.jsx)(H.div,{animate:s&&!i?{y:[0,u,d,f],scale:[1,1,1,.2],opacity:[1,1,1,0]}:{},transition:{duration:ui,times:[0,li/ui,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,q.jsx)(ci,{size:88,spinning:s&&!i})})}),!s&&(0,q.jsxs)(`button`,{type:`button`,onClick:l,className:`mt-6 flex cursor-pointer h-11 w-[234px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Claim`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}ot();var fi=640,pi=[{id:`companion-coworker`,left:`Companion`,right:`Coworker`,leftAvatar:{bodyShape:`blob`,eyeStyle:`gentle`,color:`pink`},rightAvatar:{bodyShape:`ninja`,eyeStyle:`curious`,color:`purple`}},{id:`genz-boomer`,left:`Gen Z`,right:`Baby Boomer`,leftAvatar:{bodyShape:`burst`,eyeStyle:`quirky`,color:`yellow`},rightAvatar:{bodyShape:`cloud`,eyeStyle:`dazed`,color:`green`}},{id:`execute-collaborate`,left:`Independent`,right:`Collaborative`,leftAvatar:{bodyShape:`star`,eyeStyle:`angry`,color:`orange`},rightAvatar:{bodyShape:`flower`,eyeStyle:`goofy`,color:`teal`}},{id:`playful-serious`,left:`Playful`,right:`Serious`,leftAvatar:{bodyShape:`star`,eyeStyle:`goofy`,color:`yellow`},rightAvatar:{bodyShape:`blob`,eyeStyle:`grumpy`,color:`purple`}},{id:`polite-unfiltered`,left:`Polite`,right:`Unfiltered`,leftAvatar:{bodyShape:`sprout`,eyeStyle:`bashful`,color:`green`},rightAvatar:{bodyShape:`urchin`,eyeStyle:`surprised`,color:`orange`}}],mi=[`9%`,`27%`,`45%`,`62%`,`79%`],Q=50,hi=.3*.75,gi=`rgba(36, 41, 46, 0.2)`,_i=`#FDFDFC`,vi=.16;function yi(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=r[i-1],o=e[i+1],s=e[i]??``,c=e=>e===t||e===a;if(!c(s)){r.push(s);continue}let l=n.find(e=>!c(e)&&e!==o)??n.find(e=>!c(e))??s;r.push(l)}return r}function bi(){let[e,t]=(0,K.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,K.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function xi({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+vi*100,c=n===`left`?-100+s*o:100-s*o;return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute`,style:{[n]:`calc(50% - 50vw)`,top:r,width:i,height:i,opacity:Math.min(1,o*1.6),transform:`translate(${c}%, -50%) scale(${.8+.2*o})`,transformOrigin:`${n} center`,transition:`transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease`,willChange:`transform, opacity`},children:(0,q.jsx)(m,{components:e,traits:t,size:i,breathe:!1})})}function Si({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,q.jsxs)(`div`,{className:`flex w-full shrink-0 flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,style:{opacity:i?.7:1},children:[(0,q.jsx)(`span`,{className:`order-1 flex-1 text-left text-sm sm:w-32 sm:flex-none sm:text-right sm:text-[17px]`,style:{color:r},children:e.left}),(0,q.jsx)(`span`,{className:`order-2 flex-1 text-right text-sm sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,q.jsxs)(C,{className:`relative order-3 flex h-6 w-full touch-none items-center select-none sm:order-2 sm:w-auto sm:flex-1`,value:[t],onValueChange:e=>n(e[0]??Q),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,q.jsx)(x,{className:`relative h-2 w-full grow rounded-full sm:h-3`,style:{backgroundColor:gi}}),(0,q.jsx)(S,{className:`block h-5 w-5 cursor-grab rounded-full shadow-sm transition-transform active:scale-95 active:cursor-grabbing keyboard-focus:outline-none keyboard-focus:ring-2 keyboard-focus:ring-white/70 data-[disabled]:cursor-not-allowed data-[disabled]:active:scale-100 sm:h-6 sm:w-6`,style:{backgroundColor:_i}})]})]})}function Ci({components:e,values:t,sideAvatars:n,size:r}){return(0,q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 -z-10`,children:pi.map((i,a)=>{let o=t[i.id]??Q,s=Math.max(0,(Q-o)/Q),c=Math.max(0,(o-Q)/Q),l=mi[a]??`50%`,u=n[a];return u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(xi,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,q.jsx)(xi,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function wi({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=Dr(),s=G(),c=bi(),{w:l,h:u}=Qn(),d=Math.round(hi*Math.min(l,u))+12,f=c>=fi,p=J.use.characters()[J.use.selectedIndex()]?.color,m=Math.round(Math.min(300,Math.max(160,c*.16))),h=(0,K.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=yi(pi.map(e=>e.leftAvatar.color),p,e),n=yi(pi.map(e=>e.rightAvatar.color),p,e);return pi.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,p]);return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),f&&s&&(0,q.jsx)(Ci,{components:s,values:e,sideAvatars:h,size:m}),(0,q.jsxs)(`div`,{className:`absolute inset-x-0 top-0 bottom-0 mx-auto flex w-full max-w-2xl flex-col items-center overflow-y-auto px-6`,style:{paddingBottom:d},children:[(0,q.jsx)(`div`,{className:`w-full min-h-14 shrink-[4]`,style:{flexBasis:Math.round(u*.14)}}),(0,q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,q.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,q.jsx)(`p`,{className:`hidden max-w-md text-center text-[15px] sm:block`,style:{color:o.fgMuted},children:`How do you want me to talk to you? You can always ask me to change my personality later.`})]}),(0,q.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-10`}),pi.map((r,i)=>(0,q.jsxs)(K.Fragment,{children:[i>0&&(0,q.jsx)(`div`,{className:`w-full min-h-2.5 shrink basis-8 sm:basis-11`}),(0,q.jsx)(Si,{axis:r,value:e[r.id]??Q,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n})]},r.id)),(0,q.jsx)(`div`,{className:`w-full min-h-3 shrink-[2] basis-14`}),(0,q.jsxs)(`button`,{type:`button`,onClick:r,className:`flex h-11 w-[234px] shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 active:scale-[0.97]`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[`Continue`,(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}function Ti({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s,hatchError:c=null}){let l=Dr(),{handleConnect:u,oauthInProgress:d}=it({assistantId:e??``,onConnect:n}),f=()=>{s?.(),u()},p=!e||!t,m=p||d;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:l.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[26%] flex w-[360px] -translate-x-1/2 flex-col items-center gap-5 text-center`,children:[(0,q.jsx)(`h1`,{className:`text-[2.6rem] leading-tight`,style:{fontFamily:`var(--font-serif)`},children:p?`Waking up`:o?`Access not enabled`:`Let me make this easy`}),(0,q.jsx)(`p`,{className:`text-[16px]`,style:{color:l.fgMuted},children:p?`Your assistant is getting ready`:o?`Check the box next to the Google Calendar permission so I can book the check-in.`:`Connect your Google Calendar so I can find time to check in and start helping.`}),(0,q.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,q.jsx)(`button`,{type:`button`,onClick:f,disabled:m,className:`flex cursor-pointer h-11 w-full items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition-transform duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:l.isLight?`#1A1A1A`:`#FFFFFF`,color:l.isLight?`#FFFFFF`:`#1A1A1A`},children:p?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):d?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(h,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(!p||c)&&(0,q.jsx)(`button`,{type:`button`,onClick:r,disabled:d,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:l.fgMuted},children:`Skip for now`})]})]})]})}var Ei=at(`#17191C`);function Di(){let[e,t]=(0,K.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,K.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Oi(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function ki({size:e=64,isAssistantBusy:t=!1}){let{components:n,chosen:r}=Oi();return!n||!r?(0,q.jsx)(`div`,{style:{width:e,height:e}}):(0,q.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,q.jsx)(m,{components:n,traits:r,size:e,isAssistantBusy:t})})}var Ai=64,ji=4500,Mi=7e3;function Ni({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Oi(),s=U(),{w:c,h:l}=Di(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,K.useEffect)(()=>{let t=setTimeout(e,i&&!r?Mi:ji);return()=>clearTimeout(t)},[e,i,r]);let d=(0,K.useRef)(null),[f,p]=(0,K.useState)(null);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current?.getBoundingClientRect();e&&p({cx:e.left+e.width/2,cy:e.top+e.height/2})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u]);let h=1.3*Math.max(c,l)/Ai,g=f?c/2-f.cx:0,_=f?l*.88-f.cy:0,v=l*.05;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,q.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ai,height:Ai},children:a&&o&&f&&(0,q.jsx)(H.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:h,x:g,y:_},animate:{x:[g,g,0,0],y:[_,_+v,0,0],scale:[h,h,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,q.jsx)(m,{components:a,traits:o,size:Ai})})}),(0,q.jsx)(H.span,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:s?!1:{opacity:0,x:-8},animate:{opacity:1,x:0},transition:s?{duration:0}:{duration:.4,delay:.9},children:u})]})]})}var Pi=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Fi=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Ii=`Almost there…`,Li=[...Pi,Ii],Ri=[...Fi,Ii],zi=2800;function Bi({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=Ei,[o,s]=(0,K.useState)(0);return(0,K.useEffect)(()=>{n?.(o);let t=o>=Li.length-1;if(i&&t){let t=setTimeout(e,zi);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Li.length),zi);return()=>clearTimeout(r)},[o,i,e,n]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:t,onNext:r}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(ki,{isAssistantBusy:!0}),(0,q.jsx)(qe,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Li[o]},o)})]})]})}function Vi({onDone:e,ready:t}){let n=Ei,[r,i]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let n=Ri.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,zi);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Ri.length),zi);return()=>clearTimeout(a)},[r,t,e]),(0,q.jsx)(`div`,{className:`absolute inset-0 z-10`,style:{color:n.fg},children:(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] sm:top-[26%] flex w-full max-w-xl -translate-x-1/2 items-start gap-3 px-6`,children:[(0,q.jsx)(ki,{isAssistantBusy:!0}),(0,q.jsx)(qe,{mode:`wait`,children:(0,q.jsx)(H.p,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},initial:{y:12,opacity:0},animate:{y:0,opacity:1},exit:{y:-12,opacity:0},transition:{duration:.35},children:Ri[r]},r)})]})})}function Hi({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=Ei,s=U(),[c,l]=(0,K.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,q.jsx)(Z,{onBack:i,onNext:a}),(0,q.jsxs)(`div`,{className:`absolute bottom-0 left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6 pb-8`,children:[(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(ki,{}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:o.fgMuted},children:d?t?`Still checking the rest. You can review these as they come in.`:`I searched the web. Feel free to remove anything that isn’t true`:t?`Still putting this together…`:`I didn’t turn up much — we can fill it in as we chat.`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,q.jsx)(qe,{children:u.map(e=>(0,q.jsxs)(H.div,{layout:!0,initial:s?!1:{opacity:0,y:10},animate:{opacity:1,y:0},exit:s?void 0:{opacity:0,scale:.95},className:`flex items-center justify-between gap-3 rounded-2xl px-5 py-4 text-[15px]`,style:{backgroundColor:o.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`span`,{children:e.claim}),(0,q.jsx)(`button`,{type:`button`,"aria-label":`Remove "${e.claim}"`,onClick:()=>l(t=>new Set(t).add(e.claim)),className:`flex cursor-pointer h-6 w-6 shrink-0 items-center justify-center rounded-full transition-opacity hover:opacity-100`,style:{color:o.fgMuted},children:(0,q.jsx)(v,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,q.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start shrink-0 cursor-pointer text-[14px] underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:o.fgMuted},children:`This is not me`})]}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>n([...c]),disabled:!f,className:`mt-8 flex cursor-pointer h-11 w-[200px] shrink-0 items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:o.isLight?`#1A1A1A`:`#FFFFFF`,color:o.isLight?`#FFFFFF`:`#1A1A1A`},children:[f?`Continue`:`Still searching…`,f&&(0,q.jsx)(W,{className:`h-4 w-4`})]})]})]})}var $=64,Ui=$;function Wi({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Oi();if(!a||!o)return null;let s=$/2,c=n&&t?t:e,l={x:c.x-s,y:c.y-s};return(0,q.jsx)(H.div,{className:`pointer-events-none absolute left-0 top-0`,style:{width:$,height:$,transformOrigin:`center`},initial:!1,animate:l,transition:r?{duration:0}:n&&t?{type:`spring`,duration:.9,bounce:.45}:{duration:.4},onAnimationComplete:()=>{n&&t&&i()},children:(0,q.jsx)(m,{components:a,traits:o,size:$})})}function Gi({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=Ei,o=U(),[s,c]=(0,K.useState)(!1),l=e.map(e=>({name:e,displayName:ct(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,K.useRef)(null),f=(0,K.useRef)(null),p=(0,K.useRef)(null),[m,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(!1);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=d.current,t=f.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=e=>({x:e.left-n.left+e.width/2,y:e.top-n.top+e.height/2}),i=p.current;h({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[l.length]);let b=m?.note?.y;return(0,K.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,q.jsx)(Z,{onBack:r,onNext:i}),(0,q.jsxs)(`div`,{ref:d,className:`absolute left-1/2 top-1/2 z-10 flex w-full max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(H.div,{ref:f,className:`shrink-0`,style:{height:$},initial:!1,animate:g?{width:0,marginRight:0}:{width:$,marginRight:12},transition:o?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,q.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,q.jsxs)(H.div,{initial:o?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:o?{duration:0}:{duration:.3,delay:t*.06},className:`rounded-2xl px-5 py-4`,style:{backgroundColor:a.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:[(0,q.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,q.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,q.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:Ui}}),(0,q.jsx)(H.p,{className:`text-[15px]`,style:{color:a.fg},initial:!1,animate:{opacity:+!!v,x:v?0:-6},transition:o?{duration:0}:{duration:.35},children:`I’ve set myself up with plugins around who you are.`})]}),(0,q.jsxs)(`button`,{type:`button`,onClick:()=>{s||(c(!0),Promise.resolve().then(n).catch(()=>c(!1)))},disabled:s,className:`mt-16 flex cursor-pointer h-11 w-[200px] items-center justify-center gap-2 rounded-[10px] text-body-medium-default transition duration-150 enabled:active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60`,style:{backgroundColor:a.isLight?`#1A1A1A`:`#FFFFFF`,color:a.isLight?`#FFFFFF`:`#1A1A1A`},children:[s?`Starting…`:`Let's chat`,!s&&(0,q.jsx)(W,{className:`h-4 w-4`})]}),m&&(0,q.jsx)(Wi,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var Ki=[{bodyShape:`sprout`,eyeStyle:`curious`,colorIdx:0,base:230,pos:e=>({left:-e*.32,top:`40%`})},{bodyShape:`flower`,eyeStyle:`goofy`,colorIdx:1,base:230,pos:e=>({right:-e*.32,top:`40%`})},{bodyShape:`star`,eyeStyle:`dazed`,colorIdx:2,base:240,mobile:!0,pos:e=>({left:`16%`,bottom:-e*.42}),mobilePos:e=>({left:-e*.3,bottom:-e*.3})},{bodyShape:`burst`,eyeStyle:`angry`,colorIdx:0,base:240,mobile:!0,pos:e=>({right:`16%`,bottom:-e*.42}),mobilePos:e=>({right:-e*.3,bottom:-e*.3})},{bodyShape:`blob`,eyeStyle:`gentle`,colorIdx:1,base:220,pos:e=>({left:`42%`,bottom:-e*.5})},{bodyShape:`urchin`,eyeStyle:`curious`,colorIdx:2,base:220,mobile:!0,pos:e=>({left:-e*.28,bottom:`16%`}),mobilePos:e=>({left:-e*.3,top:-e*.3})},{bodyShape:`burst`,eyeStyle:`quirky`,colorIdx:0,base:220,mobile:!0,pos:e=>({right:-e*.28,bottom:`16%`}),mobilePos:e=>({right:-e*.3,top:-e*.3})},{bodyShape:`flower`,eyeStyle:`quirky`,colorIdx:1,base:230,pos:e=>({left:`30%`,bottom:-e*.4})}],qi=`#17191C`,Ji=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],Yi=290;function Xi({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=G(),o=J.use.characters(),s=J.use.selectedIndex(),c=U(),{w:l}=Qn(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:p,peekColors:h}=(0,K.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:Zr(f.color,a.colors.map(e=>e.id),3)},[a,f]);return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(H.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?qi:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,q.jsx)(Rr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,q.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(Yi*u)*.42,right:-Math.round(Yi*u)*.12},children:Ji.map((e,t)=>{let n=Math.round(Yi*u);return(0,q.jsx)(H.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:Ji.length-t},initial:c?!1:{y:-140,opacity:0},animate:{y:0,opacity:1},transition:c?{duration:0}:{type:`spring`,stiffness:200,damping:18,delay:t*.1},children:(0,q.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,q.jsx)(qe,{children:(d?Ki.filter(e=>e.mobile):Ki).slice(0,Math.max(0,e)).map((e,t)=>{let n=Math.round(e.base*u),r=d&&e.mobilePos?e.mobilePos(n):e.pos(n);return(0,q.jsx)(H.div,{"aria-hidden":`true`,className:`pointer-events-none absolute z-[1]`,style:{...r,width:n,height:n},initial:c?!1:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:c?void 0:{scale:0,opacity:0},transition:c?{duration:0}:{type:`spring`,stiffness:220,damping:16,delay:.1},children:(0,q.jsx)(m,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:h[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var Zi={established:!1,assistantName:null};async function Qi(e,t={hasAnyActiveConversation:R,fetchAssistantIdentity:tt}){try{if(!await t.hasAnyActiveConversation(e))return Zi}catch(e){return n(e,{context:`research_onboarding_established_check`}),Zi}let r=await t.fetchAssistantIdentity(e).catch(()=>null);return{established:!0,assistantName:(typeof r?.name==`string`?r.name.trim():``)||null}}function $i({assistantName:e,onKeep:t,onRedo:n,onBack:r}){let i=e?.trim()||``,o=i||`your assistant`,s=i?`${i}'s`:`its`;return(0,q.jsxs)(`div`,{"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-primary)`},children:[(0,q.jsx)(Z,{onBack:r,tone:`light`}),(0,q.jsxs)(`div`,{className:`${ht} max-w-xl`,children:[(0,q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:i?`${i} is already up and running`:`Your assistant is already up and running`}),(0,q.jsxs)(`p`,{className:`text-[15px]`,style:{color:`var(--content-secondary)`},children:[`You two have history — a personality, memories, and past conversations. Running setup again would overwrite who `,o,` is now.`]})]}),(0,q.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center gap-3`,children:[(0,q.jsxs)(a,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:[`Keep `,o,` and start chatting`,(0,q.jsx)(W,{className:`h-4 w-4`})]}),(0,q.jsxs)(a,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:n,className:`h-11 text-base`,children:[`Start over and rebuild `,s,` personality`]})]})]})]})}var ea=4e3;function ta(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobbies:e.hobbies,timezone:pe()}}function na(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}ot();function ra(){let e=s(),t=oe.use.user(),n=t?.id??null,r=$e.use.enterFocus(),i=$e.use.exitFocus(),a=$e.use.setPendingAvatarTraits(),c=$e.use.requestSidebarCollapse(),[l,u]=(0,K.useState)(`form`),{ref:d,size:f}=dt(),[p,m]=(0,K.useState)([]),[h,g]=(0,K.useState)(!1);function _(e){u(e)}function v(e,t=`completed`){et(Qe[l],{userId:n,outcome:t}),m([]),_(e)}function y(e){m(e=>[...e,l]),_(e)}function b(){let e=p[p.length-1];e&&(m(e=>e.slice(0,-1)),_(e))}let x=p.length>0?b:void 0,[S,C]=(0,K.useState)(null),w=(0,K.useRef)(null),[T,E]=(0,K.useState)(null),[O,A]=(0,K.useState)(null),j=(0,K.useRef)(!1),[M,N]=(0,K.useState)(null),[ee,te]=(0,K.useState)({}),[ne,re]=(0,K.useState)(!1),[P,F]=(0,K.useState)(null),[ie,I]=(0,K.useState)(null),[se,ce]=(0,K.useState)(!1),[le,L]=(0,K.useState)(!1),[pe,R]=(0,K.useState)(!1),[ve,ye]=(0,K.useState)(0),[be,xe]=(0,K.useState)(0),[Se]=o(),Ce=sn({hostingParam:Se.get(`hosting`),localMode:k(),gatewayAuthSession:D()}),we=Se.get(`assistant`)??void 0,Te=Ce,{start:Ee,ready:De,assistantId:z,error:Oe,awaitReady:B}=pn({adoptExisting:Ce,adoptAssistantId:we}),V=Vn(),{start:ke,hydrate:Ae}=V,je=(0,K.useRef)(Promise.resolve()),Me=(0,K.useRef)(Promise.resolve()),[Ne,Pe]=(0,K.useState)(!1),Fe=V.status===`idle`||V.status===`running`,Ie=!Fe&&V.claims.length===0;(0,K.useEffect)(()=>{i(),a(null),Ee()},[i,a,Ee]),(0,K.useEffect)(()=>{if(w.current)return;let e=B().then(e=>Qi(e)).catch(()=>Zi);w.current=e,e.then(E)},[B]),(0,K.useLayoutEffect)(()=>{if(h||!n)return;let e=he(n);if(e?.formValues){C(e.formValues),N(e.faceValues),I(e.checkinTime),L(e.checkinBooked),F(e.researchConversationId??null),e.research&&Ae({...e.research,pluginCatalog:e.research.pluginCatalog??{}},B);let t=ge(e);u(Te&&(t===`letschat`||t===`meeting`)?`looking`:t),m([])}g(!0)},[h,n,Ae,B,Te]),(0,K.useEffect)(()=>{!h||!S||me(n,{step:l,formValues:S,faceValues:M,checkinTime:ie,checkinBooked:le,research:V.status===`done`?{status:`done`,claims:V.claims,suggestions:V.suggestions,installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog}:null,...P?{researchConversationId:P}:{}})},[h,n,l,S,M,ie,le,P,V.status,V.claims,V.suggestions,V.installedPlugins,V.pluginCatalog]),(0,K.useEffect)(()=>{h&&(!S||V.status!==`idle`||ke({awaitAssistantId:B,subject:ta(S),conversationTitle:na(S),...P?{resumeConversationId:P}:{},onConversationCreated:F,includeSuggestions:!1}))},[h,S,P,V.status,ke,B,!0]),(0,K.useEffect)(()=>{l===`results`&&Ie&&(m([]),u(`suggestions`))},[l,Ie]);function Le(t,i,o,{skip:s=!1,hidden:l=!1}={}){_e(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!s&&o===void 0;fe({tools:[],tasks:[],tone:_t,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...s?{}:{initialMessage:o??on({firstName:u,lastName:d,occupation:f,hobbies:p}),...l?{initialMessageHidden:!0}:{}},...g?{title:h?`Getting to know ${h}`:`Getting to know you`}:{},...i?.name?.trim()?{assistantName:i.name.trim()}:{}});let _=i?.name?.trim();_&&de(_),a(i?.traits??null),g&&r(),s||ae.markExpectingFirstMessage(),c(),ae.checkAssistant(z??void 0).finally(()=>{e(`${ue.assistant}?onboarding=1`,{replace:!0})})}async function Re(){S&&(await Promise.all([V.awaitPluginInstalls(),je.current,Me.current]),Le(S,M,Jn(M?.name),{hidden:!0}))}function ze(e){V.start({awaitAssistantId:B,subject:ta(e),conversationTitle:na(e),onConversationCreated:F,includeSuggestions:!1})}async function Be(e){if(!j.current&&(T??await Promise.race([w.current??Promise.resolve(null),new Promise(e=>{setTimeout(()=>e(null),ea)})]))?.established){A(e),v(`existing`);return}C(e),ze(e),v(`face`)}function Ve(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){R(!0);return}if(R(!1),z&&S){let e=[S.firstName.trim(),S.lastName.trim()].filter(Boolean).join(` `);I(null),L(!1),ce(!0),lt({assistantId:z,userName:e||void 0,assistantName:M?.name?.trim()||void 0}).then(e=>{e.scheduled&&(L(!0),I(Yn(e.start,e.timeZone)))}).finally(()=>ce(!1))}v(`meeting`)}if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l)&&S){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(l);return(0,q.jsx)(`div`,{ref:d,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,q.jsxs)(Zn,{size:f,children:[(0,q.jsx)(Xi,{eyesBumpNonce:ve,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(l)?be:0,darkBg:e,showBottomEyes:!e&&l!==`different`}),l===`different`&&(0,q.jsx)(oi,{onContinue:()=>v(`personality`),onBack:()=>y(`intro`),onForward:x}),l===`personality`&&(0,q.jsx)(wi,{values:ee,onValueChange:(e,t)=>te(n=>({...n,[e]:t})),locked:ne,onContinue:()=>{ne||(Pe(!0),Me.current=qn({awaitAssistantId:B,values:ee,userName:S?.firstName?.trim()||void 0,assistantName:M?.name?.trim()||void 0}).finally(()=>Pe(!1)),re(!0)),v(`integration`)},onBack:()=>y(`different`),onForward:x}),l===`integration`&&(0,q.jsx)(di,{onClaim:()=>v(Te?`looking`:`letschat`),onBumpEyes:()=>ye(e=>e+1),onBack:()=>y(`personality`),onForward:x}),l===`letschat`&&(0,q.jsx)(Ti,{assistantId:z,assistantReady:De,hatchError:Oe,onConnected:Ve,missingCalendarScope:pe,onRetry:()=>R(!1),onSkip:()=>{R(!1),v(`looking`,`skipped`)},onBack:()=>y(`integration`),onForward:x}),l===`meeting`&&(0,q.jsx)(Ni,{scheduledTime:ie??void 0,awaitingTime:se,onDone:()=>v(`looking`),onBack:()=>y(`letschat`),onForward:x}),l===`looking`&&(0,q.jsx)(Bi,{onDone:()=>v(Ie?`suggestions`:`results`),onBack:()=>y(Te?`integration`:`letschat`),onAdvance:e=>xe(Math.min(e+1,4)),onForward:x,ready:!Fe}),l===`results`&&(0,q.jsx)(Hi,{claims:V.claims,loading:Fe,onContinue:e=>{P&&z&&e.length>0&&(je.current=Un({assistantId:z,conversationId:P,removedClaims:e,rejectedAll:!1})),v(`suggestions`)},onRejectAll:()=>{P&&z&&(je.current=Un({assistantId:z,conversationId:P,removedClaims:V.claims.map(e=>e.claim),rejectedAll:!0})),v(`suggestions`,`skipped`)},onBack:()=>y(`looking`),onForward:x}),l===`suggestions`&&(0,q.jsx)(Gi,{installedPlugins:V.installedPlugins,pluginCatalog:V.pluginCatalog,onStart:async()=>{if(et(Qe.suggestions,{userId:n,outcome:`completed`}),Ne){m([]),u(`finishing`);return}await Re()},onBack:()=>y(Ie?`looking`:`results`),onForward:x}),l===`suggestions`&&!1,l===`finishing`&&(0,q.jsx)(Vi,{ready:!Ne,onDone:()=>void Re()})]})})}return l===`existing`?(0,q.jsx)($i,{assistantName:T?.assistantName??null,onKeep:()=>{et(Qe.existing,{userId:n,outcome:`completed`}),_e(n),ae.checkAssistant(z??void 0).finally(()=>{e(ue.assistant,{replace:!0})})},onRedo:()=>{let e=O;e&&(j.current=!0,et(Qe.existing,{userId:n,outcome:`skipped`}),C(e),ze(e),m([]),_(`face`))},onBack:()=>{A(null),y(`form`)}}):l===`intro`&&S?(0,q.jsx)(Vr,{firstName:S.firstName,assistantName:M?.name,onContinue:()=>v(`different`),onBack:()=>y(`face`),onForward:x}):l===`face`&&S?(0,q.jsx)(Ar,{onContinue:e=>{N(e),v(`intro`)},onBack:()=>y(`form`),onForward:x}):(0,q.jsx)(Er,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Be})}export{ra as ResearchOnboardingRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BGD3-GQf.js";import{t as n}from"./react-DJZBPgpf.js";import{P as r,t as i}from"./button-BQVYX8n_.js";import{f as a,u as o}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./typography-Cqi8q9o7.js";import{t as d}from"./createLucideIcon-Bjb-Kuq7.js";import{t as f}from"./calendar-D0labpMU.js";import{t as p}from"./chevron-down-DpYf9Gwq.js";import{t as m}from"./chevron-right-jRymmL7S.js";import{t as h}from"./clock-LiCGqvyn.js";import{t as g}from"./loader-circle-D57RZgLH.js";import{t as _}from"./repeat-CS_kgMdk.js";import{t as v}from"./x-CswtfvgS.js";import{t as y}from"./notice-BylgS5W_.js";import{i as b,j as x}from"./src-CDdn26Yb.js";import{t as S}from"./tag-B6WeUtBW.js";import{n as C,t as w}from"./input-ZpyYt_a0.js";import{t as T}from"./toggle-QSEiPr3k.js";import{t as E}from"./modal-BtcwNEBj.js";import{t as D}from"./panel-item-Bvqsr5n9.js";import{n as O}from"./toast-ZoZVyeDI.js";import{t as k}from"./dropdown-BMNSccmo.js";import{Bt as A,F as j,Jt as M,M as N,N as P,P as ee,Yt as te,_ as F,c as I,d as L,dt as ne,ft as re,g as R,j as ie,mt as ae,pt as oe,ut as se,v as ce,y as le}from"./react-query.gen-BQH0QRfT.js";import{a as ue}from"./api-BBMl4mW3.js";import{c as z}from"./routes-XPLb07Av.js";import{t as B}from"./effective-timezone-Ct3PoWNH.js";import{t as V}from"./assistant-feature-flag-store-BpbbAIKZ.js";import{Hi as de,Qn as H,Rr as fe,Ya as pe,Zi as me,ja as he,ra as ge,zr as _e}from"./index-CZVGv7Cn.js";import{t as ve}from"./use-active-assistant-id-9rGx8kT9.js";import{t as ye}from"./detail-card-CA8lPa5K.js";import{a as be,c as xe,i as Se,l as Ce,n as we,o as Te,r as Ee,s as De,t as Oe,u as ke}from"./page-empty-state-DbCk3v6f.js";import{r as Ae,t as je}from"./profile-metadata-DZwV-VFB.js";var Me=d(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),U=e(n(),1),Ne={frequency:`daily`,minute:0,hour24:9,weekdays:[1],dayOfMonth:1},W=[{value:0,letter:`S`,short:`Sun`,full:`Sunday`},{value:1,letter:`M`,short:`Mon`,full:`Monday`},{value:2,letter:`T`,short:`Tue`,full:`Tuesday`},{value:3,letter:`W`,short:`Wed`,full:`Wednesday`},{value:4,letter:`T`,short:`Thu`,full:`Thursday`},{value:5,letter:`F`,short:`Fri`,full:`Friday`},{value:6,letter:`S`,short:`Sat`,full:`Saturday`}],Pe=[1,2,3,4,5];function G(e,t,n){return Number.isFinite(e)?Math.min(n,Math.max(t,Math.round(e))):t}function Fe(e){let t=Array.from(new Set(e.map(e=>G(e,0,6)).filter(e=>Number.isInteger(e)))).sort((e,t)=>e-t);return t.length>0?t:[1]}function Ie(e){let t=G(e.minute,0,59),n=G(e.hour24,0,23);switch(e.frequency){case`hourly`:return`${t} * * * *`;case`daily`:return`${t} ${n} * * *`;case`weekly`:return`${t} ${n} * * ${Fe(e.weekdays).join(`,`)}`;case`monthly`:return e.dayOfMonth===`last`?`${t} ${n} L * *`:`${t} ${n} ${G(e.dayOfMonth,1,28)} * *`}}function Le(e,t){let n=G(e,0,23),r=G(t,0,59),i=n<12?`AM`:`PM`;return`${n%12==0?12:n%12}:${String(r).padStart(2,`0`)} ${i}`}function Re(e){let t=[`th`,`st`,`nd`,`rd`],n=e%100;return`${e}${t[(n-20)%10]??t[n]??t[0]}`}function ze(e){let t=Fe(e),n=new Set(t);if(t.length===7)return`every day`;if(t.length===5&&Pe.every(e=>n.has(e)))return`every weekday`;if(t.length===2&&n.has(0)&&n.has(6))return`every weekend`;if(t.length===1)return`every ${W[t[0]]?.full??`day`}`;let r=t.map(e=>W[e]?.short??``),i=r.pop();return`every ${r.join(`, `)} & ${i}`}function Be(e){let t=Le(e.hour24,e.minute);switch(e.frequency){case`hourly`:{let t=G(e.minute,0,59);return`Runs every hour at :${String(t).padStart(2,`0`)}`}case`daily`:return`Runs every day at ${t}`;case`weekly`:return`Runs ${ze(e.weekdays)} at ${t}`;case`monthly`:return e.dayOfMonth===`last`?`Runs on the last day of every month at ${t}`:`Runs on the ${Re(G(e.dayOfMonth,1,28))} of every month at ${t}`}}var K=l(),Ve=[{value:`hourly`,label:`Hourly`},{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}],He=Array.from({length:12},(e,t)=>{let n=t+1;return{value:String(n),label:String(n)}}),Ue=Array.from({length:12},(e,t)=>{let n=t*5,r=String(n).padStart(2,`0`);return{value:r,label:r}}),We=[...Array.from({length:28},(e,t)=>{let n=t+1;return{value:String(n),label:Re(n)}}),{value:`last`,label:`Last day`}],Ge=[{value:`AM`,label:`AM`},{value:`PM`,label:`PM`}];function Ke(e,t){let n=e%12;return t===`PM`?n+12:n}function qe(e){try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return t&&t!==e?`${e} · ${t}`:e}catch{return e}}function Je({isOpen:e,assistantId:t,onClose:n,onCreated:r}){return(0,K.jsx)(E.Root,{open:e,onOpenChange:e=>{e||n()},children:e?(0,K.jsx)(Ye,{assistantId:t,onClose:n,onCreated:r}):null})}function Ye({assistantId:e,onClose:t,onCreated:n}){let r=H(),[a,o]=(0,U.useState)(``),[s,c]=(0,U.useState)(``),[l,u]=(0,U.useState)(``),[d,f]=(0,U.useState)(`simple`),[p,m]=(0,U.useState)(Ne),[h,g]=(0,U.useState)(``),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null),x=a.trim(),S=s.trim(),T=l.trim(),D=h.trim(),O=(0,U.useMemo)(()=>d===`simple`?Ie(p):D,[d,p,D]),k=(0,U.useMemo)(()=>d===`simple`?Be(p):D||`Enter a cron expression to continue.`,[d,p,D]),A=(0,U.useMemo)(()=>qe(r),[r]),j=x.length>0&&S.length>0&&T.length>0&&O.length>0&&!_;return(0,K.jsxs)(E.Content,{size:`md`,children:[(0,K.jsxs)(E.Header,{children:[(0,K.jsx)(E.Title,{children:`Create schedule`}),(0,K.jsx)(E.Description,{children:`Schedule a recurring instruction for your assistant. Runs in execute mode — the message is delivered to the assistant on each fire.`})]}),(0,K.jsxs)(`form`,{onSubmit:async t=>{if(t.preventDefault(),j){v(!0),b(null);try{await we(e,{name:x,description:S,expression:O,message:T,timezone:r}),v(!1),n()}catch(e){b(e instanceof Error?e.message:`Failed to create schedule.`),v(!1)}}},children:[(0,K.jsx)(E.Body,{children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,K.jsx)(w,{label:`Name`,placeholder:`Morning briefing`,value:a,onChange:e=>o(e.target.value),required:!0,autoFocus:!0,fullWidth:!0}),(0,K.jsx)(C,{label:`Description`,placeholder:`What is this schedule for?`,value:s,onChange:e=>c(e.target.value),required:!0,fullWidth:!0,rows:2}),(0,K.jsx)(et,{label:`Repeat`,children:d===`simple`?(0,K.jsx)(Xe,{cadence:p,onChange:m}):(0,K.jsx)($e,{value:h,onChange:g,onUseSimple:()=>f(`simple`)})}),(0,K.jsx)(tt,{summary:k,mono:d===`advanced`&&D.length>0,timezoneLabel:A}),d===`simple`?(0,K.jsx)(`button`,{type:`button`,onClick:()=>{g(e=>e||Ie(p)),f(`advanced`)},className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:`Advanced — write a cron expression`}):null,(0,K.jsx)(C,{label:`Message`,placeholder:`What should the assistant do on each fire?`,value:l,onChange:e=>u(e.target.value),required:!0,fullWidth:!0,rows:4}),y?(0,K.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:y}):null]})}),(0,K.jsxs)(E.Footer,{children:[(0,K.jsx)(i,{variant:`outlined`,onClick:t,type:`button`,children:`Cancel`}),(0,K.jsx)(i,{variant:`primary`,type:`submit`,disabled:!j,children:_?`Creating…`:`Create schedule`})]})]})]})}function Xe({cadence:e,onChange:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsx)(x,{items:Ve,value:e.frequency,onChange:n=>t({...e,frequency:n}),ariaLabel:`How often the schedule runs`}),e.frequency===`hourly`?(0,K.jsx)(q,{label:`At minute`,children:(0,K.jsx)(k,{options:Ue,value:String(e.minute).padStart(2,`0`),onChange:n=>t({...e,minute:Number(n)}),"aria-label":`Minute`,className:`w-24`})}):null,e.frequency===`weekly`?(0,K.jsx)(q,{label:`On these days`,children:(0,K.jsx)(Qe,{value:e.weekdays,onChange:n=>t({...e,weekdays:n})})}):null,e.frequency===`monthly`?(0,K.jsx)(q,{label:`On day`,children:(0,K.jsx)(k,{options:We,value:e.dayOfMonth===`last`?`last`:String(e.dayOfMonth),onChange:n=>t({...e,dayOfMonth:n===`last`?`last`:Number(n)}),"aria-label":`Day of month`,className:`w-32`})}):null,e.frequency===`hourly`?null:(0,K.jsx)(q,{label:`At time`,children:(0,K.jsx)(Ze,{hour24:e.hour24,minute:e.minute,onChange:(n,r)=>t({...e,hour24:n,minute:r})})})]})}function Ze({hour24:e,minute:t,onChange:n}){let r=e<12?`AM`:`PM`,i=e%12==0?12:e%12;return(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(k,{options:He,value:String(i),onChange:e=>n(Ke(Number(e),r),t),"aria-label":`Hour`,className:`w-[72px]`}),(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`:`}),(0,K.jsx)(k,{options:Ue,value:String(t).padStart(2,`0`),onChange:t=>n(e,Number(t)),"aria-label":`Minute`,className:`w-[72px]`}),(0,K.jsx)(`div`,{className:`w-[112px]`,children:(0,K.jsx)(x,{items:Ge,value:r,onChange:e=>n(Ke(i,e),t),ariaLabel:`AM or PM`})})]})}function Qe({value:e,onChange:t}){let n=new Set(e),i=e=>{let r=new Set(n);r.has(e)?r.size>1&&r.delete(e):r.add(e),t([...r].sort((e,t)=>e-t))};return(0,K.jsx)(`div`,{className:`flex gap-1.5`,children:W.map(e=>{let t=n.has(e.value);return(0,K.jsx)(`button`,{type:`button`,onClick:()=>i(e.value),"aria-pressed":t,"aria-label":e.full,title:e.full,className:r(`flex h-9 w-9 items-center justify-center rounded-md border text-body-medium-default transition-colors`,t?`border-[var(--border-active)] bg-[var(--surface-active)] text-[var(--content-emphasised)]`:`border-[var(--field-border)] text-[var(--content-tertiary)] hover:border-[var(--border-active)] hover:text-[var(--content-default)]`),children:e.letter},e.value)})})}function $e({value:e,onChange:t,onUseSimple:n}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(w,{placeholder:`0 9 * * *`,value:e,onChange:e=>t(e.target.value),fullWidth:!0,className:`font-mono`,"aria-label":`Cron expression`,helperText:`Standard 5-field cron (minute hour day month weekday). RRULE expressions are also accepted.`}),(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`self-start text-body-small-default text-[var(--content-tertiary)] underline-offset-2 transition-colors hover:text-[var(--content-default)] hover:underline`,children:`← Back to the simple builder`})]})}function et({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:e}),t]})}function q({label:e,children:t}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:[(0,K.jsx)(`span`,{className:`min-w-[88px] text-body-small-default text-[var(--content-tertiary)]`,children:e}),t]})}function tt({summary:e,mono:t,timezoneLabel:n}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-lift)] px-3.5 py-3`,children:[(0,K.jsx)(h,{className:`mt-0.5 h-4 w-4 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:r(`text-body-medium-default text-[var(--content-default)]`,t&&`break-all font-mono`),children:e}),(0,K.jsxs)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Times use your timezone — `,n,`.`]})]})]})}function nt(e=B(),t=Date.now()){return Ae(`7d`,e,t)}function J(e){return e?new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`,hour12:!0}):`—`}function rt(e){return e==null?`—`:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}var it=new Intl.NumberFormat(void 0,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:2});function Y(e){return e==null||!Number.isFinite(e)?`—`:it.format(e)}function at(e){return`${e.toLocaleString()} ${e===1?`run`:`runs`}`}function ot(e){let t=Math.round(e/6e4);return t>=60&&t%60==0?`Every ${t/60} hr`:`Every ${t} min`}function st(e){if(!e)return;let t=new Set,n=[];for(let r of e)for(let e of r.runs)t.has(e.id)||(t.add(e.id),n.push(e));return n}function ct(e){return!!e.conversationId&&e.conversationExists===!0&&e.conversationArchivedAt==null}function lt(e){return ct(e)?e.conversationId??null:null}function X(e){return typeof e==`string`&&e.length>0}var ut={heartbeat:`system-heartbeat`,consolidation:`system-consolidation`,retrospective:`system-memory-retrospective`};function dt(e){if(e.cronExpression)return e.timezone?`Cron: ${e.cronExpression} (${e.timezone})`:`Cron: ${e.cronExpression}`;let t=ot(e.intervalMs);return e.activeHoursStart!=null&&e.activeHoursEnd!=null&&(t+=` (${e.activeHoursStart}:00–${e.activeHoursEnd}:00)`),t}function ft(e){return ot(e.intervalMs)}var pt=`After conversation activity`;function mt(e,t){return e.status===`fired`||e.status===`cancelled`?!0:e.status===`firing`?!1:e.nextRunAt==null||!e.enabled&&e.nextRunAt<=t}function ht(e,t){let n=[],r=[],i=[];for(let a of e)a.isOneShot?mt(a,t)?i.push(a):r.push(a):n.push(a);return n.sort((e,t)=>e.enabled===t.enabled?(e.nextRunAt??1/0)-(t.nextRunAt??1/0):e.enabled?-1:1),r.sort((e,t)=>(e.nextRunAt??1/0)-(t.nextRunAt??1/0)),i.sort((e,t)=>{let n=e.lastRunAt??e.nextRunAt??0;return(t.lastRunAt??t.nextRunAt??0)-n}),{recurring:n,upcomingOneTime:r,pastOneTime:i}}function gt(e,t,n=!0){return{queryKey:[{_id:`schedulesUsagesummaryGet`,path:{assistant_id:e??``},_tz:t}],queryFn:()=>e?be(e,nt(t)):Promise.resolve([]),enabled:n,staleTime:1e4}}function _t(e){return{scheduleId:e,runCount:0,totalEstimatedCostUsd:0,eventCount:0}}function vt(e,t,n){let r=(t??[]).filter(e=>{let t=e.startedAt??e.createdAt;return t>=n.from&&t<=n.to});return{scheduleId:e,runCount:r.length,totalEstimatedCostUsd:r.reduce((e,t)=>{let n=t.estimatedCostUsd;return typeof n==`number`&&Number.isFinite(n)?e+n:e},0),eventCount:0}}function yt({status:e}){return(0,K.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full`,style:{backgroundColor:e===`ok`||e===`completed`?`var(--system-positive-strong)`:e===`error`||e===`failed`?`var(--system-negative-strong)`:`var(--content-tertiary)`},"aria-label":e??`unknown`})}function bt({scheduleName:e,usage:t,onOpenUsage:n}){if(t.status===`loading`)return(0,K.jsxs)(`div`,{"aria-label":`Loading schedule usage`,className:`flex w-[156px] shrink-0 items-center justify-end gap-3`,children:[(0,K.jsx)(`span`,{className:`h-5 w-16 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,K.jsx)(`span`,{className:`h-5 w-16 animate-pulse rounded bg-[var(--surface-muted)]`})]});let r=t.status===`error`,i=r?`--`:Y(t.summary.totalEstimatedCostUsd),a=r?`--`:at(t.summary.runCount),o=t.status===`ready`&&!(t.summary.totalEstimatedCostUsd>0),s=t.status===`ready`&&t.summary.runCount===0,c=o?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`,l=s?`text-[var(--content-tertiary)]`:`text-[var(--content-default)]`;return(0,K.jsxs)(`div`,{className:`flex w-[156px] shrink-0 items-center justify-end gap-3 text-right text-body-small-default`,children:[n?(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`View usage for ${e}`,className:`min-w-[64px] cursor-pointer rounded px-1 py-0.5 text-right transition-colors hover:bg-[var(--surface-hover)] ${c}`,children:i}):(0,K.jsx)(`span`,{"aria-label":`Cost for ${e} in the last 7 days: ${i}`,className:`block min-w-[64px] px-1 py-0.5 ${c}`,children:i}),(0,K.jsx)(`span`,{"aria-label":`Runs for ${e} in the last 7 days: ${a}`,className:`block min-w-[64px] px-1 py-0.5 ${l}`,children:a})]})}function xt({name:e,subtitle:t,enabled:n,nextRunAt:r,lastRunAt:i,usage:a,helperText:o,statusLabel:s,statusTone:c=`neutral`,onClick:l}){return(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 rounded-md px-2 py-3 transition-colors hover:bg-[var(--surface-hover)] [&+&]:border-t [&+&]:border-[var(--border-base)]`,children:(0,K.jsxs)(`button`,{type:`button`,onClick:l,"aria-label":`Open ${e}`,className:`flex min-w-0 flex-1 cursor-pointer flex-wrap items-center gap-3 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e})}),(0,K.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t}),o?(0,K.jsx)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--content-secondary)]`,children:o}):null,(0,K.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-body-small-default text-[var(--content-tertiary)]`,children:[r?(0,K.jsxs)(`span`,{children:[`Next: `,J(r)]}):null,i?(0,K.jsxs)(`span`,{children:[`Last: `,J(i)]}):null]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-end gap-3`,children:[(0,K.jsx)(bt,{scheduleName:e,usage:a}),s?(0,K.jsx)(S,{tone:c,children:s}):(0,K.jsx)(`span`,{className:`h-2 w-2 rounded-full`,style:{backgroundColor:n?`var(--system-positive-strong)`:`var(--content-disabled)`},"aria-label":n?`enabled`:`disabled`}),(0,K.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})})}function St({heartbeatConfig:e,consolidationConfig:t,retrospectiveConfig:n,heartbeatUsage:r,consolidationUsage:i,retrospectiveUsage:a,isLoading:o,hasError:s,onRetry:c,onSelectHeartbeat:l,onSelectConsolidation:u,onSelectRetrospective:d}){let f=e!=null,m=t?.available===!0,h=n?.available===!0,_=f||m||h;if(!o&&!s&&!_)return null;let v=[...f?[r]:[],...m?[i]:[],...h?[a]:[]].filter(e=>e.status===`ready`),x=v.reduce((e,t)=>e+(t.summary.totalEstimatedCostUsd??0),0),S=o?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(g,{className:`h-5 w-5 animate-spin text-stone-400`})}):s&&!_?(0,K.jsxs)(y,{tone:`error`,children:[`Failed to load system jobs.`,` `,(0,K.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]}):(0,K.jsxs)(`div`,{children:[f?(0,K.jsx)(xt,{name:`Heartbeat`,subtitle:dt(e),enabled:e.enabled,nextRunAt:e.nextRunAt,lastRunAt:e.lastRunAt,usage:r,onClick:l}):null,m?(0,K.jsx)(xt,{name:`Consolidation`,subtitle:ft(t),enabled:t.enabled,helperText:t.enabled?void 0:`Memory is off, so consolidation is paused.`,nextRunAt:t.nextRunAt,lastRunAt:t.lastRunAt,usage:i,statusLabel:t.enabled?void 0:`Paused`,statusTone:`warning`,onClick:u}):null,h?(0,K.jsx)(xt,{name:`Memory retrospective`,subtitle:pt,enabled:n.enabled,helperText:n.enabled?void 0:`Memory is off, so retrospectives are paused.`,nextRunAt:n.nextRunAt,lastRunAt:n.lastRunAt,usage:a,statusLabel:n.enabled?void 0:`Paused`,statusTone:`warning`,onClick:d}):null,s?(0,K.jsx)(`div`,{className:`pt-3 first:pt-0`,children:(0,K.jsxs)(y,{tone:`error`,children:[`Some system jobs failed to load.`,` `,(0,K.jsx)(`button`,{type:`button`,onClick:c,className:`cursor-pointer underline hover:no-underline`,children:`Retry`})]})}):null]});return(0,K.jsx)(ye,{children:(0,K.jsx)(b.Root,{type:`multiple`,children:(0,K.jsxs)(b.Item,{value:`system-jobs`,children:[(0,K.jsxs)(b.Trigger,{className:`group justify-between gap-3`,children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-left`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`System`}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Built-in jobs managed by the assistant runtime`})]}),(0,K.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[v.length>0?(0,K.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[Y(x),` (7d)`]}):null,(0,K.jsx)(p,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]})]}),(0,K.jsx)(b.Content,{children:(0,K.jsx)(`div`,{className:`mt-3`,children:S})})]})})})}function Z(e,t){return{id:e.id,jobId:t,status:e.status,startedAt:e.startedAt??e.scheduledFor,finishedAt:e.finishedAt,durationMs:e.durationMs,output:`skipReason`in e&&e.skipReason?`Skipped: ${e.skipReason}`:null,error:e.error,conversationId:e.conversationId,conversationExists:e.conversationExists,conversationArchivedAt:e.conversationArchivedAt,estimatedCostUsd:e.estimatedCostUsd,createdAt:e.createdAt,...`title`in e?{title:e.title}:{}}}function Ct(e){return e.runs.map(e=>Z(e,`heartbeat`))}function wt(e){return e.runs.map(e=>Z(e,`consolidation`))}function Tt(e){return e.runs.map(e=>Z(e,`retrospective`))}var Q=1e4;function Et(e,t,n,r,i){return e?{status:`loading`}:t?{status:`error`}:{status:`ready`,summary:vt(n,r,i)}}function Dt(e,n){let r=s(),i={path:{assistant_id:e??``}},{data:a,isLoading:o,isError:l,refetch:u}=c({...ie(i),enabled:!!e,staleTime:Q}),{data:d,isLoading:f,isError:p,refetch:m}=c({...R(i),enabled:!!e,staleTime:Q}),{data:h,isLoading:g,isError:_,refetch:v}=c({...se(i),enabled:!!e,staleTime:Q}),y={path:{assistant_id:e??``},query:{limit:100}},{data:b,isLoading:x,isError:S,refetch:C}=c({...j(y),select:Ct,enabled:!!e&&a!=null,staleTime:Q}),{data:w,isLoading:T,isError:E,refetch:D}=c({...le(y),select:wt,enabled:!!e&&d?.available===!0,staleTime:Q}),{data:k,isLoading:P,isError:F,refetch:I}=c({...oe(y),select:Tt,enabled:!!e&&h?.available===!0,staleTime:Q}),L=(0,U.useMemo)(()=>nt(n),[n]),ne=(0,U.useMemo)(()=>Et(x,S,ut.heartbeat,b,L),[b,S,x,L]),ae=(0,U.useMemo)(()=>Et(T,E,ut.consolidation,w,L),[w,E,T,L]),ue=(0,U.useMemo)(()=>Et(P,F,ut.retrospective,k,L),[k,F,P,L]),z=t=>{if(!e)return;let n={heartbeat:{config:ie(i).queryKey,runs:j(y).queryKey,infinite:ee(i)},consolidation:{config:R(i).queryKey,runs:le(y).queryKey,infinite:ce(i)},retrospective:{config:se(i).queryKey,runs:oe(y).queryKey,infinite:re(i)}}[t];r.invalidateQueries({queryKey:n.config}),r.invalidateQueries({queryKey:n.runs}),r.invalidateQueries({queryKey:n.infinite})},B=te({onSuccess:e=>{e.ran?O.success(`Heartbeat started.`):O.info(`Heartbeat skipped.`)},onError:e=>{t(e,{context:`heartbeat_run_now`}),O.error(`Failed to run heartbeat.`)},onSettled:()=>z(`heartbeat`)}),V=A({onSuccess:e=>{e.ran?O.success(`Consolidation queued.`):O.info(`Consolidation already queued or running.`)},onError:e=>{t(e,{context:`consolidation_run_now`}),O.error(`Failed to run consolidation.`)},onSettled:()=>z(`consolidation`)}),de=M({onSuccess:e=>{N(r,i,e),O.success(e.enabled?`Heartbeat enabled.`:`Heartbeat disabled.`)},onError:e=>{t(e,{context:`heartbeat_toggle`}),O.error(`Failed to toggle heartbeat.`)}});return{heartbeatConfig:a,consolidationConfig:d,retrospectiveConfig:h,heartbeatUsage:ne,consolidationUsage:ae,retrospectiveUsage:ue,isLoading:o||f||g,hasError:l||p||_,isHeartbeatRunning:B.isPending,isConsolidationRunning:V.isPending,isHeartbeatLoading:o,isHeartbeatError:l,isConsolidationLoading:f,isConsolidationError:p,isRetrospectiveLoading:g,isRetrospectiveError:_,refetchHeartbeat:u,refetchConsolidation:m,refetchRetrospective:v,runHeartbeatNow:()=>{e&&B.mutate({path:{assistant_id:e}})},runConsolidationNow:()=>{e&&V.mutate({path:{assistant_id:e}})},toggleHeartbeat:t=>{e&&de.mutate({body:{enabled:t},path:{assistant_id:e}})},refetchAll:()=>{u(),m(),v(),C(),D(),I()}}}function Ot({children:e}){return(0,K.jsx)(u,{variant:`label-small-default`,as:`div`,className:`mb-2 uppercase tracking-wider text-[var(--content-tertiary)]`,children:e})}function $({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-1`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e}),(0,K.jsx)(`span`,{className:`min-w-0 text-right text-body-medium-lighter text-[var(--content-default)]`,children:t})]})}function kt({icon:e,value:t,label:n}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] p-3`,children:[(0,K.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-[var(--surface-sunken)] text-[var(--content-secondary)]`,children:e}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-body-large-default text-[var(--content-default)]`,children:t}),(0,K.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:n})]})]})}function At({usage:e}){return e.status===`loading`?(0,K.jsx)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:Array.from({length:2},(e,t)=>(0,K.jsx)(`div`,{className:`h-[60px] animate-pulse rounded-lg bg-[var(--surface-muted)]`},t))}):e.status===`error`?null:(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 pt-2`,children:[(0,K.jsx)(kt,{icon:(0,K.jsx)(he,{className:`h-4 w-4`}),value:Y(e.summary.totalEstimatedCostUsd),label:`7 Day Cost`}),(0,K.jsx)(kt,{icon:(0,K.jsx)(_,{className:`h-4 w-4`}),value:at(e.summary.runCount),label:`7 Day Runs`})]})}function jt(e){return e.exists&&e.archivedAt==null}function Mt({run:e,index:t,isExpanded:n,disableDirectOpen:i,onOpenConversation:a,onToggleDetails:o}){let s=lt(e),c=e.conversations??(s?[{id:s,title:null,exists:!0,archivedAt:null}]:[]),l=X(e.output),u=X(e.error),d=!i&&c.length===1&&jt(c[0])?c[0].id:null,f=!d&&(c.length>0||l||u),p=`schedule-run-details-${t}`,h=!!d||f,g=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(yt,{status:e.status}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:J(e.startedAt)}),(0,K.jsxs)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[rt(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd)]}),e.status===`error`&&e.error?(0,K.jsxs)(`div`,{className:`mt-0.5 text-body-small-default text-[var(--system-negative-strong)]`,children:[e.error.slice(0,120),e.error.length>120?`…`:``]}):null]}),h?(0,K.jsx)(m,{className:r(`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform`,f&&n?`rotate-90`:``)}):null]}),_=f&&n?(0,K.jsx)(`div`,{id:p,className:`px-2 pb-3`,children:(0,K.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[c.length>0?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Conversations`}),(0,K.jsx)(`div`,{className:`space-y-1`,children:c.map(e=>jt(e)?(0,K.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:`block w-full truncate text-left text-body-small-default text-[var(--content-default)] hover:underline`,children:X(e.title)?e.title:`Conversation`},e.id):(0,K.jsxs)(`span`,{className:`block truncate text-body-small-default text-[var(--content-tertiary)] italic`,children:[X(e.title)?e.title:`Conversation`,` `,e.exists?`(archived)`:`(unavailable)`]},e.id))})]}):null,l?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Output`}),(0,K.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,u?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Error`}),(0,K.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null;return d?(0,K.jsx)(`div`,{children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>a(d),"aria-label":`Open conversation for run at ${J(e.startedAt)}`,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:g})}):f?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>o(e.id),"aria-label":`Toggle details for run at ${J(e.startedAt)}`,"aria-expanded":n,"aria-controls":p,className:`flex w-full cursor-pointer items-center gap-3 px-2 py-3 text-left shadow-none transition-colors hover:bg-[var(--surface-hover)] focus:outline-none`,children:g}),_]}):(0,K.jsx)(`div`,{className:`flex items-center gap-3 px-2 py-3`,children:g})}function Nt({runs:e,isLoading:t,disableDirectOpen:n,onOpenConversation:r}){let[i,a]=(0,U.useState)(null);return t?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-6`,children:(0,K.jsx)(g,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,K.jsx)(`p`,{className:`py-2 text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:`No runs yet.`}):(0,K.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.map((e,t)=>(0,K.jsx)(Mt,{run:e,index:t,isExpanded:i===e.id,disableDirectOpen:n,onOpenConversation:r,onToggleDetails:e=>a(t=>t===e?null:e)},e.id))})}function Pt({schedule:e,assistantId:n,usage:a,isMobile:s,onClose:l,onDeleted:d}){let f=o(),{data:p,isLoading:m}=c({queryKey:ae({path:{assistant_id:n,id:e.id}}),queryFn:()=>Se(n,e.id),staleTime:1e4}),[h,_]=(0,U.useState)(!1),[y,b]=(0,U.useState)(!1),[x,S]=(0,U.useState)(!1),C=async()=>{_(!0);try{await Te(n,e.id)}catch(e){t(e,{context:`schedule_run_now`}),O.error(`Failed to run schedule.`)}finally{_(!1)}},w=async()=>{S(!0);try{await Ee(n,e.id),d()}catch(e){t(e,{context:`schedule_delete`}),O.error(`Failed to delete schedule.`),S(!1),b(!1)}};return(0,K.jsxs)(`div`,{className:r(`flex h-full flex-col bg-[var(--surface-overlay)]`,!s&&`rounded-[var(--radius-xl)] border border-[var(--border-base)]`),children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(u,{variant:`title-small`,className:`truncate text-[var(--content-default)]`,children:e.name})}),(0,K.jsx)(i,{variant:`ghost`,iconOnly:(0,K.jsx)(v,{}),onClick:l,"aria-label":`Close schedule details`,tooltip:`Close`,className:`shrink-0`})]}),(0,K.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[e.description?(0,K.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-secondary)]`,children:e.description}):null,(0,K.jsxs)(`section`,{children:[(0,K.jsx)(Ot,{children:`Details`}),(0,K.jsxs)(`div`,{className:`rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] px-4 py-2`,children:[e.cadenceDescription?(0,K.jsx)($,{label:`Cadence`,value:e.cadenceDescription}):null,(0,K.jsx)($,{label:`Mode`,value:e.mode}),(0,K.jsx)($,{label:`Status`,value:e.enabled?`Enabled`:`Disabled`}),(0,K.jsx)($,{label:`Next run`,value:J(e.nextRunAt)}),e.lastRunAt?(0,K.jsx)($,{label:`Last run`,value:(0,K.jsxs)(`span`,{className:`flex items-center justify-end gap-2`,children:[(0,K.jsx)(yt,{status:e.lastStatus}),J(e.lastRunAt)]})}):null]})]}),(0,K.jsx)(At,{usage:a}),(0,K.jsxs)(`section`,{children:[(0,K.jsx)(Ot,{children:`Recent runs`}),(0,K.jsx)(Nt,{runs:p?.runs,isLoading:m,disableDirectOpen:e.mode===`script`,onOpenConversation:e=>f(z.conversation(e))})]})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[y?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(i,{variant:`ghost`,onClick:()=>b(!1),disabled:x,children:`Cancel`}),(0,K.jsx)(i,{variant:`danger`,onClick:()=>void w(),disabled:x,children:x?`Deleting…`:`Yes, delete`})]}):(0,K.jsx)(i,{variant:`dangerOutline`,leftIcon:(0,K.jsx)(de,{className:`h-3.5 w-3.5`}),onClick:()=>b(!0),children:`Delete`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(i,{variant:`outlined`,leftIcon:(0,K.jsx)(Me,{className:`h-3.5 w-3.5`}),onClick:()=>f(z.settings.usageForSchedule(e.id)),children:`View usage`}),e.mode===`script`?(0,K.jsx)(i,{variant:`primary`,leftIcon:h?(0,K.jsx)(g,{className:`h-3.5 w-3.5 animate-spin`}):void 0,onClick:()=>void C(),disabled:h,children:h?`Running…`:`Run now`}):null]})]})]})}function Ft(e){if(e.status===`loading`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`h-4 w-12 animate-pulse rounded bg-[var(--surface-muted)]`}),(0,K.jsx)(`span`,{className:`h-4 w-10 animate-pulse rounded bg-[var(--surface-muted)]`})]});if(e.status===`error`)return(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`—`});let{summary:t}=e;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:Y(t.totalEstimatedCostUsd)}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:at(t.runCount)})]})}function It({name:e,metaParts:t,usage:n,enabled:r,selected:i,onClick:a,onToggle:o,toggleAriaLabel:s}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md px-2 py-3 transition-colors [&+&]:border-t [&+&]:border-[var(--border-base)] ${i?`bg-[var(--surface-active)]`:`hover:bg-[var(--surface-hover)]`}`,children:[o?(0,K.jsx)(T,{checked:r,onChange:o,"aria-label":s}):null,(0,K.jsxs)(`button`,{type:`button`,onClick:a,className:`flex min-w-0 flex-1 cursor-pointer items-center gap-4 text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,K.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:e}),t.length>0?(0,K.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-small-default text-[var(--content-tertiary)]`,children:t.map((e,t)=>(0,K.jsxs)(U.Fragment,{children:[t>0?(0,K.jsx)(`span`,{className:`h-[3px] w-[3px] shrink-0 rounded-full bg-[var(--content-tertiary)]`}):null,(0,K.jsx)(`span`,{className:`truncate`,children:e})]},t))}):null]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4`,children:[Ft(n),(0,K.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`})]})]})]})}function Lt({schedule:e,usage:t,selected:n,onClick:r,onToggle:i}){let a=e.isOneShot?``:e.cadenceDescription.trim(),o=e.lastRunAt??e.nextRunAt,s=[a,o?J(o):``].filter(Boolean);return(0,K.jsx)(It,{name:e.name,metaParts:s,usage:t,enabled:e.enabled,selected:n,onClick:r,onToggle:i,toggleAriaLabel:i?`Toggle ${e.name}`:void 0})}function Rt({recurring:e,oneTime:t,pastOneTime:n,usageForSchedule:r,isLoading:a,isError:o,refetch:s,onToggle:c,onSelectSchedule:l,selectedScheduleId:u,onStartNewChat:d,onCreateSchedule:p,pastOpen:h,onPastOpenChange:g,systemTasksSlot:_}){let v=e=>(0,K.jsx)(Lt,{schedule:e,usage:r(e.id),selected:e.id===u,onClick:()=>l(e.id),onToggle:t=>c(e.id,t)},e.id),x=e=>(0,K.jsx)(Lt,{schedule:e,usage:r(e.id),selected:e.id===u,onClick:()=>l(e.id)},e.id),S=n.length>0?(0,K.jsx)(b.Root,{type:`single`,collapsible:!0,className:`mt-3`,value:h?`past`:``,onValueChange:e=>g(e===`past`),children:(0,K.jsxs)(b.Item,{value:`past`,children:[(0,K.jsxs)(b.Trigger,{className:`group gap-[var(--app-spacing-xs)] px-2 text-label-small-default text-[var(--content-tertiary)]`,children:[(0,K.jsx)(m,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,K.jsxs)(`span`,{children:[`Past (`,n.length,`)`]})]}),(0,K.jsx)(b.Content,{children:(0,K.jsx)(`div`,{className:`pt-1`,children:n.map(x)})})]})}):null;return(0,K.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:[a?(0,K.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:2},(e,t)=>(0,K.jsx)(`div`,{className:`h-12 animate-pulse rounded-md bg-[var(--surface-muted)]`},t))}):o&&e.length===0?(0,K.jsx)(y,{tone:`error`,actions:(0,K.jsx)(`button`,{type:`button`,onClick:s,className:`cursor-pointer underline hover:no-underline`,children:`Retry`}),children:`Failed to load schedules.`}):e.length===0&&t.length===0&&n.length===0?(0,K.jsx)(Oe,{icon:f,title:`No schedules yet`,description:`Ask your assistant to set one up, or create one yourself.`,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(i,{variant:`primary`,size:`regular`,onClick:d,children:`New Conversation`}),(0,K.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`or`}),(0,K.jsx)(i,{variant:`outlined`,size:`regular`,onClick:p,children:`Create schedule`})]})}):(0,K.jsxs)(`div`,{children:[e.map(v),t.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`p`,{className:`mt-3 px-2 text-label-small-default text-[var(--content-tertiary)]`,children:`One-time`}),t.map(x)]}):null,S]}),_?(0,K.jsx)(`div`,{className:`mt-[var(--app-spacing-lg)]`,children:_}):null]})}var zt=`Default (assistant's main model)`,Bt=`Custom call-site model`;function Vt(e,t){return t?.[e]?.displayName??e}function Ht(e,t){if(e==null)return;if(e.provider!=null||e.model!=null)return Bt;let n=e.profile?.trim();return n?`Override (${Vt(n,t)})`:void 0}function Ut({assistantId:e,pinnedProfile:t,defaultCallSite:n=`mainAgent`,fallbackLabel:r=zt,respectCallSiteOverride:i=!1}){let a=t==null,{data:o}=c({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),s=(0,U.useMemo)(()=>o?je(o):{},[o]),{data:l}=c({...L({path:{assistant_id:e}}),enabled:!!e&&a,staleTime:6e4}),u=a&&i?Ht(o?.llm?.callSites?.[n],s):void 0,d=a?l?.callSites.find(e=>e.id===n)?.defaultProfile:void 0,f=t==null?u??(d==null?r:`Default (${Vt(d,s)})`):Vt(t,s);return(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Model profile`}),(0,K.jsx)(`span`,{className:`min-w-0 text-right`,children:f})]})}function Wt({runs:e,isLoading:t,emptyMessage:n=`No runs yet.`,hasMore:r=!1,isLoadingMore:a=!1,onLoadMore:s}){let c=o(),[l,u]=(0,U.useState)(null);return(0,K.jsx)(ye,{title:`Recent runs`,children:t?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(g,{className:`h-5 w-5 animate-spin text-stone-400`})}):!e||e.length===0?(0,K.jsx)(`p`,{className:`py-4 text-center text-body-medium-lighter text-[var(--content-tertiary)] italic`,children:n}):(0,K.jsxs)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:[e.map((e,t)=>{let n=lt(e),r=X(e.output),i=X(e.error),a=!n&&(r||i),o=l===e.id,s=`schedule-run-details-${t}`;return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(D,{label:(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-3`,children:[(0,K.jsx)(yt,{status:e.status}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate text-body-medium-lighter text-[var(--content-default)]`,children:X(e.title)?e.title:J(e.startedAt)}),(0,K.jsxs)(`span`,{className:`block text-body-small-default text-[var(--content-tertiary)]`,children:[X(e.title)?`${J(e.startedAt)} · `:``,rt(e.durationMs),` ·`,` `,Y(e.estimatedCostUsd),e.status===`error`&&e.error&&(0,K.jsxs)(`span`,{className:`ml-2 text-[var(--system-negative-strong)]`,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]})]}),n||a?(0,K.jsx)(m,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform ${o?`rotate-90`:``}`}):null]}),onSelect:n?()=>c(z.conversation(n)):a?()=>u(o?null:e.id):void 0,"aria-label":`Run at ${J(e.startedAt)}`,"aria-expanded":a?o:void 0,"aria-controls":a?s:void 0,className:`h-auto py-2.5 gap-3 -mx-2 px-2`}),a&&o?(0,K.jsx)(`div`,{id:s,className:`px-2 pb-3`,children:(0,K.jsxs)(`div`,{className:`space-y-3 rounded-md border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3`,children:[r?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Output`}),(0,K.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--content-default)]`,children:e.output})]}):null,i?(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`mb-1 text-body-small-default text-[var(--content-secondary)]`,children:`Error`}),(0,K.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words text-body-small-default font-mono text-[var(--system-negative-strong)]`,children:e.error})]}):null]})}):null]},e.id)}),r&&s?(0,K.jsx)(`div`,{className:`flex justify-center pt-3`,children:(0,K.jsx)(i,{variant:`outlined`,size:`compact`,onClick:s,disabled:a,leftIcon:a?(0,K.jsx)(g,{className:`h-3.5 w-3.5 animate-spin`}):void 0,children:a?`Loading…`:`Load more`})}):null]})})}var Gt={heartbeat:`heartbeatAgent`,consolidation:`memoryV2Consolidation`,retrospective:`memoryRetrospective`};function Kt({children:e}){return(0,K.jsx)(u,{variant:`label-small-default`,as:`div`,className:`mb-2 uppercase tracking-wider text-[var(--content-tertiary)]`,children:e})}function qt({kind:e,assistantId:t,systemTasks:n,canOpenMemorySettings:a,isMobile:s,onClose:c}){let l=o(),{heartbeatConfig:d,consolidationConfig:f,retrospectiveConfig:p}=n,m,h,_,b,x,S,C;e===`heartbeat`?(m=`Heartbeat`,h=d?dt(d):``,_=d?.enabled??!1,b=d?.nextRunAt??null,x=d?.lastRunAt??null,S=n.isHeartbeatRunning,C=n.runHeartbeatNow):e===`consolidation`?(m=`Consolidation`,h=f?ft(f):``,_=f?.enabled??!1,b=f?.nextRunAt??null,x=f?.lastRunAt??null,S=n.isConsolidationRunning,C=n.runConsolidationNow):(m=`Memory retrospective`,h=pt,_=p?.enabled??!1,b=p?.nextRunAt??null,x=p?.lastRunAt??null,S=!1,C=void 0);let w=e!==`heartbeat`,E=e===`retrospective`,D=w&&!_,O=S||D,k=w?_?`On · Managed by Memory`:`Paused`:_?`Enabled`:`Disabled`,A=E?`Memory is off, so retrospectives are paused. Turn Memory back on to resume them.`:`Memory is off, so consolidation is paused. Turn Memory back on to resume consolidation.`,j=w&&_&&a,M={path:{assistant_id:t},query:{limit:25}},N=e===`heartbeat`?P(M):e===`consolidation`?F(M):ne(M),{data:ee,isLoading:te,fetchNextPage:I,hasNextPage:L,isFetchingNextPage:re}=pe({queryKey:N.queryKey,queryFn:N.queryFn,initialPageParam:{path:M.path,query:{}},getNextPageParam:e=>e.nextCursor??void 0,staleTime:1e4}),R=st(ee?.pages.map(t=>({runs:t.runs.map(t=>Z(t,e))})));return(0,K.jsxs)(`div`,{className:r(`flex h-full flex-col bg-[var(--surface-overlay)]`,!s&&`rounded-[var(--radius-xl)] border border-[var(--border-base)]`),children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(u,{variant:`title-small`,className:`truncate text-[var(--content-default)]`,children:m}),h?(0,K.jsx)(u,{variant:`body-small-default`,as:`p`,className:`truncate text-[var(--content-tertiary)]`,children:h}):null]}),(0,K.jsx)(i,{variant:`ghost`,iconOnly:(0,K.jsx)(v,{}),onClick:c,"aria-label":`Close schedule details`,tooltip:`Close`,className:`shrink-0`})]}),(0,K.jsxs)(`div`,{className:`flex-1 space-y-6 overflow-y-auto px-[var(--app-spacing-lg)] py-[var(--app-spacing-lg)]`,children:[(0,K.jsxs)(`section`,{children:[(0,K.jsx)(Kt,{children:`Details`}),(0,K.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-lift)] px-4 py-3 text-body-medium-lighter`,children:[(0,K.jsx)(Ut,{assistantId:t,defaultCallSite:Gt[e],fallbackLabel:`Default (system task model)`,respectCallSiteOverride:!0}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Status`}),(0,K.jsxs)(`span`,{className:`flex items-center gap-2 text-[var(--content-default)]`,children:[(0,K.jsx)(`span`,{children:k}),w?null:(0,K.jsx)(T,{checked:_,onChange:n.toggleHeartbeat,"aria-label":`Toggle ${m}`})]})]}),E?null:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Next run`}),(0,K.jsx)(`span`,{className:`text-[var(--content-default)]`,children:J(b)})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,K.jsx)(`span`,{className:`text-[var(--content-secondary)]`,children:`Last run`}),(0,K.jsx)(`span`,{className:`text-[var(--content-default)]`,children:J(x)})]})]}),D?(0,K.jsx)(y,{tone:`warning`,className:`mt-4`,actions:a?(0,K.jsx)(i,{variant:`outlined`,size:`compact`,onClick:()=>l(`${z.settings.developer}?tab=memory`),children:`Turn on Memory`}):void 0,children:A}):null]}),(0,K.jsx)(Wt,{runs:R,isLoading:te,hasMore:L,isLoadingMore:re,onLoadMore:()=>void I()})]}),j||C?(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 border-t border-[var(--border-base)] p-[var(--app-spacing-lg)]`,children:[j?(0,K.jsx)(i,{variant:`outlined`,leftIcon:(0,K.jsx)(me,{className:`h-3.5 w-3.5`}),onClick:()=>l(`${z.settings.developer}?tab=memory`),children:`Memory settings`}):null,C?(0,K.jsx)(i,{variant:`primary`,leftIcon:S?(0,K.jsx)(g,{className:`h-3.5 w-3.5 animate-spin`}):(0,K.jsx)(ge,{className:`h-3.5 w-3.5`}),onClick:C,disabled:O,children:S?`Running…`:`Run now`}):null]}):null]})}function Jt(e){let n=H(),[r]=(0,U.useState)(()=>Date.now()),{data:i,isLoading:a,isError:o,refetch:s}=c(De(e)),{data:l,isLoading:u,isError:d}=c(gt(e,n,!0)),{recurring:f,oneTime:p,pastOneTime:m}=(0,U.useMemo)(()=>{let e=ht(i??[],r);return{recurring:e.recurring,oneTime:e.upcomingOneTime,pastOneTime:e.pastOneTime}},[r,i]),h=(0,U.useMemo)(()=>new Map((l??[]).map(e=>[e.scheduleId,e])),[l]);return{recurring:f,oneTime:p,pastOneTime:m,usageForSchedule:(0,U.useCallback)(e=>u?{status:`loading`}:d?{status:`error`}:{status:`ready`,summary:h.get(e)??_t(e)},[d,u,h]),handleToggle:(0,U.useCallback)(async(n,r)=>{if(e)try{await xe(e,n,r),s()}catch(e){t(e,{context:`schedule_toggle`}),O.error(`Failed to toggle schedule.`)}},[e,s]),isLoading:a,isError:o,refetch:(0,U.useCallback)(()=>{s()},[s])}}function Yt(){let e=o(),{scheduleId:t}=a(),n=ve(),r=fe(),i=H(),s=Jt(n),l=Dt(n,i),{data:u=!1}=c({queryKey:[`assistant-memory-opt-out-capability`,n],queryFn:async()=>{let e=await ue(n);return e.ok&&e.data.capabilities?.memoryOptOut===!0},retry:!1,staleTime:1e4}),d=V.use.settingsDeveloperNav(),f=u&&d===!0,[p,m]=(0,U.useState)(!1),h=t??null,[g,_]=(0,U.useState)(null),[v,y]=(0,U.useState)(!1),b=(0,U.useCallback)(t=>{e(t?z.schedules.detail(t):z.schedules.root)},[e]),x=h?s.recurring.find(e=>e.id===h)??s.oneTime.find(e=>e.id===h)??s.pastOneTime.find(e=>e.id===h)??null:null;(0,U.useEffect)(()=>{h&&!s.isLoading&&!s.isError&&!x&&b(null)},[h,x,s.isLoading,s.isError,b]);let S=g===`heartbeat`?l.heartbeatConfig!=null:g===`consolidation`?l.consolidationConfig?.available===!0:g===`retrospective`?l.retrospectiveConfig?.available===!0:!1;(0,U.useEffect)(()=>{g&&!l.isLoading&&!S&&_(null)},[g,S,l.isLoading]);let C=(0,U.useCallback)(e=>{_(null),b(e)},[b]),w=(0,U.useCallback)(e=>{h&&b(null),_(e)},[b,h]),T=(0,U.useCallback)(()=>{_e(e)},[e]),E=(x?(0,K.jsx)(Pt,{schedule:x,assistantId:n,usage:s.usageForSchedule(x.id),isMobile:r,onClose:()=>b(null),onDeleted:()=>{b(null),s.refetch()}}):null)??(g&&S?(0,K.jsx)(qt,{kind:g,assistantId:n,systemTasks:l,canOpenMemorySettings:f,isMobile:r,onClose:()=>_(null)}):null),D=(0,K.jsx)(Rt,{recurring:s.recurring,oneTime:s.oneTime,pastOneTime:s.pastOneTime,usageForSchedule:s.usageForSchedule,isLoading:s.isLoading,isError:s.isError,refetch:s.refetch,onToggle:s.handleToggle,onSelectSchedule:C,selectedScheduleId:h,onStartNewChat:T,onCreateSchedule:()=>m(!0),pastOpen:v,onPastOpenChange:y,systemTasksSlot:(0,K.jsx)(St,{heartbeatConfig:l.heartbeatConfig,consolidationConfig:l.consolidationConfig,retrospectiveConfig:l.retrospectiveConfig,heartbeatUsage:l.heartbeatUsage,consolidationUsage:l.consolidationUsage,retrospectiveUsage:l.retrospectiveUsage,isLoading:l.isLoading,hasError:l.hasError,onRetry:l.refetchAll,onSelectHeartbeat:()=>w(`heartbeat`),onSelectConsolidation:()=>w(`consolidation`),onSelectRetrospective:()=>w(`retrospective`)})});return E&&r?(0,K.jsx)(ke,{children:E}):(0,K.jsxs)(K.Fragment,{children:[E&&!r?(0,K.jsx)(Ce,{storageKey:`schedulesDetailDrawerWidth`,detailKey:h??g??void 0,section:D,detail:E}):D,(0,K.jsx)(Je,{isOpen:p,assistantId:n,onClose:()=>m(!1),onCreated:()=>{m(!1),s.refetch()}})]})}export{Yt as SchedulesPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{o as t,t as n}from"./local-settings-C-dW2vkq.js";import{t as r}from"./react-DJZBPgpf.js";import{t as i}from"./button-BQVYX8n_.js";import{l as a,m as o,n as s,u as c}from"./chunk-5KNZJZUH-SU6Q_tDT.js";import{t as l}from"./useQuery-B45lW1Kk.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-D8zyWtZh.js";import{a as f,c as p,i as m,l as h,n as ee,o as g,r as te,s as _,t as ne}from"./use-skill-actions-B443tGAI.js";import{t as v}from"./brain-CMiHVWFK.js";import{t as y}from"./check-wF3S-AV4.js";import{t as b}from"./cloud-off-DT0KnUQ4.js";import{i as x,n as re,r as S,t as ie}from"./use-skill-categories-DsLNc-NO.js";import{t as C}from"./globe-Dx8dM0gj.js";import{t as w}from"./loader-circle-D57RZgLH.js";import{t as T}from"./sparkles-DDIsk_nZ.js";import{t as E}from"./x-CswtfvgS.js";import"./src-CDdn26Yb.js";import{t as D}from"./popover-Bl6742nZ.js";import{t as O}from"./input-ZpyYt_a0.js";import{n as k,t as A}from"./panel-item-Bvqsr5n9.js";import{St as j}from"./react-query.gen-BQH0QRfT.js";import{c as M}from"./routes-XPLb07Av.js";import{$i as N,Bi as P,Hi as F,Pi as I,Rr as L,Ui as R,Va as z,ba as B,ca as V,qa as H}from"./index-CZVGv7Cn.js";import{t as U}from"./use-active-assistant-id-9rGx8kT9.js";import{n as ae,r as oe}from"./skills-DJft07cl.js";var W=e(r(),1),G=u(),K=[{value:`all`,label:`All`,icon:B},{value:`installed`,label:`Installed`,icon:z},{value:`available`,label:`Available`,icon:H}],q=[{value:`vellum`,label:`Vellum`,icon:h},{value:`clawhub`,label:`Clawhub`,icon:C},{value:`skillssh`,label:`skills.sh`,icon:R},{value:`custom`,label:`Custom`,icon:P},{value:`assistant-memory`,label:`Assistant's Memory`,icon:v}];function se({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(O,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,G.jsx)(N,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,G.jsx)(w,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,G.jsx)(J,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function J(e){let t=L(),[n,r]=(0,W.useState)(!1),a=(0,G.jsx)(i,{type:`button`,variant:`outlined`,iconOnly:(0,G.jsx)(x,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,G.jsx)(ce,{...e,open:n,onOpenChange:r,trigger:a}):(0,G.jsxs)(D.Root,{open:n,onOpenChange:r,children:[(0,G.jsx)(D.Trigger,{asChild:!0,children:a}),(0,G.jsx)(D.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,G.jsxs)(`ul`,{role:`listbox`,children:[(0,G.jsx)(Z,{label:`Status`,options:K,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,G.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,G.jsx)(Z,{label:`Source`,options:q,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function ce({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:a,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let f=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,G.jsxs)(k.Root,{open:l,onOpenChange:u,children:[(0,G.jsx)(k.Trigger,{asChild:!0,children:d}),(0,G.jsxs)(k.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,G.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,G.jsx)(k.Header,{children:(0,G.jsx)(k.Title,{children:`Filters`})}),(0,G.jsxs)(k.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,G.jsx)(Y,{label:`Status`,children:K.map(n=>(0,G.jsx)(X,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,G.jsx)(Y,{label:`Source`,children:q.map(n=>(0,G.jsx)(X,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,G.jsxs)(Y,{label:`Categories`,children:[(0,G.jsx)(X,{icon:B,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>a(null)}),f.map(e=>(0,G.jsx)(X,{icon:S(e.icon)??B,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>a(e.slug)},e.slug))]})]}),(0,G.jsx)(k.Footer,{children:(0,G.jsx)(i,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Y({label:e,children:t}){return(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function X({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,G.jsx)(A,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,G.jsx)(y,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Z({label:e,options:t,selected:n,onSelect:r}){return(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,G.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,G.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,G.jsx)(z,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function le({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:a=!1,isRemoving:o=!1}){let s=f(e),c=ae(e);return(0,G.jsx)(d.Root,{asChild:!0,children:(0,G.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,G.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,G.jsx)(p,{skill:e,className:`h-7 w-7`})}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,G.jsx)(_,{origin:e.origin})]}),(0,G.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?a?(0,G.jsx)(i,{type:`button`,iconOnly:(0,G.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,G.jsx)(i,{type:`button`,iconOnly:(0,G.jsx)(H,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,G.jsx)(i,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,G.jsx)(w,{className:`animate-spin`,"aria-hidden":!0}):(0,G.jsx)(F,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}var ue=new Set([`all`,`installed`,`available`,`vellum`,`clawhub`,`skillssh`,`custom`,`assistant-memory`]);function de(e){let t=e.get(`filter`),n=e.get(`category`);return{q:e.get(`q`)??``,filter:pe(t)?t:`all`,category:n||null}}function fe(e,t){let n=new URLSearchParams(e);return t.q!==void 0&&Q(n,`q`,t.q.trim()||null),t.filter!==void 0&&Q(n,`filter`,t.filter===`all`?null:t.filter),t.category!==void 0&&Q(n,`category`,t.category),n}function Q(e,t,n){n===null?e.delete(t):e.set(t,n)}function pe(e){return e!==null&&ue.has(e)}function me(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:case`assistant-memory`:return{origin:e};default:return{}}}function he(e){return[...e].sort((e,t)=>{let n=g(e);return n===g(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function ge(e,t){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var _e=300,$=`vellum:skills:tipDismissed`;function ve({assistantId:e}){let r=c(),i=a(),[s,u]=o(),{q:d,filter:f,category:p}=(0,W.useMemo)(()=>de(s),[s]),m=(0,W.useCallback)(e=>{u(t=>fe(t,e),{replace:!0})},[u]),[h,g]=(0,W.useState)(d),_=ge(h.trim(),_e),v=(0,W.useRef)(d);(0,W.useEffect)(()=>{if(d!==v.current&&(v.current=d,d!==h.trim())){g(d);return}_!==d&&_===h.trim()&&(v.current=_,m({q:_}))},[_,d,h,m]);let y=(0,W.useCallback)(e=>m({filter:e}),[m]),b=(0,W.useCallback)(e=>m({category:e}),[m]),[x,S]=(0,W.useState)(()=>n($,!1)),{handleInstall:C,handleRemove:w,isInstallingSkill:T,isRemovingSkill:E,skillPendingRemoval:D,confirmRemove:O,cancelRemove:k}=ne(e),{data:A=[]}=ie(e),{origin:N,kind:P}=(0,W.useMemo)(()=>me(f),[f]),F=l({...j({path:{assistant_id:e},query:{include:`catalog`,origin:N,kind:P,q:_||void 0,category:p??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),I=l({...j({path:{assistant_id:e},query:{include:`catalog`,origin:N,kind:P,q:_||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&p!==null}),L=(0,W.useCallback)(()=>{S(!0),t($,!0)},[]),R=(0,W.useMemo)(()=>F.data?.skills??[],[F.data?.skills]),z=p===null?F.data:I.data,{counts:B,totalCount:V}=ye(z?.skills??R,z?.categoryCounts,z?.totalCount),H=(0,W.useMemo)(()=>he(R),[R]),U=F.isFetching&&!!_;return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!x&&(0,G.jsx)(be,{onDismiss:L}),(0,G.jsx)(se,{search:h,onSearchChange:g,filter:f,onFilterChange:y,isSearching:U,categories:A,category:p,onCategoryChange:b,counts:B,totalCount:V,showCounts:!U}),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,G.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,G.jsx)(re,{selected:p,onSelect:b,counts:B,totalCount:V,showCounts:!U,categories:A})}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:F.isLoading?(0,G.jsx)(ee,{}):F.isError?(0,G.jsx)(te,{}):H.length===0?(0,G.jsx)(xe,{filter:f,category:p}):(0,G.jsx)(`ul`,{className:`flex flex-col gap-2`,children:H.map(e=>(0,G.jsx)(`li`,{children:(0,G.jsx)(le,{skill:e,onSelect:()=>r(M.skills.detail(e.id),{state:{listSearch:i.search}}),onInstall:()=>C(e),onRemove:()=>w(e),isInstalling:T(e),isRemoving:E(e)})},e.id))})})]}),(0,G.jsx)(oe,{skillName:D?.name??null,onConfirm:O,onCancel:k})]})}function ye(e,t,n){return(0,W.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function be({onDismiss:e}){return(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,G.jsx)(T,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,G.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,G.jsx)(i,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(E,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function xe({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Se(e,t);return(0,G.jsx)(m,{icon:i,title:n,subtitle:r})}function Se(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:B};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:I};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:z};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:V};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:C};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:R};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:P};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:b}}}function Ce(){let e=U(),[t]=o(),n=t.get(`skill`);return n?(0,G.jsx)(s,{to:M.skills.detail(n),replace:!0}):(0,G.jsx)(ve,{assistantId:e})}export{Ce as SkillsPage};
|