@vellumai/web 0.10.5-staging.1 → 0.10.5-staging.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{account-page-BZAZkN-s.js → account-page-D7N_WAt8.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-X3n1AwIx.js → acp-run-detail-panel-DGXWy1zV.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-CA-Fynld.js} +1 -1
- package/dist/assets/{ai-page-S2retULb.js → ai-page-zZGFrEzO.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-CUEhMjCI.js} +1 -1
- package/dist/assets/{archive-page-BSsZ9M74.js → archive-page-hU8w9ytm.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-BbCZGqHm.js} +1 -1
- package/dist/assets/billing-page-DvW9-kBw.js +3 -0
- package/dist/assets/{bookmarks-page-Cyf-U96p.js → bookmarks-page-DnqyJXnk.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-B0pI8wFe.js} +1 -1
- package/dist/assets/{command-palette-window-page-eBzmSsCP.js → command-palette-window-page-BgQhfKX5.js} +1 -1
- package/dist/assets/{community-page-B5ONrf2a.js → community-page-D85Cmkcv.js} +1 -1
- package/dist/assets/{contacts-page-route-DJUela8X.js → contacts-page-route-BZz1O1XL.js} +1 -1
- package/dist/assets/{debug-page-WeVUgP5W.js → debug-page-BA2gOVPd.js} +1 -1
- package/dist/assets/{deploy-dialogs-97NwI-WB.js → deploy-dialogs-wNJRqYiu.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-CCTUOLbx.js → detail-panel-stop-button-Dc3MB_3r.js} +1 -1
- package/dist/assets/detail-shell-CyXDiAEa.js +4 -0
- package/dist/assets/{developer-page-DGskh-VT.js → developer-page-B9c_NOq0.js} +1 -1
- package/dist/assets/{devices-page-UNNt0ZBi.js → devices-page-C_MPiuEN.js} +1 -1
- package/dist/assets/{dictation-overlay-page-BQyh6Xca.js → dictation-overlay-page-dlmrZeaQ.js} +1 -1
- package/dist/assets/{document-viewer-page-9ncyfQIB.js → document-viewer-page-CVJKsLcz.js} +1 -1
- package/dist/assets/{earn-credits-modal-wCf8-tQ-.js → earn-credits-modal-gdB0QAos.js} +1 -1
- package/dist/assets/{emails-page-DAMC-4si.js → emails-page-wOQsKKch.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-sKfnpW-D.js} +1 -1
- package/dist/assets/{general-page-p6Fn1GLx.js → general-page-C0EgypjR.js} +1 -1
- package/dist/assets/{hatching-screen-BLRWv5KL.js → hatching-screen-B4dscGGq.js} +1 -1
- package/dist/assets/{home-page-route-B4Uj_laj.js → home-page-route-BYUiByXT.js} +1 -1
- package/dist/assets/{hosting-screen-CwlZydKg.js → hosting-screen-oFxveMgT.js} +1 -1
- package/dist/assets/identity-page-route-jU_Rzwhx.js +1 -0
- package/dist/assets/index-CZ2UBc_U.js +130 -0
- package/dist/assets/index-Ceh6erpc.css +2 -0
- package/dist/assets/{inspect-page-DEK-iOS_.js → inspect-page-BKOxlmBF.js} +2 -2
- package/dist/assets/{install-YUo7ndT3.js → install-C22EWSPL.js} +1 -1
- package/dist/assets/{integrations-page-BsxOfQjJ.js → integrations-page-BBcBVFLT.js} +1 -1
- package/dist/assets/{intelligence-layout-C3oI98wU.js → intelligence-layout-BqECxena.js} +1 -1
- package/dist/assets/{keyboard-shortcuts-page-Cna3_88k.js → keyboard-shortcuts-page-BZTs62Wj.js} +1 -1
- package/dist/assets/{library-detail-page-ve2T0ZU2.js → library-detail-page-Ck65_rdB.js} +1 -1
- package/dist/assets/{library-page-rXVG4ivO.js → library-page-BPrjQGL6.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-8AH_ZU_7.js} +1 -1
- package/dist/assets/{logs-layout-CmT3NiSU.js → logs-layout-DD-9gYta.js} +1 -1
- package/dist/assets/{memory-router-playground-page-10PeGlWA.js → memory-router-playground-page-BRe1h0Mv.js} +1 -1
- package/dist/assets/messages-ChEiS3wF.js +13 -0
- package/dist/assets/{mobile-sidebar-drawer-DqeeN3Q1.js → mobile-sidebar-drawer-CzcwUqpn.js} +1 -1
- package/dist/assets/{notifications-page-C00eTOOg.js → notifications-page-CNz_ce_3.js} +1 -1
- package/dist/assets/{oauth-complete-page-BLjhfemY.js → oauth-complete-page-BY4IUzM3.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-BoN8I91s.js → oauth-popup-complete-page-DFSwc7gE.js} +1 -1
- package/dist/assets/{pairing-page-0KCSQ57C.js → pairing-page-rN8Xn7wW.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-BQcsJgVb.js} +1 -1
- package/dist/assets/plugins-surface-gCrqfOas.js +1 -0
- package/dist/assets/prechat-route-6ome-g7N.js +1 -0
- package/dist/assets/{prefs-CbAh5SBF.js → prefs-Ds__U7Hi.js} +1 -1
- package/dist/assets/{privacy-page-oEJv2Hh6.js → privacy-page-DtQMDaEM.js} +1 -1
- package/dist/assets/{privacy-screen-eEKGVYEM.js → privacy-screen-DdeTm5d2.js} +1 -1
- package/dist/assets/{provider-callback-page-DZFHFC3L.js → provider-callback-page-CwplW9PX.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-DMXNiiqw.js} +1 -1
- package/dist/assets/research-onboarding-route-BYbFY_h9.js +61 -0
- package/dist/assets/{review-terms-screen-cd-fxIL9.js → review-terms-screen-73sQOI_T.js} +1 -1
- package/dist/assets/{select-assistant-screen-BZcmH_-F.js → select-assistant-screen-Y_lcjNSt.js} +1 -1
- package/dist/assets/{settings-layout-COMaVywB.js → settings-layout-B99yx7iZ.js} +1 -1
- package/dist/assets/{share-feedback-modal-B68lktQY.js → share-feedback-modal-BqFpqbwt.js} +1 -1
- package/dist/assets/{sidebar-tree-D0rtTbRP.js → sidebar-tree-nlZD0iQq.js} +1 -1
- package/dist/assets/{signup-page-q4qdQh73.js → signup-page-BBz6b3Nv.js} +1 -1
- package/dist/assets/{skills-page-DSP9dwoA.js → skills-page-CyNFwtMm.js} +1 -1
- package/dist/assets/{sounds-page-DhWeSxBr.js → sounds-page-DTwqrvjQ.js} +1 -1
- package/dist/assets/{subagent-detail-panel-o1h_2eEo.js → subagent-detail-panel-B7-EOosT.js} +1 -1
- package/dist/assets/{subagent-store-CyoX60U-.js → subagent-store-DWKZ9Yt3.js} +1 -1
- package/dist/assets/{system-events-page-C6sjtW3h.js → system-events-page-kz2QZXlf.js} +1 -1
- package/dist/assets/{tiptap-document-editor-Du_gB1lJ.js → tiptap-document-editor-BkhvVzHq.js} +1 -1
- package/dist/assets/{tool-detail-panel-V3uAmbUl.js → tool-detail-panel-Djpgj3--.js} +1 -1
- package/dist/assets/{trace-page-DtUKaSHG.js → trace-page-BEyQxpBX.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-CLf-Pd9J.js → upgrade-cancel-page-BMj8YpAx.js} +1 -1
- package/dist/assets/{upgrade-success-page-BLK4gdo5.js → upgrade-success-page-BZjQzQQB.js} +1 -1
- package/dist/assets/{usage-page-A4xwoXzH.js → usage-page-YnMiaGbU.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-6bE1o8xC.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-CjOnnW4C.js} +1 -1
- package/dist/assets/{weather-forecast-display-DtEIs30H.js → weather-forecast-display-Aqhg0YWH.js} +1 -1
- package/dist/assets/{welcome-screen-DxNlfFIf.js → welcome-screen-BYiDdI6u.js} +1 -1
- package/dist/assets/{workflow-detail-panel-C54v6KXR.js → workflow-detail-panel-CEiMuzvs.js} +1 -1
- package/dist/assets/{workspace-page-CoXq9DKW.js → workspace-page-CeCbEfiQ.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,13 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./capture-error-BG-GkiMq.js";import{Cr as t,cn as n,ln as r,sn as i,u as a,un as o,yr as s}from"./sdk.gen-zA5ns5LT.js";import{n as c,r as l}from"./api-errors-DPruG7q9.js";import{t as u}from"./platform-detection-Ceodt3Hu.js";import{a as d,s as f}from"./prechat-CgM5bgoR.js";import{t as p}from"./assistant-identity-store-E8J494ln.js";import{r as m,t as h}from"./semver-l1HADz2z.js";import{t as g}from"./effective-timezone-BJxnysvd.js";var _=/^\[File attachment\] (.+?), type=([^,\n]+?)(?:, size=([^\n]+))?$/,v=/^([\d.]+)\s*(B|KB|MB|GB)$/;function y(e){let t=v.exec(e.trim());if(!t)return 0;let n=Number.parseFloat(t[1]);if(!Number.isFinite(n))return 0;switch(t[2]){case`B`:return Math.round(n);case`KB`:return Math.round(n*1024);case`MB`:return Math.round(n*1024*1024);case`GB`:return Math.round(n*1024*1024*1024);default:return 0}}function b(e){let t=e.indexOf(`[File attachment] `);if(t<0||!(t===0||e[t-1]===`
|
|
2
|
-
`))return{cleanedContent:e,attachments:void 0};let n=t>0&&e[t-1]===`
|
|
3
|
-
`?e.slice(0,t-1):e.slice(0,t),r=[];for(let n of e.slice(t).split(`
|
|
4
|
-
`)){let e=_.exec(n);if(!e)continue;let[,t,i,a]=e;r.push({id:`rehydrated:${r.length}`,filename:t,mimeType:i,sizeBytes:a?y(a):0,previewUrl:null})}return{cleanedContent:n,attachments:r.length>0?r:void 0}}var x=[`users/guardian.md`,`users/default.md`],S=`## Onboarding Context`;function C(e){let t=[S,``];return e.preferredName&&t.push(`- **Preferred name:** ${e.preferredName}`),e.occupation&&t.push(`- **Role:** ${e.occupation}`),e.commonWork.length>0&&t.push(`- **Common work:** ${e.commonWork.join(`; `)}`),e.dailyTools.length>0&&t.push(`- **Daily tools:** ${e.dailyTools.join(`, `)}`),t.push(``),t.join(`
|
|
5
|
-
`)}function w(e,t){let n=e??`# User Profile
|
|
6
|
-
|
|
7
|
-
`,r=n.indexOf(S);if(r!==-1){let e=n.indexOf(`
|
|
8
|
-
`,r),i=e===-1?``:n.slice(e+1),a=i.match(/^## /m),o=n.slice(0,r),s=a?i.slice(a.index):``;return o+t+s}return n.endsWith(`
|
|
9
|
-
`)||(n+=`
|
|
10
|
-
`),n.endsWith(`
|
|
11
|
-
|
|
12
|
-
`)||(n+=`
|
|
13
|
-
`),n+t}async function T(e,t){let{data:n,error:r,response:i}=await s({path:{assistant_id:e},query:{path:t},throwOnError:!1});if(c(i,r,`Failed to fetch onboarding profile file`),i.status===404)return null;if(!i.ok)throw Error(`Failed to fetch onboarding profile file (${i.status})`);if(n?.isBinary)throw Error(`Onboarding profile file is binary`);return typeof n?.content==`string`?n.content:null}async function E(e,n,r){let{error:i,response:a}=await t({path:{assistant_id:e},body:{path:n,content:r},throwOnError:!1});if(c(a,i,`Failed to write onboarding profile file`),!a.ok)throw Error(`Failed to write onboarding profile file (${a.status})`)}async function D(e,t,n){await E(e,t,w(await T(e,t),n))}async function O(e,t){let n=C(f(t));await Promise.allSettled(x.map(t=>D(e,t,n)))}function k(e){return e.map(e=>{let t=null;return e.data?t=`data:${e.mimeType};base64,${e.data}`:e.thumbnailData&&(t=`data:image/jpeg;base64,${e.thumbnailData}`),{id:e.id,filename:e.filename,mimeType:e.mimeType,sizeBytes:e.sizeBytes,previewUrl:t}})}function A(e){return e===`inline`||e===`panel`?e:void 0}function j(e){return{surfaceId:e.surfaceId,surfaceType:e.surfaceType,title:e.title,data:e.data,actions:e.actions,display:A(e.display),completed:e.completed,completionSummary:e.completionSummary,toolCallId:e.toolCallId}}function M(e){return e.map(j)}function N(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=new Date(e).getTime();return Number.isFinite(t)?t:void 0}}function P(e){if(!e||e.length===0)return{segments:void 0,attachments:void 0};let t=[];return{segments:e.map(e=>{let{cleanedContent:n,attachments:r}=b(e);return r&&t.push(...r),n}),attachments:t.length>0?t.map((e,t)=>({...e,id:`rehydrated:${t}`})):void 0}}function F(e){let{segments:t,attachments:n}=P(e.textSegments&&e.textSegments.length>0?e.textSegments:void 0),r=e.attachments&&e.attachments.length>0?k(e.attachments):void 0,i=W(e.contentOrder),a=G(e),o=e.toolCalls&&e.toolCalls.length>0?H(e.toolCalls,e.id):void 0,s=N(e.timestamp),c=e.thinkingSegments&&e.thinkingSegments.length>0?e.thinkingSegments:void 0,l={id:e.id,role:e.role};e.mergedMessageIds?.length&&(l.mergedMessageIds=e.mergedMessageIds),e.clientMessageId&&(l.clientMessageId=e.clientMessageId),e.surfaces&&(l.surfaces=M(e.surfaces)),a&&(l.contentBlocks=a),t&&(l.textSegments=t),i&&(l.contentOrder=i),c&&(l.thinkingSegments=c),e.subagentNotification&&(l.isSubagentNotification=!0),e.acpNotification&&(l.isAcpNotification=!0),e.backgroundToolNotification&&(l.isBackgroundToolNotification=!0),e.slackMessage&&(l.slackMessage=e.slackMessage),o&&(l.toolCalls=o),s!=null&&(l.timestamp=s);let u=r??n;return u&&(l.attachments=u),l}var I=`0.8.6`;function L(){let e=p.getState().version;if(!e)return`conversationKey`;let t=m(e),n=m(I);return!t||!n?`conversationKey`:h({...t,pre:null},n)>=0?`conversationId`:`conversationKey`}var R=1e3,z=12e4;function B(e){return{id:e.id,toolName:e.toolName,conversationId:e.conversationId,command:e.command,startedAt:e.startedAt,status:e.status,exitCode:e.exitCode,output:e.output,completedAt:e.completedAt}}async function V(e,t,n){let r=Date.now()+z;for(;Date.now()<r;){let{data:r,error:a,response:o}=await i({path:{assistant_id:e},query:{conversationId:n},throwOnError:!1});if(c(o,a,`Failed to poll for messages`),!o.ok){let e=l(a,o,`Failed to poll for messages`);throw Error(e)}let s=r?.messages??[],u=s.findIndex(e=>e.id===t);if(u>=0){let e=s.slice(u+1).find(e=>e.role===`assistant`);if(e)return e}await new Promise(e=>setTimeout(e,R))}return null}function H(e,t){return e.map((e,n)=>{let{confirmationDecision:r,...i}=e;return{...i,id:e.id??`tool-history-${t}-${n}`,...r===void 0?{}:{confirmationDecision:r}}})}function U(e){if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;if(typeof t.type==`string`&&typeof t.id==`string`)return{type:t.type,id:t.id}}if(typeof e==`string`){let t=e.indexOf(`:`);if(t>0)return{type:e.slice(0,t),id:e.slice(t+1)}}return null}function W(e){if(!e||e.length===0)return;let t=[];for(let n of e){let e=U(n);e&&t.push(e)}return t.length>0?t:void 0}function G(e){if(e.contentBlocks!==void 0)return e.contentBlocks;let t=W(e.contentOrder);if(!t)return;let n=[];for(let{type:r,id:i}of t){let t=Number.parseInt(i,10);if(!Number.isNaN(t))switch(r){case`text`:{let r=e.textSegments?.[t];if(r==null)break;let{cleanedContent:i}=b(r);i.trim().length>0&&n.push({type:`text`,text:i});break}case`thinking`:{let r=e.thinkingSegments?.[t];r!=null&&n.push({type:`thinking`,thinking:r});break}case`tool`:case`toolCall`:{let r=e.toolCalls?.[t];r&&n.push({type:`tool_use`,toolCall:{...r,id:r.id??`tool-history-${e.id}-${t}`}});break}case`surface`:{let r=e.surfaces?.[t];r&&n.push({type:`surface`,surface:r});break}case`attachment`:{let r=e.attachments[t];r&&n.push({type:`attachment`,attachment:r});break}}}return n.length>0?n:void 0}async function K(e,t,n){let r=n?.latestPageLimit==null?{conversationId:t}:{conversationId:t,page:`latest`,limit:n.latestPageLimit},{data:a,error:o,response:s}=await i({path:{assistant_id:e},query:r,throwOnError:!1});if(c(s,o,`Failed to fetch conversation messages`),!s.ok)throw Error(`Failed to fetch conversation messages (HTTP ${s.status})`);return a}async function q(e,t){let n=t.name||`attachment`,r=t.type||`application/octet-stream`,{data:i,error:o,response:s}=await a({path:{assistant_id:e},body:{file:t,filename:n,mimeType:r},throwOnError:!1});if(c(s,o,`Failed to upload attachment`),!s.ok){let e=o&&typeof o==`object`&&!Array.isArray(o)?o:{},t=(typeof e.detail==`string`?e.detail:void 0)??(typeof e.error==`string`?e.error:void 0)??`HTTP ${s.status}`;return{ok:!1,status:s.status,error:{detail:t}}}let l=i?.id;return l?{ok:!0,id:l,...typeof i.filename==`string`?{filename:i.filename}:{},...typeof i.mimeType==`string`?{mimeType:i.mimeType}:{},...typeof i.sizeBytes==`number`?{sizeBytes:i.sizeBytes}:{}}:{ok:!1,status:422,error:{detail:`Upload response did not include an attachment id.`}}}async function J(t,r,i,a=[],o,s,l,f,p){let m={content:i,sourceChannel:`vellum`,interface:`web`,clientOs:u()},h=g();h&&(m.clientTimezone=h);let _=L();(r!==null||_!==`conversationId`)&&(m[_]=r),a.length>0&&(m.attachmentIds=a),s&&(m.clientMessageId=s),l&&(m.inferenceProfile=l),f!=null&&(m.enabledPlugins=f),p&&(m.hidden=!0);let v=o?d(o):void 0;if(v){let e={tools:v.tools,tasks:v.tasks,tone:v.tone};v.userName!==void 0&&(e.userName=v.userName),v.occupation!==void 0&&(e.occupation=v.occupation),v.assistantName!==void 0&&(e.assistantName=v.assistantName),v.googleConnected!==void 0&&(e.googleConnected=v.googleConnected),v.googleScopes!==void 0&&(e.googleScopes=v.googleScopes),v.priorAssistants!==void 0&&(e.priorAssistants=v.priorAssistants),v.cohort!==void 0&&(e.cohort=v.cohort),v.bootstrapTemplate!==void 0&&(e.bootstrapTemplate=v.bootstrapTemplate),v.initialMessage!==void 0&&v.initialMessage.trim().toLowerCase().replace(/[.!?]+$/,``)!==`wake up, my friend`&&(e.initialMessage=v.initialMessage),v.skills!==void 0&&(e.skills=v.skills),v.title!==void 0&&(e.title=v.title),m.onboarding=e}v&&O(t,v).catch(t=>e(t,{context:`persistPreChatOnboardingProfile`}));let{data:y,error:b,response:x}=await n({path:{assistant_id:t},body:m,throwOnError:!1});if(c(x,b,`Failed to send chat message`),!x.ok){let e=b&&typeof b==`object`&&!Array.isArray(b)?b:{},t=e.error&&typeof e.error==`object`&&!Array.isArray(e.error)?e.error:{};return{ok:!1,status:x.status,error:{code:typeof e.code==`string`?e.code:typeof t.code==`string`?t.code:typeof e.error==`string`?e.error:void 0,detail:(typeof e.detail==`string`?e.detail:void 0)??(typeof e.message==`string`?e.message:void 0)??(typeof t.message==`string`?t.message:void 0)??`HTTP ${x.status}`}}}let S=y;if(!S?.accepted)return{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}};let C=typeof S.conversationId==`string`?S.conversationId:void 0;return C===void 0?{ok:!1,status:422,error:{detail:`Assistant accepted the message but did not return a conversation id.`}}:S.queued?{ok:!0,queued:!0,assistantId:t,conversationId:C,requestId:typeof S.requestId==`string`?S.requestId:void 0}:typeof S.messageId==`string`?{ok:!0,assistantId:t,conversationId:C,messageId:S.messageId}:{ok:!1,status:422,error:{detail:`Message was not accepted by the assistant.`}}}async function Y(e,t,n){try{let{response:r}=await o({path:{assistant_id:e,id:n},query:{conversationId:t},throwOnError:!1});return r?.ok??!1}catch{return!1}}async function X(e,t,n){try{let{response:i}=await r({path:{assistant_id:e,id:n},query:{conversationId:t},throwOnError:!1});return i?.ok??!1}catch{return!1}}export{J as a,q as c,V as i,F as l,K as n,Y as o,G as r,B as s,X as t,j as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./utils-B_yHNmjr.js";var t=`0.10.3`;function n(){return e(t)}export{n as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D-AX8Voo.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./card-BibIM9x3.js";import{t as l}from"./input-D4W4p0pZ.js";import{c as u,f as d,o as f}from"./local-mode-CgrENuVf.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{n as m}from"./resolved-assistants-store-Dqf0LJrA.js";import{t as h}from"./check-D6WkI0gF.js";import{t as g}from"./chevron-left-DghyKSEE.js";import{t as _}from"./loader-circle-BFRVtR3K.js";import{t as v}from"./pencil-B90pDI55.js";import{t as y}from"./x-DxL-bCuT.js";import{A as b,C as ee,a as x,j as S,n as C,o as w}from"./auth-store-B_ChDvJN.js";import{t as T}from"./client.gen-BHupOCJH.js";import{m as E}from"./native-biometric-BK6_QtW5.js";import{a as D}from"./routes-C6gxiCrz.js";import{r as O}from"./platform-detection-Ceodt3Hu.js";import{o as k,r as A}from"./prefs-CbAh5SBF.js";import{t as j}from"./client-feature-flag-store-BTwca_EB.js";import{c as M,l as te,n as N,t as ne}from"./prechat-CgM5bgoR.js";import{b as re,r as ie,yt as ae}from"./react-query.gen-By34AU2d.js";import{n as oe,t as P}from"./browser-DM38C5zq.js";import{t as F}from"./public-asset-C2P77n3W.js";import{$t as I,Et as se,J as ce,Qt as L,Tt as le,Zt as ue,ca as R,d as de,en as z,l as fe,nn as B,q as pe,rn as V,u as me,vt as H,wt as he,xt as ge,yt as _e}from"./index-quNf_5yL.js";import{n as U,r as ve}from"./prechat-names-NPlBAwCy.js";import{t as ye}from"./step-indicator-dots-Bc6X141I.js";var W=e(t(),1);async function be(){try{let{data:e,response:t}=await T.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=s(),xe=[{label:`Push notifications`,detail:`stay in the loop even when the browser is closed`},{label:`Biometric login`,detail:`Face ID & Touch ID for instant, secure access`},{label:`Native haptics`,detail:`tactile feedback that feels part of the device`},{label:`Home screen access`,detail:`launch your assistant with a single tap`}];function Se({onComplete:e}){function t(){de(),fe(),e()}return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col items-center justify-center px-6 pb-40 text-center`,children:[(0,G.jsx)(`div`,{className:`mb-8 flex size-16 items-center justify-center rounded-2xl border`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)`,animation:`fadeInUp 0.3s ease-out both`},children:(0,G.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{color:`var(--content-default)`},"aria-hidden":!0,children:[(0,G.jsx)(`rect`,{x:`5`,y:`2`,width:`14`,height:`20`,rx:`3`}),(0,G.jsx)(`line`,{x1:`12`,y1:`18`,x2:`12`,y2:`18.01`})]})}),(0,G.jsx)(`p`,{className:`text-label-small-default mb-3 uppercase tracking-[0.2em]`,style:{color:`var(--content-tertiary)`,animation:`fadeInUp 0.3s ease-out 0.05s both`},children:`One more thing`}),(0,G.jsx)(`h1`,{className:`mb-3 text-3xl font-semibold tracking-tight`,style:{color:`var(--content-default)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Your assistant, in your pocket.`}),(0,G.jsx)(`p`,{className:`text-body-medium-lighter mb-10 max-w-sm`,style:{color:`var(--content-secondary)`,animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`The iOS app keeps your assistant a tap away — with push notifications, biometric login, and native haptics.`}),(0,G.jsx)(`div`,{className:`mb-10 w-full rounded-xl border px-5 py-4`,style:{background:`var(--surface-overlay)`,borderColor:`var(--border-element)`,animation:`fadeInUp 0.3s ease-out 0.2s both`},children:(0,G.jsx)(`ul`,{className:`space-y-4`,children:xe.map((e,t)=>(0,G.jsxs)(`li`,{className:`flex items-start gap-3`,style:{animation:`fadeInUp 0.3s ease-out ${.25+t*.05}s both`},children:[(0,G.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full`,style:{background:`var(--system-positive-weak)`},children:(0,G.jsx)(h,{size:12,style:{color:`var(--system-positive-strong)`}})}),(0,G.jsxs)(`span`,{className:`text-left`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.label}),(0,G.jsxs)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[` — `,e.detail]})]})]},e.label))})}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.45s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,Ce=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)}];function we({assistantId:e,assistantName:t,onConnect:r,onSkip:i,onBack:o}){let s=p(),c=a(),l=E(),u=(0,W.useRef)(null),d=(0,W.useRef)(null),f=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),v=(0,W.useRef)(null),y=(0,W.useRef)(null),[b,x]=(0,W.useState)(!1),S=(0,W.useCallback)(()=>{d.current=null,x(!1)},[]),C=(0,W.useCallback)(()=>{h.current&&=(window.removeEventListener(`message`,h.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),w=(0,W.useCallback)(()=>{u.current&&!u.current.closed&&u.current.close(),u.current=null,f.current&&=(clearInterval(f.current),null),m.current&&=(clearTimeout(m.current),null)},[]),T=ae();(0,W.useEffect)(()=>()=>{f.current&&clearInterval(f.current),m.current&&clearTimeout(m.current),u.current&&!u.current.closed&&u.current.close(),h.current&&window.removeEventListener(`message`,h.current),v.current&&window.removeEventListener(`storage`,v.current),y.current&&=(y.current(),null)},[]);let O=(0,W.useCallback)(async e=>{try{return(await c.fetchQuery({...re({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[c]),k=(0,W.useCallback)(async()=>{let e=d.current?.platformAssistantId;w(),S(),r((e?await O(e):null)?.scopes_granted??[])},[S,w,O,r]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!d.current||e.requestId!==d.current.requestId||(e.oauthStatus===`connected`?k():(w(),S())))},[S,w,k]),j=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=ue(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=d.current;if(!t)return;let n=L(e,t.requestId);n&&(A(n),window.localStorage.removeItem(z(t.requestId)))},[A]);B((0,W.useCallback)(e=>{let t=d.current;t&&e.requestId===t.requestId&&A({type:`vellum:oauth-complete`,requestId:e.requestId,oauthStatus:e.oauthStatus,oauthProvider:e.oauthProvider,oauthCode:e.oauthCode})},[A]));let te=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(C(),h.current=j,v.current=M,l){x(!0),(async()=>{let n;try{n=await ee(e)}catch{S();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){P(e.connect_url)},onError(){S()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),y.current&&y.current();let n=oe(()=>{let e=d.current;if(!e){n(),y.current=null;return}(async()=>{let t=await O(e.platformAssistantId);d.current&&(t?await k():S(),C(),n(),y.current=null)})()});y.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){C();return}u.current=n,x(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),f.current=setInterval(()=>{u.current&&u.current.closed&&d.current&&!m.current&&(m.current=setTimeout(async()=>{m.current=null;let e=d.current;if(!e)return;let t=window.localStorage.getItem(z(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(z(e.requestId)),C();return}}catch{}let n=await O(e.platformAssistantId);d.current&&(n?await k():(w(),S()),C())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{w(),S(),C();return}d.current={requestId:t,platformAssistantId:n},T.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){u.current&&!u.current.closed?u.current.location.href=e.connect_url:d.current&&(w(),S(),C())},onError(){w(),S(),C()}})})()},[e,S,w,O,A,j,M,k,l,C,T]),N=t||`your assistant`,ne=t||`Your assistant`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${s?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:o,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${s?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Connect Google`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`mt-4 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you use Google, ${N} can use Gmail, Calendar, and Drive with your permission.`}),(0,G.jsx)(`div`,{className:`mt-6 flex items-stretch justify-center gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:Ce.map(e=>(0,G.jsxs)(`div`,{className:`flex w-24 flex-col items-center gap-2.5 rounded-2xl bg-[var(--surface-lift)] px-3 pb-3 pt-4`,children:[(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:28,height:28,className:`h-7 w-7 object-contain`,loading:`eager`}),(0,G.jsx)(`span`,{className:`text-center text-xs leading-tight text-[var(--content-tertiary)]`,children:e.label})]},e.id))}),(0,G.jsx)(`p`,{className:`mt-8 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.25s both`},children:`${ne} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${s?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.35s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:te,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:b||T.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(_,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:i,disabled:b||T.isPending,className:`${s?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Te({userName:e,assistantName:t,selectedGroupId:r,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:u,onSkip:d}){let f=p();return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-md flex-col items-center ${f?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${c?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[c?(0,G.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${f?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Let's get to know each other.`}),c?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`${f?`mt-6`:`mt-8`} flex w-full flex-col ${f?`gap-4`:`gap-6`}`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>o(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Pick a vibe`}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:U.map(e=>(0,G.jsx)(Ee,{group:e,isActive:r===e.id,onToggle:()=>s(r===e.id?null:e.id)},e.id))})]})]}),(0,G.jsxs)(`div`,{className:`${f?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:d,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function Ee({group:e,isActive:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":`${e.label}, ${e.descriptor}`,className:`flex cursor-pointer flex-col items-start gap-0.5 rounded-lg border p-3 text-left transition-colors ${t?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default ${t?`text-[var(--content-inset)]`:`text-[var(--content-default)]`}`,children:e.descriptor}),(0,G.jsx)(`span`,{className:`text-body-small-default ${t?`text-[var(--content-inset)] opacity-60`:`text-[var(--content-tertiary)]`}`,children:e.tagline})]})}function De({userName:e,assistantName:t,displayedAssistantNames:r,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:u,totalSteps:d}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[o?(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:o,"aria-label":`Back`}):(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(ye,{current:u,total:d})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`text-center text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`Let's get to know each other.`}),(0,G.jsx)(`p`,{className:`mt-2 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change these any time.`}),(0,G.jsxs)(`div`,{className:`mt-8 flex w-full flex-col gap-6`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(l,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(l,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),fullWidth:!0}),(0,G.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`A few to try`}),(0,G.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r.map(e=>{let n=e===t;return(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(e),"aria-pressed":n,className:`cursor-pointer rounded-full border px-3 py-1 text-label-small-default transition-colors ${n?`border-[var(--primary-base)] bg-[var(--primary-base)] text-[var(--content-inset)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] text-[var(--content-secondary)] hover:bg-[var(--surface-base)]`}`,children:e},e)})})]})]})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var Oe=[{id:`chatgpt`,label:`ChatGPT`,logoSrc:F(`/images/prior-assistants/chatgpt.svg`)},{id:`claude`,label:`Claude`,logoSrc:F(`/images/prior-assistants/claude.svg`)},{id:`openclaw`,label:`OpenClaw`,logoSrc:F(`/images/prior-assistants/openclaw.png`)},{id:`hermes`,label:`Hermes`,logoSrc:F(`/images/prior-assistants/hermes.png`)},{id:`manus`,label:`Manus`,logoSrc:F(`/images/prior-assistants/manus.svg`)},{id:`gemini`,label:`Gemini`,logoSrc:F(`/images/prior-assistants/gemini.svg`)},{id:`copilot`,label:`Copilot`,logoSrc:F(`/images/prior-assistants/copilot.svg`)}];function ke({selectedAssistants:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>q(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(J(e));(0,W.useEffect)(()=>{let t=J(e);if(t===m.current)return;let n=q(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}Ae(n,e)||(m.current=J(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center grid-cols-[auto_1fr_auto]`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`Have you used any of these?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`If you've built anything with another assistant, I can help you bring it over.`}),(0,G.jsxs)(`div`,{className:`${o?`mt-4`:`mt-8`} grid w-full grid-cols-2 gap-2 sm:grid-cols-3 md:grid-cols-4`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Oe.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>h(t.id)},t.id)),d?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),d?(0,G.jsx)(c,{padding:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom assistants`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple assistants with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function Ae(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function q(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function je({assistant:e,selected:t,onToggle:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(Ne,{assistant:e,size:32}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Me({onClick:e}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex h-[88px] w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function Ne({assistant:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Pe({selectedTasks:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),s=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)};return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What are you working on?`}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsx)(`p`,{className:`${o?`mt-2`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`Pick the one or two you do most — you can select more if it really is all of it.`}),(0,G.jsx)(`div`,{className:`${o?`mt-6`:`mt-8`} flex w-full flex-col ${o?`gap-1`:`gap-2`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:pe.map(t=>{let n=ce[t.iconKey],r=e.has(t.id);return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-pressed":r,className:`group flex w-full cursor-pointer items-center ${o?`gap-2 p-3`:`gap-3 px-4 py-3`} rounded-lg border text-left transition-colors ${r?`border-[var(--primary-base)] bg-[var(--primary-base)]/10`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`div`,{className:`flex w-6 shrink-0 items-center justify-center text-[var(--content-secondary)]`,children:n?(0,G.jsx)(n,{className:`h-4 w-4`}):null}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:t.label}),(0,G.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:t.sublabel})]}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-md ${r?`bg-[var(--primary-base)]`:`border-[1.5px] border-[var(--border-element)]`}`,children:r?(0,G.jsx)(h,{className:`h-3 w-3 text-[var(--content-inset)]`}):null})]},t.id)})}),(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}var Fe=new Set([`gmail`,`google-calendar`,`google-drive`]),Ie=[{id:`gmail`,label:`Gmail`,logoSrc:F(`/images/integrations/gmail.svg`)},{id:`outlook`,label:`Outlook`,logoSrc:F(`/images/integrations/outlook.png`)},{id:`google-calendar`,label:`Google Calendar`,logoSrc:F(`/images/integrations/google-calendar.svg`)},{id:`slack`,label:`Slack`,logoSrc:F(`/images/integrations/slack.svg`)},{id:`notion`,label:`Notion`,logoSrc:F(`/images/integrations/notion.svg`)},{id:`linear`,label:`Linear`,logoSrc:F(`/images/integrations/linear-light-logo.svg`)},{id:`jira`,label:`Jira`,logoSrc:F(`/images/integrations/jira.svg`)},{id:`github`,label:`GitHub`,logoSrc:F(`/images/integrations/github.svg`),logoSrcDark:F(`/images/integrations/github-dark.svg`)},{id:`figma`,label:`Figma`,logoSrc:F(`/images/integrations/figma.svg`)},{id:`google-drive`,label:`Google Drive`,logoSrc:F(`/images/integrations/google-drive.svg`)},{id:`excel`,label:`Excel`,logoSrc:F(`/images/integrations/excel.svg`)},{id:`apple-notes`,label:`Apple Notes`,logoSrc:F(`/images/integrations/apple-notes.svg`)}];function Le(e){let t=e.map(e=>e.startsWith(`other:`)?e.slice(6):e);return Array.from(new Set(t)).sort()}function Re({selectedTools:e,onChange:t,onBack:r,onContinue:i,onSkip:a}){let o=p(),[s,u]=(0,W.useState)(()=>Y(e)),[d,f]=(0,W.useState)(()=>s.length>0),m=(0,W.useRef)(X(e));(0,W.useEffect)(()=>{let t=X(e);if(t===m.current)return;let n=Y(e);u(n),f(e=>e||n.length>0),m.current=t},[e]),(0,W.useEffect)(()=>{let n=new Set([...e].filter(e=>!e.startsWith(`other:`))),r=new Set;for(let e of s.split(`,`)){let t=e.trim();t&&(r.has(t)||(r.add(t),n.add(`other:${t}`)))}ze(n,e)||(m.current=X(n),t(n))},[s]);let h=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},_=(0,W.useMemo)(()=>{let e=new Set;return s.split(`,`).map(e=>e.trim()).filter(t=>!t||e.has(t)?!1:(e.add(t),!0))},[s]),b=e.size===0?`Continue`:`Continue · ${e.size} selected`;return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex w-full max-w-2xl flex-col items-center ${o?`min-h-full px-8 pt-11 pb-8 electron-prechat-type`:`px-6 pt-12 pb-40`} text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full items-center ${r?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[r?(0,G.jsx)(`button`,{type:`button`,onClick:r,"aria-label":`Back`,className:`flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-[var(--content-secondary)] transition-colors hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(g,{className:`h-4 w-4`})}):null,(0,G.jsx)(`h1`,{className:`text-center ${o?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,children:`What do you use?`}),r?(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`}):null]}),(0,G.jsx)(`p`,{className:`${o?`mt-3`:`mt-4`} text-center text-body-medium-lighter text-[var(--content-${o?`secondary`:`tertiary`})]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`This helps me tailor how I assist you. No connections needed — you can set those up later.`}),(0,G.jsxs)(`div`,{className:`grid w-full gap-2 ${o?`mt-4 grid-cols-4`:`mt-8 grid-cols-2 sm:grid-cols-3 md:grid-cols-4`}`,style:{animation:`fadeInUp 0.3s ease-out 0.2s both`},children:[Ie.map(t=>(0,G.jsx)(Z,{tool:t,selected:e.has(t.id),onToggle:()=>h(t.id),electron:o},t.id)),d?null:(0,G.jsx)(Q,{onClick:()=>f(!0),electron:o})]}),d?(0,G.jsx)(c,{padding:o?`sm`:`md`,className:`mt-3 w-full border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_8%,transparent)]`,children:(0,G.jsxs)(`div`,{className:`flex flex-col ${o?`gap-2`:`gap-3`}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(v,{className:`h-3.5 w-3.5 text-[var(--content-secondary)]`,"aria-hidden":`true`}),(0,G.jsx)(`span`,{className:`text-body-medium-default prechat-md-regular text-[var(--content-default)]`,children:`Something else`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{f(!1),u(``)},"aria-label":`Dismiss custom tools`,className:`ml-auto inline-flex h-6 w-6 cursor-pointer items-center justify-center rounded-md text-[var(--content-tertiary)] hover:bg-[var(--surface-base)]`,children:(0,G.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(l,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>u(e.target.value),helperText:`Separate multiple tools with commas`,fullWidth:!0}),_.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(e=>(0,G.jsx)(`span`,{className:`rounded-full bg-[var(--primary-base)] px-3 py-1 text-label-small-default text-[var(--content-inset)]`,children:e},e))}):null]})}):null,(0,G.jsxs)(`div`,{className:`${o?`mt-auto`:`mt-8`} flex w-full flex-col gap-2`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:e.size===0,onClick:i,className:`${o?`h-9`:`h-11 text-base`}`,children:b}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function ze(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function X(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Z({tool:e,selected:t,onToggle:n,electron:r}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,"aria-label":e.label,className:`relative flex ${r?`h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border p-2 transition-colors ${t?`border-[var(--primary-base)] bg-[color-mix(in_srgb,var(--primary-base)_10%,transparent)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)($,{tool:e,size:32}),(0,G.jsx)(`span`,{className:`${r?`w-full truncate`:`line-clamp-2`} text-center text-label-medium-default text-[var(--content-default)]`,children:e.label}),t?(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-2 top-2 flex h-4 w-4 items-center justify-center rounded-full bg-[var(--primary-base)]`,children:(0,G.jsx)(h,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function Q({onClick:e,electron:t}){return(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Something else`,className:`flex ${t?`min-h-[72px]`:`h-[88px]`} w-full cursor-pointer flex-col items-center justify-center gap-1.5 rounded-lg border border-[var(--border-element)] bg-[var(--surface-lift)] p-2 transition-colors hover:bg-[var(--surface-base)]`,children:[(0,G.jsx)(`span`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-[var(--surface-base)]`,children:(0,G.jsx)(R,{className:`h-4 w-4 text-[var(--content-secondary)]`,"aria-hidden":`true`})}),(0,G.jsx)(`span`,{className:`line-clamp-2 text-center text-label-medium-default text-[var(--content-default)]`,children:`Something else`})]})}function $({tool:e,size:t}){if(e.logoSrc)return e.logoSrcDark?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`flex items-center justify-center dark:hidden`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})}),(0,G.jsx)(`span`,{className:`hidden items-center justify-center dark:flex`,style:{width:t,height:t},"aria-hidden":`true`,children:(0,G.jsx)(`img`,{src:e.logoSrcDark,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})})]}):(0,G.jsx)(`span`,{className:`flex items-center justify-center`,style:{width:t,height:t},children:(0,G.jsx)(`img`,{src:e.logoSrc,alt:``,width:t,height:t,className:`max-h-full max-w-full object-contain`,loading:`eager`})});let n=e.label.slice(0,2).toUpperCase();return(0,G.jsx)(`span`,{className:`flex items-center justify-center rounded-full bg-[var(--surface-base)] text-label-small-default text-[var(--content-default)]`,style:{width:t,height:t},"aria-hidden":`true`,children:n})}function Be({selectedGroupId:e,onGroupChange:t,onBack:r,onContinue:i,onSkip:a,currentStep:o,totalSteps:s}){return(0,G.jsx)(V,{showCreatureFooter:!1,children:(0,G.jsxs)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-md flex-col px-6 pb-40 text-[var(--content-default)]`,children:[(0,G.jsxs)(`div`,{className:`grid w-full grid-cols-[auto_1fr_auto] items-center pb-4`,style:{paddingTop:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`,animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[(0,G.jsx)(n,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(g,{}),onClick:r,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(ye,{current:o,total:s})}),(0,G.jsx)(`div`,{"aria-hidden":`true`,className:`h-8 w-8`})]}),(0,G.jsxs)(`div`,{className:`flex flex-1 flex-col items-center pt-4`,children:[(0,G.jsx)(`h1`,{className:`w-full text-left text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:`What's my vibe?`}),(0,G.jsx)(`p`,{className:`mt-2 w-full text-left text-body-medium-lighter text-[var(--content-secondary)]`,style:{animation:`fadeInUp 0.3s ease-out 0.15s both`},children:`You can change this any time.`}),(0,G.jsx)(`div`,{className:`mt-8 flex w-full flex-col gap-3`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:U.map(n=>{let r=e===n.id;return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(r?null:n.id),"aria-pressed":r,className:`flex cursor-pointer items-center justify-between rounded-xl border px-4 py-4 text-left transition-colors ${r?`border-[var(--content-default)] bg-[var(--surface-lift)]`:`border-[var(--border-element)] bg-[var(--surface-lift)] hover:bg-[var(--surface-base)]`}`,children:[(0,G.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:n.descriptor}),(0,G.jsx)(`span`,{className:`flex h-5 w-5 items-center justify-center rounded-full border-2 transition-colors ${r?`border-[var(--content-default)]`:`border-[var(--content-disabled)]`}`,children:r&&(0,G.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-[var(--content-default)]`})})]},n.id)})})]}),(0,G.jsxs)(`div`,{className:`flex w-full flex-col gap-2 pb-4`,style:{animation:`fadeInUp 0.3s ease-out 0.3s both`},children:[(0,G.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(n,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function Ve(e){let[t,n]=(0,W.useState)(()=>(e??``).trim()),r=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(r.current)return;let t=(e??``).trim();t&&n(e=>e||t)},[e]),{value:t,onChange:(0,W.useCallback)(e=>{r.current=!0,n(e)},[])}}var He=[`gmail`,`google-calendar`,`google-drive`],Ue=`experiment-activation-flow-2026-06-03`,We=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ge(e,t,n){return t?.initialMessage?t.initialMessage:n?N(e):ne}function Ke(e){let{mode:t,recipe:n}=e,r=e.connectedScopes!==void 0,i;i=t===`native`?{tools:[],tasks:[],tone:e.tone,googleConnected:!1}:t===`paredDown`?{tools:r?[...He]:[],tasks:n?.tasks??[],tone:e.tone,googleConnected:r}:{tools:Le([...e.selectedTools]),tasks:[...e.selectedTasks].sort(),tone:e.tone},n&&(i.cohort=n.cohort,i.bootstrapTemplate=n.bootstrapTemplate,i.skills=n.skills),e.activationFlowEnabled&&(i.cohort=Ue,i.bootstrapTemplate=We);let a=e.userName.trim();a&&(i.userName=a);let o=e.occupation?.trim();o&&(i.occupation=o);let s=e.assistantName.trim();return s&&(i.assistantName=s),t===`paredDown`?r&&(i.googleScopes=e.connectedScopes):t===`control`&&(r?(i.googleConnected=!0,i.googleScopes=e.connectedScopes):e.googleConnected?(i.googleConnected=!0,i.googleScopes=e.googleScopes):i.googleConnected=!1),t===`control`&&e.selectedPriorAssistants.size>0&&(i.priorAssistants=Le([...e.selectedPriorAssistants])),i.initialMessage=Ge(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function qe(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Je(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:H.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:H.controlWorkType,enabled:!t},{id:`tools`,funnelStep:H.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:H.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?H.gmailConnect:H.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:H.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Ye(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Xe=`1`;function Ze(e){return e===`nativeVibe`||e===Xe?`nativeVibe`:null}function Qe(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function et(){let e=r(),t=E(),n=k()&&A();return(0,W.useEffect)(()=>{!n&&!t&&e(D.onboarding.privacy,{replace:!0})},[n,t,e]),t||n}function tt(e,t){let n=e?`prechat_native_screen:${e}`:null,[r,i]=(0,W.useState)(()=>t?`nativeName`:`name`),a=(0,W.useCallback)(e=>{if(n)try{e===null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},[n]);return(0,W.useLayoutEffect)(()=>{if(n)try{let e=Ze(sessionStorage.getItem(n));e&&i(e)}catch{}},[n]),(0,W.useEffect)(()=>{t&&a(r===`nativeVibe`?`nativeVibe`:null)},[t,r,a]),{currentStep:r,setCurrentStep:i,clearPersistedStep:(0,W.useCallback)(()=>{a(null)},[a])}}var nt=3;function rt(){let e=u();return e?.cloud===`vellum`?e.assistantId:f()[0]?.assistantId??null}function it(){let e=r(),[t]=i(),n=t.get(`preview`)===`true`,a=C.use.user(),s=x(),c=w(),l=a?.id??null,u=a?.firstName??``,f=a?.lastName??``,p=E(),h=m.use.activeAssistantId(),g=d(),_=O()&&!me(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),T=he(v),k=le()??T,A=k===_e.paredDown,N=g?rt():null,ne=et(),{currentStep:re,setCurrentStep:ae,clearPersistedStep:oe}=tt(l,p),P=C.use.platformSession(),F=S(P),[I,ce]=(0,W.useState)(()=>new Set),[L,ue]=(0,W.useState)(()=>new Set),[R,de]=(0,W.useState)(()=>new Set),{value:z,onChange:fe}=Ve(g&&!F?``:u||f),[B,pe]=(0,W.useState)(null),[V]=(0,W.useState)(()=>ve()),[H,U]=(0,W.useState)(``),[ye,xe]=(0,W.useState)(!1),[K,Ce]=(0,W.useState)([]),{data:Ee}=o({...ie(),enabled:!c&&s&&(!g||F)}),{data:Oe,isLoading:Ae}=o({queryKey:[`onboarding-recipe`,l],queryFn:be,enabled:!c&&s&&!p&&!g,staleTime:1/0}),q=Oe??null,J=Ee?.id??h??N,je=qe({localMode:g,platformSession:P,hasCachedPlatformAssistant:N!==null}),Me=je,Ne=je,Ie=async()=>{await b.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Le(e,t=k){n||ge(e,{userId:l,variant:se(t)})}let ze=[...I].some(e=>Fe.has(e)),Y=p?Ye():Je({paredDown:A,canOfferPriorAssistants:Ne,canOfferGoogleStep:n?!1:Me,hasGoogleTool:ze,showIOSAppStep:_});function X(t){if(n){e(-1);return}te(Ke({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:L,selectedPriorAssistants:t?.selectedPriorAssistants??R,tone:B??q?.tone??`grounded`,userName:z,assistantName:H,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:ye,googleScopes:K,connectedScopes:t?.connectedScopes}));let r=H.trim();r&&M(r),p?(oe(),e(D.onboarding.privacy)):(b.markExpectingFirstMessage(),Ie())}let Z=(e,t)=>{e.funnelStep&&Le(e.funnelStep);let n=Qe(Y,e.id);n?ae(n):X(t)},Q=e=>{let t=$e(Y,e.id);t&&ae(t)};if(!ne||Ae)return null;let $=Y.find(e=>e.id===re)??Y[0];return $?$.id===`nativeName`?(0,G.jsx)(De,{userName:z,assistantName:H,displayedAssistantNames:V,onUserNameChange:fe,onAssistantNameChange:U,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:nt}):$.id===`nativeVibe`?(0,G.jsx)(Be,{selectedGroupId:B,onGroupChange:pe,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:nt}):$.id===`name`?(0,G.jsx)(Te,{userName:z,assistantName:H,selectedGroupId:B,displayedAssistantNames:V,onUserNameChange:fe,onAssistantNameChange:U,onGroupChange:pe,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:L,onChange:ue,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:ce,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(ke,{selectedAssistants:R,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;de(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(we,{assistantId:J,assistantName:H,onConnect:e=>{xe(!0),Ce(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Se,{onComplete:()=>Z($)}):null:null}function at(){return(0,G.jsx)(it,{})}export{at as PreChatRoute};
|
|
@@ -1,61 +0,0 @@
|
|
|
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-DjujnGJR.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-B_ChDvJN.js";import{a as M,o as re,r as ie}from"./api-Ckbwsd-f.js";import{a as ae}from"./routes-C6gxiCrz.js";import{t as N}from"./platform-detection-Ceodt3Hu.js";import{t as oe}from"./client-feature-flag-store-BTwca_EB.js";import{c as se,l as ce}from"./prechat-CgM5bgoR.js";import{A as le,B as ue,C as de,D as fe,E as pe,F as me,I as P,L as he,M as ge,N as _e,O as ve,P as ye,R as F,S as I,T as L,V as R,_ as be,a as z,b as xe,d as B,f as Se,g as Ce,i as we,j as Te,k as Ee,m as De,o as Oe,p as ke,r as Ae,s as je,t as V,v as Me,w as Ne,x as Pe,y as Fe}from"./proxy-BgtfAoJj.js";import{t as Ie}from"./AnimatePresence-uY0BR2n2.js";import{t as H}from"./use-reduced-motion-BG6r0Z46.js";import{$n as Le,Ma as U,Si as Re,St as ze,bt as Be,hn as Ve,in as He,it as W,ki as Ue,on as We,qt as Ge,rn as Ke,rt as qe,sn as Je}from"./index-quNf_5yL.js";import{t as Ye}from"./prechat-names-NPlBAwCy.js";var Xe=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Ze(e,t){return ge(e)?e[Xe(0,e.length,t)]:e}var Qe=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 $e(this.animations,`duration`)}get iterationDuration(){return $e(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 $e(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 et=class extends Qe{then(e,t){return this.finished.finally(e).then(()=>{})}};function tt(...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=pe(i,a,o);return t?s(r):s}function nt(e,t){return e in t}var rt=class extends je{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(nt(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 Se()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function it(e){let t=R(()=>I(e)),{isStatic:n}=(0,G.useContext)(Ae);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function at(e,t){let n=it(t()),r=()=>n.set(t());return r(),ue(()=>{let t=()=>Te.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),le(r)}}),n}function ot(e){Pe.current=[],e();let t=at(Pe.current,e);return Pe.current=void 0,t}function st(e,t,n,r){if(typeof e==`function`)return ot(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return lt(e,t,n,r);let i=typeof t==`function`?t:tt(t,n,r),a=Array.isArray(e)?ct(e,i):ct([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 ct(e,t){let n=R(()=>[]);return at(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function lt(e,t,n,r){let i=R(()=>Object.keys(n)),a=R(()=>({}));for(let o of i)a[o]=st(e,t,n[o],r);return a}function ut(e){e.values.forEach(e=>e.stop())}function dt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&xe(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{dt(e,t)})})}function ft(e,t){if(Array.isArray(t))return dt(e,t);if(typeof t==`string`)return dt(e,[t]);xe(e,t)}function pt(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){P(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(be(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return P(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{ft(e,n)})},stop(){t.forEach(e=>{ut(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function mt(e){return typeof e==`object`&&!Array.isArray(e)}function ht(e,t,n,r){return e==null?[]:typeof e==`string`&&mt(t)?Ce(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function gt(e,t,n){return e*(t+1)+n*t}function _t(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 vt(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(F(e,i),r--)}}function yt(e,t,n,r,i,a){vt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Ee(i,a,r[o]),easing:Ze(n,o)})}function bt(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function xt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var St=`easeInOut`,Ct=20;function wt(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,_t(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=_t(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=Dt(e),{delay:l=0,times:u=Ne(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=de(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&At(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=ye(b));let r=ve(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&&L(u,T),c.length===1&&c.unshift(null),m&&he(m<Ct,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${Ct} or apply repeat at the sequence level instead.`),m&&m<Ct){let e=b>0?_/b:0;b=gt(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`?_e(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`:Ze(f,e-1))}bt(u,m,e)}let E=w+b;yt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(Fe(p)){let e=Tt(p,s);_(m,h,Et(`default`,e))}else{let e=ht(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=Tt(r,s);for(let e in m)_(m[e],Ot(h,e),Et(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(xt);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(me(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(St)),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 Tt(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function Et(e,t){return t[e]||(t[e]=[]),t[e]}function Dt(e){return Array.isArray(e)?e:[e]}function Ot(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var kt=e=>typeof e==`number`,At=e=>e.every(kt);function jt(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=De(e)&&!ke(e)?new z(t):new Oe(t);n.mount(e),B.set(e,n)}function Mt(e){let t=new rt({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),B.set(e,t)}function Nt(e,t){return Fe(e)||typeof e==`number`||typeof e==`string`&&!mt(t)}function Pt(e,t,n,r){let i=[];if(Nt(e,t))i.push(we(e,mt(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=ht(e,t,r),o=a.length;P(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?jt:Mt;B.has(r)||s(r);let c=B.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...Me(c,{...t,transition:l},{}))}}return i}function Ft(e,t,n){let r=[];return wt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=I(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:fe}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Pt(n,e,t))}),r}function It(e){return Array.isArray(e)&&e.some(Array.isArray)}function Lt(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),It(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Ft(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Pt(e,i,{...c,...r},t)}let l=new et(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{F(t.animations,l)})),l}return i}var Rt=Lt();function zt(){let e=R(pt);return ue(e.mount,[]),e}var Bt=12;function Vt(e,t){let n=e.slice(0,Bt).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 Ht({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=Vt(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 Ut=3e3,Wt=3e5,Gt=`Failed to start your assistant. Please try again.`,Kt=`Your assistant is taking longer than expected. Please try again.`,qt=e=>new Promise(t=>setTimeout(t,e));function Jt(){let[e,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(null),[a,o]=(0,G.useState)(null),s=(0,G.useRef)(!1),c=(0,G.useRef)([]),l=(0,G.useRef)(null),u=(0,G.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,G.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,G.useCallback)(()=>{if(s.current)return;s.current=!0;let e=Date.now(),n=()=>Date.now()-e>=Wt;(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,Gt));return}}}catch(e){t(e,{context:`research_background_hatch`})}let r;for(;!r;){if(n()){d(Kt);return}try{let t=await ie(e);e&&!t.ok&&t.status===404&&(e=void 0,t=await ie());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 qt(Ut)}for(;;){try{if((await M(r)).ok)break}catch{}if(n()){d(Kt);return}await qt(Ut)}u(r)})()},[d,u]),ready:e,assistantId:r,error:a,awaitReady:(0,G.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 Yt(e,n){try{await w({path:{assistant_id:e,id:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_archive`})}}var Xt=[`admin-copilot`],Zt=[{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 Qt(e){return` ${e.toLowerCase().replace(/[^a-z0-9]+/g,` `).trim()} `}function $t(e,t){return e.includes(` ${t} `)}function en(e){let t=Qt(e),n=[];for(let{plugin:e,keywords:r}of Zt)r.some(e=>$t(t,e))&&n.push(e);return n}function tn(e,t){let n=[...Xt,...en(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 nn=1500,rn=12e4,an=2;function on({complete:e,stableReads:t}){return e&&t>=an}function sn({sawCompletePayload:e}){return e?`done`:`error`}function cn({sawCompletePayload:e}){return e}var ln=`vellum-ai`,un=new Set([`simple-memory`,`level-up`]);function dn(e){let t=e.trim().split(/(?<=\.)\s/)[0]?.trim()??e.trim();return t.length>100?`${t.slice(0,97).trimEnd()}…`:t}function fn(e){return e?.split(`/`)[0]?.trim()??``}function pn(e){let t=[],n=new Set;for(let r of e){let e=r.name?.trim(),i=r.description?.trim();!e||!i||fn(r.source?.repo)===ln&&(un.has(e)||(n.add(e),t.push({name:e,description:dn(i)})))}return{capabilities:t,validNames:n}}async function mn(e){try{return pn((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 hn(e,n){try{await C({path:{assistant_id:e},body:{name:n},throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_install`})}}var gn=e=>new Promise(t=>setTimeout(t,e));function _n({role:e,validNames:t,modelPlugins:n}){return[...new Set([...tn(e,t),...n.filter(e=>t.has(e))])]}function vn(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 yn(){let[e,n]=(0,G.useState)({status:`idle`,claims:[],suggestions:[],installedPlugins:[],pluginCatalog:{}}),r=(0,G.useRef)(0),i=(0,G.useRef)(null),a=(0,G.useRef)(new Map),o=(0,G.useRef)(Promise.resolve()),c=s(),l=(0,G.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 mn(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=tn(s.occupation,p);for(let e of v)_.has(e)||_.set(e,hn(t,e));v.length>0&&n(e=>({...e,installedPlugins:v}));let y=async e=>{let n={conversationId:e,content:Ht(s,c,{includeSuggestions:f}),sourceChannel:`vellum`,interface:`web`,clientOs:N(),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()+rn,w=``,E=0;for(;Date.now()<C;){if(await gn(nn),h())return;let e=await D({path:{assistant_id:t},query:{conversationId:x},throwOnError:!1});if(h())return;let r=vn(e.data?.messages??[]);if(r){let{claims:e,suggestions:i,plugins:a,pluginsResolved:c,complete:l}=We(r),u=a.filter(e=>p.has(e));for(let e of u)_.has(e)||_.set(e,hn(t,e));if(c&&g(),n({status:`running`,claims:e,suggestions:i,installedPlugins:_n({role:s.occupation,validNames:p,modelPlugins:u}),pluginCatalog:m}),l&&(o=!0),E=r===w?E+1:0,w=r,on({complete:l,stableReads:E}))break}}if(h())return;n(e=>({...e,status:sn({sawCompletePayload:o})}))}catch(e){if(h())return;t(e,{context:`research_onboarding_runner`}),n(e=>({...e,status:`error`}))}finally{g(),cn({sawCompletePayload:o})&&r&&i&&(await Yt(r,i),Le(c,r))}})()},[c]),u=(0,G.useCallback)(async()=>{await o.current,await Promise.all([...a.current.values()])},[]),d=(0,G.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 hn(await t(),r)}catch{}})())}},[]);return{...e,start:l,awaitPluginInstalls:u,hydrate:d}}function bn({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 xn({assistantId:e,conversationId:n,removedClaims:r,rejectedAll:i}){let a=bn({removedClaims:r,rejectedAll:i});if(a){try{let t={conversationId:n,content:a,sourceChannel:`vellum`,interface:`web`,clientOs:N(),clientMessageId:crypto.randomUUID()};await T({path:{assistant_id:e},body:t,throwOnError:!1})}catch(e){t(e,{context:`research_onboarding_correction`})}await Yt(e,n)}}var Sn={companionCoworker:`companion-coworker`,genzBoomer:`genz-boomer`,executeCollaborate:`execute-collaborate`,playfulSerious:`playful-serious`,politeUnfiltered:`polite-unfiltered`},Cn=1500,wn=12e4,Tn=2,En=e=>new Promise(t=>setTimeout(t,e)),Dn=e=>Math.max(0,Math.min(100,Math.round(e)));function On(e,t){let n=t=>Dn(e[t]??50),r=n(Sn.companionCoworker),i=n(Sn.executeCollaborate),a=n(Sn.playfulSerious),o=n(Sn.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(Sn.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 kn(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 An({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:On(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()+wn,c=``,l=0;for(;Date.now()<s;){await En(Cn);let e=kn((await D({path:{assistant_id:i},query:{conversationId:a},throwOnError:!1})).data?.messages??[]);if(e&&(l=e===c?l+1:0,c=e,l>=Tn))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 jn(e){return e?`research_onboarding:${e}`:null}function Mn(e){let t=jn(e);if(!t)return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch{return null}}function Nn(e,t){let n=jn(e);if(n)try{localStorage.setItem(n,JSON.stringify(t))}catch{}}function Pn(e){let t=jn(e);if(t)try{localStorage.removeItem(t)}catch{}}function Fn(e){return e.research?.status===`done`?`suggestions`:e.step===`meeting`?e.checkinBooked?`looking`:`letschat`:e.step}function In(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 K=c(),Ln={w:1280,h:800};function Rn(){return typeof window>`u`?Ln:{w:window.innerWidth,h:window.innerHeight}}function zn(){let[e,t]=(0,G.useState)(null),[n,r]=(0,G.useState)(()=>Rn());return(0,G.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 Bn=(0,G.createContext)(null);function Vn({size:e,children:t}){return(0,K.jsx)(Bn.Provider,{value:e,children:t})}function Hn(){let e=(0,G.useContext)(Bn),[t,n]=(0,G.useState)(()=>Rn());return(0,G.useEffect)(()=>{if(e)return;let t=()=>n(Rn());return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t)},[e]),e??t}var Un={x:.5,y:.4},Wn=[-8,6,9,0,7,-6,5,0,-7,4,-5,6];function Gn(e){return Wn[e%Wn.length]??0}var Kn=[1,0,1,0,1,0,1,0,1,0,0],qn=[.72,1],Jn=[.4,1],Yn=[10,20],Xn=50;function Zn(e){return qn[Kn[e]??1]??1}function Qn(e){return Jn[Kn[e]??1]??1}function $n(e){return Yn[Kn[e]??1]??20}function er(e,t){return Math.round(Math.max(130,Math.min(Math.min(e,t)*.4,420)))}function tr(e,t){return Math.round(Math.max(110,Math.min(Math.min(e,t)*.21,205)))}function nr(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 rr(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 ir({components:e,characters:t,centerChar:n,edgeOrder:r,entering:i,exiting:a,onEnterComplete:o,onSelectChar:s}){let{w:c,h:l}=Hn(),u=H(),d=c<640,f=new Set([4,7,8,9,10]),p=e=>d&&f.has(e),m=er(c,l),h=m/2,g=m/2,_=tr(c,l)/m,y=tr(c,l),b=(0,G.useMemo)(()=>{let e=new Map;return r.forEach((t,n)=>e.set(t,n)),e},[r]),x=Un.x*c,S=Un.y*l,C=x-h,w=S-h,T=(0,G.useMemo)(()=>nr(c,l,g),[c,l,g]);return(0,K.jsxs)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-0 overflow-hidden`,children:[(0,K.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=rr(n,x,S,c,l),s=Zn(i.fromSlot),u=Qn(i.fromSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:Xn},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,K.jsx)(v,{components:e,traits:t,size:m})},r)}if(g){if(p(a.toSlot))return null;let n=T[a.toSlot],i=rr(n,x,S,c,l),o=Zn(a.toSlot),s=Qn(a.toSlot);return(0,K.jsx)(V.div,{className:`absolute left-0 top-0`,style:{width:m,height:m,zIndex:$n(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,K.jsx)(`div`,{style:{transform:`rotate(${Gn(a.toSlot)}deg)`},children:(0,K.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,K.jsx)(V.div,{className:`absolute left-0 top-0 ${d?``:`pointer-events-auto cursor-pointer`}`,style:{width:m,height:m,zIndex:d?Xn:$n(y)},initial:!1,animate:{x:E.x-h,y:E.y-h,scale:d?_:Zn(y),opacity:d?1:Qn(y)},transition:u?{duration:0}:{type:`spring`,stiffness:230,damping:26},onClick:d?void 0:()=>s(r),children:(0,K.jsx)(`div`,{style:{transform:d?void 0:`rotate(${Gn(b.get(r)??0)}deg)`},children:(0,K.jsx)(v,{components:e,traits:t,size:m,breathe:d})})},r)})]})}var ar=[{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`}],q=p(f((e,t)=>({characters:[],selectedIndex:0,ensureGenerated:()=>{t().characters.length>0||e({characters:ar,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 or(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function sr(){let e=W(),t=q.use.characters(),n=q.use.ensureGenerated(),r=H(),{w:i,h:a}=or();(0,G.useEffect)(()=>{e&&n(e)},[e,n]);let o=er(i,a),s=(0,G.useMemo)(()=>nr(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,K.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=Wn[i%Wn.length]??0,d=o*Zn(i),f=Qn(i),p=$n(i);return(0,K.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,K.jsx)(`div`,{style:{opacity:f,transform:`rotate(${u}deg)`},children:(0,K.jsx)(v,{components:e,traits:t,size:d,breathe:!1})})},n)})})}var cr=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)]`),lr=l(`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)]`,`placeholder:text-[var(--content-tertiary)] outline-none`);function J(e){return e.trim().toLowerCase()}function ur(e,t,n=[],r=8){let i=J(t),a=new Set(n.map(J)),o=[];for(let t of e)if(!a.has(J(t))&&((i.length===0||J(t).includes(i))&&o.push(t),o.length>=r))break;return o}function dr({id:e,options:t,highlighted:n,showAddHint:r,onPick:i,onHover:a}){return(0,K.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,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Ue,{size:15,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`Add “`,t.value,`”`]}),(0,K.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,K.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 fr({htmlFor:e,required:t,children:n}){return(0,K.jsxs)(`label`,{htmlFor:e,className:`text-body-small-default text-[var(--content-secondary)]`,children:[n,t?(0,K.jsx)(`span`,{"aria-hidden":!0,className:`text-[var(--system-negative-strong)]`,children:` *`}):null]})}function pr(e,t){(0,G.useEffect)(()=>{function n(n){e.current&&!e.current.contains(n.target)&&t()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e,t])}function mr({label:e,placeholder:t,values:n,onChange:r,suggestions:i}){let a=(0,G.useId)(),o=`tac-${a}`,s=`tac-list-${a}`,c=(0,G.useRef)(null),[d,f]=(0,G.useState)(``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(-1),_=(0,G.useMemo)(()=>ur(i,d,n),[i,d,n]),v=d.trim(),y=(0,G.useMemo)(()=>{if(!v)return!1;let e=J(v);return!(n.some(t=>J(t)===e)||_.some(t=>J(t)===e))},[v,n,_]),b=(0,G.useMemo)(()=>{let e=_.map(e=>({value:e,isAdd:!1}));return y?[...e,{value:v,isAdd:!0}]:e},[_,y,v]);pr(c,()=>m(!1)),(0,G.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=>J(e)===J(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,K.jsxs)(`div`,{ref:c,className:`relative flex flex-col gap-1.5`,children:[(0,K.jsx)(fr,{htmlFor:o,children:e}),(0,K.jsxs)(`div`,{className:l(cr,`min-h-9 flex-wrap py-1.5`),children:[(0,K.jsx)(Re,{size:16,"aria-hidden":!0,className:`shrink-0 self-center text-[var(--content-tertiary)]`}),n.map(e=>(0,K.jsx)(u,{onRemove:()=>w(e),removeLabel:`Remove ${e}`,className:`border border-[var(--border-base)] bg-[var(--surface-base)]`,children:e},e)),(0,K.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(lr,`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,K.jsx)(dr,{id:s,options:b,highlighted:h,showAddHint:S,onPick:C,onHover:g})]})}var hr=`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 Y(e,t){return{animation:`fadeInUp 0.4s ease-out ${e}s both`,...t==null?{}:{position:`relative`,zIndex:t}}}function gr({initialFirstName:e=``,initialLastName:t=``,onSubmit:n}){let[r,a]=(0,G.useState)(e),[o,s]=(0,G.useState)(t),[c,l]=(0,G.useState)(``),[u,f]=(0,G.useState)([]),p=r.trim().length>0&&c.trim().length>0;function m(){p&&n({firstName:r,lastName:o,role:c,hobbies:u})}return(0,K.jsx)(`div`,{"data-theme":`dark`,className:`h-full`,children:(0,K.jsxs)(Ke,{showCreatureFooter:!1,children:[(0,K.jsx)(sr,{}),(0,K.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,K.jsx)(`h1`,{className:`text-center font-serif text-[2.75rem] leading-[1.05] tracking-tight`,style:Y(.05),children:`Let's start with you.`}),(0,K.jsx)(`p`,{className:`mt-3 text-center text-body-medium-lighter text-[var(--content-secondary)]`,style:Y(.12),children:`A few details so I can get to know you.`}),(0,K.jsxs)(`div`,{className:`mt-10 flex w-full flex-col gap-5`,children:[(0,K.jsx)(`div`,{style:Y(.2,40),children:(0,K.jsx)(d,{label:(0,K.jsxs)(K.Fragment,{children:[`What should I call you?`,(0,K.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,K.jsx)(`div`,{style:Y(.27,30),children:(0,K.jsx)(d,{label:`And your last name?`,placeholder:`Your last name (optional)`,value:o,onChange:e=>s(e.target.value),fullWidth:!0})}),(0,K.jsx)(`div`,{style:Y(.34,20),children:(0,K.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,K.jsx)(`div`,{style:Y(.41,10),children:(0,K.jsx)(mr,{label:`Any hobbies?`,placeholder:`Cars, books, growing tomatoes?`,values:u,onChange:f,suggestions:hr})})]}),(0,K.jsx)(`div`,{className:`mt-10 w-full`,style:Y(.5),children:(0,K.jsx)(i,{type:`submit`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),fullWidth:!0,disabled:!p,className:`h-11 text-base`,children:`Continue`})})]})]})})}var _r=`#1A1A1A`,vr=`#FFFFFF`;function yr(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 br(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 xr(e){let t=yr(e)>.6;return{bg:e,isLight:t,fg:t?_r:vr,fgDeep:br(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 X(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex();return(0,G.useMemo)(()=>{let r=t[n],i=e?.colors.find(e=>e.id===r?.color)?.hex;return xr(i??`var(--surface-base)`)},[e,t,n])}function Z({onBack:e,onNext:t,tone:n}){let r=X(),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,K.jsxs)(`div`,{className:`absolute left-4 top-6 z-10 flex items-center gap-3`,children:[(0,K.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,K.jsx)(h,{className:`h-5 w-5`})}),t?(0,K.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,K.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=W(),a=q.use.characters(),o=q.use.ensureGenerated(),s=q.use.selectedIndex(),c=q.use.setSelectedIndex();(0,G.useEffect)(()=>{r&&o(r)},[r,o]);let l=a.length,[u,d]=(0,G.useState)(null),[f,p]=(0,G.useState)(``),[h,g]=(0,G.useState)(!1),v=(0,G.useRef)(!1),y=(0,G.useRef)(null),{ref:x,size:S}=zn(),[C,w]=(0,G.useState)(null);(0,G.useEffect)(()=>{l>0&&u===null&&d(Cr(l,s))},[l,s,u]),(0,G.useEffect)(()=>{u&&c(u.centerChar)},[u,c]);let T=u?.centerChar;(0,G.useEffect)(()=>{T!=null&&!v.current&&p(Sr[T%Sr.length])},[T]),(0,G.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,G.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,K.jsx)(`div`,{ref:x,"data-theme":`dark`,className:`relative h-full overflow-hidden bg-[var(--surface-base)] text-[var(--content-default)]`,children:(0,K.jsxs)(Vn,{size:S,children:[O&&(0,K.jsx)(ir,{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,K.jsx)(Z,{tone:`light`,onBack:t,onNext:n?k:void 0}),(0,K.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,K.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,K.jsx)(m,{className:`h-4 w-4`})}),(0,K.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,K.jsx)(U,{className:`h-4 w-4`})}),(0,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),"aria-label":`Edit name`,className:`flex cursor-pointer items-center gap-2.5`,children:[(0,K.jsx)(`span`,{className:`text-3xl font-medium ${f?`text-[var(--content-default)]`:`text-[var(--content-tertiary)]`}`,children:f||`Name your assistant`}),(0,K.jsx)(b,{className:`h-5 w-5 text-[var(--content-tertiary)]`})]}),(0,K.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,K.jsx)(_,{className:`h-5 w-5`})})]}),(0,K.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{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=W(),a=q.use.characters(),o=q.use.selectedIndex(),s=H(),{w:c,h:l}=Hn(),[u,d]=(0,G.useState)({x:0,y:0});(0,G.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=zt();(0,G.useEffect)(()=>{n>0&&!s&&p.start({y:[0,-34,8,0],transition:{duration:.45,ease:`easeOut`}})},[n,s,p]);let[m,h]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!e);(0,G.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,G.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,K.jsx)(V.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,K.jsx)(V.div,{animate:p,children:(0,K.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,K.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,K.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,K.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=W(),s=q.use.characters(),c=q.use.selectedIndex(),l=H(),{ref:u,size:{w:d,h:f}}=zn(),p=X(),m=s.length>0?s[c]:void 0,h=(0,G.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,K.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,K.jsx)(`div`,{ref:u,"data-theme":`dark`,className:`relative h-full overflow-hidden`,style:{backgroundColor:`var(--surface-base)`},children:(0,K.jsxs)(Vn,{size:{w:d,h:f},children:[(0,K.jsx)(V.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,K.jsx)(V.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,K.jsx)(`path`,{d:h.body.svgPath,fill:h.color})}),(0,K.jsx)(Lr,{entrance:!0}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0},animate:{opacity:1},transition:l?{duration:0}:{duration:.4,delay:1},children:(0,K.jsx)(Z,{onBack:r,onNext:a})}),(0,K.jsxs)(`div`,{className:Tr,children:[(0,K.jsxs)(V.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,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fgDeep},children:g}),(0,K.jsx)(`span`,{className:`block text-[clamp(2.5rem,6vw,5rem)]`,style:{color:p.fg},children:_})]}),(0,K.jsx)(V.div,{initial:l?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:l?{duration:0}:{duration:.4,delay:1.15},children:(0,K.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{size:16}),onClick:n,className:`h-11 w-[234px] text-base`,children:`Continue`})})]})]})})}var Vr=.3,Hr=.85,Ur=.25;function Wr(){let e=W(),t=q.use.characters(),n=q.use.selectedIndex(),r=t.length>0?t[n]:void 0,{w:i,h:a}=Hn(),o=(0,G.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=st(i,e=>e-n/2),u=e.bbox.x+e.bbox.w/2,d=e.bbox.y+e.bbox.h/2;return(0,K.jsx)(V.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,K.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,K.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,K.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,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,initial:!1,animate:{height:o?t:e},transition:l?{duration:0}:{duration:.5,ease:`easeInOut`},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:e},children:(0,K.jsx)(V.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,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:t},children:(0,K.jsx)(`span`,{className:`block`,children:i})})]})})}function ai({onContinue:e,onBack:t,onForward:n}){let r=X(),a=H(),{art:o,eyesW:s,eyesH:c,restCy:l,centerX:u,w:d,h:f}=Wr(),p=W(),m=q.use.characters(),h=q.use.selectedIndex(),g=m.length>0?m[h]:void 0,_=f>0&&f<=800,y=_?.17:.22,b=_?`top-[17%]`:`top-[22%]`,x=it(0),S=it(1),C=(0,G.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=it(-220),ee=(0,G.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=it(-320),[ne,M]=(0,G.useState)(!!a),[re,ie]=(0,G.useState)(!!a),[ae,N]=(0,G.useState)(!1),[oe,se]=(0,G.useState)(!1),[ce,le]=(0,G.useState)(!1),[ue,de]=(0,G.useState)(!1),[fe,pe]=(0,G.useState)(!!a),me=Math.min(d,768)-48,P=(0,G.useRef)(null),he=(0,G.useRef)(null),ge=(0,G.useRef)(null),_e=(0,G.useRef)(null),ve=(0,G.useRef)(null),[ye,F]=(0,G.useState)(0),[I,L]=(0,G.useState)(0),[R,be]=(0,G.useState)(0),[z,xe]=(0,G.useState)(0),[B,Se]=(0,G.useState)(0);return(0,G.useLayoutEffect)(()=>{P.current?.offsetHeight&&F(P.current.offsetHeight),he.current?.offsetHeight&&L(he.current.offsetHeight),ge.current?.offsetHeight&&be(ge.current.offsetHeight),_e.current?.offsetHeight&&xe(_e.current.offsetHeight),ve.current?.offsetHeight&&Se(ve.current.offsetHeight)},[me]),(0,G.useEffect)(()=>{x.set(l),de(!0)},[l,x]),(0,G.useEffect)(()=>{if(!a)return;let e=setTimeout(()=>{N(!0),se(!0),le(!0)},1400);return()=>clearTimeout(e)},[a]),(0,G.useEffect)(()=>{if(a||!o)return;x.set(l),S.set(1),D.set(T),j.set(k),M(!1),ie(!1),N(!1),se(!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(Rt(x,e,{duration:.55,ease:`easeOut`})),i(Rt(S,.55,{duration:.55,ease:`easeOut`}))]),r)||(ie(!0),await Promise.all([i(Rt(x,l,{type:`spring`,stiffness:210,damping:15})),i(Rt(S,1,{duration:.45,ease:`easeOut`}))]),r)||(await s(900),r)||(N(!0),se(!0),await i(Rt(D,[T,E,E,T],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`})),r)||(await s(150),r))return;le(!0);let t=i(Rt(j,[k,A,A,k],{duration:1.5,times:[0,.28,.62,1],ease:`easeInOut`}));await s(700),!r&&(pe(!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,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:r.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:n}),(0,K.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:me,fontFamily:`var(--font-serif)`},children:[(0,K.jsx)(`span`,{ref:P,className:`block`,children:Zr}),(0,K.jsx)(`span`,{ref:he,className:`block`,children:Qr}),(0,K.jsx)(`span`,{ref:ge,className:`block`,children:$r}),(0,K.jsx)(`span`,{ref:_e,className:`block`,children:ei}),(0,K.jsx)(`span`,{ref:ve,className:`block`,children:ti})]}),ue&&o&&(0,K.jsx)(Gr,{art:o,eyesW:s,eyesH:c,centerX:u,eyeCy:x,eyeScale:S,blinking:!1}),!a&&p&&(0,K.jsx)(V.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,K.jsx)(v,{components:p,traits:{bodyShape:`blob`,eyeStyle:`goofy`,color:C},size:w,breathe:!1})}),!a&&p&&(0,K.jsx)(V.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,K.jsx)(`div`,{style:{width:O,height:O,marginLeft:t===0?0:-O*.34,zIndex:ni.length-t},children:(0,K.jsx)(v,{components:p,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:ee[t]??`teal`},size:O,breathe:!1})},e.bodyShape))}),(0,K.jsxs)(`div`,{className:`${Tr.replace(`top-[30%]`,b)} max-w-3xl`,children:[(0,K.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,K.jsx)(ii,{firstH:ye,secondH:I,color:r.fgDeep,firstText:Zr,secondText:Qr,revealed:ne,carouseled:ae,revealFrom:`bottom`,revealDuration:.55,reduce:!!a}),(0,K.jsx)(ii,{firstH:R,secondH:z,color:r.fg,firstText:$r,secondText:ei,revealed:re,carouseled:oe,revealFrom:`top`,revealDuration:.45,reduce:!!a}),(0,K.jsx)(V.div,{className:`relative w-full overflow-hidden`,style:{color:r.fg},initial:!1,animate:{height:ce?B:0},transition:a?{duration:0}:{duration:.5,ease:`easeInOut`},children:B>0&&(0,K.jsx)(`div`,{className:`flex items-center justify-center`,style:{height:B},children:(0,K.jsx)(V.span,{className:`block`,initial:!1,animate:{clipPath:ce?`inset(0% 0 0% 0)`:`inset(100% 0 0 0)`},transition:a?{duration:0}:{duration:.5,ease:`easeOut`},children:ti})})})]}),fe&&(0,K.jsx)(V.div,{initial:a?!1:{opacity:0,y:8},animate:{opacity:1,y:0},transition:a?{duration:0}:{duration:.4},children:(0,K.jsx)(i,{type:`button`,variant:`primary`,size:`regular`,rightIcon:(0,K.jsx)(U,{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,K.jsxs)(`svg`,{viewBox:`0 0 100 100`,width:`100%`,height:`100%`,style:{display:`block`,position:`absolute`,inset:0},children:[(0,K.jsxs)(`defs`,{children:[(0,K.jsxs)(`linearGradient`,{id:n,x1:`0.12`,y1:`0.05`,x2:`0.85`,y2:`0.95`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF0AE`}),(0,K.jsx)(`stop`,{offset:`50%`,stopColor:`#F4C231`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#D29B1A`})]}),(0,K.jsxs)(`radialGradient`,{id:t,cx:`42%`,cy:`36%`,r:`82%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFF6CE`}),(0,K.jsx)(`stop`,{offset:`55%`,stopColor:`#F8CB3E`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#EEB52C`})]}),(0,K.jsxs)(`radialGradient`,{id:r,cx:`36%`,cy:`24%`,r:`44%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`0.85`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]}),(0,K.jsxs)(`radialGradient`,{id:i,cx:`50%`,cy:`50%`,r:`50%`,children:[(0,K.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`,stopOpacity:`1`}),(0,K.jsx)(`stop`,{offset:`100%`,stopColor:`#FFFFFF`,stopOpacity:`0`})]})]}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`49`,fill:`url(#${n})`}),(0,K.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,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`url(#${t})`}),(0,K.jsx)(`circle`,{cx:`50`,cy:`50`,r:`40`,fill:`none`,stroke:`#C28F18`,strokeOpacity:`0.35`,strokeWidth:`1.4`}),(0,K.jsxs)(`g`,{fontFamily:`var(--font-sans), system-ui, sans-serif`,fontWeight:900,fontSize:`58`,textAnchor:`middle`,children:[(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#C88E16`,transform:`translate(1.3 1.6)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#FFF6CF`,opacity:`0.7`,transform:`translate(-1.3 -1.5)`,children:`$`}),(0,K.jsx)(`text`,{x:`50`,y:`50`,dy:`0.355em`,fill:`#F4C12A`,children:`$`})]}),(0,K.jsx)(`ellipse`,{cx:`38`,cy:`28`,rx:`22`,ry:`14`,fill:`url(#${r})`}),(0,K.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,K.jsxs)(`div`,{style:{position:`relative`,width:e,height:e},children:[r&&(0,K.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,K.jsx)(`div`,{style:{width:e,height:e,perspective:e*10},children:(0,K.jsxs)(V.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,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(0.5px)`},children:(0,K.jsx)(oi,{idSuffix:`front`})}),(0,K.jsx)(`div`,{style:{position:`absolute`,inset:0,backfaceVisibility:`hidden`,transform:`translateZ(-0.5px) rotateY(180deg)`},children:(0,K.jsx)(oi,{idSuffix:`back`})})]})})]})}var ci=.3,li=.95;function ui({onClaim:e,onBumpEyes:t,onBack:n,onForward:r}){let i=H(),a=X(),{h:o}=Hn(),[s,c]=(0,G.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,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:n,onNext:r}),(0,K.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,K.jsx)(`h1`,{className:`text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here are some free credits to get started`}),(0,K.jsx)(`div`,{className:`mt-8 flex flex-col items-center gap-4`,children:(0,K.jsx)(V.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,K.jsx)(si,{size:88,spinning:s&&!i})})}),!s&&(0,K.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,K.jsx)(U,{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 G.useCallback(mi(...e),e)}function hi(e,t=[]){let n=[];function r(t,r){let i=G.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=G.useMemo(()=>o,Object.values(o));return(0,K.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=G.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=>G.createContext(e));return function(n){let r=n?.[e]||t;return G.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 G.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var _i=globalThis?.document?G.useLayoutEffect:()=>{},vi=G.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=G.useRef(e!==void 0);G.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,G.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]=G.useState(e),i=G.useRef(n),a=G.useRef(t);return vi(()=>{a.current=t},[t]),G.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function xi(e){return typeof e==`function`}var Si=G.createContext(void 0);function Ci(e){let t=G.useContext(Si);return e||t||`ltr`}function wi(e){let t=G.useRef({value:e,previous:e});return G.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]=G.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=G.forwardRef((e,n)=>{let{children:r,...i}=e,a=G.Children.toArray(r),o=a.find(ki);if(o){let e=o.props.children,r=a.map(t=>t===o?G.Children.count(e)>1?G.Children.only(null):G.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:G.isValidElement(e)?G.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Di(e){let t=G.forwardRef((e,t)=>{let{children:n,...r}=e;if(G.isValidElement(n)){let e=ji(n),i=Ai(r,n.props);return n.type!==G.Fragment&&(i.ref=t?mi(t,e):e),G.cloneElement(n,i)}return G.Children.count(n)>1?G.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oi=Symbol(`radix.slottable`);function ki(e){return G.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=G.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ni(e){let t=Pi(e),n=G.forwardRef((e,n)=>{let{children:r,...i}=e,a=G.Children.toArray(r),o=a.find(Ii);if(o){let e=o.props.children,r=a.map(t=>t===o?G.Children.count(e)>1?G.Children.only(null):G.isValidElement(e)?e.props.children:null:t);return(0,K.jsx)(t,{...i,ref:n,children:G.isValidElement(e)?G.cloneElement(e,void 0,r):null})}return(0,K.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Pi(e){let t=G.forwardRef((e,t)=>{let{children:n,...r}=e;if(G.isValidElement(n)){let e=Ri(n),i=Li(r,n.props);return n.type!==G.Fragment&&(i.ref=t?mi(t,e):e),G.cloneElement(n,i)}return G.Children.count(n)>1?G.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fi=Symbol(`radix.slottable`);function Ii(e){return G.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=G.useRef(null),a=G.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Ni(s),l=G.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,K.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=G.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=G.useRef(null),s=Q(t,o),c=a(u,n);return G.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,K.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return G.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=G.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=G.useRef(new Set),_=G.useRef(0),v=o===`horizontal`?ea:ta,[y=[],b]=yi({prop:u,defaultProp:l,onChange:e=>{[...g.current][_.current]?.focus(),d(e)}}),x=G.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,K.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,K.jsx)(Wi.Provider,{scope:e.__scopeSlider,children:(0,K.jsx)(Wi.Slot,{scope:e.__scopeSlider,children:(0,K.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=G.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,[d,f]=G.useState(null),p=Q(t,e=>f(e)),m=G.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,K.jsx)(Qi,{scope:e.__scopeSlider,startEdge:_?`left`:`right`,endEdge:_?`right`:`left`,direction:_?1:-1,size:`width`,children:(0,K.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=G.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,u=G.useRef(null),d=Q(t,u),f=G.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,K.jsx)(Qi,{scope:e.__scopeSlider,startEdge:p?`bottom`:`top`,endEdge:p?`top`:`bottom`,size:`height`,direction:p?1:-1,children:(0,K.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=G.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,K.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=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Xi(ra,n);return(0,K.jsx)(Mi.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});ia.displayName=ra;var aa=`SliderRange`,oa=G.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=Xi(aa,n),a=$i(aa,n),o=Q(t,G.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,K.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=G.forwardRef((e,t)=>{let n=Gi(e.__scopeSlider),[r,i]=G.useState(null),a=Q(t,e=>i(e)),o=G.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,K.jsx)(la,{...e,ref:a,index:o})}),la=G.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=Xi(sa,n),s=$i(sa,n),[c,l]=G.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 G.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,K.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${m}% + ${_}px)`},children:[(0,K.jsx)(Wi.ItemSlot,{scope:e.__scopeSlider,children:(0,K.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,K.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=G.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=G.useRef(null),a=Q(i,r),o=wi(t);return G.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,K.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;qe();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,G.useState)(()=>typeof window>`u`?1280:window.innerWidth);return(0,G.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,K.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,K.jsx)(v,{components:e,traits:t,size:i,breathe:!1})})}function Fa({axis:e,value:t,onValueChange:n,fg:r,disabled:i}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1.5 sm:flex-nowrap`,children:[(0,K.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,K.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,K.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,K.jsx)(Ca,{className:`relative h-3 w-full grow rounded-full`,style:{backgroundColor:ka}}),(0,K.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,K.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,K.jsxs)(`div`,{children:[(0,K.jsx)(Pa,{components:e,traits:u.left,side:`left`,top:l,size:r,progress:s}),(0,K.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=X(),s=W(),c=Na(),l=c>=Ta,u=q.use.characters()[q.use.selectedIndex()]?.color,d=Math.round(Math.min(300,Math.max(160,c*.16))),f=(0,G.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,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),l&&s&&(0,K.jsx)(Ia,{components:s,values:e,sideAvatars:f,size:d}),(0,K.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,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,K.jsx)(`h1`,{className:`text-center text-[2.6rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Create my personality`}),n?(0,K.jsx)(`p`,{className:`text-center text-[15px]`,style:{color:o.fgMuted},children:`Personality locked — chat with your assistant to make any more updates`}):(0,K.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,K.jsx)(`div`,{className:`flex w-full flex-col gap-8 sm:gap-11`,style:{opacity:n?.7:1},children:Ea.map(r=>(0,K.jsx)(Fa,{axis:r,value:e[r.id]??Oa,onValueChange:e=>t(r.id,e),fg:o.fg,disabled:n},r.id))}),(0,K.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,K.jsx)(U,{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=X(),{handleConnect:l,oauthInProgress:u}=Ge({assistantId:e??``,onConnect:n}),d=()=>{s?.(),l()},f=!e||!t,p=f||u;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:c.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.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,K.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,K.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,K.jsxs)(`div`,{className:`mt-6 flex w-[234px] flex-col items-center gap-4`,children:[(0,K.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Starting assistant…`]}):u?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization…`]}):o?`Try again`:`Connect Calendar →`}),(0,K.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=xr(`#17191C`);function Ba(){let[e,t]=(0,G.useState)(()=>({w:typeof window>`u`?1280:window.innerWidth,h:typeof window>`u`?800:window.innerHeight}));return(0,G.useEffect)(()=>{let e=()=>t({w:window.innerWidth,h:window.innerHeight});return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function Va(){let e=W(),t=q.use.characters(),n=q.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,K.jsx)(`div`,{style:{width:e,height:e}}):(0,K.jsx)(`div`,{className:`shrink-0`,style:{width:e,height:e},children:(0,K.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=H(),{w:c,h:l}=Ba(),u=r?`Check-in scheduled for tomorrow at ${r}!`:`Check-in scheduled!`;(0,G.useEffect)(()=>{let t=setTimeout(e,i&&!r?Ga:Wa);return()=>clearTimeout(t)},[e,i,r]);let d=(0,G.useRef)(null),[f,p]=(0,G.useState)(null);(0,G.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,K.jsxs)(`div`,{className:`absolute inset-0 z-10 overflow-hidden text-white`,children:[(0,K.jsx)(Z,{onBack:t,onNext:n,tone:`light`}),(0,K.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,K.jsx)(`div`,{ref:d,className:`relative shrink-0`,style:{width:Ua,height:Ua},children:a&&o&&f&&(0,K.jsx)(V.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,K.jsx)(v,{components:a,traits:o,size:Ua})})}),(0,K.jsx)(V.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=2800;function Za({onDone:e,onBack:t,onAdvance:n,onForward:r,ready:i,applyingPersonality:a=!1}){let o=za,[s,c]=(0,G.useState)(0),l=(0,G.useMemo)(()=>{let e=[...qa];return a&&e.push(...Ja),e.push(Ya),e},[a]);return(0,G.useEffect)(()=>{n?.(s);let t=s>=l.length-1;if(i&&t){let t=setTimeout(e,Xa);return()=>clearTimeout(t)}let r=setTimeout(()=>c(e=>(e+1)%l.length),Xa);return()=>clearTimeout(r)},[s,i,e,n,l.length]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:t,onNext:r}),(0,K.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,K.jsx)(Ha,{isStreaming:!0}),(0,K.jsx)(Ie,{mode:`wait`,children:(0,K.jsx)(V.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:l[s]},s)})]})]})}function Qa({claims:e,loading:t,onContinue:n,onRejectAll:r,onBack:i,onForward:a}){let o=za,s=H(),[c,l]=(0,G.useState)(()=>new Set),u=e.filter(e=>!c.has(e.claim)),d=u.length>0,f=!t;return(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:o.fg},children:[(0,K.jsx)(Z,{onBack:i,onNext:a}),(0,K.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,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(Ha,{}),(0,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`This is what I found about you`})]}),(0,K.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,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:(0,K.jsx)(Ie,{children:u.map(e=>(0,K.jsxs)(V.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,K.jsx)(`span`,{children:e.claim}),(0,K.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,K.jsx)(x,{className:`h-4 w-4`})})]},e.claim))})}),d&&f&&(0,K.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,K.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,K.jsx)(U,{className:`h-4 w-4`})]})]})]})}var $a=[{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 eo({label:e,tone:t}){return(0,K.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 to(e,t){return e.map((n,r)=>{let i=``;return r>0&&(i=r===e.length-1?e.length===2?` and `:`, and `:`, `),(0,K.jsxs)(G.Fragment,{children:[i,(0,K.jsx)(eo,{label:n,tone:t})]},n)})}var $=64,no=$;function ro({pluginLabels:e,tone:t,pillTone:n,reduce:r,slotRef:i,revealed:a}){let o=e.length>1;return(0,K.jsxs)(`div`,{className:`mt-12 flex items-center gap-3`,children:[(0,K.jsx)(`div`,{ref:i,className:`shrink-0`,style:{width:no,height:no}}),(0,K.jsxs)(V.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 `,to(e,n),` plugin`,o?`s`:``,` `,`to help with your work`]})]})}function io({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,K.jsx)(V.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,K.jsx)(v,{components:a,traits:o,size:$})})}function ao({suggestions:e,loading:t,installedPlugins:n=[],onSuggestionClick:r,onSkip:i,onBack:a,onForward:o}){let s=za,c=X(),l=H(),u=e.length>0?e:t?[]:$a,d=n.map(Je).filter(e=>e.length>0),f=d.length>0,p=(0,G.useRef)(null),m=(0,G.useRef)(null),h=(0,G.useRef)(null),[g,_]=(0,G.useState)(null),[v,y]=(0,G.useState)(!1),[b,x]=(0,G.useState)(!1);(0,G.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,G.useEffect)(()=>{!f||S===void 0||v||y(!0)},[f,S,v]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:s.fg},children:[(0,K.jsx)(Z,{onBack:a,onNext:o}),(0,K.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,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(V.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,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`Here’s what we could do first`})]}),(0,K.jsx)(`p`,{className:`mb-7 mt-2 text-[15px]`,style:{color:s.fgMuted},children:u.length>0?(0,K.jsxs)(K.Fragment,{children:[`Pick one to jump in — or start your own thing.`,` `,(0,K.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,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:u.map((e,t)=>(0,K.jsx)(V.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,K.jsx)(`span`,{children:e.suggestion})},`${t}-${e.suggestion}`))}),f&&(0,K.jsx)(ro,{pluginLabels:d,tone:s,pillTone:c,reduce:l,slotRef:h,revealed:b}),g&&(0,K.jsx)(io,{head:g.head,note:g.note,flyToNote:v&&f&&g.note!==void 0,reduce:l,onLanded:()=>x(!0)})]})]})}function oo({installedPlugins:e=[],pluginCatalog:t={},onStart:n,onBack:r,onForward:i}){let a=za,o=H(),[s,c]=(0,G.useState)(!1),l=e.map(e=>({name:e,displayName:Je(e),description:t[e]?.trim()??``})).filter(e=>e.displayName.length>0),u=l.length>0,d=(0,G.useRef)(null),f=(0,G.useRef)(null),p=(0,G.useRef)(null),[m,h]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(!1);(0,G.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,G.useEffect)(()=>{b===void 0||g||_(!0)},[b,g]),(0,K.jsxs)(`div`,{className:`absolute inset-0 z-10`,style:{color:a.fg},children:[(0,K.jsx)(Z,{onBack:r,onNext:i}),(0,K.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,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(V.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,K.jsx)(`h1`,{className:`text-[2.2rem] leading-none`,style:{fontFamily:`var(--font-serif)`},children:`You’re all set`})]}),u&&(0,K.jsx)(`div`,{className:`mt-4 flex flex-col gap-3`,children:l.map((e,t)=>(0,K.jsxs)(V.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,K.jsx)(`div`,{className:`text-[15px] font-medium`,children:e.displayName}),e.description&&(0,K.jsx)(`div`,{className:`mt-1 text-[13px] leading-snug`,style:{color:a.fgMuted},children:e.description})]},e.name))}),(0,K.jsxs)(`div`,{className:`mt-16 flex items-center gap-3`,children:[(0,K.jsx)(`div`,{ref:p,className:`shrink-0`,style:{width:no}}),(0,K.jsx)(V.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,K.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,K.jsx)(U,{className:`h-4 w-4`})]}),m&&(0,K.jsx)(io,{head:m.head,note:m.note,flyToNote:g&&m.note!==void 0,reduce:o,onLanded:()=>y(!0)})]})]})}var so=[{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})}],co=`#17191C`,lo=[{bodyShape:`blob`,eyeStyle:`gentle`},{bodyShape:`urchin`,eyeStyle:`curious`},{bodyShape:`star`,eyeStyle:`goofy`}],uo=290;function fo({peekLevel:e=0,eyesBumpNonce:t=0,darkBg:n=!1,showBottomEyes:r=!0,showTopTeam:i=!1}){let a=W(),o=q.use.characters(),s=q.use.selectedIndex(),c=H(),{w:l}=Hn(),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,G.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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(V.div,{className:`absolute inset-0 z-0`,initial:!1,animate:{backgroundColor:n?co:p},transition:c?{duration:0}:{duration:1,ease:`easeInOut`}}),r&&(0,K.jsx)(Lr,{bumpNonce:t,settleBlink:!1}),i&&a&&(0,K.jsx)(`div`,{className:`pointer-events-none absolute right-0 z-[1] flex items-start`,style:{top:-Math.round(uo*u)*.42,right:-Math.round(uo*u)*.12},children:lo.map((e,t)=>{let n=Math.round(uo*u);return(0,K.jsx)(V.div,{style:{width:n,height:n,marginLeft:t===0?0:-n*.34,zIndex:lo.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,K.jsx)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[t]??`teal`},size:n,breathe:!1})},e.bodyShape)})}),a&&(0,K.jsx)(Ie,{children:(d?so.filter(e=>e.mobile):so).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,K.jsx)(V.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,K.jsx)(v,{components:a,traits:{bodyShape:e.bodyShape,eyeStyle:e.eyeStyle,color:m[e.colorIdx]??`teal`},size:n,breathe:!1})},`peek-${t}`)})})]})}var po=`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 mo(e){return{firstName:e.firstName,lastName:e.lastName,occupation:e.role,hobby:e.hobbies.join(`, `)}}function ho(e){let t=e.firstName.trim();return t?`Getting to know ${t}`:`Getting to know you`}qe();function go(){let e=a(),t=j.use.user(),n=t?.id??null,r=Ve.use.enterFocus(),i=Ve.use.exitFocus(),s=Ve.use.setPendingAvatarTraits(),c=Ve.use.requestSidebarCollapse(),l=oe.use.researchOnboarding(),u=oe.use.personalityOnboarding(),d=oe.use.hydrated(),[f,p]=(0,G.useState)(`form`),{ref:m,size:h}=zn(),[g,_]=(0,G.useState)([]),[v,y]=(0,G.useState)(!1);function b(e){p(e)}function x(e,t=`completed`){ze(Be[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,G.useState)(null),[D,ee]=(0,G.useState)(null),[O,k]=(0,G.useState)({}),[A,ne]=(0,G.useState)(!1),[M,re]=(0,G.useState)(null),[ie,N]=(0,G.useState)(null),[le,ue]=(0,G.useState)(!1),[de,fe]=(0,G.useState)(!1),[pe,me]=(0,G.useState)(!1),[P,he]=(0,G.useState)(0),[ge,_e]=(0,G.useState)(0),{start:ve,ready:ye,assistantId:F,awaitReady:I}=Jt(),L=yn(),{start:R,hydrate:be}=L,z=(0,G.useRef)(Promise.resolve()),xe=(0,G.useRef)(Promise.resolve()),[B,Se]=(0,G.useState)(!1),Ce=L.status===`idle`||L.status===`running`,we=!Ce&&L.claims.length===0;(0,G.useEffect)(()=>{i(),s(null),l&&d&&ve()},[i,s,ve,l,d]),(0,G.useLayoutEffect)(()=>{if(v||!n)return;let e=Mn(n);e?.formValues&&(E(e.formValues),ee(e.faceValues),N(e.checkinTime),fe(e.checkinBooked),re(e.researchConversationId??null),e.research&&be({...e.research,pluginCatalog:e.research.pluginCatalog??{}},I),p(Fn(e)),_([])),y(!0)},[v,n,be,I]),(0,G.useEffect)(()=>{!v||!T||Nn(n,{step:f,formValues:T,faceValues:D,checkinTime:ie,checkinBooked:de,research:L.status===`done`?{status:`done`,claims:L.claims,suggestions:L.suggestions,installedPlugins:L.installedPlugins,pluginCatalog:L.pluginCatalog}:null,...M?{researchConversationId:M}:{}})},[v,n,f,T,D,ie,de,M,L.status,L.claims,L.suggestions,L.installedPlugins,L.pluginCatalog]),(0,G.useEffect)(()=>{!v||!l||!d||!T||L.status!==`idle`||R({awaitAssistantId:I,subject:mo(T),conversationTitle:ho(T),...M?{resumeConversationId:M}:{},onConversationCreated:re,includeSuggestions:!u})},[v,l,d,T,M,L.status,R,I,u]),(0,G.useEffect)(()=>{f===`results`&&we&&(_([]),p(`suggestions`))},[f,we]);function Te(t,i,a,{skip:o=!1,hidden:l=!1}={}){Pn(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;ce({tools:[],tasks:[],tone:Ye,...m?{userName:m}:{},...f.trim()?{occupation:f.trim()}:{},...o?{}:{initialMessage:a??Ht({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();_&&se(_),s(i?.traits??null),g&&r(),o||te.markExpectingFirstMessage(),c(),te.checkAssistant(F??void 0).finally(()=>{e(`${ae.assistant}?onboarding=1`,{replace:!0})})}function Ee(e){E(e),L.start({awaitAssistantId:I,subject:mo(e),conversationTitle:ho(e),onConversationCreated:re,includeSuggestions:!u}),x(`face`)}function De(e){if(e.length>0&&!e.includes(`https://www.googleapis.com/auth/calendar.events`)){me(!0);return}if(me(!1),F&&T){let e=[T.firstName.trim(),T.lastName.trim()].filter(Boolean).join(` `);N(null),fe(!1),ue(!0),He({assistantId:F,userName:e||void 0,assistantName:D?.name?.trim()||void 0}).then(e=>{e.scheduled&&(fe(!0),N(In(e.start,e.timeZone)))}).finally(()=>ue(!1))}x(`meeting`)}if(!l)return d?(0,K.jsx)(o,{to:ae.assistant,replace:!0}):null;if([`different`,`personality`,`integration`,`letschat`,`meeting`,`looking`,`results`,`suggestions`].includes(f)&&T){let e=[`meeting`,`looking`,`results`,`suggestions`].includes(f);return(0,K.jsx)(`div`,{ref:m,"data-theme":`dark`,className:`relative h-full overflow-hidden`,children:(0,K.jsxs)(Vn,{size:h,children:[(0,K.jsx)(fo,{eyesBumpNonce:P,peekLevel:[`looking`,`results`,`suggestions`].includes(f)?ge:0,darkBg:e,showBottomEyes:!e&&f!==`different`}),f===`different`&&(0,K.jsx)(ai,{onContinue:()=>x(u?`personality`:`integration`),onBack:()=>S(`intro`),onForward:w}),f===`personality`&&(0,K.jsx)(La,{values:O,onValueChange:(e,t)=>k(n=>({...n,[e]:t})),locked:A,onContinue:()=>{A||(Se(!0),xe.current=An({awaitAssistantId:I,values:O,userName:T?.firstName?.trim()||void 0}).finally(()=>Se(!1)),ne(!0)),x(`integration`)},onBack:()=>S(`different`),onForward:w}),f===`integration`&&(0,K.jsx)(ui,{onClaim:()=>x(`letschat`),onBumpEyes:()=>he(e=>e+1),onBack:()=>S(u?`personality`:`different`),onForward:w}),f===`letschat`&&(0,K.jsx)(Ra,{assistantId:F,assistantReady:ye,onConnected:De,missingCalendarScope:pe,onRetry:()=>me(!1),onSkip:()=>{me(!1),x(`looking`,`skipped`)},onBack:()=>S(`integration`),onForward:w}),f===`meeting`&&(0,K.jsx)(Ka,{scheduledTime:ie??void 0,awaitingTime:le,onDone:()=>x(`looking`),onBack:()=>S(`letschat`),onForward:w}),f===`looking`&&(0,K.jsx)(Za,{onDone:()=>x(we?`suggestions`:`results`),onBack:()=>S(`letschat`),onAdvance:e=>_e(Math.min(e+1,4)),onForward:w,ready:!Ce&&!B,applyingPersonality:A}),f===`results`&&(0,K.jsx)(Qa,{claims:L.claims,loading:Ce,onContinue:e=>{M&&F&&e.length>0&&(z.current=xn({assistantId:F,conversationId:M,removedClaims:e,rejectedAll:!1})),x(`suggestions`)},onRejectAll:()=>{M&&F&&(z.current=xn({assistantId:F,conversationId:M,removedClaims:L.claims.map(e=>e.claim),rejectedAll:!0})),x(`suggestions`,`skipped`)},onBack:()=>S(`looking`),onForward:w}),f===`suggestions`&&u&&(0,K.jsx)(oo,{installedPlugins:L.installedPlugins,pluginCatalog:L.pluginCatalog,onStart:async()=>{ze(Be.suggestions,{userId:n,outcome:`completed`}),await Promise.all([L.awaitPluginInstalls(),z.current,xe.current]),Te(T,D,po,{hidden:!0})},onBack:()=>S(we?`looking`:`results`),onForward:w}),f===`suggestions`&&!u&&(0,K.jsx)(ao,{suggestions:L.suggestions,loading:Ce,installedPlugins:L.installedPlugins,onSuggestionClick:async e=>{ze(Be.suggestions,{userId:n,outcome:`completed`}),await Promise.all([L.awaitPluginInstalls(),z.current]),Te(T,D,e.prompt)},onSkip:async()=>{ze(Be.suggestions,{userId:n,outcome:`skipped`}),await Promise.all([L.awaitPluginInstalls(),z.current]),Te(T,D,void 0,{skip:!0})},onBack:()=>S(we?`looking`:`results`),onForward:w})]})})}return f===`intro`&&T?(0,K.jsx)(Br,{firstName:T.firstName,assistantName:D?.name,onContinue:()=>x(`different`),onBack:()=>S(`face`),onForward:w}):f===`face`&&T?(0,K.jsx)(wr,{onContinue:e=>{ee(e),x(`intro`)},onBack:()=>S(`form`),onForward:w}):(0,K.jsx)(gr,{initialFirstName:t?.firstName??``,initialLastName:t?.lastName??``,onSubmit:Ee})}export{go as ResearchOnboardingRoute};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e,i as t}from"./auth-store-B_ChDvJN.js";function n(){let n=e.use.currentOrganizationId();return!t()||n!=null}export{n as t};
|
/package/dist/assets/{avatar-svg-compositor-DG7zqpYr.js → avatar-svg-compositor-CNy1XmWD.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/{conversation-selection-DgYtLnyB.js → conversation-selection-CNssqGbG.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/{impersonate-version-flag-BsxCoimD.js → impersonate-version-flag-DyVWQf97.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|