@vellumai/web 0.10.5-staging.1 → 0.10.5-staging.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-BZAZkN-s.js → account-page-B4_qrJXM.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-X3n1AwIx.js → acp-run-detail-panel-ZJb9mPFf.js} +1 -1
- package/dist/assets/{add-credits-modal-DVhhJnT7.js → add-credits-modal-BnXqKqkz.js} +1 -1
- package/dist/assets/{advanced-page-Bg10cCRx.js → advanced-page-BsF8JW-4.js} +1 -1
- package/dist/assets/{ai-page-S2retULb.js → ai-page-BNaD9M7D.js} +1 -1
- package/dist/assets/{animated-avatar-DjujnGJR.js → animated-avatar-CEC1DGcI.js} +1 -1
- package/dist/assets/{api-Ckbwsd-f.js → api-1X5EQzNF.js} +1 -1
- package/dist/assets/{api-key-screen-lsVJoBIF.js → api-key-screen-DiW5rDSM.js} +1 -1
- package/dist/assets/{archive-page-BSsZ9M74.js → archive-page-DZ_8uaQt.js} +1 -1
- package/dist/assets/{assistant-api-DpkyBCPz.js → assistant-api-B17nD3D6.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-D5j_0A29.js → assistant-feature-flag-store-Btrsn1VW.js} +1 -1
- package/dist/assets/{assistant-identity-store-E8J494ln.js → assistant-identity-store-cODRsfVo.js} +1 -1
- package/dist/assets/{assistant-status-panel-BEtIO9N6.js → assistant-status-panel-D-XT9dcW.js} +1 -1
- package/dist/assets/{auth-store-B_ChDvJN.js → auth-store-B1y6dgYQ.js} +1 -1
- package/dist/assets/{background-task-detail-panel-CMOlnak6.js → background-task-detail-panel-DRBcuGts.js} +1 -1
- package/dist/assets/billing-page-Rw3ECU55.js +3 -0
- package/dist/assets/{bookmarks-page-Cyf-U96p.js → bookmarks-page-DmPcHyC_.js} +1 -1
- package/dist/assets/{build-state-DJGHxFaR.js → build-state-B-RL-LxH.js} +1 -1
- package/dist/assets/{client-feature-flag-store-BTwca_EB.js → client-feature-flag-store-CHA6YxVq.js} +1 -1
- package/dist/assets/{command-palette-1tOG7FMF.js → command-palette-DkJaPl6x.js} +1 -1
- package/dist/assets/{command-palette-window-page-eBzmSsCP.js → command-palette-window-page-v-j032zP.js} +1 -1
- package/dist/assets/{community-page-B5ONrf2a.js → community-page-BZ9IruGQ.js} +1 -1
- package/dist/assets/{contacts-page-route-DJUela8X.js → contacts-page-route-iggE95MQ.js} +1 -1
- package/dist/assets/{debug-page-WeVUgP5W.js → debug-page-DhYoaQMd.js} +1 -1
- package/dist/assets/{deploy-dialogs-97NwI-WB.js → deploy-dialogs-Cbti_xsn.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CCTUOLbx.js → detail-panel-stop-button-BHEQd627.js} +1 -1
- package/dist/assets/detail-shell-CPp3KhI8.js +4 -0
- package/dist/assets/{developer-page-DGskh-VT.js → developer-page-D0Ttwt5o.js} +1 -1
- package/dist/assets/{devices-page-UNNt0ZBi.js → devices-page-CkA_1aNA.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BQyh6Xca.js → dictation-overlay-page-BHrUGwJK.js} +1 -1
- package/dist/assets/{document-viewer-page-9ncyfQIB.js → document-viewer-page-CnFgbOqH.js} +1 -1
- package/dist/assets/{earn-credits-modal-wCf8-tQ-.js → earn-credits-modal-DOIDaArW.js} +1 -1
- package/dist/assets/{emails-page-DAMC-4si.js → emails-page-B0bc-Gj2.js} +1 -1
- package/dist/assets/{feature-flag-catalog-zMOeOE8I.js → feature-flag-catalog-qaNLg85h.js} +1 -1
- package/dist/assets/{file-editor-DFeKmizY.js → file-editor-Bm5LJXwA.js} +1 -1
- package/dist/assets/{general-page-p6Fn1GLx.js → general-page-Df1AoP_V.js} +1 -1
- package/dist/assets/{hatching-screen-BLRWv5KL.js → hatching-screen-CENPVFoZ.js} +1 -1
- package/dist/assets/{home-page-route-B4Uj_laj.js → home-page-route-mQBcsrfW.js} +1 -1
- package/dist/assets/{hosting-screen-CwlZydKg.js → hosting-screen-I6v4dE5d.js} +1 -1
- package/dist/assets/identity-page-route-DlM3U1hC.js +1 -0
- package/dist/assets/index-B-S-gNKm.js +131 -0
- package/dist/assets/index-Ceh6erpc.css +2 -0
- package/dist/assets/{inspect-page-DEK-iOS_.js → inspect-page-BIEfENnw.js} +2 -2
- package/dist/assets/{install-YUo7ndT3.js → install-lYdVLxh2.js} +1 -1
- package/dist/assets/{integrations-page-BsxOfQjJ.js → integrations-page-BBZ2VFVI.js} +1 -1
- package/dist/assets/{intelligence-layout-C3oI98wU.js → intelligence-layout-zqIx7Q-I.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-Cna3_88k.js → keyboard-shortcuts-page-H4mn2-og.js} +1 -1
- package/dist/assets/{library-detail-page-ve2T0ZU2.js → library-detail-page-DTbtqnJW.js} +1 -1
- package/dist/assets/{library-page-rXVG4ivO.js → library-page-CtniKYuA.js} +1 -1
- package/dist/assets/{login-flow-DxPdSc5D.js → login-flow-DB9qs18f.js} +1 -1
- package/dist/assets/{login-page-tRUjaTel.js → login-page-CA6jFCFt.js} +1 -1
- package/dist/assets/{logout-page-MsznCz-s.js → logout-page-BbQCJKwL.js} +1 -1
- package/dist/assets/{logs-layout-CmT3NiSU.js → logs-layout-xXeY2t6B.js} +1 -1
- package/dist/assets/{memory-router-playground-page-10PeGlWA.js → memory-router-playground-page-BhFJ0lwa.js} +1 -1
- package/dist/assets/messages-ChEiS3wF.js +13 -0
- package/dist/assets/{mobile-sidebar-drawer-DqeeN3Q1.js → mobile-sidebar-drawer-BA9ERuJ7.js} +1 -1
- package/dist/assets/{notifications-page-C00eTOOg.js → notifications-page-BSwHh8Mx.js} +1 -1
- package/dist/assets/{oauth-complete-page-BLjhfemY.js → oauth-complete-page-KFGDIl3q.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BoN8I91s.js → oauth-popup-complete-page-C9FKG9VY.js} +1 -1
- package/dist/assets/{pairing-page-0KCSQ57C.js → pairing-page-CT45DoH8.js} +1 -1
- package/dist/assets/{platform-loopback-page-u4nuT5FD.js → platform-loopback-page-BXnADBto.js} +1 -1
- package/dist/assets/{plugin-detail-page-Bb-HIhbL.js → plugin-detail-page-3mf9oR80.js} +1 -1
- package/dist/assets/{plugins-page-DQ4jLWGj.js → plugins-page-H6DAm3HM.js} +1 -1
- package/dist/assets/plugins-surface-gCrqfOas.js +1 -0
- package/dist/assets/prechat-route-BfQPMYu8.js +1 -0
- package/dist/assets/{prefs-CbAh5SBF.js → prefs-Ds__U7Hi.js} +1 -1
- package/dist/assets/{privacy-page-oEJv2Hh6.js → privacy-page-CLJnEPBh.js} +1 -1
- package/dist/assets/{privacy-screen-eEKGVYEM.js → privacy-screen-DWLF6KuW.js} +1 -1
- package/dist/assets/{provider-callback-page-DZFHFC3L.js → provider-callback-page-UAlBgfqn.js} +1 -1
- package/dist/assets/{provider-signup-page-BEHS8uPO.js → provider-signup-page-B1fLCCUD.js} +1 -1
- package/dist/assets/{research-mock-page-CmwxRt-1.js → research-mock-page-5ewHxOuJ.js} +1 -1
- package/dist/assets/research-onboarding-route-RxDDgsKx.js +61 -0
- package/dist/assets/{review-terms-screen-cd-fxIL9.js → review-terms-screen-BqGwop2y.js} +1 -1
- package/dist/assets/{select-assistant-screen-BZcmH_-F.js → select-assistant-screen-BfhDJw-S.js} +1 -1
- package/dist/assets/{settings-layout-COMaVywB.js → settings-layout-D_5HXQhT.js} +1 -1
- package/dist/assets/{share-feedback-modal-B68lktQY.js → share-feedback-modal-B3axmWXR.js} +1 -1
- package/dist/assets/{sidebar-tree-D0rtTbRP.js → sidebar-tree-DM30_BN8.js} +1 -1
- package/dist/assets/{signup-page-q4qdQh73.js → signup-page-DlqG9kP3.js} +1 -1
- package/dist/assets/{skills-page-DSP9dwoA.js → skills-page-C303uEzv.js} +1 -1
- package/dist/assets/{sounds-page-DhWeSxBr.js → sounds-page-DC_yF186.js} +1 -1
- package/dist/assets/{subagent-detail-panel-o1h_2eEo.js → subagent-detail-panel-B69kOmY_.js} +2 -2
- package/dist/assets/{subagent-store-CyoX60U-.js → subagent-store-DWKZ9Yt3.js} +1 -1
- package/dist/assets/{system-events-page-C6sjtW3h.js → system-events-page-CMXtS3Lt.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Du_gB1lJ.js → tiptap-document-editor-BILtD2S2.js} +1 -1
- package/dist/assets/{tool-detail-panel-V3uAmbUl.js → tool-detail-panel-CG9Wp2NK.js} +2 -2
- package/dist/assets/{trace-page-DtUKaSHG.js → trace-page-k0cYj2Bt.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CLf-Pd9J.js → upgrade-cancel-page-KGY9H9Mg.js} +1 -1
- package/dist/assets/{upgrade-success-page-BLK4gdo5.js → upgrade-success-page-9MHgGZFb.js} +1 -1
- package/dist/assets/{usage-page-A4xwoXzH.js → usage-page-CVI5PvbA.js} +1 -1
- package/dist/assets/use-is-org-ready-BviznO9P.js +1 -0
- package/dist/assets/{use-onboarding-login-BsEQxsJe.js → use-onboarding-login-Da1r3M06.js} +1 -1
- package/dist/assets/{use-skill-categories-BBEwB_89.js → use-skill-categories-nKUbiuQn.js} +1 -1
- package/dist/assets/{utils-B_yHNmjr.js → utils-P-AuKiE9.js} +1 -1
- package/dist/assets/{voice-page-Br5ACLXP.js → voice-page-ChYDqNwz.js} +1 -1
- package/dist/assets/{weather-forecast-display-DtEIs30H.js → weather-forecast-display-DaU-H5wf.js} +1 -1
- package/dist/assets/{welcome-screen-DxNlfFIf.js → welcome-screen-1tj61zH7.js} +1 -1
- package/dist/assets/{workflow-detail-panel-C54v6KXR.js → workflow-detail-panel-Di63Av9t.js} +1 -1
- package/dist/assets/{workspace-page-CoXq9DKW.js → workspace-page-C5nupXN6.js} +1 -1
- package/dist/index.html +29 -29
- package/package.json +1 -1
- package/dist/assets/billing-page-D0pjgf4M.js +0 -3
- package/dist/assets/detail-shell-B-seQn0C.js +0 -4
- package/dist/assets/identity-page-route-Doz1ah65.js +0 -1
- package/dist/assets/index-CRRDl50x.css +0 -2
- package/dist/assets/index-quNf_5yL.js +0 -130
- package/dist/assets/messages-SsreLLvu.js +0 -13
- package/dist/assets/plugins-surface-CbPGIeTp.js +0 -1
- package/dist/assets/prechat-route-D8_IVMC6.js +0 -1
- package/dist/assets/research-onboarding-route-BPk32Bxf.js +0 -61
- package/dist/assets/use-is-org-ready-WjRaX4WG.js +0 -1
- /package/dist/assets/{avatar-svg-compositor-DG7zqpYr.js → avatar-svg-compositor-CNy1XmWD.js} +0 -0
- /package/dist/assets/{conversation-list-fetchers-SoVgasfq.js → conversation-list-fetchers-COStMaVO.js} +0 -0
- /package/dist/assets/{conversation-selection-DgYtLnyB.js → conversation-selection-CNssqGbG.js} +0 -0
- /package/dist/assets/{conversation-store-DJC4_sse.js → conversation-store-B8D6wE18.js} +0 -0
- /package/dist/assets/{effective-timezone-BJxnysvd.js → effective-timezone-B99h9zr7.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-BsxCoimD.js → impersonate-version-flag-DyVWQf97.js} +0 -0
- /package/dist/assets/{prechat-CgM5bgoR.js → prechat-RG0Q0UrS.js} +0 -0
- /package/dist/assets/{react-query.gen-By34AU2d.js → react-query.gen-gQ1_8EHv.js} +0 -0
- /package/dist/assets/{semver-l1HADz2z.js → semver-0cyB3qXO.js} +0 -0
- /package/dist/assets/{sound-manager-BiKNWTMI.js → sound-manager-45n1b-Bl.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,n,o as r,r as i,s as a}from"./device-settings-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{O as s,t as c}from"./button-D-AX8Voo.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-DvW5mxZR.js";import{t as m}from"./card-BibIM9x3.js";import{t as h}from"./dropdown-ChWAdhLG.js";import{t as g}from"./confirm-dialog-bfBx6UYv.js";import{t as _}from"./notice-CqRgVmeL.js";import{t as v}from"./tag-CW6WC4fE.js";import{t as y}from"./input-D4W4p0pZ.js";import{t as b}from"./toggle-X_kQW5my.js";import{n as x}from"./toast-sdJJ6aTV.js";import{t as S}from"./chevron-right-B6vEpVY0.js";import{t as C}from"./loader-circle-BFRVtR3K.js";import{t as w}from"./pencil-B90pDI55.js";import{t as T}from"./x-DxL-bCuT.js";import{f as E,n as D,r as O}from"./auth-store-B_ChDvJN.js";import{t as k}from"./sdk.gen-DmWuY0SL.js";import{c as A,i as ee,m as te,n as ne,o as j,r as re,s as ie,t as ae}from"./native-biometric-BK6_QtW5.js";import{a as oe,i as se}from"./routes-C6gxiCrz.js";import{n as M,t as ce}from"./react-query.gen-By34AU2d.js";import{B as le,Fr as N,H as ue,Mn as de,Nn as fe,Nr as pe,Oa as me,Pr as he,Tn as P,V as F,g as I,h as L,jn as R,m as z,p as B,ui as ge,x as _e,yi as V}from"./index-quNf_5yL.js";import{t as H}from"./use-active-assistant-id-BVzVN4_g.js";import{t as U}from"./detail-card-EsA9SOvZ.js";import{t as W}from"./setting-row-BGQgDyhv.js";var G=e(o(),1),K=f(),q=[{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.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,r]=(0,G.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||P(0)}]}function xe({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(b,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Se(){return(0,K.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 Ce({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=fe(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.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=ve.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 R(e.sourceKind):await de(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,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(Se,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(xe,{row:e,onToggle:p},e.id))}),r&&(0,K.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 we(){let e=N({platformHostedOnly:!0}),t=pe(),n=he(),r=l(),{data:i,isLoading:a,isError:o}=u({...ce(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await k({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{M(r,void 0,e),x.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{x.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.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,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(b,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,K.jsx)(_e,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function Te(){let e=te(),[t,n]=(0,G.useState)(()=>ee()),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`Face ID`),[s,c]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(re().then(i),ne().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)j(!1),await ae(),n(!1);else{let e=A();e&&await ie(e),j(!0),n(!0)}}finally{c(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,K.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,K.jsx)(b,{checked:t,onChange:()=>void l(),disabled:s})]})})}function J(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=B.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Ee(){let e=H(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>L(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,d]=(0,G.useState)(`strict`),[f,p]=(0,G.useState)(!1),g=(0,G.useRef)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||g.current||(a(z(n.interactive).id),s(z(n.autonomous).id),d(z(n.headless).id),v(!0))},[n]),(0,G.useEffect)(()=>()=>{y.current!==null&&(clearTimeout(y.current),y.current=null,b.current?.(),b.current=null)},[]);let x=(0,G.useCallback)((n,r,i)=>{if(!e||!_)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,G.useCallback)((e,t,n)=>{y.current!==null&&clearTimeout(y.current),b.current=()=>x(e,t,n),y.current=setTimeout(()=>{b.current?.(),y.current=null,b.current=null},500)},[x]),w=(0,G.useCallback)(e=>{g.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,G.useCallback)(e=>{g.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,G.useCallback)(e=>{g.current=!0,d(e),C(i,o,e)},[i,o,C]),D=B.find(e=>e.id===i),O=B.find(e=>e.id===o),k=B.find(e=>e.id===c),A=!e||!_;return(0,K.jsxs)(m,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,K.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 tolerance determines which levels auto-approve.`}),r&&(0,K.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,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:i,onChange:w,options:Y,disabled:A})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.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,K.jsx)(me,{className:`h-4 w-4`}):(0,K.jsx)(S,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.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,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:o,onChange:T,options:Y,disabled:A})}),O&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:c,onChange:E,options:Y,disabled:A})}),k&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var X=e(s(),1),De=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Z=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[g,v]=(0,G.useState)(null),b=s.trim(),x=b.length>0&&!p,S=(0,G.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;m(!0),v(null);try{await ue(e,t.id,{risk:l,description:i}),r()}catch(e){v(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,x,d,t,r,l,a,b]);return(0,X.createPortal)((0,K.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,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.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,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void S(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[g&&(0,K.jsx)(_,{tone:`error`,children:g}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(h,{value:a,onChange:o,disabled:!0,options:De.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(y,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Z.map(e=>(0,K.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,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(y,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.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,K.jsx)(`button`,{type:`submit`,disabled:!x,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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(!1),y=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([F(e),F(e,{origin:`default`})]);return Ae(t,n)}return F(e)},[e]),x=(0,G.useCallback)(async()=>{o(!0);try{i(await y(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[y,m]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await y(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}},[y,m]);let S=(0,G.useCallback)(async()=>{if(f)try{await le(e,f.id),x()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,x]);return(0,X.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.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,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(b,{checked:m,onChange:h,label:`Show all defaults`}),(0,K.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(_,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(V,{className:`h-8 w-8`}),(0,K.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,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(v,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(v,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(v,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.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,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.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,K.jsx)(ge,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,K.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),x()}}),(0,K.jsx)(g,{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 S(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(m,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(V,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.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,K.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=N({platformHostedOnly:!0}),t=O(),a=t,o=D.use.user()?.id??null,[s,c]=(0,G.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>i(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(Te,{}),(0,K.jsx)(Ce,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Ee,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:t?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:se(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),E(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),E(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(we,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,K.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{Ie as PrivacyPage};
|
|
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-BBwtGKJb.js";import{t as o}from"./react-DJZBPgpf.js";import{O as s,t as c}from"./button-D-AX8Voo.js";import{n as l}from"./QueryClientProvider-DKhXIxGb.js";import{t as u}from"./useQuery-B45lW1Kk.js";import{t as d}from"./useMutation-Lj4VunQV.js";import{t as f}from"./jsx-runtime-CVSDxk6A.js";import{t as p}from"./cn-DvW5mxZR.js";import{t as m}from"./card-BibIM9x3.js";import{t as h}from"./dropdown-ChWAdhLG.js";import{t as g}from"./confirm-dialog-bfBx6UYv.js";import{t as _}from"./notice-CqRgVmeL.js";import{t as v}from"./tag-CW6WC4fE.js";import{t as y}from"./input-D4W4p0pZ.js";import{t as b}from"./toggle-X_kQW5my.js";import{n as x}from"./toast-sdJJ6aTV.js";import{t as S}from"./chevron-right-B6vEpVY0.js";import{t as C}from"./loader-circle-BFRVtR3K.js";import{t as w}from"./pencil-B90pDI55.js";import{t as T}from"./x-DxL-bCuT.js";import{f as E,n as D,r as O}from"./auth-store-B1y6dgYQ.js";import{t as k}from"./sdk.gen-DmWuY0SL.js";import{c as A,i as ee,m as te,n as ne,o as j,r as re,s as ie,t as ae}from"./native-biometric-BK6_QtW5.js";import{a as oe,i as se}from"./routes-C6gxiCrz.js";import{n as M,t as ce}from"./react-query.gen-gQ1_8EHv.js";import{B as le,Fr as N,H as ue,Mn as de,Nn as fe,Nr as pe,Oa as me,Pr as he,Tn as P,V as F,g as I,h as L,jn as R,m as z,p as B,ui as ge,x as _e,yi as V}from"./index-B-S-gNKm.js";import{t as H}from"./use-active-assistant-id-BVzVN4_g.js";import{t as U}from"./detail-card-EsA9SOvZ.js";import{t as W}from"./setting-row-BGQgDyhv.js";var G=e(o(),1),K=f(),q=[{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.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,r]=(0,G.useState)(()=>n(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>a(`dockBadgesEnabled`,()=>{r(n(`dockBadgesEnabled`,!0))}),[]),[e,e=>{r(e),t(`dockBadgesEnabled`,e),e||P(0)}]}function xe({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(b,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:p(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function Se(){return(0,K.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 Ce({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=fe(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.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=ve.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 R(e.sourceKind):await de(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,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(Se,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(xe,{row:e,onToggle:p},e.id))}),r&&(0,K.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 we(){let e=N({platformHostedOnly:!0}),t=pe(),n=he(),r=l(),{data:i,isLoading:a,isError:o}=u({...ce(),enabled:e===`full`&&t}),s=d({mutationFn:async e=>{let{data:t}=await k({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{M(r,void 0,e),x.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{x.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,f=i?.access_consented??!1,p=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.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,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(b,{checked:f,disabled:p,onChange:()=>s.mutate(!f)})]})})]}),e===`disabled`&&(0,K.jsx)(_e,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function Te(){let e=te(),[t,n]=(0,G.useState)(()=>ee()),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(`Face ID`),[s,c]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(re().then(i),ne().then(o))},[e]),!e||!r)return null;let l=async()=>{c(!0);try{if(t)j(!1),await ae(),n(!1);else{let e=A();e&&await ie(e),j(!0),n(!0)}}finally{c(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,a,` for sign-in`]}),(0,K.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,K.jsx)(b,{checked:t,onChange:()=>void l(),disabled:s})]})})}function J(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var Y=B.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Ee(){let e=H(),t=l(),{data:n,isError:r}=u({queryKey:[`thresholds`,e],queryFn:()=>L(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,d]=(0,G.useState)(`strict`),[f,p]=(0,G.useState)(!1),g=(0,G.useRef)(!1),[_,v]=(0,G.useState)(!1),y=(0,G.useRef)(null),b=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||g.current||(a(z(n.interactive).id),s(z(n.autonomous).id),d(z(n.headless).id),v(!0))},[n]),(0,G.useEffect)(()=>()=>{y.current!==null&&(clearTimeout(y.current),y.current=null,b.current?.(),b.current=null)},[]);let x=(0,G.useCallback)((n,r,i)=>{if(!e||!_)return;let a=B.find(e=>e.id===n)?.riskThreshold,o=B.find(e=>e.id===r)?.riskThreshold,s=B.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,_,t]),C=(0,G.useCallback)((e,t,n)=>{y.current!==null&&clearTimeout(y.current),b.current=()=>x(e,t,n),y.current=setTimeout(()=>{b.current?.(),y.current=null,b.current=null},500)},[x]),w=(0,G.useCallback)(e=>{g.current=!0,a(e),C(e,o,c)},[o,c,C]),T=(0,G.useCallback)(e=>{g.current=!0,s(e),C(i,e,c)},[i,c,C]),E=(0,G.useCallback)(e=>{g.current=!0,d(e),C(i,o,e)},[i,o,C]),D=B.find(e=>e.id===i),O=B.find(e=>e.id===o),k=B.find(e=>e.id===c),A=!e||!_;return(0,K.jsxs)(m,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Risk Tolerance`}),(0,K.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 tolerance determines which levels auto-approve.`}),r&&(0,K.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,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:i,onChange:w,options:Y,disabled:A})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.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,K.jsx)(me,{className:`h-4 w-4`}):(0,K.jsx)(S,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:f?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.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,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:o,onChange:T,options:Y,disabled:A})}),O&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:O.description})]}),(0,K.jsx)(J,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:c,onChange:E,options:Y,disabled:A})}),k&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:k.description})]})]})]})]})]})}var X=e(s(),1),De=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],Z=[{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 Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[g,v]=(0,G.useState)(null),b=s.trim(),x=b.length>0&&!p,S=(0,G.useCallback)(async n=>{if(n.preventDefault(),!x)return;let i=d.trim()||`${a} — ${b}`;m(!0),v(null);try{await ue(e,t.id,{risk:l,description:i}),r()}catch(e){v(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,x,d,t,r,l,a,b]);return(0,X.createPortal)((0,K.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,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.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,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void S(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[g&&(0,K.jsx)(_,{tone:`error`,children:g}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(h,{value:a,onChange:o,disabled:!0,options:De.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(y,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:Z.map(e=>(0,K.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,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(y,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${b||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.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,K.jsx)(`button`,{type:`submit`,disabled:!x,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 ke(e){return e.origin===`default`&&!e.userModified}function Ae(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 je(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 Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(null),[m,h]=(0,G.useState)(!1),y=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([F(e),F(e,{origin:`default`})]);return Ae(t,n)}return F(e)},[e]),x=(0,G.useCallback)(async()=>{o(!0);try{i(await y(m)),l(null)}catch(e){l(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[y,m]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await y(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}},[y,m]);let S=(0,G.useCallback)(async()=>{if(f)try{await le(e,f.id),x()}catch(e){l(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{p(null)}},[e,f,x]);return(0,X.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.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,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(b,{checked:m,onChange:h,label:`Show all defaults`}),(0,K.jsx)(c,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(_,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(V,{className:`h-8 w-8`}),(0,K.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,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(v,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(v,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(v,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.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,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.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,K.jsx)(ge,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),u&&(0,K.jsx)(Oe,{assistantId:e,existingRule:u,onClose:()=>d(null),onSaved:()=>{d(null),x()}}),(0,K.jsx)(g,{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 S(),onCancel:()=>p(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(m,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(V,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.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,K.jsx)(c,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{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`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=N({platformHostedOnly:!0}),t=O(),a=t,o=D.use.user()?.id??null,[s,c]=(0,G.useState)(()=>n(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>n(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>i(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(Te,{}),(0,K.jsx)(Ce,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Ee,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:t?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:se(oe.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:s,onChange:()=>{let e=!s;c(e),E(`share_analytics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),E(`share_diagnostics`,e,{userId:o,hasPlatformSession:t})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(we,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(h,{value:d,onChange:e=>{f(e),r(`llmLogRetention`,e)},options:Pe})}),(0,K.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{Ie as PrivacyPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{f as o}from"./local-mode-CgrENuVf.js";import{t as s}from"./is-electron-C_ZTVhv8.js";import{d as c,i as l,n as u}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{f as o}from"./local-mode-CgrENuVf.js";import{t as s}from"./is-electron-C_ZTVhv8.js";import{d as c,i as l,n as u}from"./auth-store-B1y6dgYQ.js";import{m as d}from"./native-biometric-BK6_QtW5.js";import{a as f}from"./routes-C6gxiCrz.js";import{d as p,f as m,l as h,u as g}from"./prefs-Ds__U7Hi.js";import{t as _}from"./client-feature-flag-store-CHA6YxVq.js";import{Ct as v,St as y,Tt as b,_t as x,bt as S,rn as C}from"./index-B-S-gNKm.js";import{t as w}from"./step-indicator-dots-Bc6X141I.js";import{n as T,t as E}from"./consent-controls-BzFFpG2p.js";var D=e(t(),1);function O({researchOnboardingEnabled:e,isNative:t,isLocalMode:n}){return e&&!t&&!n?f.onboarding.research:f.onboarding.hatching}var k=a();function A(){let e=r(),[t]=i(),a=u.use.user()?.id??null,A=s(),j=d(),M=_.use.stringFlags().preChatOnboardingExperiment20260606??`control`,N=_.use.researchOnboarding(),P=v(M),[F,I]=g(),[L,R]=p(),[z,B]=m(),[V,H]=h(),U=l();(0,D.useEffect)(()=>{j||y()},[j]);let W=t.get(`preview`)===`true`,G=(0,D.useCallback)(e=>{},[]),K=W?G:I,q=W?G:R,J=W?G:B,Y=W?G:H,X=(0,D.useCallback)(()=>{if(W){e(`${f.onboarding.prechat}?preview=true`);return}if(c({userId:a,tos:z,privacy:V,shareAnalytics:F,shareDiagnostics:L,hasPlatformSession:U}),!j){let e=b(P);S(x.privacyTos,{userId:a,variant:e})}let n=t.get(`hosting`),r=new URLSearchParams;n&&r.set(`hosting`,n);let i=r.toString();e(`${O({researchOnboardingEnabled:N,isNative:j,isLocalMode:o()})}${i?`?${i}`:``}`)},[V,U,j,W,e,P,N,t,F,L,z,a]);return(0,k.jsx)(C,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:F,shareDiagnostics:L,onShareAnalyticsChange:K,onShareDiagnosticsChange:q,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:V,tosAccepted:z,onPrivacyChange:Y,onTosChange:J,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!z||!V,onClick:X,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
|
package/dist/assets/{provider-callback-page-DZFHFC3L.js → provider-callback-page-UAlBgfqn.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BG-GkiMq.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-CgrENuVf.js";import{D as l,n as u}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BG-GkiMq.js";import{t as n}from"./react-DJZBPgpf.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{S as s,f as c}from"./local-mode-CgrENuVf.js";import{D as l,n as u}from"./auth-store-B1y6dgYQ.js";import{c as d}from"./api-1X5EQzNF.js";import{S as f,_ as p}from"./native-biometric-BK6_QtW5.js";import{a as m}from"./routes-C6gxiCrz.js";import{a as h,i as g}from"./login-flow-DB9qs18f.js";import{n as _}from"./index-B-S-gNKm.js";import{r as v,t as y}from"./account-shell-PzFH1_ZC.js";var b=e(n(),1),x=o();function S(){let[e]=i(),n=r(),o=u.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let t=await f(),r=p(t.ok&&!!t.data.user,t.ok?[]:t.flows??[]);switch(r.kind){case`authenticated`:{if(await o(),c())try{let e=await d();if(e.ok&&e.data.length>0&&(await s(e.data,l.getState().currentOrganizationId??void 0),!E)){n(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:r}=h({returnTo:E,fallback:e,authIntent:D});r?window.location.href=t:n(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);n(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(r.message);break}}catch(e){t(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,o,E,n,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(a,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(a,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{n as o}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,h as r,t as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{n as o}from"./auth-store-B1y6dgYQ.js";import{C as s,T as c,x as l}from"./native-biometric-BK6_QtW5.js";import{a as u}from"./routes-C6gxiCrz.js";import{a as d,o as f}from"./login-flow-DB9qs18f.js";import{i as p,n as m,r as h,t as g}from"./account-shell-PzFH1_ZC.js";import{t as _}from"./signup-shell-DMX1tgqB.js";var v=e(t(),1),y=a();function b(){let e=n(),[t]=r(),a=o.use.refreshSession(),b=t.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await l();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let t=await c({email:x,username:C});if(!t.ok){if(s(t)){await a();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(t.errors[0]?.message??`Failed to complete signup.`);return}await a();let n=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});n.requiresFullPageNavigation?window.location.href=n.destination:e(n.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(i,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-C6gxiCrz.js";import{t as s}from"./client-feature-flag-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-C6gxiCrz.js";import{t as s}from"./client-feature-flag-store-CHA6YxVq.js";import{t as c}from"./conversation-store-B8D6wE18.js";import{t as l}from"./conversation-selection-CNssqGbG.js";import{an as u}from"./index-B-S-gNKm.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BG-GkiMq.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,t as i}from"./button-D-AX8Voo.js";import{d as a,r as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./cn-DvW5mxZR.js";import{t as u}from"./tag-CW6WC4fE.js";import{t as d}from"./input-D4W4p0pZ.js";import{n as f,t as p}from"./create-selectors-BE0_e_Ed.js";import{t as m}from"./arrow-left-CP-EhDNF.js";import{t as h}from"./chevron-left-DghyKSEE.js";import{t as g}from"./chevron-right-B6vEpVY0.js";import{n as _,t as v}from"./animated-avatar-CEC1DGcI.js";import{t as y}from"./loader-circle-BFRVtR3K.js";import{t as b}from"./pencil-B90pDI55.js";import{t as x}from"./x-DxL-bCuT.js";import{$ as S,An as C,B as w,cn as T,jn as E,sn as D}from"./sdk.gen-zA5ns5LT.js";import{r as ee}from"./api-errors-DPruG7q9.js";import{A as te,B as O,L as k,R as A,n as j,z as ne}from"./auth-store-B1y6dgYQ.js";import{a as M,o as re,r as N}from"./api-1X5EQzNF.js";import{a as ie}from"./routes-C6gxiCrz.js";import{t as P}from"./platform-detection-Ceodt3Hu.js";import{t as ae}from"./client-feature-flag-store-CHA6YxVq.js";import{c as oe,l as se}from"./prechat-RG0Q0UrS.js";import{A as ce,B as le,C as ue,D as de,E as fe,F,I,L as pe,M as me,N as he,O as ge,P as _e,R as L,S as R,T as z,V as B,_ as ve,a as ye,b as be,d as V,f as xe,g as Se,i as Ce,j as we,k as Te,m as Ee,o as De,p as Oe,r as ke,s as Ae,t as H,v as je,w as Me,x as Ne,y as Pe}from"./proxy-BgtfAoJj.js";import{t as Fe}from"./AnimatePresence-uY0BR2n2.js";import{t as U}from"./use-reduced-motion-BG6r0Z46.js";import{$n as Ie,Ma as W,Si as Le,hn as Re,in as ze,it as G,ki as Be,on as Ve,qt as He,rn as Ue,rt as We,sn as Ge,xt as Ke,yt as qe}from"./index-B-S-gNKm.js";import{t as Je}from"./prechat-names-NPlBAwCy.js";var Ye=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Xe(e,t){return me(e)?e[Ye(0,e.length,t)]:e}var Ze=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 Qe(this.animations,`duration`)}get iterationDuration(){return Qe(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 Qe(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 $e=class extends Ze{then(e,t){return this.finished.finally(e).then(()=>{})}};function et(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=fe(i,a,o);return t?s(r):s}function tt(e,t){return e in t}var nt=class extends Ae{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(tt(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 xe()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},K=e(n(),1);function rt(e){let t=B(()=>R(e)),{isStatic:n}=(0,K.useContext)(ke);if(n){let[,n]=(0,K.useState)(e);(0,K.useEffect)(()=>t.on(`change`,n),[])}return t}function it(e,t){let n=rt(t()),r=()=>n.set(t());return r(),le(()=>{let t=()=>we.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),ce(r)}}),n}function at(e){Ne.current=[],e();let t=it(Ne.current,e);return Ne.current=void 0,t}function ot(e,t,n,r){if(typeof e==`function`)return at(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return ct(e,t,n,r);let i=typeof t==`function`?t:et(t,n,r),a=Array.isArray(e)?st(e,i):st([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 st(e,t){let n=B(()=>[]);return it(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function ct(e,t,n,r){let i=B(()=>Object.keys(n)),a=B(()=>({}));for(let o of i)a[o]=ot(e,t,n[o],r);return a}function lt(e){e.values.forEach(e=>e.stop())}function ut(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&be(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{ut(e,t)})})}function dt(e,t){if(Array.isArray(t))return ut(e,t);if(typeof t==`string`)return ut(e,[t]);be(e,t)}function ft(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){I(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(ve(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return I(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{dt(e,n)})},stop(){t.forEach(e=>{lt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function pt(e){return typeof e==`object`&&!Array.isArray(e)}function mt(e,t,n,r){return e==null?[]:typeof e==`string`&&pt(t)?Se(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ht(e,t,n){return e*(t+1)+n*t}function gt(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 _t(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(L(e,i),r--)}}function vt(e,t,n,r,i,a){_t(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Te(i,a,r[o]),easing:Xe(n,o)})}function yt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function bt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var xt=`easeInOut`,St=20;function Ct(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,gt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=gt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Et(e),{delay:l=0,times:u=Me(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=ue(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&kt(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=_e(b));let r=ge(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&&z(u,T),c.length===1&&c.unshift(null),m&&pe(m<St,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${St} or apply repeat at the sequence level instead.`),m&&m<St){let e=b>0?_/b:0;b=ht(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`?he(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`:Xe(f,e-1))}yt(u,m,e)}let E=w+b;vt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Pe(p)){let e=wt(p,s);_(m,h,Tt(`default`,e))}else{let e=mt(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=wt(r,s);for(let e in m)_(m[e],Dt(h,e),Tt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(bt);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(F(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(xt)),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 wt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Tt(e,t){return t[e]||(t[e]=[]),t[e]}function Et(e){return Array.isArray(e)?e:[e]}function Dt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var Ot=e=>typeof e==`number`,kt=e=>e.every(Ot);function At(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Ee(e)&&!Oe(e)?new ye(t):new De(t);n.mount(e),V.set(e,n)}function jt(e){let t=new nt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),V.set(e,t)}function Mt(e,t){return Pe(e)||typeof e==`number`||typeof e==`string`&&!pt(t)}function Nt(e,t,n,r){let i=[];if(Mt(e,t))i.push(Ce(e,pt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=mt(e,t,r),o=a.length;I(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?At:jt;V.has(r)||s(r);let c=V.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...je(c,{...t,transition:l},{}))}}return i}function Pt(e,t,n){let r=[];return Ct(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=R(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:de}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Nt(n,e,t))}),r}function Ft(e){return Array.isArray(e)&&e.some(Array.isArray)}function It(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),Ft(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Pt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Nt(e,i,{...c,...r},t)}let l=new $e(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{L(t.animations,l)})),l}return i}var Lt=It();function Rt(){let e=B(ft);return le(e.mount,[]),e}var zt=12;function Bt(e,t){let n=e.slice(0,zt).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 Vt({firstName:e,lastName:t,occupation:n,hobby:r},i=[],{includeSuggestions:a=!0}={}){let o=[e.trim(),t.trim()].filter(Boolean).join(` `),s=n.trim(),c=r?.trim()??``,l=Bt(i,a),u=l?`"plugins": ["<exact name from the list above>"], `:``,d=[o?`My name is ${o}.`:``,s?`I work as ${s}.`:``,c?`My hobby is ${c}.`:``].filter(Boolean).join(` `)||`I'd like you to get to know me before we start working together.`,f=a?` "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." } ]`:``,p=`{ ${u}"claims": [ { "claim": "Senior engineer at an AI infra startup", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Based in Boulder, CO", "confidence": "confident", "sources": ["https://linkedin.com/in/example-user"] }, { "claim": "Active climber on Mountain Project", "confidence": "maybe", "sources": [] }, { "claim": "Focused on evals or model serving infrastructure", "confidence": "guessing", "sources": ["https://github.com/example-user"] } ]${f?`,${f}`:``} }`;return`${d}
|
|
8
|
+
|
|
9
|
+
Get to know me. Search the web for what's publicly known about the person matching my name and role, 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. Lean on public sources (LinkedIn, company pages, social profiles, articles, personal sites, GitHub). It's fine to make reasonable inferences and label them honestly.
|
|
10
|
+
|
|
11
|
+
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 ${a?`claims and suggestions`:`claims`} aligned with my stated role.
|
|
12
|
+
|
|
13
|
+
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:
|
|
14
|
+
|
|
15
|
+
${p}
|
|
16
|
+
|
|
17
|
+
Rules for "claims":
|
|
18
|
+
|
|
19
|
+
AT MOST 5 claims, typically 3 to 4. Aim for at least one "confident" and at least one "guessing"; the rest "maybe".
|
|
20
|
+
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".
|
|
21
|
+
Each claim must be independently true-or-false so I can remove the ones that are wrong.
|
|
22
|
+
"confidence" is one of: "confident" (well supported by what you found), "maybe" (plausible but unverified), "guessing" (a hunch from limited signal).
|
|
23
|
+
"sources": 0 to 3 URLs you actually used as evidence for that specific claim. Use [] for pure inferences.
|
|
24
|
+
${a?`Rules for "suggestions":
|
|
25
|
+
|
|
26
|
+
Each suggestion is an object with two fields:
|
|
27
|
+
"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.
|
|
28
|
+
"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.
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
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."
|
|
32
|
+
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.
|
|
33
|
+
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.
|
|
34
|
+
`:``}${l}
|
|
35
|
+
${a?`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims and broadly useful suggestions for my role.`:`Don't include anything sensitive or private. If you found very little, lean on "guessing" claims.`}
|
|
36
|
+
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.`}var Ht=3e3,Ut=3e5,Wt=`Failed to start your assistant. Please try again.`,Gt=`Your assistant is taking longer than expected. Please try again.`,Kt=e=>new Promise(t=>setTimeout(t,e));function qt(){let[e,n]=(0,K.useState)(!1),[r,i]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),s=(0,K.useRef)(!1),c=(0,K.useRef)([]),l=(0,K.useRef)(null),u=(0,K.useCallback)(e=>{if(!l.current){l.current={kind:`ready`,id:e},n(!0);for(let t of c.current)t.resolve(e);c.current=[]}},[]),d=(0,K.useCallback)(e=>{if(l.current)return;l.current={kind:`error`,message:e},o(e);let t=Error(e);for(let e of c.current)e.reject(t);c.current=[]},[]);return{start:(0,K.useCallback)(()=>{if(s.current)return;s.current=!0;let e=Date.now(),n=()=>Date.now()-e>=Ut;(async()=>{let e;try{let t=await re();if(t.ok)e=t.data.id,i(t.data.id);else{if(A(t.status,t.error)){d(k);return}if(!O(t.status)){d(ee(t.error,void 0,Wt));return}}}catch(e){t(e,{context:`research_background_hatch`})}let r;for(;!r;){if(n()){d(Gt);return}try{let t=await N(e);e&&!t.ok&&t.status===404&&(e=void 0,t=await N());let n=ne(t);if(n.kind===`active`&&t.ok){r=t.data.id,i(r);break}if(n.kind===`error`){d(n.message);return}}catch(e){t(e,{context:`research_background_hatch_poll`})}await Kt(Ht)}for(;;){try{if((await M(r)).ok)break}catch{}if(n()){d(Gt);return}await Kt(Ht)}u(r)})()},[d,u]),ready:e,assistantId:r,error:a,awaitReady:(0,K.useCallback)(()=>{let e=l.current;return e?.kind===`ready`?Promise.resolve(e.id):e?.kind===`error`?Promise.reject(Error(e.message)):new Promise((e,t)=>{c.current.push({resolve:e,reject:t})})},[])}}async function Jt(e,n){try{await w({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var Yt=[`admin-copilot`],Xt=[{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 Zt(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function Qt(e,t){return e.includes(` ${t} `)}function $t(e){let t=Zt(e),n=[];for(let{plugin:e,keywords:r}of Xt)r.some(e=>Qt(t,e))&&n.push(e);return n}function en(e,t){let n=[...Yt,...$t(e)],r=new Set,i=[];for(let e of n)!t.has(e)||r.has(e)||(r.add(e),i.push(e));return i}var tn=1500,nn=12e4,rn=2;function an({complete:e,stableReads:t}){return e&&t>=rn}function on({sawCompletePayload:e}){return e?`done`:`error`}function sn({sawCompletePayload:e}){return e}var cn=`vellum-ai`,ln=new Set([`simple-memory`,`level-up`]);function un(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function dn(e){return e?.split(`/`)[0]?.trim()??``}function fn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||dn(r.source?.repo)===cn&&(ln.has(e)||(n.add(e),t.push({name:e,description:un(i)})))}return{capabilities:t,validNames:n}}async function pn(e){try{return fn((await E({path:{assistant_id:e},throwOnError:!1})).data?.matches??[])}catch(e){return t(e,{context:`research_onboarding_catalog`}),{capabilities:[],validNames:new Set}}}async function mn(e,n){try{await C({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var hn=e=>new Promise(t=>setTimeout(t,e));function gn({role:e,validNames:t,modelPlugins:n}){return[...new Set([...en(e,t),...n.filter(e=>t.has(e))])]}function _n(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
37
|
+
`).trim();if(e)return e}return(n.content??``).trim()}return``}function vn(){let[e,n]=(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()),c=s(),l=(0,K.useCallback)(({awaitAssistantId:e,subject:s,conversationTitle:l,resumeConversationId:u,onConversationCreated:d,includeSuggestions:f=!0})=>{let p=JSON.stringify(s);if(i.current===p)return;i.current=p;let m=r.current+1;r.current=m;let h=()=>r.current!==m,g=()=>{};o.current=new Promise(e=>{g=e}),a.current.clear(),n({status:`running`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),(async()=>{let r,i,o=!1;try{let t=await e();if(r=t,h())return;let{capabilities:c,validNames:p}=await pn(t);if(h())return;let m=Object.fromEntries(c.map(e=>[e.name,e.description]));n(e=>({...e,pluginCatalog:m})),p.size===0&&g();let _=a.current,v=en(s.occupation,p);for(let e of v)_.has(e)||_.set(e,mn(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:Vt(s,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:P(),clientMessageId:crypto.randomUUID()};try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;e&&(n.clientTimezone=e)}catch{}return!!(await T({path:{assistant_id:t},body:n,throwOnError:!1})).response?.ok},b=async()=>{let e=await S({path:{assistant_id:t},body:{conversationType:`standard`,...l?{title:l}:{}},throwOnError:!1});i=e.data?.id;let n=e.data?.id;if(!(!e.response?.ok||!n))return d?.(n),n},x;if(u){let e=await D({path:{assistant_id:t},query:{conversationId:u},throwOnError:!1});if(h())return;if(e.response?.ok&&(x=u,i=u,!(e.data?.messages??[]).some(e=>e.role===`user`))){if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}}if(!x){if(x=await b(),h())return;if(!x){n(e=>({...e,status:`error`}));return}if(!await y(x)){n(e=>({...e,status:`error`}));return}if(h())return}let C=Date.now()+nn,w=``,E=0;for(;Date.now()<C;){if(await hn(tn),h())return;let e=await D({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=_n(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=Ve(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,mn(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:gn({role:s.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(o=!0),E=r===w?E+1:0,w=r,an({complete:l,stableReads:E}))break}}if(h())return;n(e=>({...e,status:on({sawCompletePayload:o})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),sn({sawCompletePayload:o})&&r&&i&&(await Jt(r,i),Ie(c,r))}})()},[c]),u=(0,K.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,K.useCallback)((e,t)=>{if(r.current+=1,n(e),t&&e.installedPlugins.length>0){let n=a.current;n.clear();for(let r of e.installedPlugins)n.set(r,(async()=>{try{await mn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function yn({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(`
|
|
38
|
+
`)}async function bn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=yn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:P(),clientMessageId:crypto.randomUUID()};await T({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await Jt(e,n)}}var xn={companionCoworker:`companion-coworker`,genzBoomer:`genz-boomer`,executeCollaborate:`execute-collaborate`,playfulSerious:`playful-serious`,politeUnfiltered:`polite-unfiltered`},Sn=1500,Cn=12e4,wn=2,Tn=e=>new Promise(t=>setTimeout(t,e)),En=e=>Math.max(0,Math.min(100,Math.round(e)));function Dn(e,t){let n=t=>En(e[t]??50),r=n(xn.companionCoworker),i=n(xn.executeCollaborate),a=n(xn.playfulSerious),o=n(xn.politeUnfiltered);return`<system-message>
|
|
39
|
+
${t?.trim()||`The user`} wants to customize your personality.
|
|
40
|
+
This is what they want you to be:
|
|
41
|
+
Companion (0-100): ${100-r}
|
|
42
|
+
Coworker (0-100): ${r}
|
|
43
|
+
Voice Style (0 = Gen Z, 100 = Boomer): ${n(xn.genzBoomer)}
|
|
44
|
+
Execute Independently (0 - 100): ${100-i}
|
|
45
|
+
Collaborative (0 - 100): ${i}
|
|
46
|
+
Playfulness (0 - 100): ${100-a}
|
|
47
|
+
Seriousness (0 - 100): ${a}
|
|
48
|
+
Politeness (0 - 100): ${100-o}
|
|
49
|
+
Unfiltered Rawness/Crassness (0 - 100): ${o}
|
|
50
|
+
|
|
51
|
+
Rewrite your own identity files (IDENTITY.md and SOUL.md) to reflect your new personality — first person, in a voice and style that matches it. Do not touch users/guardian.md or anything else under users/: that is your user's profile (their name, work, preferences), not your identity.
|
|
52
|
+
|
|
53
|
+
Overwrite each file completely with file_write: write the whole file fresh in one pass. This is a from-scratch rewrite, not an edit — do not append to what's already there, do not patch individual lines, and leave none of the current default wording behind. Fill in every IDENTITY.md placeholder (the _(not yet chosen)_ / _(not yet established)_ fields).
|
|
54
|
+
|
|
55
|
+
Keep your existing name exactly as it is — this changes your personality, not who you are. Do not rename yourself, and if your name is already set, carry it through verbatim (don't treat it as a placeholder to fill).
|
|
56
|
+
|
|
57
|
+
Each rewritten file must still be complete: SOUL.md keeps everything you operate by — how you use memory, your boundaries, your compliance stance — re-expressed in your new voice rather than dropped. When you finish, both files should read top-to-bottom as this new personality, with nothing left in the generic default voice.
|
|
58
|
+
</system-message>`}function On(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||n.role!==`assistant`)continue;let r=n.contentBlocks;if(r&&r.length>0){let e=r.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
59
|
+
`).trim();if(e)return e}return(n.content??``).trim()}return``}async function kn({awaitAssistantId:e,values:n,userName:r}){let i,a;try{i=await e();let t=await S({path:{assistant_id:i},body:{conversationType:`standard`,title:`Updating personality`},throwOnError:!1});if(a=t.data?.id,!t.response?.ok||!a)return;let o={conversationId:a,content:Dn(n,r),sourceChannel:`vellum`,interface:`vellum`,clientMessageId:crypto.randomUUID()};if(!(await T({path:{assistant_id:i},body:o,throwOnError:!1})).response?.ok)return;let s=Date.now()+Cn,c=``,l=0;for(;Date.now()<s;){await Tn(Sn);let e=On((await D({path:{assistant_id:i},query:{conversationId:a},throwOnError:!1})).data?.messages??[]);if(e&&(l=e===c?l+1:0,c=e,l>=wn))break}}catch(e){t(e,{context:`research_onboarding_personality`})}finally{if(i&&a)try{await w({path:{assistant_id:i,id:a},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_personality_archive`})}}}function An(e){return e?`research_onboarding:${e}`:null}function jn(e){let t=An(e);if(!t)return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}function Mn(e,t){let n=An(e);if(n)try{localStorage.setItem(n,JSON.stringify(t))}catch{}}function Nn(e){let t=An(e);if(t)try{localStorage.removeItem(t)}catch{}}function Pn(e){return e.research?.status===`done`?`suggestions`:e.step===`meeting`?e.checkinBooked?`looking`:`letschat`:e.step}function Fn(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=c(),In={w:1280,h:800};function Ln(){return typeof window>`u`?In:{w:window.innerWidth,h:window.innerHeight}}function Rn(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(()=>Ln());return(0,K.useLayoutEffect)(()=>{if(!e)return;let t=()=>{let t=e.getBoundingClientRect();r({w:t.width,h:t.height})};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]),{ref:t,size:n}}var zn=(0,K.createContext)(null);function Bn({size:e,children:t}){return(0,q.jsx)(zn.Provider,{value:e,children:t})}function Vn(){let e=(0,K.useContext)(zn),[t,n]=(0,K.useState)(()=>Ln());return(0,K.useEffect)(()=>{if(e)return;let t=()=>n(Ln());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var Hn={x:.5,y:.4},Un=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function Wn(e){return Un[e%Un.length]??0}var Gn=[1,0,1,0,1,0,1,0,1,0,0],Kn=[.72,1],qn=[.4,1],Jn=[10,20],Yn=50;function Xn(e){return Kn[Gn[e]??1]??1}function Zn(e){return qn[Gn[e]??1]??1}function Qn(e){return Jn[Gn[e]??1]??20}function $n(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function er(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function tr(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 nr(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 rr({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Vn(),u=U(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=$n(c,l),h=m/2,g=m/2,_=er(c,l)/m,y=er(c,l),b=(0,K.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=Hn.x*c,S=Hn.y*l,C=x-h,w=S-h,T=(0,K.useMemo)(()=>tr(c,l,g),[c,l,g]);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,g=!u&&a?.char===r;if(f){let n=T[i.fromSlot],a=nr(n,x,S,c,l),s=Xn(i.fromSlot),u=Zn(i.fromSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:Yn},initial:!1,animate:{x:[n.x-h,a.x-h,a.x-h,C,C,C],y:[n.y-h,a.y-h,a.y-h,w,w,w],scale:[s,s,s,_*.7,_*1.08,_],opacity:[u,u,0,0,1,1]},transition:{duration:.85,times:[0,.28,.34,.42,.72,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},onAnimationComplete:()=>o(r),children:(0,q.jsx)(v,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=T[a.toSlot],i=nr(n,x,S,c,l),o=Xn(a.toSlot),s=Zn(a.toSlot);return(0,q.jsx)(H.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:Qn(a.toSlot)},initial:!1,animate:{x:[C,C,i.x-h,i.x-h,n.x-h,n.x-h],y:[w,w,i.y-h,i.y-h,n.y-h,n.y-h],scale:[_,_*.6,o,o,o*1.1,o],opacity:[1,0,0,s,s,s]},transition:{duration:.85,times:[0,.28,.34,.45,.78,1],ease:[`easeIn`,`linear`,`linear`,`easeOut`,`easeOut`]},children:(0,q.jsx)(`div`,{style:{transform:`rotate(${Wn(a.toSlot)}deg)`},children:(0,q.jsx)(v,{components:e,traits:t,size:m,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:m,height:m,zIndex:d?Yn:Qn(y)},initial:!1,animate:{x:E.x-h,y:E.y-h,scale:d?_:Xn(y),opacity:d?1:Zn(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(${Wn(b.get(r)??0)}deg)`},children:(0,q.jsx)(v,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var ir=[{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=p(f((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:ir,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 ar(){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 or(){let e=G(),t=J.use.characters(),n=J.use.ensureGenerated(),r=U(),{w:i,h:a}=ar();(0,K.useEffect)(()=>{e&&n(e)},[e,n]);let o=$n(i,a),s=(0,K.useMemo)(()=>tr(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=Un[i%Un.length]??0,d=o*Xn(i),f=Zn(i),p=Qn(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)(v,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var sr=l(`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)]`),cr=l(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`);function Y(e){return e.trim().toLowerCase()}function lr(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 ur({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,q.jsxs)(`ul`,{id:e,role:`listbox`,className:l(`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(),i(t.value)},onMouseEnter:()=>a(r),className:l(`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)(Be,{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 dr({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 fr(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 pr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,K.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,c=(0,K.useRef)(null),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(-1),_=(0,K.useMemo)(()=>lr(i,d,n),[i,d,n]),v=d.trim(),y=(0,K.useMemo)(()=>{if(!v)return!1;let e=Y(v);return!(n.some(t=>Y(t)===e)||_.some(t=>Y(t)===e))},[v,n,_]),b=(0,K.useMemo)(()=>{let e=_.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[_,y,v]);fr(c,()=>m(!1)),(0,K.useEffect)(()=>{g(e=>e>=b.length?b.length-1:e)},[b.length]);let x=p&&b.length>0,S=!y;function C(e){let t=e.trim();t&&(n.some(e=>Y(e)===Y(t))||r([...n,t]),f(``),g(-1))}function w(e){r(n.filter(t=>t!==e))}function T(e){e.key===`ArrowDown`?(e.preventDefault(),m(!0),g(e=>Math.min(e+1,b.length-1))):e.key===`ArrowUp`?(e.preventDefault(),g(e=>Math.max(e-1,0))):e.key===`Enter`?x&&h>=0?(e.preventDefault(),C(b[h].value)):d.trim()&&(e.preventDefault(),C(d)):e.key===`,`?(e.preventDefault(),C(d)):e.key===`Backspace`&&d.length===0&&n.length>0?w(n[n.length-1]):e.key===`Escape`&&m(!1)}return(0,q.jsxs)(`div`,{ref:c,className:`relative flex flex-col gap-1.5`,children:[(0,q.jsx)(dr,{htmlFor:o,children:e}),(0,q.jsxs)(`div`,{className:l(sr,`min-h-9 flex-wrap py-1.5`),children:[(0,q.jsx)(Le,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,q.jsx)(u,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,q.jsx)(`input`,{id:o,role:`combobox`,"aria-expanded":x,"aria-controls":s,"aria-autocomplete":`list`,"aria-activedescendant":h>=0?`${s}-opt-${h}`:void 0,autoComplete:`off`,className:l(cr,`h-6 w-24`),placeholder:n.length===0?t:``,value:d,onChange:e=>{f(e.target.value),m(!0)},onFocus:()=>m(!0),onKeyDown:T})]}),x&&(0,q.jsx)(ur,{id:s,options:b,highlighted:h,showAddHint:S,onPick:C,onHover:g})]})}var mr=`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 hr({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,a]=(0,K.useState)(e),[o,s]=(0,K.useState)(t),[c,l]=(0,K.useState)(``),[u,f]=(0,K.useState)([]),p=r.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,q.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,q.jsxs)(Ue,{showCreatureFooter:!1,children:[(0,q.jsx)(or,{}),(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(),m()},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)(d,{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=>a(e.target.value),autoFocus:!0,required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.27,30),children:(0,q.jsx)(d,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.34,20),children:(0,q.jsx)(d,{label:`Your role`,placeholder:`What do you do for work?`,value:c,onChange:e=>l(e.target.value),required:!0,fullWidth:!0})}),(0,q.jsx)(`div`,{style:X(.41,10),children:(0,q.jsx)(pr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:f,suggestions:mr})})]}),(0,q.jsx)(`div`,{className:`mt-10 w-full`,style:X(.5),children:(0,q.jsx)(i,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var gr=`#1A1A1A`,_r=`#FFFFFF`;function vr(e){let t=/^#?([0-9a-f]{6})$/i.exec(e);if(!t)return 0;let n=parseInt(t[1],16),r=n>>16&255,i=n>>8&255,a=n&255;return(r*299+i*587+a*114)/1e3/255}function yr(e,t){let n=/^#?([0-9a-f]{6})$/i.exec(e);if(!n)return e;let r=parseInt(n[1],16),i=e=>Math.max(0,Math.min(255,Math.round((r>>e&255)*t)));return`#${(1<<24|i(16)<<16|i(8)<<8|i(0)).toString(16).slice(1)}`}function br(e){let t=vr(e)>.6;return{bg:e,isLight:t,fg:t?gr:_r,fgDeep:yr(e,.6),fgMuted:t?`rgba(0,0,0,0.6)`:`rgba(255,255,255,0.65)`,wash:t?`rgba(0,0,0,0.08)`:`rgba(255,255,255,0.12)`}}function xr(){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 br(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=xr(),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)(h,{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)(g,{className:`h-5 w-5`})}):null]})}var Sr=[`Ziggy`,`Quill`,`Luna`,`Remy`,`Cleo`,`Cade`];function Cr(e,t){let n=[];for(let r=0;r<e;r++)r!==t&&n.push(r);return{centerChar:t,edgeOrder:n}}function wr({onContinue:e,onBack:t,onForward:n}){let r=G(),a=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=a.length,[u,d]=(0,K.useState)(null),[f,p]=(0,K.useState)(``),[h,g]=(0,K.useState)(!1),v=(0,K.useRef)(!1),y=(0,K.useRef)(null),{ref:x,size:S}=Rn(),[C,w]=(0,K.useState)(null);(0,K.useEffect)(()=>{l>0&&u===null&&d(Cr(l,s))},[l,s,u]),(0,K.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let T=u?.centerChar;(0,K.useEffect)(()=>{T!=null&&!v.current&&p(Sr[T%Sr.length])},[T]),(0,K.useEffect)(()=>{h&&(y.current?.focus(),y.current?.select())},[h]);function E(e){if(!u||e===u.centerChar)return;let t=u.edgeOrder.indexOf(e);if(t<0)return;let n=[...u.edgeOrder];n[t]=u.centerChar,w({entering:{char:e,fromSlot:t},exiting:{char:u.centerChar,toSlot:t}}),d({centerChar:e,edgeOrder:n})}let D=()=>u&&E((u.centerChar+1)%l),ee=()=>u&&E((u.centerChar-1+l)%l),te=(0,K.useMemo)(()=>u?a[u.centerChar]:void 0,[u,a]),O=!!r&&!!u&&!!te;function k(){te&&e({traits:te,name:f.trim()})}function A(){v.current=!0,p(e=>{let t=Sr.filter(t=>t!==e),n=t.length>0?t:Sr;return n[Math.floor(Math.random()*n.length)]})}let j=`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)(Bn,{size:S,children:[O&&(0,q.jsx)(rr,{components:r,characters:a,centerChar:u.centerChar,edgeOrder:u.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?k: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:ee,className:`absolute left-[calc(50%-170px)] top-[40%] -translate-y-1/2 ${j}`,children:(0,q.jsx)(m,{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 ${j}`,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:[h?(0,q.jsx)(`input`,{ref:y,value:f,onChange:e=>{v.current=!0,p(e.target.value)},onBlur:()=>g(!1),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),g(!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:()=>g(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,q.jsx)(`span`,{className:`text-3xl font-medium ${f?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:f||`Name your assistant`}),(0,q.jsx)(b,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,q.jsx)(`button`,{type:`button`,onClick:A,"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)(_,{className:`h-5 w-5`})})]}),(0,q.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,q.jsx)(W,{size:16}),disabled:!O,onClick:k,className:`h-11 w-[234px] text-base`,children:`Continue`})]})]})})}var Tr=`absolute left-1/2 top-[30%] z-10 flex w-full -translate-x-1/2 flex-col items-center gap-8 px-6 text-center`,Er=/-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/gi,Dr=/[MmLlHhVvCcSsQqTtAaZz][^MmLlHhVvCcSsQqTtAaZz]*/g;function Or(e){let t=1/0,n=1/0,r=-1/0,i=-1/0,a=0,o=0,s=(e,a)=>{e<t&&(t=e),a<n&&(n=a),e>r&&(r=e),a>i&&(i=a)},c=e.match(Dr)??[];for(let e of c){let t=e[0],n=t.toUpperCase();if(n===`Z`)continue;let r=t!==n,i=(e.slice(1).match(Er)??[]).map(Number);if(n===`H`)for(let e of i)a=r?a+e:e,s(a,o);else if(n===`V`)for(let e of i)o=r?o+e:e,s(a,o);else if(n===`A`)for(let e=0;e+7<=i.length;e+=7){let t=i[e+5],n=i[e+6];a=r?a+t:t,o=r?o+n:n,s(a,o)}else{let e=a,t=o;for(let n=0;n+2<=i.length;n+=2){let c=r?e+i[n]:i[n],l=r?t+i[n+1]:i[n+1];s(c,l),n+2>=i.length-i.length%2&&(a=c,o=l)}}}return t===1/0?{x:0,y:0,w:0,h:0}:{x:t,y:n,w:r-t,h:i-n}}function kr(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}var Ar=.25,jr=.46,Mr=.3,Nr=.85,Pr=40,Fr=14,Ir=8;function Lr({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}=Vn(),[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=Rt();(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:kr(e.paths.map(e=>Or(e.svgPath)))}:null},[i,v]);if(!y)return null;let b=c*Nr,x=Math.min(Math.min(c,l)*Mr,b*y.bbox.h/y.bbox.w),S=x*y.bbox.w/y.bbox.h,C=(c-S)/2,w=l-(1-Ar)*x,T=Pr/100*l-(w+x/2),E=(jr-Ar)*x,D=y.bbox.x+y.bbox.w/2,ee=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*Fr}px, ${u.y*Ir}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 ${ee}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 Rr=200,zr=40;function Br({firstName:e,assistantName:t,onContinue:n,onBack:r,onForward:a}){let o=G(),s=J.use.characters(),c=J.use.selectedIndex(),l=U(),{ref:u,size:{w:d,h:f}}=Rn(),p=xr(),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=Rr/v,C=(zr/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)(Bn,{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)(Lr,{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:a})}),(0,q.jsxs)(`div`,{className:Tr,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)(i,{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 Vr=.3,Hr=.85,Ur=.25;function Wr(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=Vn(),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:kr(t.paths.map(e=>Or(e.svgPath)))}:null},[e,r]),s=o?Math.min(Math.min(i,a)*Vr,i*Hr*o.bbox.h/o.bbox.w):0;return{art:o,eyesW:o?s*o.bbox.w/o.bbox.h:0,eyesH:s,restCy:a-Ur*s,centerX:i/2,w:i,h:a}}function Gr({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=ot(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 Kr={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 qr(e,t){let n=Kr[e];return n&&n.length>0?n:t.filter(t=>t!==e)}var Jr=new Set([`orange`,`pink`,`red`]);function Yr(e,t){return Jr.has(e)&&Jr.has(t)}function Xr(e,t,n){let r=qr(e,t),i=[];for(let e of r){if(i.length>=n)break;i.some(t=>Yr(t,e))||i.push(e)}for(let e of r){if(i.length>=n)break;i.includes(e)||i.push(e)}return i}var Zr=`You’ve used AI that just answers questions`,Qr=`The more I help`,$r=`I’m different`,ei=`The better I get`,ti=`and the less you have to do`,ni=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],ri=290;function ii({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 ai({onContinue:e,onBack:t,onForward:n}){let r=xr(),a=U(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Wr(),p=G(),m=J.use.characters(),h=J.use.selectedIndex(),g=m.length>0?m[h]:void 0,_=f>0&&f<=800,y=_?.17:.22,b=_?`top-[17%]`:`top-[22%]`,x=rt(0),S=rt(1),C=(0,K.useMemo)(()=>!p||!g?`orange`:Xr(g.color,p.colors.map(e=>e.id),1)[0]??`orange`,[p,g]),w=Math.min(220,Math.max(150,d*.16)),T=-w,E=-w*.4,D=rt(-220),ee=(0,K.useMemo)(()=>!p||!g?[]:Xr(g.color,p.colors.map(e=>e.id),3),[p,g]),te=Math.max(.42,Math.min(d/1100,1)),O=Math.round(ri*te),k=-O*1.1,A=-O*.42,j=rt(-320),[ne,M]=(0,K.useState)(!!a),[re,N]=(0,K.useState)(!!a),[ie,P]=(0,K.useState)(!1),[ae,oe]=(0,K.useState)(!1),[se,ce]=(0,K.useState)(!1),[le,ue]=(0,K.useState)(!1),[de,fe]=(0,K.useState)(!!a),F=Math.min(d,768)-48,I=(0,K.useRef)(null),pe=(0,K.useRef)(null),me=(0,K.useRef)(null),he=(0,K.useRef)(null),ge=(0,K.useRef)(null),[_e,L]=(0,K.useState)(0),[R,z]=(0,K.useState)(0),[B,ve]=(0,K.useState)(0),[ye,be]=(0,K.useState)(0),[V,xe]=(0,K.useState)(0);return(0,K.useLayoutEffect)(()=>{I.current?.offsetHeight&&L(I.current.offsetHeight),pe.current?.offsetHeight&&z(pe.current.offsetHeight),me.current?.offsetHeight&&ve(me.current.offsetHeight),he.current?.offsetHeight&&be(he.current.offsetHeight),ge.current?.offsetHeight&&xe(ge.current.offsetHeight)},[F]),(0,K.useEffect)(()=>{x.set(l),ue(!0)},[l,x]),(0,K.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{P(!0),oe(!0),ce(!0)},1400);return()=>clearTimeout(e)},[a]),(0,K.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),j.set(k),M(!1),N(!1),P(!1),oe(!1);let e=Math.max(c*.5,f*y-36),t=[],n=[],r=!1,i=e=>(t.push(e),e),s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{if(await s(200),r||(M(!0),await Promise.all([i(Lt(x,e,{duration:.55,ease:`easeOut`})),i(Lt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(N(!0),await Promise.all([i(Lt(x,l,{type:`spring`,stiffness:210,damping:15})),i(Lt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(P(!0),oe(!0),await i(Lt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;ce(!0);let t=i(Lt(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(fe(!0),await t)})(),()=>{r=!0,t.forEach(e=>e.stop()),n.forEach(clearTimeout)}},[a,o,f,y,c,l,x,S,D,T,E,j,k,A]),(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:F,fontFamily:`var(--font-serif)`},children:[(0,q.jsx)(`span`,{ref:I,className:`block`,children:Zr}),(0,q.jsx)(`span`,{ref:pe,className:`block`,children:Qr}),(0,q.jsx)(`span`,{ref:me,className:`block`,children:$r}),(0,q.jsx)(`span`,{ref:he,className:`block`,children:ei}),(0,q.jsx)(`span`,{ref:ge,className:`block`,children:ti})]}),le&&o&&(0,q.jsx)(Gr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&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)(v,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&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(O*.12),y:j},children:ni.map((e,t)=>(0,q.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:ni.length-t},children:(0,q.jsx)(v,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:ee[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,q.jsxs)(`div`,{className:`${Tr.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)(ii,{firstH:_e,secondH:R,color:r.fgDeep,firstText:Zr,secondText:Qr,revealed:ne,carouseled:ie,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,q.jsx)(ii,{firstH:B,secondH:ye,color:r.fg,firstText:$r,secondText:ei,revealed:re,carouseled:ae,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,q.jsx)(H.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:se?V:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:V>0&&(0,q.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:V},children:(0,q.jsx)(H.span,{className:`block`,initial:!1,animate:{clipPath:se?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:ti})})})]}),de&&(0,q.jsx)(H.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,q.jsx)(i,{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 oi({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 si({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)(oi,{idSuffix:`front`})}),(0,q.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,q.jsx)(oi,{idSuffix:`back`})})]})})]})}var ci=.3,li=.95;function ui({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=U(),a=xr(),{h:o}=Vn(),[s,c]=(0,K.useState)(!1);function l(){if(!s){if(c(!0),i){e();return}window.setTimeout(t,ci*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:li,times:[0,ci/li,.62,1],ease:[`easeIn`,`easeOut`,`easeIn`]},onAnimationComplete:()=>{s&&e()},children:(0,q.jsx)(si,{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`})]})]})]})}function di(e,[t,n]){return Math.min(n,Math.max(t,e))}typeof window<`u`&&window.document&&window.document.createElement;function fi(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function pi(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function mi(...e){return t=>{let n=!1,r=e.map(e=>{let r=pi(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():pi(e[t],null)}}}}function Q(...e){return K.useCallback(mi(...e),e)}function hi(e,t=[]){let n=[];function r(t,r){let i=K.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=K.useMemo(()=>o,Object.values(o));return(0,q.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=K.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>K.createContext(e));return function(n){let r=n?.[e]||t;return K.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,gi(i,...t)]}function gi(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return K.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var _i=globalThis?.document?K.useLayoutEffect:()=>{},vi=K.useInsertionEffect||_i;function yi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=bi({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=K.useRef(e!==void 0);K.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,K.useCallback(t=>{if(s){let n=xi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function bi({defaultProp:e,onChange:t}){let[n,r]=K.useState(e),i=K.useRef(n),a=K.useRef(t);return vi(()=>{a.current=t},[t]),K.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function xi(e){return typeof e==`function`}var Si=K.createContext(void 0);function Ci(e){let t=K.useContext(Si);return e||t||`ltr`}function wi(e){let t=K.useRef({value:e,previous:e});return K.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Ti(e){let[t,n]=K.useState(void 0);return _i(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}r();function Ei(e){let t=Di(e),n=K.forwardRef((e,n)=>{let{children:r,...i}=e,a=K.Children.toArray(r),o=a.find(ki);if(o){let e=o.props.children,r=a.map(t=>t===o?K.Children.count(e)>1?K.Children.only(null):K.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:K.isValidElement(e)?K.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Di(e){let t=K.forwardRef((e,t)=>{let{children:n,...r}=e;if(K.isValidElement(n)){let e=ji(n),i=Ai(r,n.props);return n.type!==K.Fragment&&(i.ref=t?mi(t,e):e),K.cloneElement(n,i)}return K.Children.count(n)>1?K.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oi=Symbol(`radix.slottable`);function ki(e){return K.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Oi}function Ai(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ji(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Mi=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ei(`Primitive.${t}`),r=K.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ni(e){let t=Pi(e),n=K.forwardRef((e,n)=>{let{children:r,...i}=e,a=K.Children.toArray(r),o=a.find(Ii);if(o){let e=o.props.children,r=a.map(t=>t===o?K.Children.count(e)>1?K.Children.only(null):K.isValidElement(e)?e.props.children:null:t);return(0,q.jsx)(t,{...i,ref:n,children:K.isValidElement(e)?K.cloneElement(e,void 0,r):null})}return(0,q.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Pi(e){let t=K.forwardRef((e,t)=>{let{children:n,...r}=e;if(K.isValidElement(n)){let e=Ri(n),i=Li(r,n.props);return n.type!==K.Fragment&&(i.ref=t?mi(t,e):e),K.cloneElement(n,i)}return K.Children.count(n)>1?K.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fi=Symbol(`radix.slottable`);function Ii(e){return K.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Fi}function Li(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Ri(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function zi(e){let t=e+`CollectionProvider`,[n,r]=hi(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=K.useRef(null),a=K.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Ni(s),l=K.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,q.jsx)(c,{ref:Q(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ni(u),p=K.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=K.useRef(null),s=Q(t,o),c=a(u,n);return K.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,q.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return K.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Bi=[`PageUp`,`PageDown`],Vi=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Hi={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},Ui=`Slider`,[Wi,Gi,Ki]=zi(Ui),[qi,Ji]=hi(Ui,[Ki]),[Yi,Xi]=qi(Ui),Zi=K.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:u,onValueChange:d=()=>{},onValueCommit:f=()=>{},inverted:p=!1,form:m,...h}=e,g=K.useRef(new Set),_=K.useRef(0),v=o===`horizontal`?ea:ta,[y=[],b]=yi({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus(),d(e)}}),x=K.useRef(y);function S(e){T(e,ha(y,e))}function C(e){T(e,_.current)}function w(){let e=x.current[_.current];y[_.current]!==e&&f(y)}function T(e,t,{commit:n}={commit:!1}){let o=ba(a),s=di(xa(Math.round((e-r)/a)*a+r,o),[r,i]);b((e=[])=>{let r=fa(e,s,t);if(va(r,c*a)){_.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&f(r),t?r:e}else return e})}return(0,q.jsx)(Yi,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:_,thumbs:g.current,values:y,orientation:o,form:m,children:(0,q.jsx)(Wi.Provider,{scope:e.__scopeSlider,children:(0,q.jsx)(Wi.Slot,{scope:e.__scopeSlider,children:(0,q.jsx)(v,{"aria-disabled":s,"data-disabled":s?``:void 0,...h,ref:t,onPointerDown:fi(h.onPointerDown,()=>{s||(x.current=y)}),min:r,max:i,inverted:p,onSlideStart:s?void 0:S,onSlideMove:s?void 0:C,onSlideEnd:s?void 0:w,onHomeKeyDown:()=>!s&&T(r,0,{commit:!0}),onEndKeyDown:()=>!s&&T(i,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=Bi.includes(e.key)||e.shiftKey&&Vi.includes(e.key)?10:1,r=_.current,i=y[r];T(i+a*n*t,r,{commit:!0})}}})})})})});Zi.displayName=Ui;var[Qi,$i]=qi(Ui,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ea=K.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=K.useState(null),p=Q(t,e=>f(e)),m=K.useRef(void 0),h=Ci(i),g=h===`ltr`,_=g&&!a||!g&&a;function v(e){let t=m.current||d.getBoundingClientRect(),i=ya([0,t.width],_?[n,r]:[r,n]);return m.current=t,i(e-t.left)}return(0,q.jsx)(Qi,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,q.jsx)(na,{dir:h,"data-orientation":`horizontal`,...u,ref:p,style:{...u.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=v(e.clientX);o?.(t)},onSlideMove:e=>{let t=v(e.clientX);s?.(t)},onSlideEnd:()=>{m.current=void 0,c?.()},onStepKeyDown:e=>{let t=Hi[_?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),ta=K.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=K.useRef(null),d=Q(t,u),f=K.useRef(void 0),p=!i;function m(e){let t=f.current||u.current.getBoundingClientRect(),i=ya([0,t.height],p?[r,n]:[n,r]);return f.current=t,i(e-t.top)}return(0,q.jsx)(Qi,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,q.jsx)(na,{"data-orientation":`vertical`,...l,ref:d,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=m(e.clientY);a?.(t)},onSlideMove:e=>{let t=m(e.clientY);o?.(t)},onSlideEnd:()=>{f.current=void 0,s?.()},onStepKeyDown:e=>{let t=Hi[p?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),na=K.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=Xi(Ui,n);return(0,q.jsx)(Mi.span,{...l,ref:t,onKeyDown:fi(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):Bi.concat(Vi).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:fi(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:fi(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:fi(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),ra=`SliderTrack`,ia=K.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Xi(ra,n);return(0,q.jsx)(Mi.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});ia.displayName=ra;var aa=`SliderRange`,oa=K.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Xi(aa,n),a=$i(aa,n),o=Q(t,K.useRef(null)),s=i.values.length,c=i.values.map(e=>pa(e,i.min,i.max)),l=s>1?Math.min(...c):0,u=100-Math.max(...c);return(0,q.jsx)(Mi.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:u+`%`}})});oa.displayName=aa;var sa=`SliderThumb`,ca=K.forwardRef((e,t)=>{let n=Gi(e.__scopeSlider),[r,i]=K.useState(null),a=Q(t,e=>i(e)),o=K.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,q.jsx)(la,{...e,ref:a,index:o})}),la=K.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Xi(sa,n),s=$i(sa,n),[c,l]=K.useState(null),u=Q(t,e=>l(e)),d=c?o.form||!!c.closest(`form`):!0,f=Ti(c),p=o.values[r],m=p===void 0?0:pa(p,o.min,o.max),h=ma(r,o.values.length),g=f?.[s.size],_=g?ga(g,m,s.direction):0;return K.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,q.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${_}px)`},children:[(0,q.jsx)(Wi.ItemSlot,{scope:e.__scopeSlider,children:(0,q.jsx)(Mi.span,{role:`slider`,"aria-label":e[`aria-label`]||h,"aria-valuemin":o.min,"aria-valuenow":p,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?``:void 0,tabIndex:o.disabled?void 0:0,...a,ref:u,style:p===void 0?{display:`none`}:e.style,onFocus:fi(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),d&&(0,q.jsx)(da,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:p},r)]})});ca.displayName=sa;var ua=`RadioBubbleInput`,da=K.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=K.useRef(null),a=Q(i,r),o=wi(t);return K.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,q.jsx)(Mi.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});da.displayName=ua;function fa(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function pa(e,t,n){return di(100/(n-t)*(e-t),[0,100])}function ma(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function ha(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function ga(e,t,n){let r=e/2;return(r-ya([0,50],[0,r])(t)*n)*n}function _a(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function va(e,t){if(t>0){let n=_a(e);return Math.min(...n)>=t}return!0}function ya(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function ba(e){return(String(e).split(`.`)[1]||``).length}function xa(e,t){let n=10**t;return Math.round(e*n)/n}var Sa=Zi,Ca=ia,wa=ca;We();var Ta=640,Ea=[{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`}}],Da=[`9%`,`27%`,`45%`,`62%`,`79%`],Oa=50,ka=`rgba(36, 41, 46, 0.2)`,Aa=`#FDFDFC`,ja=.16;function Ma(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 Na(){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 Pa({components:e,traits:t,side:n,top:r,size:i,progress:a}){let o=Math.max(0,Math.min(1,a)),s=100+ja*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)(v,{components:e,traits:t,size:i,breathe:!1})})}function Fa({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,children:[(0,q.jsx)(`span`,{className:`order-1 flex-1 text-left text-base 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-base sm:order-3 sm:w-32 sm:flex-none sm:text-left sm:text-[17px]`,style:{color:r},children:e.right}),(0,q.jsxs)(Sa,{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]??Oa),disabled:i,min:0,max:100,step:1,"aria-label":`${e.left} to ${e.right}`,children:[(0,q.jsx)(Ca,{className:`relative h-3 w-full grow rounded-full`,style:{backgroundColor:ka}}),(0,q.jsx)(wa,{className:`block h-6 w-6 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`,style:{backgroundColor:Aa}})]})]})}function Ia({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:Ea.map((i,a)=>{let o=t[i.id]??Oa,s=Math.max(0,(Oa-o)/Oa),c=Math.max(0,(o-Oa)/Oa),l=Da[a]??`50%`,u=n[a];return u?(0,q.jsxs)(`div`,{children:[(0,q.jsx)(Pa,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,q.jsx)(Pa,{components:e,traits:u.right,side:`right`,top:l,size:r,progress:c})]},i.id):null})})}function La({values:e,onValueChange:t,locked:n,onContinue:r,onBack:i,onForward:a}){let o=xr(),s=G(),c=Na(),l=c>=Ta,u=J.use.characters()[J.use.selectedIndex()]?.color,d=Math.round(Math.min(300,Math.max(160,c*.16))),f=(0,K.useMemo)(()=>{let e=s?.colors.map(e=>e.id)??[],t=Ma(Ea.map(e=>e.leftAvatar.color),u,e),n=Ma(Ea.map(e=>e.rightAvatar.color),u,e);return Ea.map((e,r)=>({left:{...e.leftAvatar,color:t[r]??e.leftAvatar.color},right:{...e.rightAvatar,color:n[r]??e.rightAvatar.color}}))},[s,u]);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}),l&&s&&(0,q.jsx)(Ia,{components:s,values:e,sideAvatars:f,size:d}),(0,q.jsxs)(`div`,{className:`absolute left-1/2 top-[14%] flex w-full max-w-2xl -translate-x-1/2 flex-col items-center gap-10 px-6`,children:[(0,q.jsxs)(`div`,{className:`flex 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:`max-w-md text-center text-[15px]`,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:`flex w-full flex-col gap-8 sm:gap-11`,style:{opacity:n?.7:1},children:Ea.map(r=>(0,q.jsx)(Fa,{axis:r,value:e[r.id]??Oa,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n},r.id))}),(0,q.jsxs)(`button`,{type:`button`,onClick:r,className:`mt-4 flex h-11 w-[234px] 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 Ra({assistantId:e,assistantReady:t,onConnected:n,onSkip:r,onBack:i,onForward:a,missingCalendarScope:o=!1,onRetry:s}){let c=xr(),{handleConnect:l,oauthInProgress:u}=He({assistantId:e??``,onConnect:n}),d=()=>{s?.(),l()},f=!e||!t,p=f||u;return(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:c.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:f?`Almost ready`:o?`Access not enabled`:`Let me make this easy`}),(0,q.jsx)(`p`,{className:`text-[16px]`,style:{color:c.fgMuted},children:f?`Your assistant is still getting ready. Calendar setup will be available in a moment.`: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:d,disabled:p,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:c.isLight?`#1A1A1A`:`#FFFFFF`,color:c.isLight?`#FFFFFF`:`#1A1A1A`},children:f?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):u?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(0,q.jsx)(`button`,{type:`button`,onClick:r,disabled:u,className:`cursor-pointer text-body-small-default transition-opacity hover:opacity-100 disabled:opacity-60`,style:{color:c.fgMuted},children:`Skip for now`})]})]})]})}var za=br(`#17191C`);function Ba(){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 Va(){let e=G(),t=J.use.characters(),n=J.use.selectedIndex();return{components:e,chosen:t.length>0?t[n]:void 0}}function Ha({size:e=64,isStreaming:t=!1}){let{components:n,chosen:r}=Va();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)(v,{components:n,traits:r,size:e,isStreaming:t})})}var Ua=64,Wa=4500,Ga=7e3;function Ka({onDone:e,onBack:t,onForward:n,scheduledTime:r,awaitingTime:i}){let{components:a,chosen:o}=Va(),s=U(),{w:c,h:l}=Ba(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,K.useEffect)(()=>{let t=setTimeout(e,i&&!r?Ga:Wa);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 m=1.3*Math.max(c,l)/Ua,h=f?c/2-f.cx:0,g=f?l*.88-f.cy:0,_=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:Ua,height:Ua},children:a&&o&&f&&(0,q.jsx)(H.div,{className:`absolute inset-0`,style:{transformOrigin:`center`},initial:s?!1:{scale:m,x:h,y:g},animate:{x:[h,h,0,0],y:[g,g+_,0,0],scale:[m,m,1.07,1]},transition:s?{duration:0}:{duration:1.1,times:[0,.18,.82,1],ease:[`easeOut`,`easeIn`,`easeOut`]},children:(0,q.jsx)(v,{components:a,traits:o,size:Ua})})}),(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 qa=[`Searching the web to get to know you…`,`Reading public profiles…`,`Skimming the highlights…`,`Connecting the dots…`,`Piecing it together…`],Ja=[`Updating my personality…`,`Finding my voice…`,`Getting into character…`],Ya=`Almost there…`,Xa=[...qa,Ya],Za=[...Ja,Ya],Qa=2800;function $a({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i}){let a=za,[o,s]=(0,K.useState)(0);return(0,K.useEffect)(()=>{n?.(o);let t=o>=Xa.length-1;if(i&&t){let t=setTimeout(e,Qa);return()=>clearTimeout(t)}let r=setTimeout(()=>s(e=>(e+1)%Xa.length),Qa);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)(Ha,{isStreaming:!0}),(0,q.jsx)(Fe,{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:Xa[o]},o)})]})]})}function eo({onDone:e,ready:t}){let n=za,[r,i]=(0,K.useState)(0);return(0,K.useEffect)(()=>{let n=Za.length-1;if(t){if(r!==n){i(n);return}let t=setTimeout(e,Qa);return()=>clearTimeout(t)}let a=setTimeout(()=>i(e=>(e+1)%Za.length),Qa);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)(Ha,{isStreaming:!0}),(0,q.jsx)(Fe,{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:Za[r]},r)})]})})}function to({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=za,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 left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,q.jsx)(Ha,{}),(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)(Fe,{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)(x,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,q.jsx)(`button`,{type:`button`,onClick:r,className:`mt-5 self-start 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] 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 no=[{suggestion:`I'll pull together a quick brief on what's new in your field`,prompt:`Give me a quick brief on what's new in my field right now.`},{suggestion:`I'll send a weekly briefing on news in your space`,prompt:`Set up a weekly briefing on news in my space.`},{suggestion:`I'll help you get on top of your week`,prompt:`Help me get on top of my week.`},{suggestion:`I'll draft something from a few rough notes`,prompt:`Draft something from a few rough notes I'll give you.`}];function ro({label:e,tone:t}){return(0,q.jsx)(`span`,{className:`inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-[3px] text-[12px] font-medium align-middle`,style:{backgroundColor:t.bg,color:t.fg},children:e})}function io(e,t){return e.map((n,r)=>{let i=``;return r>0&&(i=r===e.length-1?e.length===2?` and `:`, and `:`, `),(0,q.jsxs)(K.Fragment,{children:[i,(0,q.jsx)(ro,{label:n,tone:t})]},n)})}var $=64,ao=$;function oo({pluginLabels:e,tone:t,pillTone:n,reduce:r,slotRef:i,revealed:a}){let o=e.length>1;return(0,q.jsxs)(`div`,{className:`mt-12 flex items-center gap-3`,children:[(0,q.jsx)(`div`,{ref:i,className:`shrink-0`,style:{width:ao,height:ao}}),(0,q.jsxs)(H.p,{className:`text-[14px]`,style:{color:t.fg},initial:!1,animate:{opacity:+!!a,x:a?0:-6},transition:r?{duration:0}:{duration:.35},children:[`Already set up the `,io(e,n),` plugin`,o?`s`:``,` `,`to help with your work`]})]})}function so({head:e,note:t,flyToNote:n,reduce:r,onLanded:i}){let{components:a,chosen:o}=Va();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)(v,{components:a,traits:o,size:$})})}function co({suggestions:e,loading:t,installedPlugins:n=[],onSuggestionClick:r,onSkip:i,onBack:a,onForward:o}){let s=za,c=xr(),l=U(),u=e.length>0?e:t?[]:no,d=n.map(Ge).filter(e=>e.length>0),f=d.length>0,p=(0,K.useRef)(null),m=(0,K.useRef)(null),h=(0,K.useRef)(null),[g,_]=(0,K.useState)(null),[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!1);(0,K.useLayoutEffect)(()=>{let e=()=>{let e=p.current,t=m.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=h.current;_({head:r(t.getBoundingClientRect()),note:i?r(i.getBoundingClientRect()):void 0})};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[u.length,f]);let S=g?.note?.y;return(0,K.useEffect)(()=>{!f||S===void 0||v||y(!0)},[f,S,v]),(0,q.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:s.fg},children:[(0,q.jsx)(Z,{onBack:a,onNext:o}),(0,q.jsxs)(`div`,{ref:p,className:`absolute left-1/2 top-[14%] sm:top-[26%] z-10 flex w-full max-w-xl -translate-x-1/2 flex-col px-6`,children:[(0,q.jsxs)(`div`,{className:`flex items-center`,children:[(0,q.jsx)(H.div,{ref:m,className:`shrink-0`,style:{height:$},initial:!1,animate:v?{width:0,marginRight:0}:{width:$,marginRight:12},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`}}),(0,q.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,q.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:s.fgMuted},children:u.length>0?(0,q.jsxs)(q.Fragment,{children:[`Pick one to jump in — or start your own thing.`,` `,(0,q.jsx)(`button`,{type:`button`,onClick:i,className:`cursor-pointer underline underline-offset-2 transition-opacity hover:opacity-80`,style:{color:s.fg},children:`Skip to Chat`})]}):`Putting together a few ideas…`}),(0,q.jsx)(`div`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,q.jsx)(H.button,{type:`button`,onClick:()=>r(e),initial:l?!1:{opacity:0,y:10},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.3,delay:t*.06},className:`cursor-pointer rounded-2xl px-5 py-4 text-left text-[15px] transition-transform duration-150 hover:scale-[1.01] active:scale-[0.99]`,style:{backgroundColor:s.isLight?`rgba(0,0,0,0.06)`:`rgba(255,255,255,0.1)`},children:(0,q.jsx)(`span`,{children:e.suggestion})},`${t}-${e.suggestion}`))}),f&&(0,q.jsx)(oo,{pluginLabels:d,tone:s,pillTone:c,reduce:l,slotRef:h,revealed:b}),g&&(0,q.jsx)(so,{head:g.head,note:g.note,flyToNote:v&&f&&g.note!==void 0,reduce:l,onLanded:()=>x(!0)})]})]})}function lo({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=za,o=U(),[s,c]=(0,K.useState)(!1),l=e.map(e=>({name:e,displayName:Ge(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:ao}}),(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)(so,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var uo=[{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})}],fo=`#17191C`,po=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],mo=290;function ho({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}=Vn(),u=Math.max(.42,Math.min(l/1100,1)),d=l<640,f=o.length>0?o[s]:void 0,{bg:p,peekColors:m}=(0,K.useMemo)(()=>!a||!f?{bg:`var(--surface-base)`,peekColors:[]}:{bg:a.colors.find(e=>e.id===f.color)?.hex??`var(--surface-base)`,peekColors:Xr(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?fo:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,q.jsx)(Lr,{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(mo*u)*.42,right:-Math.round(mo*u)*.12},children:po.map((e,t)=>{let n=Math.round(mo*u);return(0,q.jsx)(H.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:po.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)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,q.jsx)(Fe,{children:(d?uo.filter(e=>e.mobile):uo).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)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var go=`You're about to begin your first conversation.
|
|
60
|
+
Respond with a warm and engaging greeting. Be interesting, be real. This is your chance to get to know and impress the user.
|
|
61
|
+
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 _o(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)}}function vo(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}We();function yo(){let e=a(),t=j.use.user(),n=t?.id??null,r=Re.use.enterFocus(),i=Re.use.exitFocus(),s=Re.use.setPendingAvatarTraits(),c=Re.use.requestSidebarCollapse(),l=ae.use.researchOnboarding(),u=ae.use.personalityOnboarding(),d=ae.use.hydrated(),[f,p]=(0,K.useState)(`form`),{ref:m,size:h}=Rn(),[g,_]=(0,K.useState)([]),[v,y]=(0,K.useState)(!1);function b(e){p(e)}function x(e,t=`completed`){Ke(qe[f],{userId:n,outcome:t}),_([]),b(e)}function S(e){_(e=>[...e,f]),b(e)}function C(){let e=g[g.length-1];e&&(_(e=>e.slice(0,-1)),b(e))}let w=g.length>0?C:void 0,[T,E]=(0,K.useState)(null),[D,ee]=(0,K.useState)(null),[O,k]=(0,K.useState)({}),[A,ne]=(0,K.useState)(!1),[M,re]=(0,K.useState)(null),[N,P]=(0,K.useState)(null),[ce,le]=(0,K.useState)(!1),[ue,de]=(0,K.useState)(!1),[fe,F]=(0,K.useState)(!1),[I,pe]=(0,K.useState)(0),[me,he]=(0,K.useState)(0),{start:ge,ready:_e,assistantId:L,awaitReady:R}=qt(),z=vn(),{start:B,hydrate:ve}=z,ye=(0,K.useRef)(Promise.resolve()),be=(0,K.useRef)(Promise.resolve()),[V,xe]=(0,K.useState)(!1),Se=z.status===`idle`||z.status===`running`,Ce=!Se&&z.claims.length===0;(0,K.useEffect)(()=>{i(),s(null),l&&d&&ge()},[i,s,ge,l,d]),(0,K.useLayoutEffect)(()=>{if(v||!n)return;let e=jn(n);e?.formValues&&(E(e.formValues),ee(e.faceValues),P(e.checkinTime),de(e.checkinBooked),re(e.researchConversationId??null),e.research&&ve({...e.research,pluginCatalog:e.research.pluginCatalog??{}},R),p(Pn(e)),_([])),y(!0)},[v,n,ve,R]),(0,K.useEffect)(()=>{!v||!T||Mn(n,{step:f,formValues:T,faceValues:D,checkinTime:N,checkinBooked:ue,research:z.status===`done`?{status:`done`,claims:z.claims,suggestions:z.suggestions,installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog}:null,...M?{researchConversationId:M}:{}})},[v,n,f,T,D,N,ue,M,z.status,z.claims,z.suggestions,z.installedPlugins,z.pluginCatalog]),(0,K.useEffect)(()=>{!v||!l||!d||!T||z.status!==`idle`||B({awaitAssistantId:R,subject:_o(T),conversationTitle:vo(T),...M?{resumeConversationId:M}:{},onConversationCreated:re,includeSuggestions:!u})},[v,l,d,T,M,z.status,B,R,u]),(0,K.useEffect)(()=>{f===`results`&&Ce&&(_([]),p(`suggestions`))},[f,Ce]);function we(t,i,a,{skip:o=!1,hidden:l=!1}={}){Nn(n);let{firstName:u,lastName:d,role:f,hobbies:p}=t,m=[u.trim(),d.trim()].filter(Boolean).join(` `),h=u.trim(),g=!o&&a===void 0;se({tools:[],tasks:[],tone:Je,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??Vt({firstName:u,lastName:d,occupation:f,hobby:p.join(`, `)}),...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();_&&oe(_),s(i?.traits??null),g&&r(),o||te.markExpectingFirstMessage(),c(),te.checkAssistant(L??void 0).finally(()=>{e(`${ie.assistant}?onboarding=1`,{replace:!0})})}async function Te(){T&&(await Promise.all([z.awaitPluginInstalls(),ye.current,be.current]),we(T,D,go,{hidden:!0}))}function Ee(e){E(e),z.start({awaitAssistantId:R,subject:_o(e),conversationTitle:vo(e),onConversationCreated:re,includeSuggestions:!u}),x(`face`)}function De(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){F(!0);return}if(F(!1),L&&T){let e=[T.firstName.trim(),T.lastName.trim()].filter(Boolean).join(` `);P(null),de(!1),le(!0),ze({assistantId:L,userName:e||void 0,assistantName:D?.name?.trim()||void 0}).then(e=>{e.scheduled&&(de(!0),P(Fn(e.start,e.timeZone)))}).finally(()=>le(!1))}x(`meeting`)}if(!l)return d?(0,q.jsx)(o,{to:ie.assistant,replace:!0}):null;if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(f)&&T){let e=[`meeting`,`looking`,`results`,`suggestions`,`finishing`].includes(f);return(0,q.jsx)(`div`,{ref:m,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,q.jsxs)(Bn,{size:h,children:[(0,q.jsx)(ho,{eyesBumpNonce:I,peekLevel:[`looking`,`results`,`suggestions`,`finishing`].includes(f)?me:0,darkBg:e,showBottomEyes:!e&&f!==`different`}),f===`different`&&(0,q.jsx)(ai,{onContinue:()=>x(u?`personality`:`integration`),onBack:()=>S(`intro`),onForward:w}),f===`personality`&&(0,q.jsx)(La,{values:O,onValueChange:(e,t)=>k(n=>({...n,[e]:t})),locked:A,onContinue:()=>{A||(xe(!0),be.current=kn({awaitAssistantId:R,values:O,userName:T?.firstName?.trim()||void 0}).finally(()=>xe(!1)),ne(!0)),x(`integration`)},onBack:()=>S(`different`),onForward:w}),f===`integration`&&(0,q.jsx)(ui,{onClaim:()=>x(`letschat`),onBumpEyes:()=>pe(e=>e+1),onBack:()=>S(u?`personality`:`different`),onForward:w}),f===`letschat`&&(0,q.jsx)(Ra,{assistantId:L,assistantReady:_e,onConnected:De,missingCalendarScope:fe,onRetry:()=>F(!1),onSkip:()=>{F(!1),x(`looking`,`skipped`)},onBack:()=>S(`integration`),onForward:w}),f===`meeting`&&(0,q.jsx)(Ka,{scheduledTime:N??void 0,awaitingTime:ce,onDone:()=>x(`looking`),onBack:()=>S(`letschat`),onForward:w}),f===`looking`&&(0,q.jsx)($a,{onDone:()=>x(Ce?`suggestions`:`results`),onBack:()=>S(`letschat`),onAdvance:e=>he(Math.min(e+1,4)),onForward:w,ready:!Se}),f===`results`&&(0,q.jsx)(to,{claims:z.claims,loading:Se,onContinue:e=>{M&&L&&e.length>0&&(ye.current=bn({assistantId:L,conversationId:M,removedClaims:e,rejectedAll:!1})),x(`suggestions`)},onRejectAll:()=>{M&&L&&(ye.current=bn({assistantId:L,conversationId:M,removedClaims:z.claims.map(e=>e.claim),rejectedAll:!0})),x(`suggestions`,`skipped`)},onBack:()=>S(`looking`),onForward:w}),f===`suggestions`&&u&&(0,q.jsx)(lo,{installedPlugins:z.installedPlugins,pluginCatalog:z.pluginCatalog,onStart:async()=>{if(Ke(qe.suggestions,{userId:n,outcome:`completed`}),V){_([]),p(`finishing`);return}await Te()},onBack:()=>S(Ce?`looking`:`results`),onForward:w}),f===`suggestions`&&!u&&(0,q.jsx)(co,{suggestions:z.suggestions,loading:Se,installedPlugins:z.installedPlugins,onSuggestionClick:async e=>{Ke(qe.suggestions,{userId:n,outcome:`completed`}),await Promise.all([z.awaitPluginInstalls(),ye.current]),we(T,D,e.prompt)},onSkip:async()=>{Ke(qe.suggestions,{userId:n,outcome:`skipped`}),await Promise.all([z.awaitPluginInstalls(),ye.current]),we(T,D,void 0,{skip:!0})},onBack:()=>S(Ce?`looking`:`results`),onForward:w}),f===`finishing`&&(0,q.jsx)(eo,{ready:!V,onDone:()=>void Te()})]})})}return f===`intro`&&T?(0,q.jsx)(Br,{firstName:T.firstName,assistantName:D?.name,onContinue:()=>x(`different`),onBack:()=>S(`face`),onForward:w}):f===`face`&&T?(0,q.jsx)(wr,{onContinue:e=>{ee(e),x(`intro`)},onBack:()=>S(`form`),onForward:w}):(0,q.jsx)(hr,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ee})}export{yo as ResearchOnboardingRoute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{d as s,i as c,n as l}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{d as s,i as c,n as l}from"./auth-store-B1y6dgYQ.js";import{t as u}from"./return-to-yMLvlnXN.js";import{a as d}from"./routes-C6gxiCrz.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-Ds__U7Hi.js";import{rn as v,ur as y,yi as b}from"./index-B-S-gNKm.js";import{n as x,t as S}from"./consent-controls-BzFFpG2p.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=m(),[M,N]=h(),[P,F]=_(),[I,L]=p(),[R]=g(),[z]=f(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(v,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(b,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
|
package/dist/assets/{select-assistant-screen-BZcmH_-F.js → select-assistant-screen-BfhDJw-S.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-bfBx6UYv.js";import{t as s}from"./modal-BNAVT2FK.js";import{A as c,N as l,O as u,st as d,t as f,tt as p,u as ee}from"./local-mode-CgrENuVf.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as g}from"./check-D6WkI0gF.js";import{D as _,O as v,i as y,n as b}from"./auth-store-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-bfBx6UYv.js";import{t as s}from"./modal-BNAVT2FK.js";import{A as c,N as l,O as u,st as d,t as f,tt as p,u as ee}from"./local-mode-CgrENuVf.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as g}from"./check-D6WkI0gF.js";import{D as _,O as v,i as y,n as b}from"./auth-store-B1y6dgYQ.js";import{a as x}from"./routes-C6gxiCrz.js";import{t as S}from"./use-onboarding-login-Da1r3M06.js";import{Dn as C,On as te,Yi as w,pa as T,rn as E}from"./index-B-S-gNKm.js";import{r as D}from"./format-date-D4tzd1DT.js";var O=e(t(),1),k=a();function A({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,onRetire:l}){let[u,d]=(0,O.useState)(`menu`);(0,O.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,k.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,k.jsx)(o,{open:e,title:`Repair Assistant?`,message:(0,k.jsxs)(k.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,k.jsx)(C,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,k.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,k.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,k.jsx)(s.Header,{children:(0,k.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,k.jsxs)(s.Body,{children:[(0,k.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,k.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,k.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,k.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,k.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function j(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function M(e){if(e.hatchedAt)return`Created ${D(e.hatchedAt)}`}function N(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),g=y(),C=h.use.assistants(),w=_.use.currentOrganizationId(),{loading:T,error:D,login:M,cancel:N}=S(),F=e=>e.isLocal||g,I=C.filter(F),L=C.some(e=>e.isPlatformHosted)&&!g,[R,z]=(0,O.useState)(null),[B,V]=(0,O.useState)(!1),[H,U]=(0,O.useState)(!1),[W,G]=(0,O.useState)(null),[K,q]=(0,O.useState)(null),[J,Y]=(0,O.useState)(!1),[ne,X]=(0,O.useState)(null);(0,O.useEffect)(()=>{if(R!=null||I.length===0)return;let e=v(w);z(I.find(t=>t.id===e)?.id??I[0].id)},[R,I,w]);let Z=async t=>{V(!0),G(null);try{t.isLocal?await b.getState().connectLocalAssistant(t.id):await b.getState().connectPlatformAssistant(t.id),e(x.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&u()&&(c(e)||d(e)||e instanceof f)&&ee(t.id)?q(t):G(`Failed to connect. Please try again.`),V(!1)}},Q=()=>{q(null),Y(!1),X(null),U(!1)},re=async()=>{if(!(!K||J)){Y(!0),X(null);try{let e=await l(K.id,{repairGuardian:!0});if(e.ok){p(),Q(),Z(K);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}Y(!1)}},ie=async()=>{if(!(!K||J)){Y(!0),X(null);try{let t=await te(K.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}Y(!1)}};(0,O.useEffect)(()=>{a||o||B||H||C.length!==0&&C.length===1&&I.length===1&&(U(!0),Z(I[0]))},[C.length,I.length]);let ae=()=>{let e=C.find(e=>e.id===R);e&&Z(e)},oe=()=>{e(x.welcome)},$=D??W;return H&&!$&&!K?(0,k.jsx)(E,{children:(0,k.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,k.jsxs)(E,{children:[(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,k.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,k.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,k.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,k.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:C.map(e=>{let t=F(e);return(0,k.jsx)(P,{assistant:e,selected:R===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&z(e.id)}},e.id)})}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[I.length>0&&(0,k.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!R||B,children:B?`Connecting…`:`Continue`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${x.onboarding.hosting}?from=select-assistant`),disabled:B||T,children:`Create New Assistant`}),L&&(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?N:()=>void M(),disabled:B,children:T?`Cancel`:`Log In`}),(0,k.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:B||T,children:`Back`})]})]}),(0,k.jsx)(A,{open:K!=null,assistantName:K?j(K):``,isPending:J,errorMessage:ne??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function P({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=M(e),o=m();return(0,k.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,k.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,o?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,k.jsx)(w,{className:`h-5 w-5`}):(0,k.jsx)(T,{className:`h-5 w-5`})}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:j(e)}),r&&(0,k.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,k.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,k.jsx)(g,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{N as SelectAssistantScreen};
|