@vellumai/web 0.10.7-dev.202607092332.9deedf4 → 0.10.7-dev.202607100313.fffdfea

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.
Files changed (119) hide show
  1. package/dist/assets/{account-page-CMV43GIE.js → account-page-Ce-pbLMJ.js} +1 -1
  2. package/dist/assets/{acp-run-detail-panel-Q6Pa1K4J.js → acp-run-detail-panel-T0GBDg-W.js} +1 -1
  3. package/dist/assets/{activity-steps-panel-CtNAZTDH.js → activity-steps-panel-BXXeXc19.js} +1 -1
  4. package/dist/assets/{advanced-page-BznS_S2-.js → advanced-page-C8Ib_u5F.js} +1 -1
  5. package/dist/assets/ai-page-BezzLmVq.js +1 -0
  6. package/dist/assets/{animated-avatar-DK4gO-3x.js → animated-avatar-DDpjZzRx.js} +1 -1
  7. package/dist/assets/{api-ByWcEKXC.js → api-Zs5JMgKY.js} +1 -1
  8. package/dist/assets/{api-key-screen-COgM-31V.js → api-key-screen-B_g5hH5v.js} +1 -1
  9. package/dist/assets/{archive-page-CbI42Xl9.js → archive-page-rl2uRUik.js} +1 -1
  10. package/dist/assets/{assistant-feature-flag-store-DZtH0LSq.js → assistant-feature-flag-store-CKUjJHuh.js} +1 -1
  11. package/dist/assets/{assistant-status-panel-je6tdnDq.js → assistant-status-panel-DPwgE1TF.js} +1 -1
  12. package/dist/assets/{auth-store-B0Vpa2Ej.js → auth-store-CKsDsnkp.js} +1 -1
  13. package/dist/assets/{background-task-detail-panel-C9gXqdcp.js → background-task-detail-panel-3xiHMnCC.js} +1 -1
  14. package/dist/assets/{billing-page-1lNYGQXM.js → billing-page-D-gIsav0.js} +1 -1
  15. package/dist/assets/{bookmarks-page-CrTrSqCx.js → bookmarks-page-giPayf1N.js} +1 -1
  16. package/dist/assets/{build-state-mRQrHtjQ.js → build-state-BLXpH8o6.js} +1 -1
  17. package/dist/assets/{channels-page-route-CH4rDnAa.js → channels-page-route-DAZ5e9vo.js} +1 -1
  18. package/dist/assets/{chat-markdown-message-Di8W_mZ2.js → chat-markdown-message-BuypfAkx.js} +1 -1
  19. package/dist/assets/{client-feature-flag-store-DdDbgq_C.js → client-feature-flag-store-C0g8zi1W.js} +1 -1
  20. package/dist/assets/{command-palette-CESousz_.js → command-palette-C0XZVlzp.js} +1 -1
  21. package/dist/assets/{command-palette-window-page-CDsU8OFx.js → command-palette-window-page-CxIvQGwt.js} +1 -1
  22. package/dist/assets/{community-page-C5ZLBw-d.js → community-page-CwSloAl0.js} +1 -1
  23. package/dist/assets/{contacts-page-route-7vAYmrEW.js → contacts-page-route-CBqOhX8s.js} +1 -1
  24. package/dist/assets/{conversation-list-fetchers-DPPBc9-e.js → conversation-list-fetchers-tE99dnUJ.js} +1 -1
  25. package/dist/assets/{credentials-page-DPAWp3ig.js → credentials-page-Bd-E5j_2.js} +1 -1
  26. package/dist/assets/{debug-page-ChigwOvQ.js → debug-page-CU0jo5tG.js} +1 -1
  27. package/dist/assets/{deploy-dialogs-BYLzWrGV.js → deploy-dialogs-8TBhlLXZ.js} +1 -1
  28. package/dist/assets/{detail-panel-stop-button-CzdpVulo.js → detail-panel-stop-button-B0utUgSr.js} +1 -1
  29. package/dist/assets/{developer-page-DpEsh6NB.js → developer-page-Da1bdSPK.js} +1 -1
  30. package/dist/assets/{devices-page-Pnn1eowJ.js → devices-page-DC9det1s.js} +1 -1
  31. package/dist/assets/{dictation-overlay-page-ChVTUFRD.js → dictation-overlay-page-6l-KJCrE.js} +1 -1
  32. package/dist/assets/{document-viewer-page-2ll_cJLl.js → document-viewer-page-djjsg4WE.js} +1 -1
  33. package/dist/assets/{earn-credits-modal-DeZpTKSj.js → earn-credits-modal-B4iirPUC.js} +1 -1
  34. package/dist/assets/{emails-page-ABf-We6M.js → emails-page-RItjmMG5.js} +1 -1
  35. package/dist/assets/feature-flag-catalog-CHuc71P8.js +1 -0
  36. package/dist/assets/{general-page-DkKSrMme.js → general-page-BtAuGqFM.js} +1 -1
  37. package/dist/assets/{hatching-screen-D8Pjfvhy.js → hatching-screen-C71v2Kqp.js} +1 -1
  38. package/dist/assets/{home-page-route-B1N6-RGa.js → home-page-route-DxKq7gEn.js} +1 -1
  39. package/dist/assets/{hosting-screen-BiP9Rnsg.js → hosting-screen-DBN9hO0s.js} +1 -1
  40. package/dist/assets/{identity-page-route-BWqNkDHQ.js → identity-page-route-Ck1TCmSd.js} +1 -1
  41. package/dist/assets/index-DQjUULFO.js +113 -0
  42. package/dist/assets/{inspect-page-C4TiFioA.js → inspect-page-BuriU_iU.js} +2 -2
  43. package/dist/assets/{integrations-page-DtTvWU0Y.js → integrations-page-N-I7F_JQ.js} +1 -1
  44. package/dist/assets/{intelligence-layout-BUgKwjS8.js → intelligence-layout-C_H2Uec7.js} +1 -1
  45. package/dist/assets/{keyboard-shortcuts-page-B2sR16aW.js → keyboard-shortcuts-page-B2ozF8zY.js} +1 -1
  46. package/dist/assets/{library-detail-page-CWNbUJqt.js → library-detail-page-BKj7gWNL.js} +1 -1
  47. package/dist/assets/{library-page-5UprXzT9.js → library-page-BJljT3MY.js} +1 -1
  48. package/dist/assets/{login-flow-C69Wgb68.js → login-flow-C4Ehxg-g.js} +1 -1
  49. package/dist/assets/{login-page-jYS-XYJb.js → login-page-CZBdlVje.js} +1 -1
  50. package/dist/assets/{logout-page-DDATXd1t.js → logout-page-BryU7bK_.js} +1 -1
  51. package/dist/assets/{logs-layout-DGGiZCW7.js → logs-layout-nPLZjXX5.js} +1 -1
  52. package/dist/assets/{memory-router-playground-page-CC3Q-ii9.js → memory-router-playground-page-qIG7U97D.js} +1 -1
  53. package/dist/assets/{messages-CUJ5eqjM.js → messages-DF7pzUR8.js} +2 -2
  54. package/dist/assets/{mobile-sidebar-drawer-UKduN0Pv.js → mobile-sidebar-drawer-DpvWGGSA.js} +1 -1
  55. package/dist/assets/{notifications-page-7QBHhSOv.js → notifications-page-DBlKmak1.js} +1 -1
  56. package/dist/assets/{oauth-complete-page-nDiAeozi.js → oauth-complete-page-D8aQ3tJ_.js} +1 -1
  57. package/dist/assets/{oauth-popup-complete-page-weYCBDud.js → oauth-popup-complete-page-CXXZdxWJ.js} +1 -1
  58. package/dist/assets/{pairing-page-BAl_HWtd.js → pairing-page-b1uNitAm.js} +1 -1
  59. package/dist/assets/{platform-loopback-page-Bgb9VIUM.js → platform-loopback-page-hCZEK9-q.js} +1 -1
  60. package/dist/assets/{plugins-page-B4pNE_2E.js → plugins-page-C0TtdwgQ.js} +1 -1
  61. package/dist/assets/{prechat-route-C9OMadRC.js → prechat-route-CnIcxqAR.js} +1 -1
  62. package/dist/assets/{prefs-DIsAodtg.js → prefs-hu4Ft3Gc.js} +1 -1
  63. package/dist/assets/{privacy-page-59CvcL5F.js → privacy-page-PFWKww1A.js} +1 -1
  64. package/dist/assets/{privacy-screen-BoOkqfMk.js → privacy-screen-DSr2ddPX.js} +1 -1
  65. package/dist/assets/{provider-callback-page-BZSaYWMK.js → provider-callback-page-CVVL9mxY.js} +1 -1
  66. package/dist/assets/{provider-key-BBkXTnhk.js → provider-key-B9HxajGj.js} +1 -1
  67. package/dist/assets/{provider-signup-page-Dxl1u-LY.js → provider-signup-page-BBqT_sHe.js} +1 -1
  68. package/dist/assets/{quick-input-page-C8ZUm4TO.js → quick-input-page-CLwquN93.js} +1 -1
  69. package/dist/assets/react-query.gen-DOfazqkL.js +1 -0
  70. package/dist/assets/{research-mock-page-CyAaxUmt.js → research-mock-page-DeBKxHSz.js} +1 -1
  71. package/dist/assets/{research-onboarding-route-DfFaJpJ1.js → research-onboarding-route-2nc0yKsq.js} +4 -4
  72. package/dist/assets/{review-terms-screen-sQAJ3zHo.js → review-terms-screen-QliTExQL.js} +1 -1
  73. package/dist/assets/{risk-CrkyJx_W.js → risk-jKF7qGwV.js} +1 -1
  74. package/dist/assets/{schedules-BnoWhTUm.js → schedules-CQO3UwTc.js} +1 -1
  75. package/dist/assets/sdk.gen-jDeNbBv8.js +6 -0
  76. package/dist/assets/{security-page-edEfQa2K.js → security-page-CQfQh2wW.js} +1 -1
  77. package/dist/assets/{select-assistant-screen-BaWxwdJN.js → select-assistant-screen-BsGcZIsZ.js} +1 -1
  78. package/dist/assets/{settings-layout-DmT_OhwB.js → settings-layout-hvCEbqwx.js} +1 -1
  79. package/dist/assets/{share-feedback-modal-CiZZc4P8.js → share-feedback-modal-BFxBtlP7.js} +1 -1
  80. package/dist/assets/{sidebar-tree-DqBUS7Di.js → sidebar-tree-BaU6dAAM.js} +1 -1
  81. package/dist/assets/{signup-page-RKGKd4D4.js → signup-page-COVsB50a.js} +1 -1
  82. package/dist/assets/{site-favicon-BOtLPhLi.js → site-favicon-D9Rp1QPZ.js} +1 -1
  83. package/dist/assets/{skill-detail-page-BA-R0TUF.js → skill-detail-page-D5UAAUmZ.js} +1 -1
  84. package/dist/assets/{skill-detail-panel-qExRv5Fy.js → skill-detail-panel-DIoN-AUc.js} +1 -1
  85. package/dist/assets/{skills-cdOwT5VQ.js → skills-C9wbjXsQ.js} +1 -1
  86. package/dist/assets/{skills-page-DTyII3yz.js → skills-page-DhUitBj9.js} +1 -1
  87. package/dist/assets/{sound-manager-D6rR29ls.js → sound-manager-CSAwT8Vm.js} +1 -1
  88. package/dist/assets/{sounds-page-DX0M0BI7.js → sounds-page-DeBeDlcY.js} +1 -1
  89. package/dist/assets/{subagent-detail-panel-DZ2aFOtQ.js → subagent-detail-panel-CF-VVQJA.js} +1 -1
  90. package/dist/assets/{subagent-store-CkVBDrlq.js → subagent-store-C-pyGmFU.js} +1 -1
  91. package/dist/assets/{system-events-page-C7PYjQ1_.js → system-events-page-CYqUpGpC.js} +1 -1
  92. package/dist/assets/{tiptap-document-editor-UuUX9dDg.js → tiptap-document-editor-aGPkbqbr.js} +1 -1
  93. package/dist/assets/{tool-detail-panel-CNNk22iE.js → tool-detail-panel-CzkNK-ue.js} +1 -1
  94. package/dist/assets/{upgrade-cancel-page-DtomPtfd.js → upgrade-cancel-page-BytvxNqQ.js} +1 -1
  95. package/dist/assets/{upgrade-success-page-ByqZaDgj.js → upgrade-success-page-CeuBASa8.js} +1 -1
  96. package/dist/assets/{usage-page-4pf5Kokb.js → usage-page-CI7scN-b.js} +1 -1
  97. package/dist/assets/{use-edge-swipe-back-KZ3UbiGX.js → use-edge-swipe-back-U9h8O8rp.js} +1 -1
  98. package/dist/assets/{use-invite-link-dialog-CefIg3No.js → use-invite-link-dialog-JL5Jevln.js} +1 -1
  99. package/dist/assets/use-is-org-ready-BP6_0L-A.js +1 -0
  100. package/dist/assets/{use-onboarding-login-BE7XAcLS.js → use-onboarding-login-CP7O8ZzB.js} +1 -1
  101. package/dist/assets/{use-skill-actions-DvXJseoE.js → use-skill-actions-BKfLB9Oe.js} +1 -1
  102. package/dist/assets/{use-skill-categories-SyeYfwMa.js → use-skill-categories-8DmU61Hs.js} +1 -1
  103. package/dist/assets/{use-skill-detail-files-DEAuvZ9C.js → use-skill-detail-files-DmLQiG5u.js} +1 -1
  104. package/dist/assets/{viewer-store-B7if16dM.js → viewer-store-SsoxBypb.js} +1 -1
  105. package/dist/assets/{voice-page-vBrdgTVm.js → voice-page-DX8ma3dY.js} +1 -1
  106. package/dist/assets/{weather-forecast-display-LnisXlEl.js → weather-forecast-display-hxrsJwFy.js} +1 -1
  107. package/dist/assets/{welcome-screen-CWHGZa4i.js → welcome-screen-Drx018g8.js} +1 -1
  108. package/dist/assets/{workflow-detail-panel-BUjpdiIu.js → workflow-detail-panel-n5adDCz2.js} +1 -1
  109. package/dist/assets/{workflow-store-CKPwCutv.js → workflow-store-B_M196cU.js} +1 -1
  110. package/dist/assets/workspace-page-CYDMc7C-.js +1 -0
  111. package/dist/index.html +23 -23
  112. package/package.json +1 -1
  113. package/dist/assets/ai-page-DUWe0qVj.js +0 -1
  114. package/dist/assets/feature-flag-catalog-8Bd8qhz2.js +0 -1
  115. package/dist/assets/index-6YxiY2Ly.js +0 -113
  116. package/dist/assets/react-query.gen-SVZdN1r_.js +0 -1
  117. package/dist/assets/sdk.gen-D-8W_bKa.js +0 -6
  118. package/dist/assets/use-is-org-ready-BrsKMV8W.js +0 -1
  119. package/dist/assets/workspace-page-BTFdn_4T.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./card-Bv5O5juh.js";import{t as u}from"./check-DFNrQERi.js";import{t as d}from"./chevron-left-BMF1xNfR.js";import{t as f}from"./loader-circle-Cz7opInR.js";import{t as p}from"./pencil-CUIr0IFo.js";import{t as m}from"./x-CkSVp1Ok.js";import{t as h}from"./input-CoUmPnRU.js";import{l as g,p as _,s as v}from"./local-mode-grqHUoNh.js";import{t as y}from"./is-electron-y5bNUVyG.js";import{n as b}from"./resolved-assistants-store-BSZbT8Ju.js";import{A as x,C as ee,a as S,j as C,n as w,o as T}from"./auth-store-B0Vpa2Ej.js";import{t as E}from"./client.gen-DVfIRXUZ.js";import{c as D}from"./routes-BbeIx_F9.js";import{a as O}from"./platform-detection-BrxvFUiR.js";import{i as k,s as A}from"./prefs-DIsAodtg.js";import{t as j}from"./client-feature-flag-store-DdDbgq_C.js";import{n as te,t as ne}from"./browser-BPZAXjRE.js";import{c as M,l as re,n as ie,t as N}from"./prechat-P1y7ZM6C.js";import{Ct as ae,b as P,r as oe}from"./react-query.gen-DPzPS206.js";import{t as F}from"./public-asset-Di3QykUd.js";import{$t as I,Qt as se,U as ce,W as le,Zt as ue,_ as de,bt as fe,en as L,ft as R,g as pe,h as z,ht as me,nn as he,pa as B,pt as ge,rn as V,vt as _e,yt as ve}from"./index-6YxiY2Ly.js";import{t as H}from"./onboarding-step-layout-zvLUIT7j.js";import{n as U,r as ye}from"./prechat-names-b5RkG_F-.js";import{t as be}from"./step-indicator-dots-Cou0-IgA.js";var W=e(n(),1);async function xe(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=c(),Se=[{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 Ce({onComplete:e}){function t(){de(),z(),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:Se.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)(u,{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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,we=[{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 Te({assistantId:e,assistantName:n,onConnect:i,onSkip:a,onBack:s}){let c=y(),l=o(),u=t(),p=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(null),_=(0,W.useRef)(null),v=(0,W.useRef)(null),b=(0,W.useRef)(null),[x,S]=(0,W.useState)(!1),C=(0,W.useCallback)(()=>{m.current=null,S(!1)},[]),w=(0,W.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,W.useCallback)(()=>{p.current&&!p.current.closed&&p.current.close(),p.current=null,h.current&&=(clearInterval(h.current),null),g.current&&=(clearTimeout(g.current),null)},[]),E=ae();(0,W.useEffect)(()=>()=>{h.current&&clearInterval(h.current),g.current&&clearTimeout(g.current),p.current&&!p.current.closed&&p.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,W.useCallback)(async e=>{try{return(await l.fetchQuery({...P({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[l]),k=(0,W.useCallback)(async()=>{let e=m.current?.platformAssistantId;T(),C(),i((e?await O(e):null)?.scopes_granted??[])},[C,T,O,i]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!m.current||e.requestId!==m.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=ue(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=se(e,t.requestId);n&&(A(n),window.localStorage.removeItem(L(t.requestId)))},[A]);he((0,W.useCallback)(e=>{let t=m.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 re=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=j,v.current=M,u){S(!0),(async()=>{let n;try{n=await ee(e)}catch{C();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){ne(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),b.current&&b.current();let n=te(()=>{let e=m.current;if(!e){n(),b.current=null;return}(async()=>{let t=await O(e.platformAssistantId);m.current&&(t?await k():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}p.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),h.current=setInterval(()=>{p.current&&p.current.closed&&m.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=m.current;if(!e)return;let t=window.localStorage.getItem(L(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(L(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);m.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{T(),C(),w();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){p.current&&!p.current.closed?p.current.location.href=e.connect_url:m.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,M,k,u,w,E]),ie=n||`your assistant`,N=n||`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 ${c?`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:s,"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)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${c?`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, ${ie} 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:we.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:`${N} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${c?`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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||E.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:u}){let f=y();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)(d,{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)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:H,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)(De,{group:e,isActive:n===e.id,onToggle:()=>s(n===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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({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 Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:u}){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)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),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)(be,{current:l,total:u})}),(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)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:H,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:n.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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{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 Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>J(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Y(e));(0,W.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=J(e);c(n),f(e=>e||n.length>0),g.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}`)))}q(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(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:n,"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)(d,{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:[ke.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),u?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),u?(0,G.jsx)(l,{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)(p,{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),c(``)},"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)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple assistants with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.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)(r,{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)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function q(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function 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)(u,{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)(B,{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:n,onContinue:i,onSkip:a}){let o=y(),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:n,"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)(d,{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:ce.map(t=>{let n=le[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)(u,{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)(r,{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)(r,{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:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>ze(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Z(e));(0,W.useEffect)(()=>{let t=Z(e);if(t===g.current)return;let n=ze(e);c(n),f(e=>e||n.length>0),g.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}`)))}X(n,e)||(g.current=Z(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(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 ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,G.jsx)(`button`,{type:`button`,onClick:n,"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)(d,{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?`}),n?(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)(Q,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),u?null:(0,G.jsx)($,{onClick:()=>f(!0),electron:o})]}),u?(0,G.jsx)(l,{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)(p,{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),c(``)},"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)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple tools with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.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)(r,{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)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function X(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Z(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Q({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)(Be,{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)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function $({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)(B,{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 Be({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 Ve({selectedGroupId:e,onGroupChange:t,onBack:n,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)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:n,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function He(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 Ue=[`gmail`,`google-calendar`,`google-drive`],We=`experiment-activation-flow-2026-06-03`,Ge=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ke(e,t,n){return t?.initialMessage?t.initialMessage:n?ie(e):N}function qe(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?[...Ue]:[],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=We,i.bootstrapTemplate=Ge);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=Ke(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:R.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:R.controlWorkType,enabled:!t},{id:`tools`,funnelStep:R.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:R.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?R.gmailConnect:R.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:R.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function tt(){let e=i(),n=t(),r=A()&&k();return(0,W.useEffect)(()=>{!r&&!n&&e(D.onboarding.privacy,{replace:!0})},[r,n,e]),n||r}function nt(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=Qe(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 rt=3;function it(){let e=g();return e?.cloud===`vellum`?e.assistantId:v()[0]?.assistantId??null}function at(){let e=i(),[n]=a(),r=n.get(`preview`)===`true`,o=w.use.user(),c=S(),l=T(),u=o?.id??null,d=o?.firstName??``,f=o?.lastName??``,p=t(),m=b.use.activeAssistantId(),h=_(),g=O()&&!pe(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),E=_e(v),k=ve()??E,A=k===ge.paredDown,te=h?it():null,ne=tt(),{currentStep:ie,setCurrentStep:N,clearPersistedStep:ae}=nt(u,p),P=w.use.platformSession(),F=C(P),[I,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),[ue,de]=(0,W.useState)(()=>new Set),{value:L,onChange:R}=He(h&&!F?``:d||f),[z,he]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,be]=(0,W.useState)(!1),[Se,K]=(0,W.useState)([]),{data:we}=s({...oe(),enabled:!l&&c&&(!h||F)}),{data:De,isLoading:ke}=s({queryKey:[`onboarding-recipe`,u],queryFn:xe,enabled:!l&&c&&!p&&!h,staleTime:1/0}),q=De??null,J=we?.id??m??te,Y=Je({localMode:h,platformSession:P,hasCachedPlatformAssistant:te!==null}),je=Y,Me=Y,Ne=async()=>{await x.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Ie(e,t=k){r||me(e,{userId:u,variant:fe(t)})}let Le=[...I].some(e=>Fe.has(e)),X=p?Xe():Ye({paredDown:A,canOfferPriorAssistants:Me,canOfferGoogleStep:r?!1:je,hasGoogleTool:Le,showIOSAppStep:g});function ze(t){if(r){e(-1);return}re(qe({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:ce,selectedPriorAssistants:t?.selectedPriorAssistants??ue,tone:z??q?.tone??`grounded`,userName:L,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:Se,connectedScopes:t?.connectedScopes}));let n=V.trim();n&&M(n),p?(ae(),e(D.onboarding.privacy)):(x.markExpectingFirstMessage(),Ne())}let Z=(e,t)=>{e.funnelStep&&Ie(e.funnelStep);let n=$e(X,e.id);n?N(n):ze(t)},Q=e=>{let t=et(X,e.id);t&&N(t)};if(!ne||ke)return null;let $=X.find(e=>e.id===ie)??X[0];return $?$.id===`nativeName`?(0,G.jsx)(Oe,{userName:L,assistantName:V,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:rt}):$.id===`nativeVibe`?(0,G.jsx)(Ve,{selectedGroupId:z,onGroupChange:he,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:rt}):$.id===`name`?(0,G.jsx)(Ee,{userName:L,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onGroupChange:he,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(Ae,{selectedAssistants:ue,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;de(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(Te,{assistantId:J,assistantName:V,onConnect:e=>{be(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function ot(){return(0,G.jsx)(at,{})}export{ot as PreChatRoute};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{t as l}from"./card-Bv5O5juh.js";import{t as u}from"./check-DFNrQERi.js";import{t as d}from"./chevron-left-BMF1xNfR.js";import{t as f}from"./loader-circle-Cz7opInR.js";import{t as p}from"./pencil-CUIr0IFo.js";import{t as m}from"./x-CkSVp1Ok.js";import{t as h}from"./input-CoUmPnRU.js";import{l as g,p as _,s as v}from"./local-mode-grqHUoNh.js";import{t as y}from"./is-electron-y5bNUVyG.js";import{n as b}from"./resolved-assistants-store-BSZbT8Ju.js";import{A as x,C as ee,a as S,j as C,n as w,o as T}from"./auth-store-CKsDsnkp.js";import{t as E}from"./client.gen-DVfIRXUZ.js";import{c as D}from"./routes-BbeIx_F9.js";import{a as O}from"./platform-detection-BrxvFUiR.js";import{i as k,s as A}from"./prefs-hu4Ft3Gc.js";import{t as j}from"./client-feature-flag-store-C0g8zi1W.js";import{n as te,t as ne}from"./browser-BPZAXjRE.js";import{c as M,l as re,n as ie,t as N}from"./prechat-P1y7ZM6C.js";import{Ct as ae,b as P,r as oe}from"./react-query.gen-DPzPS206.js";import{t as F}from"./public-asset-Di3QykUd.js";import{$t as I,Qt as se,U as ce,W as le,Zt as ue,_ as de,bt as fe,en as L,ft as R,g as pe,h as z,ht as me,nn as he,pa as B,pt as ge,rn as V,vt as _e,yt as ve}from"./index-DQjUULFO.js";import{t as H}from"./onboarding-step-layout-zvLUIT7j.js";import{n as U,r as ye}from"./prechat-names-b5RkG_F-.js";import{t as be}from"./step-indicator-dots-Cou0-IgA.js";var W=e(n(),1);async function xe(){try{let{data:e,response:t}=await E.get({url:`/v1/onboarding/recipe/`,throwOnError:!1});if(!t?.ok||!e)return null;let n=e;return typeof n.cohort!=`string`||!Array.isArray(n.tasks)||typeof n.tone!=`string`||typeof n.bootstrap_template!=`string`||typeof n.initial_message!=`string`||!Array.isArray(n.skills)||typeof n.skip_prechat!=`boolean`?null:{cohort:n.cohort,tasks:n.tasks,tone:n.tone,bootstrapTemplate:n.bootstrap_template,initialMessage:n.initial_message,skills:n.skills,skipPrechat:n.skip_prechat}}catch{return null}}var G=c(),Se=[{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 Ce({onComplete:e}){function t(){de(),z(),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:Se.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)(u,{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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:t,className:`h-11 text-base`,children:`Download on the App Store`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:e,className:`h-11 text-base`,children:`Continue in browser`})]})]})})}var K=`google`,we=[{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 Te({assistantId:e,assistantName:n,onConnect:i,onSkip:a,onBack:s}){let c=y(),l=o(),u=t(),p=(0,W.useRef)(null),m=(0,W.useRef)(null),h=(0,W.useRef)(null),g=(0,W.useRef)(null),_=(0,W.useRef)(null),v=(0,W.useRef)(null),b=(0,W.useRef)(null),[x,S]=(0,W.useState)(!1),C=(0,W.useCallback)(()=>{m.current=null,S(!1)},[]),w=(0,W.useCallback)(()=>{_.current&&=(window.removeEventListener(`message`,_.current),null),v.current&&=(window.removeEventListener(`storage`,v.current),null)},[]),T=(0,W.useCallback)(()=>{p.current&&!p.current.closed&&p.current.close(),p.current=null,h.current&&=(clearInterval(h.current),null),g.current&&=(clearTimeout(g.current),null)},[]),E=ae();(0,W.useEffect)(()=>()=>{h.current&&clearInterval(h.current),g.current&&clearTimeout(g.current),p.current&&!p.current.closed&&p.current.close(),_.current&&window.removeEventListener(`message`,_.current),v.current&&window.removeEventListener(`storage`,v.current),b.current&&=(b.current(),null)},[]);let O=(0,W.useCallback)(async e=>{try{return(await l.fetchQuery({...P({path:{assistant_id:e}}),staleTime:0})).find(e=>e.provider===K&&e.connected)??null}catch{return null}},[l]),k=(0,W.useCallback)(async()=>{let e=m.current?.platformAssistantId;T(),C(),i((e?await O(e):null)?.scopes_granted??[])},[C,T,O,i]),A=(0,W.useCallback)(e=>{e.type===`vellum:oauth-complete`&&(!m.current||e.requestId!==m.current.requestId||(e.oauthStatus===`connected`?k():(T(),C())))},[C,T,k]),j=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=ue(e,window.location.origin,t.requestId);n&&A(n)},[A]),M=(0,W.useCallback)(e=>{let t=m.current;if(!t)return;let n=se(e,t.requestId);n&&(A(n),window.localStorage.removeItem(L(t.requestId)))},[A]);he((0,W.useCallback)(e=>{let t=m.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 re=(0,W.useCallback)(()=>{let t=crypto.randomUUID();if(w(),_.current=j,v.current=M,u){S(!0),(async()=>{let n;try{n=await ee(e)}catch{C();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}&native=1`}},{onSuccess(e){ne(e.connect_url)},onError(){C()}})})(),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),b.current&&b.current();let n=te(()=>{let e=m.current;if(!e){n(),b.current=null;return}(async()=>{let t=await O(e.platformAssistantId);m.current&&(t?await k():C(),w(),n(),b.current=null)})()});b.current=n;return}let n=window.open(``,`_blank`,`width=500,height=600`);if(n===null){w();return}p.current=n,S(!0),window.addEventListener(`message`,j),window.addEventListener(`storage`,M),h.current=setInterval(()=>{p.current&&p.current.closed&&m.current&&!g.current&&(g.current=setTimeout(async()=>{g.current=null;let e=m.current;if(!e)return;let t=window.localStorage.getItem(L(e.requestId));if(t)try{let n=JSON.parse(t);if(I(n,e.requestId)){A(n),window.localStorage.removeItem(L(e.requestId)),w();return}}catch{}let n=await O(e.platformAssistantId);m.current&&(n?await k():(T(),C()),w())},1e3))},100),(async()=>{let n;try{n=await ee(e)}catch{T(),C(),w();return}m.current={requestId:t,platformAssistantId:n},E.mutate({path:{assistant_id:n,provider:K},body:{requested_scopes:[],redirect_after_connect:`${D.account.oauth.popupComplete}?requestId=${t}`}},{onSuccess(e){p.current&&!p.current.closed?p.current.location.href=e.connect_url:m.current&&(T(),C(),w())},onError(){T(),C(),w()}})})()},[e,C,T,O,A,j,M,k,u,w,E]),ie=n||`your assistant`,N=n||`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 ${c?`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:s,"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)(d,{className:`h-4 w-4`})}),(0,G.jsx)(`h1`,{className:`text-center ${c?`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, ${ie} 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:we.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:`${N} will never send email, change calendar events, or edit files without your permission. You can disconnect at any time.`}),(0,G.jsxs)(`div`,{className:`${c?`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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:re,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:x||E.isPending?(0,G.jsxs)(`span`,{className:`flex items-center justify-center gap-2`,children:[(0,G.jsx)(f,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}),`Waiting for authorization...`]}):`Connect Google`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,disabled:x||E.isPending,className:`${c?`h-9`:`h-11 text-base`}`,children:`Skip for now`})]})]})})}function Ee({userName:e,assistantName:t,selectedGroupId:n,displayedAssistantNames:i,onUserNameChange:a,onAssistantNameChange:o,onGroupChange:s,onBack:c,onComplete:l,onSkip:u}){let f=y();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)(d,{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)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>a(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>o(e.target.value),className:H,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)(De,{group:e,isActive:n===e.id,onToggle:()=>s(n===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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:l,className:`${f?`h-9`:`h-11 text-base`}`,children:`Let's go`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:u,className:`${f?`h-9`:`h-11 text-base`}`,children:`Skip`})]})]})})}function De({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 Oe({userName:e,assistantName:t,displayedAssistantNames:n,onUserNameChange:i,onAssistantNameChange:a,onBack:o,onContinue:s,onSkip:c,currentStep:l,totalSteps:u}){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)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),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)(be,{current:l,total:u})}),(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)(h,{label:`Your name`,placeholder:`Your name`,value:e,onChange:e=>i(e.target.value),className:H,fullWidth:!0}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsx)(h,{label:`What should I go by?`,placeholder:`Assistant name`,value:t,onChange:e=>a(e.target.value),className:H,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:n.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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:s,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:c,className:`h-11 text-base`,children:`Skip`})]})]})})}var ke=[{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 Ae({selectedAssistants:e,onChange:t,onBack:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>J(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Y(e));(0,W.useEffect)(()=>{let t=Y(e);if(t===g.current)return;let n=J(e);c(n),f(e=>e||n.length>0),g.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}`)))}q(n,e)||(g.current=Y(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(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:n,"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)(d,{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:[ke.map(t=>(0,G.jsx)(je,{assistant:t,selected:e.has(t.id),onToggle:()=>_(t.id)},t.id)),u?null:(0,G.jsx)(Me,{onClick:()=>f(!0)})]}),u?(0,G.jsx)(l,{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)(p,{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),c(``)},"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)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other assistants`,placeholder:`e.g. Perplexity, Poe, Character.AI...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple assistants with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.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)(r,{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)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I haven't used any`})]})]})})}function q(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function J(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Y(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function 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)(u,{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)(B,{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:n,onContinue:i,onSkip:a}){let o=y(),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:n,"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)(d,{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:ce.map(t=>{let n=le[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)(u,{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)(r,{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)(r,{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:n,onContinue:i,onSkip:a}){let o=y(),[s,c]=(0,W.useState)(()=>ze(e)),[u,f]=(0,W.useState)(()=>s.length>0),g=(0,W.useRef)(Z(e));(0,W.useEffect)(()=>{let t=Z(e);if(t===g.current)return;let n=ze(e);c(n),f(e=>e||n.length>0),g.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}`)))}X(n,e)||(g.current=Z(n),t(n))},[s]);let _=n=>{let r=new Set(e);r.has(n)?r.delete(n):r.add(n),t(r)},v=(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 ${n?`grid-cols-[auto_1fr_auto]`:``}`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:[n?(0,G.jsx)(`button`,{type:`button`,onClick:n,"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)(d,{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?`}),n?(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)(Q,{tool:t,selected:e.has(t.id),onToggle:()=>_(t.id),electron:o},t.id)),u?null:(0,G.jsx)($,{onClick:()=>f(!0),electron:o})]}),u?(0,G.jsx)(l,{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)(p,{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),c(``)},"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)(m,{className:`h-3 w-3`,"aria-hidden":`true`})})]}),(0,G.jsx)(h,{"aria-label":`Other tools`,placeholder:`e.g. Trello, Basecamp, Asana...`,value:s,onChange:e=>c(e.target.value),helperText:`Separate multiple tools with commas`,className:H,fullWidth:!0}),v.length>0?(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:v.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)(r,{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)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`${o?`h-9`:`h-11 text-base`}`,children:`I'll set this up later`})]})]})})}function X(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ze(e){return[...e].filter(e=>e.startsWith(`other:`)).map(e=>e.slice(6)).sort().join(`, `)}function Z(e){return[...e].filter(e=>e.startsWith(`other:`)).sort().join(`|`)}function Q({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)(Be,{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)(u,{className:`h-2.5 w-2.5 text-[var(--content-inset)]`,"aria-hidden":`true`})}):null]})}function $({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)(B,{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 Be({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 Ve({selectedGroupId:e,onGroupChange:t,onBack:n,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)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,G.jsx)(d,{}),onClick:n,"aria-label":`Back`}),(0,G.jsx)(`div`,{className:`flex justify-center`,children:(0,G.jsx)(be,{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)(r,{variant:`primary`,size:`regular`,fullWidth:!0,onClick:i,className:`h-11 text-base`,children:`Continue`}),(0,G.jsx)(r,{variant:`ghost`,size:`regular`,fullWidth:!0,onClick:a,className:`h-11 text-base`,children:`Skip`})]})]})})}function He(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 Ue=[`gmail`,`google-calendar`,`google-drive`],We=`experiment-activation-flow-2026-06-03`,Ge=`BOOTSTRAP-ACTIVATION-RAIL.md`;function Ke(e,t,n){return t?.initialMessage?t.initialMessage:n?ie(e):N}function qe(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?[...Ue]:[],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=We,i.bootstrapTemplate=Ge);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=Ke(i,e.activationFlowEnabled?null:n,e.selfIntroGreetingEnabled),i}function Je(e){return!e.localMode||e.platformSession===`present`?!0:e.platformSession===`unknown`&&e.hasCachedPlatformAssistant}function Ye(e){let{paredDown:t}=e;return[{id:`name`,funnelStep:R.nameVibe,enabled:!0},{id:`taskTone`,funnelStep:R.controlWorkType,enabled:!t},{id:`tools`,funnelStep:R.controlTools,enabled:!t},{id:`priorAssistants`,funnelStep:R.controlPriorAssistants,enabled:!t&&e.canOfferPriorAssistants},{id:`google`,funnelStep:t?R.gmailConnect:R.controlGmailConnect,enabled:e.canOfferGoogleStep&&(t||e.hasGoogleTool)},{id:`iosApp`,funnelStep:R.controlGetApp,enabled:!t&&e.showIOSAppStep}].filter(e=>e.enabled).map(({enabled:e,...t})=>t)}function Xe(){return[{id:`nativeName`,funnelStep:null},{id:`nativeVibe`,funnelStep:null}]}var Ze=`1`;function Qe(e){return e===`nativeVibe`||e===Ze?`nativeVibe`:null}function $e(e,t){let n=e.findIndex(e=>e.id===t);return n<0?null:e[n+1]?.id??null}function et(e,t){let n=e.findIndex(e=>e.id===t);return n<=0?null:e[n-1]?.id??null}function tt(){let e=i(),n=t(),r=A()&&k();return(0,W.useEffect)(()=>{!r&&!n&&e(D.onboarding.privacy,{replace:!0})},[r,n,e]),n||r}function nt(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=Qe(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 rt=3;function it(){let e=g();return e?.cloud===`vellum`?e.assistantId:v()[0]?.assistantId??null}function at(){let e=i(),[n]=a(),r=n.get(`preview`)===`true`,o=w.use.user(),c=S(),l=T(),u=o?.id??null,d=o?.firstName??``,f=o?.lastName??``,p=t(),m=b.use.activeAssistantId(),h=_(),g=O()&&!pe(),v=j.use.stringFlags().preChatOnboardingExperiment20260606??`control`,y=(j.use.stringFlags().experimentActivationFlow20260603??`control`)===`variant-a`,ee=j.use.selfIntroGreeting(),E=_e(v),k=ve()??E,A=k===ge.paredDown,te=h?it():null,ne=tt(),{currentStep:ie,setCurrentStep:N,clearPersistedStep:ae}=nt(u,p),P=w.use.platformSession(),F=C(P),[I,se]=(0,W.useState)(()=>new Set),[ce,le]=(0,W.useState)(()=>new Set),[ue,de]=(0,W.useState)(()=>new Set),{value:L,onChange:R}=He(h&&!F?``:d||f),[z,he]=(0,W.useState)(null),[B]=(0,W.useState)(()=>ye()),[V,H]=(0,W.useState)(``),[U,be]=(0,W.useState)(!1),[Se,K]=(0,W.useState)([]),{data:we}=s({...oe(),enabled:!l&&c&&(!h||F)}),{data:De,isLoading:ke}=s({queryKey:[`onboarding-recipe`,u],queryFn:xe,enabled:!l&&c&&!p&&!h,staleTime:1/0}),q=De??null,J=we?.id??m??te,Y=Je({localMode:h,platformSession:P,hasCachedPlatformAssistant:te!==null}),je=Y,Me=Y,Ne=async()=>{await x.checkAssistant(),e(`${D.assistant}?onboarding=1`,{replace:!0})};function Ie(e,t=k){r||me(e,{userId:u,variant:fe(t)})}let Le=[...I].some(e=>Fe.has(e)),X=p?Xe():Ye({paredDown:A,canOfferPriorAssistants:Me,canOfferGoogleStep:r?!1:je,hasGoogleTool:Le,showIOSAppStep:g});function ze(t){if(r){e(-1);return}re(qe({mode:p?`native`:A?`paredDown`:`control`,recipe:p?null:q,selectedTools:I,selectedTasks:ce,selectedPriorAssistants:t?.selectedPriorAssistants??ue,tone:z??q?.tone??`grounded`,userName:L,assistantName:V,selfIntroGreetingEnabled:ee,activationFlowEnabled:p?void 0:y,googleConnected:U,googleScopes:Se,connectedScopes:t?.connectedScopes}));let n=V.trim();n&&M(n),p?(ae(),e(D.onboarding.privacy)):(x.markExpectingFirstMessage(),Ne())}let Z=(e,t)=>{e.funnelStep&&Ie(e.funnelStep);let n=$e(X,e.id);n?N(n):ze(t)},Q=e=>{let t=et(X,e.id);t&&N(t)};if(!ne||ke)return null;let $=X.find(e=>e.id===ie)??X[0];return $?$.id===`nativeName`?(0,G.jsx)(Oe,{userName:L,assistantName:V,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onContinue:()=>Z($),onSkip:()=>Z($),currentStep:0,totalSteps:rt}):$.id===`nativeVibe`?(0,G.jsx)(Ve,{selectedGroupId:z,onGroupChange:he,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($),currentStep:1,totalSteps:rt}):$.id===`name`?(0,G.jsx)(Ee,{userName:L,assistantName:V,selectedGroupId:z,displayedAssistantNames:B,onUserNameChange:R,onAssistantNameChange:H,onGroupChange:he,onComplete:()=>Z($),onSkip:()=>Z($)}):$.id===`taskTone`?(0,G.jsx)(Pe,{selectedTasks:ce,onChange:le,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`tools`?(0,G.jsx)(Re,{selectedTools:I,onChange:se,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>Z($)}):$.id===`priorAssistants`?(0,G.jsx)(Ae,{selectedAssistants:ue,onChange:de,onBack:()=>Q($),onContinue:()=>Z($),onSkip:()=>{let e=new Set;de(e),Z($,{selectedPriorAssistants:e})}}):$.id===`google`?J?(0,G.jsx)(Te,{assistantId:J,assistantName:V,onConnect:e=>{be(!0),K(e),Z($,{connectedScopes:e})},onSkip:()=>Z($),onBack:()=>Q($)}):null:$.id===`iosApp`?(0,G.jsx)(Ce,{onComplete:()=>Z($)}):null:null}function ot(){return(0,G.jsx)(at,{})}export{ot as PreChatRoute};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{O as i}from"./native-biometric-Czaf9IqI.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-B0Vpa2Ej.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().consentHydrated}function b(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function x(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function S(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{x as a,p as c,l as d,u as f,g as i,m as l,S as m,y as n,b as o,d as p,v as r,h as s,_ as t,f as u};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,r as n,s as r}from"./local-settings-lVNyIOJ_.js";import{O as i}from"./native-biometric-Czaf9IqI.js";import{t as a}from"./react-DJZBPgpf.js";import{p as o}from"./auth-store-CKsDsnkp.js";var s=e(a(),1),c=`vellum:onboarding:selectedVersion`;function l(){return[o.use.shareAnalytics(),(0,s.useCallback)(e=>{o.getState().setShareAnalytics(e)},[])]}function u(){return[o.use.shareDiagnostics(),(0,s.useCallback)(e=>{o.getState().setShareDiagnostics(e)},[])]}function d(){return[o.use.tosAccepted(),(0,s.useCallback)(e=>{o.getState().setTosAccepted(e)},[])]}function f(){return[o.use.privacyConsent(),(0,s.useCallback)(e=>{o.getState().setPrivacyConsent(e)},[])]}function p(){return[o.use.analyticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setAnalyticsConsentCurrent(e)},[])]}function m(){return[o.use.diagnosticsConsentCurrent(),(0,s.useCallback)(e=>{o.getState().setDiagnosticsConsentCurrent(e)},[])]}function h(){return o.getState().tosAccepted}function g(){return o.getState().privacyConsent}function _(){return o.getState().analyticsConsentCurrent}function v(){return o.getState().diagnosticsConsentCurrent}function y(){return o.getState().consentHydrated}function b(){return o.getState().shareAnalytics&&i(`shareAnalytics`,!1)}function x(){if(typeof window>`u`)return``;try{return n(c,``)}catch{return``}}function S(e){if(!(typeof window>`u`))try{e===``?t(c):r(c,e)}catch{}}export{x as a,p as c,l as d,u as f,g as i,m as l,S as m,y as n,b as o,d as p,v as r,h as s,_ as t,f as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{M as t,N as n,O as r,c as i,i as a,j as o,k as s,m as c,n as l,o as u,r as d,s as f,t as p}from"./native-biometric-Czaf9IqI.js";import{t as m}from"./react-DJZBPgpf.js";import{F as h,t as g}from"./button-amTXFI-2.js";import{n as _}from"./QueryClientProvider-DKhXIxGb.js";import{t as v}from"./useQuery-B45lW1Kk.js";import{t as y}from"./useMutation-Lj4VunQV.js";import{t as b}from"./jsx-runtime-CVSDxk6A.js";import{t as x}from"./cn-C36Yvcac.js";import{t as S}from"./card-Bv5O5juh.js";import{t as ee}from"./chevron-down-qD-re7AW.js";import{t as te}from"./chevron-right-DqqmezXC.js";import{t as C}from"./loader-circle-Cz7opInR.js";import{t as w}from"./pencil-CUIr0IFo.js";import{t as T}from"./x-CkSVp1Ok.js";import{t as E}from"./notice-DkcNAP8O.js";import{t as D}from"./tag-CV4v7fRF.js";import{t as O}from"./input-CoUmPnRU.js";import{t as k}from"./toggle-CDfguvUz.js";import{n as A}from"./toast-xTp-xwYL.js";import{t as ne}from"./confirm-dialog-CSkhRFRk.js";import{t as j}from"./dropdown-ByHOpeOU.js";import{f as M,n as re,r as ie}from"./auth-store-B0Vpa2Ej.js";import{t as N}from"./sdk.gen-CmKfVpgB.js";import{c as P,s as ae}from"./routes-BbeIx_F9.js";import{n as oe,t as se}from"./react-query.gen-DPzPS206.js";import{B as ce,D as le,Fn as ue,H as de,Hr as fe,In as pe,Ln as me,Oi as F,S as I,Ur as L,V as R,Wr as z,b as B,kn as he,x as ge,y as V,yi as _e}from"./index-6YxiY2Ly.js";import{t as H}from"./use-active-assistant-id-BNRMo_Mi.js";import{t as U}from"./detail-card-RGTjHkZ8.js";import{t as W}from"./setting-row-QKgqbQ4U.js";var G=e(m(),1),K=b(),q=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,t]=(0,G.useState)(()=>r(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>n(`dockBadgesEnabled`,()=>{t(r(`dockBadgesEnabled`,!0))}),[]),[e,e=>{t(e),o(`dockBadgesEnabled`,e),e||he(0)}]}function J({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:x(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=me(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=ve.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ue(e.sourceKind):await pe(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(xe,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(J,{row:e,onToggle:p},e.id))}),r&&(0,K.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Ce(){let e=z({platformHostedOnly:!0}),t=fe(),n=L(),r=_(),{data:i,isLoading:a,isError:o}=v({...se(),enabled:e===`full`&&t}),s=y({mutationFn:async e=>{let{data:t}=await N({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,l=i?.access_consented??!1,u=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(k,{checked:l,disabled:u,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,K.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=c(),[t,n]=(0,G.useState)(()=>a()),[r,o]=(0,G.useState)(!1),[s,m]=(0,G.useState)(`Face ID`),[h,g]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(d().then(o),l().then(m))},[e]),!e||!r)return null;let _=async()=>{g(!0);try{if(t)u(!1),await p(),n(!1);else{let e=i();e&&await f(e),u(!0),n(!0)}}finally{g(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,s,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,s,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(k,{checked:t,onChange:()=>void _(),disabled:h})]})})}function Y(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=V.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=H(),t=_(),{data:n,isError:r}=v({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,l]=(0,G.useState)(`strict`),[u,d]=(0,G.useState)(!1),f=(0,G.useRef)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||f.current||(a(B(n.interactive).id),s(B(n.autonomous).id),l(B(n.headless).id),m(!0))},[n]),(0,G.useEffect)(()=>()=>{h.current!==null&&(clearTimeout(h.current),h.current=null,g.current?.(),g.current=null)},[]);let y=(0,G.useCallback)((n,r,i)=>{if(!e||!p)return;let a=V.find(e=>e.id===n)?.riskThreshold,o=V.find(e=>e.id===r)?.riskThreshold,s=V.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,p,t]),b=(0,G.useCallback)((e,t,n)=>{h.current!==null&&clearTimeout(h.current),g.current=()=>y(e,t,n),h.current=setTimeout(()=>{g.current?.(),h.current=null,g.current=null},500)},[y]),x=(0,G.useCallback)(e=>{f.current=!0,a(e),b(e,o,c)},[o,c,b]),C=(0,G.useCallback)(e=>{f.current=!0,s(e),b(i,e,c)},[i,c,b]),w=(0,G.useCallback)(e=>{f.current=!0,l(e),b(i,o,e)},[i,o,b]),T=V.find(e=>e.id===i),E=V.find(e=>e.id===o),D=V.find(e=>e.id===c),O=!e||!p;return(0,K.jsxs)(S,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:i,onChange:x,options:X,disabled:O})}),T&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:T.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":u,children:[u?(0,K.jsx)(ee,{className:`h-4 w-4`}):(0,K.jsx)(te,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:u?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:o,onChange:C,options:X,disabled:O})}),E&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:E.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:c,onChange:w,options:X,disabled:O})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]})]})]})]})]})}var Z=e(h(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,G.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await de(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,K.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,K.jsx)(E,{tone:`error`,children:h}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(j,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([R(e),R(e,{origin:`default`})]);return Ae(t,n)}return R(e)},[e]),_=(0,G.useCallback)(async()=>{o(!0);try{i(await h(p)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[h,p]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await h(p);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[h,p]);let v=(0,G.useCallback)(async()=>{if(d)try{await ce(e,d.id),_()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{f(null)}},[e,d,_]);return(0,Z.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(k,{checked:p,onChange:m,label:`Show all defaults`}),(0,K.jsx)(g,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(E,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(F,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(D,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>u(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>f(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(_e,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,K.jsx)(Oe,{assistantId:e,existingRule:l,onClose:()=>u(null),onSaved:()=>{u(null),_()}}),(0,K.jsx)(ne,{open:d!==null,title:`Delete Trust Rule?`,message:d?`Remove the ${Q(d.risk).toLowerCase()}-risk rule for ${d.tool} matching "${d.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>f(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(S,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(F,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,K.jsx)(g,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),n=ie(),i=n,a=re.use.user()?.id??null,[o,c]=(0,G.useState)(()=>r(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>r(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>s(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(we,{}),(0,K.jsx)(Se,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Te,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:n?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:ae(P.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:o,onChange:()=>{let e=!o;c(e),M(`share_analytics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),M(`share_diagnostics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(Ce,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:d,onChange:e=>{f(e),t(`llmLogRetention`,e)},options:Pe})}),(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{M as t,N as n,O as r,c as i,i as a,j as o,k as s,m as c,n as l,o as u,r as d,s as f,t as p}from"./native-biometric-Czaf9IqI.js";import{t as m}from"./react-DJZBPgpf.js";import{F as h,t as g}from"./button-amTXFI-2.js";import{n as _}from"./QueryClientProvider-DKhXIxGb.js";import{t as v}from"./useQuery-B45lW1Kk.js";import{t as y}from"./useMutation-Lj4VunQV.js";import{t as b}from"./jsx-runtime-CVSDxk6A.js";import{t as x}from"./cn-C36Yvcac.js";import{t as S}from"./card-Bv5O5juh.js";import{t as ee}from"./chevron-down-qD-re7AW.js";import{t as te}from"./chevron-right-DqqmezXC.js";import{t as C}from"./loader-circle-Cz7opInR.js";import{t as w}from"./pencil-CUIr0IFo.js";import{t as T}from"./x-CkSVp1Ok.js";import{t as E}from"./notice-DkcNAP8O.js";import{t as D}from"./tag-CV4v7fRF.js";import{t as O}from"./input-CoUmPnRU.js";import{t as k}from"./toggle-CDfguvUz.js";import{n as A}from"./toast-xTp-xwYL.js";import{t as ne}from"./confirm-dialog-CSkhRFRk.js";import{t as j}from"./dropdown-ByHOpeOU.js";import{f as M,n as re,r as ie}from"./auth-store-CKsDsnkp.js";import{t as N}from"./sdk.gen-CmKfVpgB.js";import{c as P,s as ae}from"./routes-BbeIx_F9.js";import{n as oe,t as se}from"./react-query.gen-DPzPS206.js";import{B as ce,D as le,Fn as ue,H as de,Hr as fe,In as pe,Ln as me,Oi as F,S as I,Ur as L,V as R,Wr as z,b as B,kn as he,x as ge,y as V,yi as _e}from"./index-DQjUULFO.js";import{t as H}from"./use-active-assistant-id-BNRMo_Mi.js";import{t as U}from"./detail-card-RGTjHkZ8.js";import{t as W}from"./setting-row-QKgqbQ4U.js";var G=e(m(),1),K=b(),q=[{id:`accessibility`,type:`system`,sourceKind:`accessibility`,label:`Accessibility`,description:`Allows your assistant to click, type, and control apps on your behalf.`},{id:`screen`,type:`system`,sourceKind:`screen`,label:`Screen Recording`,description:`Allows your assistant to capture screen context during computer-use tasks.`},{id:`microphone`,type:`system`,sourceKind:`microphone`,label:`Microphone`,description:`Allows your assistant to capture audio for voice input and recordings.`},{id:`speechRecognition`,type:`system`,sourceKind:`speechRecognition`,label:`Speech Recognition`,description:`Allows your assistant to transcribe your speech into text on-device.`},{id:`notifications`,type:`system`,sourceKind:`notifications`,label:`Notifications`,description:`Allows your assistant to send macOS alerts for approvals, messages, and task updates.`}],ve=[{id:`notificationBadges`,type:`local`,label:`Notification Badges`,description:`Allows your assistant to show unseen conversation counts on the Dock icon.`}];function ye(){let[e,t]=(0,G.useState)(null);return{pendingKind:e,run:async(e,n)=>{t(e);try{await n()}catch{}finally{t(t=>t===e?null:t)}}}}function be(){let[e,t]=(0,G.useState)(()=>r(`dockBadgesEnabled`,!0));return(0,G.useEffect)(()=>n(`dockBadgesEnabled`,()=>{t(r(`dockBadgesEnabled`,!0))}),[]),[e,e=>{t(e),o(`dockBadgesEnabled`,e),e||he(0)}]}function J({row:e,onToggle:t}){return(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(k,{checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:()=>t(e.id)}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>t(e.id),className:x(`block w-full text-left`,e.disabled?`cursor-not-allowed`:`cursor-pointer`),children:[(0,K.jsx)(`span`,{className:`block text-[14px] font-semibold leading-[18px] text-[var(--content-emphasised)]`,children:e.label}),(0,K.jsx)(`span`,{className:`mt-1 block text-[13px] font-medium leading-[18px] text-[var(--content-tertiary)]`,children:e.description})]}),e.error&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:e.error})]})]})}function xe(){return(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin rounded-full border-2 border-[var(--border-base)] border-t-[var(--content-tertiary)]`})}function Se({compact:e=!1}){let{state:t,loading:n,error:r,supported:i,refresh:a}=me(),{pendingKind:o,run:s}=ye(),[c,l]=be(),u=(0,G.useMemo)(()=>{let e=new Map;if(!t)return e;for(let n of q){let r=t[n.sourceKind];r&&e.set(n.id,{meta:n,item:r})}return e},[t]),d=(0,G.useMemo)(()=>{let e=q.map(e=>{let t=u.get(e.id)?.item;return t?{id:e.id,label:e.label,description:e.description,checked:t.status===`granted`,disabled:o===e.id||t.status===`restricted`,...t.error?{error:t.error}:{}}:null}).filter(Boolean),t=ve.map(e=>({id:e.id,label:e.label,description:e.description,checked:c,disabled:o===e.id}));return[...e,...t]},[c,o,u]);if(!i)return null;let f=async(e,t)=>{t.status===`granted`||t.status===`denied`||!t.canRequest?await ue(e.sourceKind):await pe(e.sourceKind),await a()},p=e=>{let t=u.get(e);if(t){s(e,()=>f(t.meta,t.item));return}e===`notificationBadges`&&s(e,async()=>{l(!c)})};return(0,K.jsxs)(`section`,{className:`w-full rounded-[20px] border border-[var(--border-hover)] bg-[var(--surface-lift)] px-4 pb-3 pt-5`,children:[(0,K.jsx)(`h2`,{className:`text-[18px] font-semibold leading-[22px] text-[var(--content-emphasised)]`,children:`System Permissions`}),n&&d.length===0?(0,K.jsxs)(`div`,{className:`mt-6 flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,K.jsx)(xe,{}),`Checking permissions...`]}):(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:d.map(e=>(0,K.jsx)(J,{row:e,onToggle:p},e.id))}),r&&(0,K.jsx)(`div`,{role:`alert`,className:`mt-6 rounded-lg border border-[color-mix(in_srgb,var(--system-negative-strong)_25%,transparent)] bg-[var(--system-negative-weak)] p-3 text-body-medium-lighter text-[var(--content-secondary)]`,children:r})]})}function Ce(){let e=z({platformHostedOnly:!0}),t=fe(),n=L(),r=_(),{data:i,isLoading:a,isError:o}=v({...se(),enabled:e===`full`&&t}),s=y({mutationFn:async e=>{let{data:t}=await N({body:{access_consented:e},throwOnError:!0});return t},onSuccess:e=>{oe(r,void 0,e),A.success(e?.access_consented?`Admin data access enabled.`:`Admin data access disabled.`)},onError:()=>{A.error(`Failed to update log access consent.`)}});if(e===`gated`)return null;let c=e===`full`&&n,l=i?.access_consented??!1,u=e!==`full`||!t||a||o||s.isPending;return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Allow Staff Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:`When enabled, Vellum Staff will be able to access your assistant and its data for debugging purposes. It's suggested that you leave this off and only turn it on temporarily if you need Vellum Support's help in investigating an issue.`}),e===`full`&&o&&(0,K.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--system-negative-strong)]`,children:`Failed to load consent setting.`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e===`disabled`?null:(0,K.jsxs)(K.Fragment,{children:[(s.isPending||c)&&(0,K.jsx)(C,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,K.jsx)(k,{checked:l,disabled:u,onChange:()=>s.mutate(!l)})]})})]}),e===`disabled`&&(0,K.jsx)(le,{className:`mt-3`,children:`Log in to the Vellum platform to manage admin data access.`})]})}function we(){let e=c(),[t,n]=(0,G.useState)(()=>a()),[r,o]=(0,G.useState)(!1),[s,m]=(0,G.useState)(`Face ID`),[h,g]=(0,G.useState)(!1);if((0,G.useEffect)(()=>{e&&(d().then(o),l().then(m))},[e]),!e||!r)return null;let _=async()=>{g(!0);try{if(t)u(!1),await p(),n(!1);else{let e=i();e&&await f(e),u(!0),n(!0)}}finally{g(!1)}};return(0,K.jsx)(U,{title:`Security`,children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsxs)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:[`Use `,s,` for sign-in`]}),(0,K.jsxs)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-tertiary)]`,children:[`When your session expires, verify with `,s,` or your device passcode instead of signing in again.`]})]}),(0,K.jsx)(k,{checked:t,onChange:()=>void _(),disabled:h})]})})}function Y(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}var X=V.map(e=>({value:e.id,label:e.label,icon:(0,K.jsx)(e.icon,{className:`h-3.5 w-3.5`})}));function Te(){let e=H(),t=_(),{data:n,isError:r}=v({queryKey:[`thresholds`,e],queryFn:()=>ge(e),staleTime:3e4}),[i,a]=(0,G.useState)(`relaxed`),[o,s]=(0,G.useState)(`conservative`),[c,l]=(0,G.useState)(`strict`),[u,d]=(0,G.useState)(!1),f=(0,G.useRef)(!1),[p,m]=(0,G.useState)(!1),h=(0,G.useRef)(null),g=(0,G.useRef)(null);(0,G.useEffect)(()=>{!n||f.current||(a(B(n.interactive).id),s(B(n.autonomous).id),l(B(n.headless).id),m(!0))},[n]),(0,G.useEffect)(()=>()=>{h.current!==null&&(clearTimeout(h.current),h.current=null,g.current?.(),g.current=null)},[]);let y=(0,G.useCallback)((n,r,i)=>{if(!e||!p)return;let a=V.find(e=>e.id===n)?.riskThreshold,o=V.find(e=>e.id===r)?.riskThreshold,s=V.find(e=>e.id===i)?.riskThreshold;!a||!o||!s||I(e,{interactive:a,autonomous:o,headless:s}).then(()=>{t.invalidateQueries({queryKey:[`thresholds`,e]})}).catch(()=>{})},[e,p,t]),b=(0,G.useCallback)((e,t,n)=>{h.current!==null&&clearTimeout(h.current),g.current=()=>y(e,t,n),h.current=setTimeout(()=>{g.current?.(),h.current=null,g.current=null},500)},[y]),x=(0,G.useCallback)(e=>{f.current=!0,a(e),b(e,o,c)},[o,c,b]),C=(0,G.useCallback)(e=>{f.current=!0,s(e),b(i,e,c)},[i,c,b]),w=(0,G.useCallback)(e=>{f.current=!0,l(e),b(i,o,e)},[i,o,b]),T=V.find(e=>e.id===i),E=V.find(e=>e.id===o),D=V.find(e=>e.id===c),O=!e||!p;return(0,K.jsxs)(S,{children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Assistant Access`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Control which actions your assistant can take without asking first. Each action is classified by risk level — your access level determines which levels auto-approve. Trust Rules fine-tune this for specific actions by raising or lowering their risk.`}),r&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--system-negative-strong)]`,children:`Could not load threshold settings. Check your connection and reload.`}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Conversations`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When you're chatting with your assistant directly.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:i,onChange:x,options:X,disabled:O})}),T&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:T.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1 text-[var(--content-secondary)] hover:text-[var(--content-default)] transition-colors`,"aria-expanded":u,children:[u?(0,K.jsx)(ee,{className:`h-4 w-4`}):(0,K.jsx)(te,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{className:`text-body-medium-default`,children:`Advanced`})]}),(0,K.jsxs)(`div`,{className:u?`mt-4 space-y-4`:`hidden`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Background`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When your assistant acts without you — scheduled tasks, background jobs, and external triggers.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:o,onChange:C,options:X,disabled:O})}),E&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:E.description})]}),(0,K.jsx)(Y,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Headless`}),(0,K.jsx)(`p`,{className:`mt-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:`When triggered externally with no interactive client.`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:c,onChange:w,options:X,disabled:O})}),D&&(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:D.description})]})]})]})]})]})}var Z=e(h(),1),Ee=[`bash`,`file_read`,`file_write`,`file_edit`,`web_fetch`,`skill_load`],De=[{value:`low`,label:`Low`,description:`Auto-approve without prompting`},{value:`medium`,label:`Medium`,description:`Prompt before executing`},{value:`high`,label:`High`,description:`Always require explicit approval`}];function Oe({assistantId:e,existingRule:t,onClose:n,onSaved:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(t.tool),[s,c]=(0,G.useState)(t.pattern),[l,u]=(0,G.useState)(t.risk),[d,f]=(0,G.useState)(t.description??``),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=s.trim(),v=_.length>0&&!p,y=(0,G.useCallback)(async n=>{if(n.preventDefault(),!v)return;let i=d.trim()||`${a} — ${_}`;m(!0),g(null);try{await de(e,t.id,{risk:l,description:i}),r()}catch(e){g(e instanceof Error?e.message:`Failed to save trust rule.`)}finally{m(!1)}},[e,v,d,t,r,l,a,_]);return(0,Z.createPortal)((0,K.jsx)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rule-form-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&n()},[n]),onClick:(0,G.useCallback)(e=>{e.target===i.current&&n()},[n]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[calc(100vh-2rem)] w-full max-w-md flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rule-form-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Edit Trust Rule`}),(0,K.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(T,{className:`h-4 w-4`})})]}),(0,K.jsxs)(`form`,{onSubmit:e=>void y(e),className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-6 py-4`,children:[h&&(0,K.jsx)(E,{tone:`error`,children:h}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`trust-rule-tool`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`Tool`}),(0,K.jsx)(`div`,{className:`mt-1`,children:(0,K.jsx)(j,{value:a,onChange:o,disabled:!0,options:Ee.map(e=>({value:e,label:e}))})})]}),(0,K.jsx)(O,{label:`Pattern`,type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:`e.g., git *`,disabled:!0}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Risk Level`}),(0,K.jsx)(`div`,{className:`mt-2 flex gap-2`,children:De.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>u(e.value),className:`flex-1 rounded-lg border px-3 py-2 text-left text-body-small-default transition-colors ${l===e.value?e.value===`low`?`border-[var(--system-positive-strong)] bg-[var(--system-positive-weak)] text-[var(--system-positive-strong)]`:e.value===`medium`?`border-[var(--system-warning-strong)] bg-[var(--system-warning-weak)] text-[var(--system-warning-strong)]`:`border-[var(--system-negative-strong)] bg-[var(--system-negative-weak)] text-[var(--system-negative-strong)]`:`border-[var(--border-element)] text-[var(--content-default)] hover:bg-[var(--surface-base)]`}`,children:[(0,K.jsx)(`div`,{children:e.label}),(0,K.jsx)(`div`,{className:`mt-0.5 text-label-medium-default leading-tight opacity-70`,children:e.description})]},e.value))})]}),(0,K.jsx)(O,{label:`Description (optional)`,type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:`${a} — ${_||`pattern`}`}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`rounded-lg border border-[var(--border-element)] bg-white px-4 py-2 text-body-medium-default text-[var(--content-default)] transition-colors hover:bg-[var(--surface-base)] dark:border-[var(--border-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:`Cancel`}),(0,K.jsx)(`button`,{type:`submit`,disabled:!v,className:`rounded-lg bg-[var(--system-positive-strong)] px-4 py-2 text-body-medium-default text-white transition-colors hover:bg-[var(--system-positive-strong)] disabled:cursor-not-allowed disabled:opacity-50`,children:p?`Saving…`:`Save`})]})]})]})}),document.body)}function ke(e){return e.origin===`default`&&!e.userModified}function Ae(e,t){let n=new Set,r=[];for(let t of e)n.has(t.id)||(n.add(t.id),r.push(t));for(let e of t)n.has(e.id)||(n.add(e.id),r.push(e));return r.sort((e,t)=>e.tool===t.tool?e.description.localeCompare(t.description):e.tool.localeCompare(t.tool))}function je(e){switch(e){case`low`:return`positive`;case`medium`:return`warning`;case`high`:return`negative`}}function Q(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me({assistantId:e,onClose:t}){let n=(0,G.useRef)(null),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(!0),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),h=(0,G.useCallback)(async t=>{if(t){let[t,n]=await Promise.all([R(e),R(e,{origin:`default`})]);return Ae(t,n)}return R(e)},[e]),_=(0,G.useCallback)(async()=>{o(!0);try{i(await h(p)),c(null)}catch(e){c(e instanceof Error?e.message:`Failed to load trust rules.`)}finally{o(!1)}},[h,p]);(0,G.useEffect)(()=>{let e=!1;return(async()=>{o(!0);try{let t=await h(p);e||(i(t),c(null))}catch(t){e||c(t instanceof Error?t.message:`Failed to load trust rules.`)}finally{e||o(!1)}})(),()=>{e=!0}},[h,p]);let v=(0,G.useCallback)(async()=>{if(d)try{await ce(e,d.id),_()}catch(e){c(e instanceof Error?e.message:`Failed to delete trust rule.`)}finally{f(null)}},[e,d,_]);return(0,Z.createPortal)((0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{ref:n,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`trust-rules-title`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:(0,G.useCallback)(e=>{e.key===`Escape`&&t()},[t]),onClick:(0,G.useCallback)(e=>{e.target===n.current&&t()},[t]),children:(0,K.jsxs)(`div`,{className:`mx-4 flex max-h-[80vh] w-full max-w-2xl flex-col rounded-xl border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-xl`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-[var(--border-base)] px-6 py-4`,children:[(0,K.jsx)(`h2`,{id:`trust-rules-title`,className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(k,{checked:p,onChange:m,label:`Show all defaults`}),(0,K.jsx)(g,{variant:`outlined`,onClick:t,children:`Done`})]})]}),(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-6 py-4`,children:[s&&(0,K.jsx)(`div`,{className:`mb-3`,children:(0,K.jsx)(E,{tone:`error`,children:s})}),a?(0,K.jsx)(`div`,{className:`flex h-48 items-center justify-center text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Loading…`}):r.length===0?(0,K.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 px-6 text-[var(--content-tertiary)]`,children:[(0,K.jsx)(F,{className:`h-8 w-8`}),(0,K.jsx)(`p`,{className:`max-w-xs text-center text-body-medium-lighter`,children:`No trust rules yet. Rules are created when you classify actions from permission prompts.`})]}):(0,K.jsx)(`ul`,{className:`divide-y divide-[var(--border-base)]`,children:r.map(e=>{let t=ke(e);return(0,K.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:e.tool}),(0,K.jsx)(D,{tone:je(e.risk),children:Q(e.risk)}),e.origin===`default`&&(0,K.jsx)(D,{tone:`neutral`,children:`Default`}),e.userModified&&(0,K.jsx)(D,{tone:`warning`,children:`Modified`})]}),(0,K.jsx)(`div`,{className:`mt-1 truncate font-mono text-body-small-default text-[var(--content-secondary)]`,children:e.pattern}),e.description&&(0,K.jsx)(`div`,{className:`mt-0.5 truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-label":`Edit ${e.tool} rule`,onClick:()=>u(e),className:`rounded-lg p-1.5 text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-base)] hover:text-[var(--content-default)]`,children:(0,K.jsx)(w,{className:`h-4 w-4`})}),(!t||e.userModified)&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Delete ${e.tool} rule`,onClick:()=>f(e),className:`rounded-lg p-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:(0,K.jsx)(_e,{className:`h-4 w-4`})})]})]},e.id)})})]})]})}),l&&(0,K.jsx)(Oe,{assistantId:e,existingRule:l,onClose:()=>u(null),onSaved:()=>{u(null),_()}}),(0,K.jsx)(ne,{open:d!==null,title:`Delete Trust Rule?`,message:d?`Remove the ${Q(d.risk).toLowerCase()}-risk rule for ${d.tool} matching "${d.pattern}"?`:``,confirmLabel:`Delete`,cancelLabel:`Cancel`,destructive:!0,onConfirm:()=>void v(),onCancel:()=>f(null)})]}),document.body)}function Ne(){let e=H(),[t,n]=(0,G.useState)(!1);return(0,K.jsxs)(S,{children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)(F,{className:`mt-0.5 h-5 w-5 shrink-0 text-[var(--content-secondary)]`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`h2`,{className:`text-title-medium text-[var(--content-default)]`,children:`Trust Rules`}),(0,K.jsx)(`p`,{className:`mt-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Manage per-tool rules that control which actions auto-approve and which require your explicit permission.`})]}),(0,K.jsx)(g,{variant:`outlined`,onClick:()=>n(!0),children:`Manage`})]}),t&&(0,K.jsx)(Me,{assistantId:e,onClose:()=>n(!1)})]})}var Pe=[{value:`dontRetain`,label:`Don't retain`},{value:`oneHour`,label:`1 hour`},{value:`oneDay`,label:`1 day`},{value:`sevenDays`,label:`7 days`},{value:`thirtyDays`,label:`30 days`},{value:`ninetyDays`,label:`90 days`},{value:`keepForever`,label:`Keep forever`}],Fe=`thirtyDays`;function $(){return(0,K.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function Ie(){let e=z({platformHostedOnly:!0}),n=ie(),i=n,a=re.use.user()?.id??null,[o,c]=(0,G.useState)(()=>r(`shareAnalytics`,!0)),[l,u]=(0,G.useState)(()=>r(`shareDiagnostics`,!0)),[d,f]=(0,G.useState)(()=>s(`llmLogRetention`,Fe));return(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsx)(we,{}),(0,K.jsx)(Se,{}),(0,K.jsx)(Ne,{}),(0,K.jsx)(Te,{}),(0,K.jsx)(U,{title:`Privacy`,subtitle:n?(0,K.jsxs)(K.Fragment,{children:[`View details about what data we collect and how it's used in our`,` `,(0,K.jsx)(`a`,{href:ae(P.docs.legal.privacyPolicy),target:`_blank`,rel:`noreferrer`,className:`underline`,children:`privacy policy`}),`.`]}):void 0,children:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[i&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(W,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:o,onChange:()=>{let e=!o;c(e),M(`share_analytics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{}),(0,K.jsx)(W,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:l,onChange:()=>{let e=!l;u(e),M(`share_diagnostics`,e,{userId:a,hasPlatformSession:n})},variant:`toggle-trailing`}),(0,K.jsx)($,{})]}),(0,K.jsx)(Ce,{}),e!==`gated`&&(0,K.jsx)($,{}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`llm-log-retention`,className:`block text-body-medium-default text-[var(--content-default)]`,children:`LLM Request Log Retention`}),(0,K.jsx)(`div`,{className:`mt-2`,style:{maxWidth:280},children:(0,K.jsx)(j,{value:d,onChange:e=>{f(e),t(`llmLogRetention`,e)},options:Pe})}),(0,K.jsx)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:`How long to keep LLM request and response logs on this device. These logs record the prompts and completions sent to model providers and are used for debugging. Shorter retention improves privacy; longer retention helps troubleshoot issues.`})]})]})})]})}export{Ie as PrivacyPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s}from"./local-mode-grqHUoNh.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{d as l,i as u,n as d}from"./auth-store-B0Vpa2Ej.js";import{c as f}from"./routes-BbeIx_F9.js";import{d as p,f as m,p as h,u as g}from"./prefs-DIsAodtg.js";import{t as _}from"./client-feature-flag-store-DdDbgq_C.js";import{_t as v,bt as y,ft as b,ht as x,rn as S,vt as C}from"./index-6YxiY2Ly.js";import{t as w}from"./step-indicator-dots-Cou0-IgA.js";import{n as T,t as E}from"./consent-controls-BZMxm0n3.js";var D=e(n(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=o();function A(){let e=i(),[n]=a(),o=d.use.user()?.id??null,A=c(),j=t(),M=C(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=u();(0,D.useEffect)(()=>{j||v()},[j]);let H=n.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(l({userId:o,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=y(M);x(b.privacyTos,{userId:o,variant:e})}let t=n.get(`hosting`),r=new URLSearchParams;t&&r.set(`hosting`,t);let i=r.toString();e(`${O({isNative:j,isLocalHatch:s()&&t!==null&&t!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,n,N,F,L,o]);return(0,k.jsx)(S,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(r,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{m as t}from"./native-biometric-Czaf9IqI.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-amTXFI-2.js";import{d as i,h as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{p as s}from"./local-mode-grqHUoNh.js";import{t as c}from"./is-electron-y5bNUVyG.js";import{d as l,i as u,n as d}from"./auth-store-CKsDsnkp.js";import{c as f}from"./routes-BbeIx_F9.js";import{d as p,f as m,p as h,u as g}from"./prefs-hu4Ft3Gc.js";import{t as _}from"./client-feature-flag-store-C0g8zi1W.js";import{_t as v,bt as y,ft as b,ht as x,rn as S,vt as C}from"./index-DQjUULFO.js";import{t as w}from"./step-indicator-dots-Cou0-IgA.js";import{n as T,t as E}from"./consent-controls-BZMxm0n3.js";var D=e(n(),1);function O({isNative:e,isLocalHatch:t}){return e||t?f.onboarding.hatching:f.onboarding.research}var k=o();function A(){let e=i(),[n]=a(),o=d.use.user()?.id??null,A=c(),j=t(),M=C(_.use.stringFlags().preChatOnboardingExperiment20260606??`control`),[N,P]=p(),[F,I]=m(),[L,R]=h(),[z,B]=g(),V=u();(0,D.useEffect)(()=>{j||v()},[j]);let H=n.get(`preview`)===`true`,U=(0,D.useCallback)(e=>{},[]),W=H?U:P,G=H?U:I,K=H?U:R,q=H?U:B,J=(0,D.useCallback)(()=>{if(H){e(`${f.onboarding.prechat}?preview=true`);return}if(l({userId:o,tos:L,privacy:z,shareAnalytics:N,shareDiagnostics:F,hasPlatformSession:V}),!j){let e=y(M);x(b.privacyTos,{userId:o,variant:e})}let t=n.get(`hosting`),r=new URLSearchParams;t&&r.set(`hosting`,t);let i=r.toString();e(`${O({isNative:j,isLocalHatch:s()&&t!==null&&t!==`vellum-cloud`})}${i?`?${i}`:``}`)},[z,V,j,H,e,M,n,N,F,L,o]);return(0,k.jsx)(S,{children:(0,k.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${A?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[j&&(0,k.jsx)(`div`,{className:`mb-8 flex w-full justify-center`,style:{animation:`fadeInUp 0.3s ease-out 0.1s both`},children:(0,k.jsx)(w,{current:2,total:3})}),(0,k.jsx)(`h1`,{className:A?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Before You Start`}),(0,k.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${A?`mt-3.5`:`mt-4`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Choose your privacy preferences. You can update these anytime in the Settings.`}),(0,k.jsx)(T,{electron:A,shareAnalytics:N,shareDiagnostics:F,onShareAnalyticsChange:W,onShareDiagnosticsChange:G,className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`}}),(0,k.jsx)(E,{electron:A,privacyConsent:z,tosAccepted:L,onPrivacyChange:q,onTosChange:K,className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`}}),(0,k.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${A?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.55s both`},children:[(0,k.jsx)(r,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:!L||!z,onClick:J,className:A?void 0:`h-11 text-base`,children:`Start`}),(0,k.jsx)(r,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:()=>e(-1),className:A?void 0:`h-11 text-base`,children:`Back`})]})]})})}export{A as PrivacyScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{S as t,_ as n}from"./native-biometric-Czaf9IqI.js";import{t as r}from"./capture-error-Dhiismgm.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{p as l,w as u}from"./local-mode-grqHUoNh.js";import{D as d,n as f}from"./auth-store-B0Vpa2Ej.js";import{c as p}from"./api-ByWcEKXC.js";import{c as m}from"./routes-BbeIx_F9.js";import{a as h,i as g}from"./login-flow-C69Wgb68.js";import{n as _}from"./index-6YxiY2Ly.js";import{r as v,t as y}from"./account-shell-74OchOxg.js";var b=e(i(),1),x=c();function S(){let[e]=o(),i=a(),c=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let r=await t(),a=n(r.ok&&!!r.data.user,r.ok?[]:r.flows??[]);switch(a.kind){case`authenticated`:{if(await c(),l())try{let e=await p();if(e.ok&&e.data.length>0&&(await u(e.data,d.getState().currentOrganizationId??void 0),!E)){i(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:n}=h({returnTo:E,fallback:e,authIntent:D});n?window.location.href=t:i(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);i(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(a.message);break}}catch(e){r(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,c,E,i,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(s,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(s,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{S as t,_ as n}from"./native-biometric-Czaf9IqI.js";import{t as r}from"./capture-error-Dhiismgm.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{p as l,w as u}from"./local-mode-grqHUoNh.js";import{D as d,n as f}from"./auth-store-CKsDsnkp.js";import{c as p}from"./api-Zs5JMgKY.js";import{c as m}from"./routes-BbeIx_F9.js";import{a as h,i as g}from"./login-flow-C4Ehxg-g.js";import{n as _}from"./index-DQjUULFO.js";import{r as v,t as y}from"./account-shell-74OchOxg.js";var b=e(i(),1),x=c();function S(){let[e]=o(),i=a(),c=f.use.refreshSession(),S=e.get(`error`),[C,w]=(0,b.useState)(null),T=(0,b.useRef)(!1),E=e.get(`returnTo`),D=g(e);return(0,b.useEffect)(()=>{T.current||S||(T.current=!0,(async()=>{try{let r=await t(),a=n(r.ok&&!!r.data.user,r.ok?[]:r.flows??[]);switch(a.kind){case`authenticated`:{if(await c(),l())try{let e=await p();if(e.ok&&e.data.length>0&&(await u(e.data,d.getState().currentOrganizationId??void 0),!E)){i(m.assistant,{replace:!0});break}}catch{}let e=m.assistant,{destination:t,requiresFullPageNavigation:n}=h({returnTo:E,fallback:e,authIntent:D});n?window.location.href=t:i(t,{replace:!0});break}case`provider_signup`:{let t=e.get(`returnTo`);i(t?`${m.account.providerSignup}?returnTo=${encodeURIComponent(t)}`:m.account.providerSignup,{replace:!0});break}case`error`:w(a.message);break}}catch(e){r(e,{context:`provider_callback`}),w(`Something went wrong. Please try signing in again.`)}})())},[D,S,c,E,i,e]),S===`signup_closed`?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Signups are currently closed`,subtitle:`Join the community to request access or learn when signups reopen.`}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,x.jsx)(`a`,{href:_,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Join the community`}),(0,x.jsx)(s,{to:m.account.login,className:`text-sm font-medium text-[var(--content-emphasised)] hover:underline`,children:`Back to sign in`})]})]}):S||C?(0,x.jsxs)(y,{children:[(0,x.jsx)(v,{title:`Authentication failed`,subtitle:C??`Something went wrong during social sign-in. Please try again or use a different method.`}),(0,x.jsx)(`div`,{className:`flex flex-col items-center gap-4`,children:(0,x.jsx)(s,{to:m.account.login,className:`inline-flex items-center justify-center gap-2 rounded-lg bg-[var(--primary-base)] px-6 py-3 text-sm font-medium text-[var(--content-inset)] no-underline transition-colors hover:bg-[var(--primary-hover)]`,children:`Back to sign in`})})]}):(0,x.jsx)(y,{children:(0,x.jsx)(v,{title:`Completing sign-in...`,subtitle:`Please wait while we finish authenticating you.`})})}export{S as ProviderCallbackPage};
@@ -1 +1 @@
1
- import{Gt as e,j as t,k as n,tr as r}from"./sdk.gen-D-8W_bKa.js";var i=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0,defaultModel:`claude-sonnet-4-6`},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0,defaultModel:`gpt-5.4-mini`},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0,defaultModel:`gemini-3-flash-preview`},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1,defaultModel:`llama3.2`,models:[{id:`llama3.2`,displayName:`Llama 3.2`,contextWindowTokens:128e3,maxOutputTokens:4096},{id:`mistral`,displayName:`Mistral`,contextWindowTokens:32768,maxOutputTokens:4096}]},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0,defaultModel:`accounts/fireworks/models/minimax-m3`},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`x-ai/grok-4.20`,displayName:`Grok 4.20`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-r1-0528`,displayName:`DeepSeek R1`,contextWindowTokens:163840,maxOutputTokens:32e3}]},{id:`vercel-ai-gateway`,displayName:`Vercel AI Gateway`,apiKeyPlaceholder:`vck_...`,docsUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys&title=AI+Gateway+API+Keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`xai/grok-4.3`,displayName:`Grok 4.3`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-v4-flash`,displayName:`DeepSeek V4 Flash`,contextWindowTokens:2e5,maxOutputTokens:384e3}]},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key (optional)`,docsUrl:null,requiresKey:!0}],a=i[0];function o(e){return i.find(t=>t.id===e)}function s(e){let t=o(e);return t?.defaultModel??t?.models?.[0]?.id}var c=`onboarding.providerKey`,l=`custom-balanced`,u=2e5;function d(e){try{if(e===null){sessionStorage.removeItem(c);return}sessionStorage.setItem(c,JSON.stringify(e))}catch{}}function f(e){return typeof e==`object`&&!!e&&`provider`in e&&typeof e.provider==`string`&&`key`in e&&typeof e.key==`string`&&(!(`model`in e)||typeof e.model==`string`)&&(!(`baseUrl`in e)||typeof e.baseUrl==`string`)&&(!(`customModels`in e)||typeof e.customModels==`string`)}function p(){try{let e=sessionStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return f(t)?t:null}catch{return null}}function m(){let e=p();try{sessionStorage.removeItem(c)}catch{}return e}async function h(e,t,n){let{response:i}=await r({path:{assistant_id:e},body:{type:`api_key`,name:t,value:n},throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to write provider secret`),{status:i?.status})}async function g(t,n,r,i){let a=n===`openai-compatible`,o=r||a?{type:`api_key`,credential:`credential/${n}/api_key`}:{type:`none`},s=a&&i?.baseUrl?i.baseUrl:void 0,c=a&&i?.customModels?i.customModels.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):void 0,{response:l}=await e({path:{assistant_id:t},body:{name:n,provider:n,auth:o,...s===void 0?{}:{base_url:s},...c===void 0?{}:{models:c}},throwOnError:!1});if(!l?.ok&&l?.status!==409)throw Object.assign(Error(`Failed to create provider connection`),{status:l?.status})}function _(e,t){let n=o(e)?.models?.find(e=>e.id===t),r={provider:e,model:t,provider_connection:e,source:`user`,label:`Balanced`,description:`Good balance of quality, cost, and speed`,maxTokens:n?.maxOutputTokens??16e3,contextWindow:{maxInputTokens:n?.contextWindowTokens??u}};return e===`ollama`?(r.effort=`none`,r.thinking={enabled:!1,streamThinking:!1}):(r.effort=`high`,r.thinking={enabled:!0,streamThinking:!0}),r}async function v(e,t,r){let{response:i}=await n({path:{assistant_id:e,name:l},body:_(t,r),throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to set provider profile`),{status:i?.status})}async function y(e){let{response:n}=await t({path:{assistant_id:e},body:{llm:{activeProfile:l}},throwOnError:!1});if(!n?.ok)throw Object.assign(Error(`Failed to activate provider profile`),{status:n?.status})}async function b(e){let t=m();if(!t)return;let n=t.key.trim(),r=n.length>0,i=t.provider===`openai-compatible`;(r||i)&&await h(e,t.provider,n),await g(e,t.provider,r,{baseUrl:t.baseUrl,customModels:t.customModels});let a=t.model?.trim(),o=t.customModels?.split(`,`).map(e=>e.trim()).find(e=>e),c=a||o||s(t.provider);c&&(await v(e,t.provider,c),await y(e))}export{i as a,a as i,p as n,s as o,d as r,o as s,b as t};
1
+ import{Wt as e,er as t,j as n,k as r}from"./sdk.gen-jDeNbBv8.js";var i=[{id:`anthropic`,displayName:`Anthropic`,apiKeyPlaceholder:`sk-ant-api03-...`,docsUrl:`https://console.anthropic.com/settings/keys`,requiresKey:!0,defaultModel:`claude-sonnet-4-6`},{id:`openai`,displayName:`OpenAI`,apiKeyPlaceholder:`sk-proj-...`,docsUrl:`https://platform.openai.com/api-keys`,requiresKey:!0,defaultModel:`gpt-5.4-mini`},{id:`gemini`,displayName:`Google Gemini`,apiKeyPlaceholder:`AIza...`,docsUrl:`https://aistudio.google.com/apikey`,requiresKey:!0,defaultModel:`gemini-3-flash-preview`},{id:`ollama`,displayName:`Ollama`,apiKeyPlaceholder:null,docsUrl:`https://ollama.com/download`,requiresKey:!1,defaultModel:`llama3.2`,models:[{id:`llama3.2`,displayName:`Llama 3.2`,contextWindowTokens:128e3,maxOutputTokens:4096},{id:`mistral`,displayName:`Mistral`,contextWindowTokens:32768,maxOutputTokens:4096}]},{id:`fireworks`,displayName:`Fireworks`,apiKeyPlaceholder:`fw_...`,docsUrl:`https://fireworks.ai/account/api-keys`,requiresKey:!0,defaultModel:`accounts/fireworks/models/minimax-m3`},{id:`openrouter`,displayName:`OpenRouter`,apiKeyPlaceholder:`sk-or-v1-...`,docsUrl:`https://openrouter.ai/keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`x-ai/grok-4.20`,displayName:`Grok 4.20`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-r1-0528`,displayName:`DeepSeek R1`,contextWindowTokens:163840,maxOutputTokens:32e3}]},{id:`vercel-ai-gateway`,displayName:`Vercel AI Gateway`,apiKeyPlaceholder:`vck_...`,docsUrl:`https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys&title=AI+Gateway+API+Keys`,requiresKey:!0,defaultModel:`anthropic/claude-sonnet-4.6`,models:[{id:`anthropic/claude-sonnet-4.6`,displayName:`Claude Sonnet 4.6`,contextWindowTokens:2e5,maxOutputTokens:64e3},{id:`anthropic/claude-opus-4.8`,displayName:`Claude Opus 4.8`,contextWindowTokens:2e5,maxOutputTokens:128e3},{id:`xai/grok-4.3`,displayName:`Grok 4.3`,contextWindowTokens:2e5,maxOutputTokens:16e3},{id:`deepseek/deepseek-v4-flash`,displayName:`DeepSeek V4 Flash`,contextWindowTokens:2e5,maxOutputTokens:384e3}]},{id:`openai-compatible`,displayName:`OpenAI-compatible`,apiKeyPlaceholder:`Your provider's API key (optional)`,docsUrl:null,requiresKey:!0}],a=i[0];function o(e){return i.find(t=>t.id===e)}function s(e){let t=o(e);return t?.defaultModel??t?.models?.[0]?.id}var c=`onboarding.providerKey`,l=`custom-balanced`,u=2e5;function d(e){try{if(e===null){sessionStorage.removeItem(c);return}sessionStorage.setItem(c,JSON.stringify(e))}catch{}}function f(e){return typeof e==`object`&&!!e&&`provider`in e&&typeof e.provider==`string`&&`key`in e&&typeof e.key==`string`&&(!(`model`in e)||typeof e.model==`string`)&&(!(`baseUrl`in e)||typeof e.baseUrl==`string`)&&(!(`customModels`in e)||typeof e.customModels==`string`)}function p(){try{let e=sessionStorage.getItem(c);if(!e)return null;let t=JSON.parse(e);return f(t)?t:null}catch{return null}}function m(){let e=p();try{sessionStorage.removeItem(c)}catch{}return e}async function h(e,n,r){let{response:i}=await t({path:{assistant_id:e},body:{type:`api_key`,name:n,value:r},throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to write provider secret`),{status:i?.status})}async function g(t,n,r,i){let a=n===`openai-compatible`,o=r||a?{type:`api_key`,credential:`credential/${n}/api_key`}:{type:`none`},s=a&&i?.baseUrl?i.baseUrl:void 0,c=a&&i?.customModels?i.customModels.split(`,`).map(e=>({id:e.trim()})).filter(e=>e.id):void 0,{response:l}=await e({path:{assistant_id:t},body:{name:n,provider:n,auth:o,...s===void 0?{}:{base_url:s},...c===void 0?{}:{models:c}},throwOnError:!1});if(!l?.ok&&l?.status!==409)throw Object.assign(Error(`Failed to create provider connection`),{status:l?.status})}function _(e,t){let n=o(e)?.models?.find(e=>e.id===t),r={provider:e,model:t,provider_connection:e,source:`user`,label:`Balanced`,description:`Good balance of quality, cost, and speed`,maxTokens:n?.maxOutputTokens??16e3,contextWindow:{maxInputTokens:n?.contextWindowTokens??u}};return e===`ollama`?(r.effort=`none`,r.thinking={enabled:!1,streamThinking:!1}):(r.effort=`high`,r.thinking={enabled:!0,streamThinking:!0}),r}async function v(e,t,n){let{response:i}=await r({path:{assistant_id:e,name:l},body:_(t,n),throwOnError:!1});if(!i?.ok)throw Object.assign(Error(`Failed to set provider profile`),{status:i?.status})}async function y(e){let{response:t}=await n({path:{assistant_id:e},body:{llm:{activeProfile:l}},throwOnError:!1});if(!t?.ok)throw Object.assign(Error(`Failed to activate provider profile`),{status:t?.status})}async function b(e){let t=m();if(!t)return;let n=t.key.trim(),r=n.length>0,i=t.provider===`openai-compatible`;(r||i)&&await h(e,t.provider,n),await g(e,t.provider,r,{baseUrl:t.baseUrl,customModels:t.customModels});let a=t.model?.trim(),o=t.customModels?.split(`,`).map(e=>e.trim()).find(e=>e),c=a||o||s(t.provider);c&&(await v(e,t.provider,c),await y(e))}export{i as a,a as i,p as n,s as o,d as r,o as s,b as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{C as t,T as n,x as r}from"./native-biometric-Czaf9IqI.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{n as l}from"./auth-store-B0Vpa2Ej.js";import{c as u}from"./routes-BbeIx_F9.js";import{a as d,o as f}from"./login-flow-C69Wgb68.js";import{i as p,n as m,r as h,t as g}from"./account-shell-74OchOxg.js";import{t as _}from"./signup-shell-D4Afeijm.js";var v=e(i(),1),y=c();function b(){let e=a(),[i]=o(),c=l.use.refreshSession(),b=i.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await r();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let r=await n({email:x,username:C});if(!r.ok){if(t(r)){await c();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(r.errors[0]?.message??`Failed to complete signup.`);return}await c();let i=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});i.requiresFullPageNavigation?window.location.href=i.destination:e(i.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(s,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{C as t,T as n,x as r}from"./native-biometric-Czaf9IqI.js";import{t as i}from"./react-DJZBPgpf.js";import{d as a,h as o,t as s}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as c}from"./jsx-runtime-CVSDxk6A.js";import{n as l}from"./auth-store-CKsDsnkp.js";import{c as u}from"./routes-BbeIx_F9.js";import{a as d,o as f}from"./login-flow-C4Ehxg-g.js";import{i as p,n as m,r as h,t as g}from"./account-shell-74OchOxg.js";import{t as _}from"./signup-shell-D4Afeijm.js";var v=e(i(),1),y=c();function b(){let e=a(),[i]=o(),c=l.use.refreshSession(),b=i.get(`returnTo`),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),[F,I]=(0,v.useState)(!0),L=(0,v.useRef)(!1);(0,v.useEffect)(()=>{L.current||(L.current=!0,(async()=>{try{let t=await r();if(!t.ok){e(u.account.login,{replace:!0});return}S(t.data.user.email??``),w(t.data.user.username??``),E(t.data.user.first_name??``),O(t.data.user.last_name??``),I(!1)}catch{e(u.account.login,{replace:!0})}})())},[e]);let R=async()=>{let r=await n({email:x,username:C});if(!r.ok){if(t(r)){await c();let t=f(b,u.account.root);t.requiresFullPageNavigation?window.location.href=t.destination:e(t.destination);return}M(r.errors[0]?.message??`Failed to complete signup.`);return}await c();let i=d({returnTo:b,fallback:u.account.root,authIntent:`signup`});i.requiresFullPageNavigation?window.location.href=i.destination:e(i.destination)},z=async e=>{e.preventDefault(),M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}},B=async e=>{if(e.preventDefault(),k.trim()){M(null),P(!0);try{await R()}catch{M(`Something went wrong. Please try again.`)}finally{P(!1)}}};if(F)return(0,y.jsx)(g,{children:(0,y.jsx)(h,{title:`Completing signup...`,subtitle:`Please wait while we load your information.`})});if(x&&C){let e=k.trim().length>0&&!N;return(0,y.jsx)(_,{children:(0,y.jsxs)(`form`,{onSubmit:B,className:`signup-details__thread`,children:[(0,y.jsxs)(`h2`,{className:`signup-details__heading`,children:[`Almost there,`,(0,y.jsx)(`br`,{}),`one more detail`]}),j&&(0,y.jsx)(`p`,{className:`signup-details__error`,children:j}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`What should I call you? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`First name`,value:T,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`And your last name? `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,placeholder:`Last name`,value:D,readOnly:!0,disabled:!0})]}),(0,y.jsxs)(`div`,{className:`signup-details__step`,children:[(0,y.jsxs)(`span`,{className:`signup-details__label`,children:[`Your role `,(0,y.jsx)(`span`,{className:`signup-details__req`,children:`*`})]}),(0,y.jsx)(`input`,{className:`signup-details__input`,type:`text`,autoComplete:`organization-title`,placeholder:`e.g. Software Engineer`,value:k,onChange:e=>A(e.target.value),autoFocus:!0})]}),(0,y.jsx)(`div`,{className:`signup-details__step`,children:(0,y.jsx)(`button`,{type:`submit`,className:`signup-details__continue`,disabled:!e,children:N?`Setting up…`:`Continue →`})})]})})}return(0,y.jsxs)(g,{children:[(0,y.jsx)(h,{title:`Complete your account`,subtitle:`We need a few more details to finish setting up your account.`}),(0,y.jsxs)(m,{onSubmit:z,error:j,submitLabel:`Complete signup`,submittingLabel:`Completing...`,isSubmitting:N,footer:(0,y.jsx)(s,{to:u.account.login,className:`text-sm text-[var(--content-secondary)] hover:text-[var(--content-default)]`,children:`← Back to sign in`}),children:[(0,y.jsx)(p,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`Email`,value:x,onChange:e=>S(e.target.value),required:!0}),(0,y.jsx)(p,{id:`username`,type:`text`,autoComplete:`username`,placeholder:`Username`,value:C,onChange:e=>w(e.target.value),required:!0})]})]})}export{b as ProviderSignupPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-Di3QykUd.js";import{Aa as a}from"./index-6YxiY2Ly.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:i(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:i(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(a,{size:16})})]})})}export{u as QuickInputPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{t as r}from"./is-electron-y5bNUVyG.js";import{t as i}from"./public-asset-Di3QykUd.js";import{Aa as a}from"./index-DQjUULFO.js";var o=e(t(),1);async function s(e){r()&&await window.vellum?.quickInput?.submit(e)}async function c(){r()&&await window.vellum?.quickInput?.dismiss()}var l=n();function u(){let[e,t]=(0,o.useState)(``),n=(0,o.useRef)(null);(0,o.useEffect)(()=>{n.current?.focus()},[]);let r=(0,o.useCallback)(n=>{n.preventDefault();let r=e.trim();r&&(s(r),t(``))},[e]),u=(0,o.useCallback)(e=>{e.key===`Escape`&&(e.preventDefault(),c())},[]);return(0,l.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center bg-transparent p-2`,children:(0,l.jsxs)(`form`,{onSubmit:r,className:`flex w-full items-center gap-3 rounded-2xl border border-[var(--border-default)] bg-[var(--surface-base)] px-4 py-3 shadow-lg`,children:[(0,l.jsx)(`img`,{src:i(`/vellum-logo.svg`),alt:`Vellum`,width:24,height:24,className:`shrink-0 dark:hidden`,draggable:!1}),(0,l.jsx)(`img`,{src:i(`/vellum-logo-white.svg`),alt:`Vellum`,width:24,height:24,className:`hidden shrink-0 dark:block`,draggable:!1}),(0,l.jsx)(`input`,{ref:n,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:u,placeholder:`Ask Vellum anything...`,className:`min-w-0 flex-1 bg-transparent text-sm text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`}),(0,l.jsx)(`button`,{type:`submit`,disabled:!e.trim(),className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-[var(--surface-accent)] text-[var(--content-on-accent)] transition-opacity disabled:opacity-30`,children:(0,l.jsx)(a,{size:16})})]})})}export{u as QuickInputPage};
@@ -0,0 +1 @@
1
+ import{t as e}from"./useMutation-Lj4VunQV.js";import{t}from"./queryOptions-BtNi-_9H.js";import{t as n}from"./infiniteQueryOptions-C6p49ZmI.js";import{$n as r,A as i,At as a,Bn as ee,C as te,Cn as ne,Cr as re,D as ie,Dn as ae,Dt as oe,E as se,En as ce,Et as le,F as o,Fr as ue,Ft as de,Gt as fe,Hn as pe,I as me,In as he,Jt as ge,L as _e,Ln as ve,Lt as ye,Mt as s,N as be,O as xe,On as Se,P as Ce,Pn as we,Pr as Te,R as Ee,Sn as De,Sr as Oe,T as ke,Tn as Ae,Tt as je,Un as c,Ut as Me,W as Ne,ar as Pe,br as Fe,dn as Ie,dr as l,fr as u,ir as d,j as f,jn as p,jt as m,kt as h,ln as g,lr as _,nr as Le,o as Re,on as ze,or as Be,ot as Ve,pr as He,qt as Ue,rr as We,sn as Ge,sr as Ke,st as qe,un as Je,ur as Ye,ut as Xe,w as Ze,wn as Qe,wr as $e,wt as et,x as tt,xn as nt,xt as rt,zn as it}from"./sdk.gen-jDeNbBv8.js";var v=(e,t,n,r)=>{let i={_id:e,baseUrl:t?.baseUrl||(t?.client??ue).getConfig().baseUrl};return n&&(i._infinite=n),r&&(i.tags=r),t?.body&&(i.body=t.body),t?.headers&&(i.headers=t.headers),t?.path&&(i.path=t.path),t?.query&&(i.query=t.query),[i]},y=e=>v(`appsGet`,e),at=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:y(e)}),b=e=>v(`bookmarksGet`,e),ot=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await tt({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:b(e)}),st=e=>v(`channelsAvailableGet`,e),ct=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await te({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:st(e)}),x=e=>v(`channelsReadinessGet`,e),lt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ze({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:x(e)}),S=e=>v(`configGet`,e),C=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:S(e)}),ut=(e,t,n)=>e.setQueryData(C(t).queryKey,n),dt=e=>({mutationFn:async t=>{let{data:n}=await f({...e,...t,throwOnError:!0});return n}}),ft=t=>e({...dt(),...t}),pt=e=>v(`configLlmCallsitesGet`,e),mt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:pt(e)}),w=e=>v(`configLlmDefaultproviderGet`,e),ht=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ie({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:w(e)}),gt=e=>({mutationFn:async t=>{let{data:n}=await xe({...e,...t,throwOnError:!0});return n}}),_t=e=>v(`configLlmProfilesGet`,e),vt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await i({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:_t(e)}),yt=e=>v(`consolidationConfigGet`,e),bt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await be({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:yt(e)}),xt=e=>({mutationFn:async t=>{let{data:n}=await Ce({...e,...t,throwOnError:!0});return n}}),St=t=>e({...xt(),...t}),Ct=e=>v(`consolidationRunsGet`,e),wt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await o({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Ct(e)}),T=(e,t)=>{let n={...e[0]};return t.body&&(n.body={...e[0].body,...t.body}),t.headers&&(n.headers={...e[0].headers,...t.headers}),t.path&&(n.path={...e[0].path,...t.path}),t.query&&(n.query={...e[0].query,...t.query}),n},E=e=>v(`consolidationRunsGet`,e,!0),Tt=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=T(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await o({...e,...i,signal:r,throwOnError:!0});return a},queryKey:E(e)}),Et=e=>({mutationFn:async t=>{let{data:n}=await me({...e,...t,throwOnError:!0});return n}}),Dt=t=>e({...Et(),...t}),D=e=>v(`contactsGet`,e),O=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await _e({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:D(e)}),Ot=(e,t,n)=>e.setQueryData(O(t).queryKey,n),kt=e=>({mutationFn:async t=>{let{data:n}=await Ee({...e,...t,throwOnError:!0});return n}}),At=t=>e({...kt(),...t}),jt=e=>v(`conversationstartersGet`,e),Mt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ve({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:jt(e)}),k=e=>v(`conversationsByIdGet`,e),Nt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ne({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:k(e)}),Pt=e=>({mutationFn:async t=>{let{data:n}=await qe({...e,...t,throwOnError:!0});return n}}),Ft=t=>e({...Pt(),...t}),It=e=>({mutationFn:async t=>{let{data:n}=await Xe({...e,...t,throwOnError:!0});return n}}),Lt=t=>e({...It(),...t}),A=e=>v(`documentsGet`,e),Rt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await rt({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:A(e)}),j=e=>v(`groupsGet`,e),M=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await le({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:j(e)}),zt=(e,t,n)=>e.setQueryData(M(t).queryKey,n),Bt=e=>({mutationFn:async t=>{let{data:n}=await oe({...e,...t,throwOnError:!0});return n}}),Vt=t=>e({...Bt(),...t}),Ht=e=>({mutationFn:async t=>{let{data:n}=await et({...e,...t,throwOnError:!0});return n}}),Ut=t=>e({...Ht(),...t}),Wt=e=>({mutationFn:async t=>{let{data:n}=await je({...e,...t,throwOnError:!0});return n}}),Gt=t=>e({...Wt(),...t}),Kt=e=>v(`heartbeatConfigGet`,e),N=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await h({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Kt(e)}),qt=(e,t,n)=>e.setQueryData(N(t).queryKey,n),Jt=e=>({mutationFn:async t=>{let{data:n}=await a({...e,...t,throwOnError:!0});return n}}),P=t=>e({...Jt(),...t}),Yt=e=>({mutationFn:async t=>{let{data:n}=await m({...e,...t,throwOnError:!0});return n}}),Xt=t=>e({...Yt(),...t}),Zt=e=>v(`heartbeatRunsGet`,e),Qt=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await s({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Zt(e)}),F=e=>v(`heartbeatRunsGet`,e,!0),$t=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=T(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await s({...e,...i,signal:r,throwOnError:!0});return a},queryKey:F(e)}),I=e=>v(`homeFeedGet`,e),en=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await de({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:I(e)}),tn=(e,t,n)=>e.setQueryData(en(t).queryKey,n),L=e=>v(`homeStateGet`,e),nn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ye({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:L(e)}),rn=e=>v(`identityGet`,e),R=e=>v(`inferenceProviderconnectionsGet`,e),an=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Me({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:R(e)}),on=e=>({mutationFn:async t=>{let{data:n}=await fe({...e,...t,throwOnError:!0});return n}}),z=e=>v(`integrationsSlackChannelConfigGet`,e),sn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ue({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:z(e)}),cn=e=>({mutationFn:async t=>{let{data:n}=await ge({...e,...t,throwOnError:!0});return n}}),ln=e=>v(`memoryV2NowtextGet`,e),un=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ze({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:ln(e)}),dn=e=>v(`memoryV2RouterprompttemplateGet`,e),fn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ge({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:dn(e)}),pn=e=>({mutationFn:async t=>{let{data:n}=await g({...e,...t,throwOnError:!0});return n}}),mn=t=>e({...pn(),...t}),hn=e=>v(`memoryWorkerStatusGet`,e),B=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Je({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:hn(e)}),gn=(e,t,n)=>e.setQueryData(B(t).queryKey,n),_n=e=>({mutationFn:async t=>{let{data:n}=await Ie({...e,...t,throwOnError:!0});return n}}),vn=t=>e({..._n(),...t}),V=e=>v(`oauthAppsGet`,e),yn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Qe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:V(e)}),bn=e=>({mutationFn:async t=>{let{data:n}=await Ae({...e,...t,throwOnError:!0});return n}}),xn=t=>e({...bn(),...t}),Sn=e=>({mutationFn:async t=>{let{data:n}=await nt({...e,...t,throwOnError:!0});return n}}),Cn=t=>e({...Sn(),...t}),H=e=>v(`oauthAppsByAppIdConnectionsGet`,e),wn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await De({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:H(e)}),Tn=e=>({mutationFn:async t=>{let{data:n}=await ne({...e,...t,throwOnError:!0});return n}}),En=t=>e({...Tn(),...t}),Dn=e=>({mutationFn:async t=>{let{data:n}=await ce({...e,...t,throwOnError:!0});return n}}),On=t=>e({...Dn(),...t}),kn=e=>v(`oauthProvidersGet`,e),An=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Se({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:kn(e)}),jn=e=>v(`oauthProvidersByProviderKeyGet`,e),Mn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ae({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:jn(e)}),Nn=e=>v(`pluginsGet`,e),Pn=e=>({mutationFn:async t=>{let{data:n}=await p({...e,...t,throwOnError:!0});return n}}),Fn=t=>e({...Pn(),...t}),U=e=>v(`pluginsByNameGet`,e),In=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await we({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:U(e)}),W=e=>v(`pluginsByNameInspectGet`,e),Ln=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await he({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:W(e)}),Rn=e=>({mutationFn:async t=>{let{data:n}=await ve({...e,...t,throwOnError:!0});return n}}),zn=t=>e({...Rn(),...t}),Bn=e=>({mutationFn:async t=>{let{data:n}=await it({...e,...t,throwOnError:!0});return n}}),Vn=t=>e({...Bn(),...t}),G=e=>v(`pluginsSearchGet`,e),Hn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await ee({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:G(e)}),Un=e=>v(`retrospectiveConfigGet`,e),Wn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await pe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Un(e)}),Gn=e=>v(`retrospectiveRunsGet`,e),Kn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await c({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Gn(e)}),K=e=>v(`retrospectiveRunsGet`,e,!0),qn=e=>n({queryFn:async({pageParam:t,queryKey:n,signal:r})=>{let i=T(n,typeof t==`object`?t:{query:{before:t}}),{data:a}=await c({...e,...i,signal:r,throwOnError:!0});return a},queryKey:K(e)}),Jn=e=>v(`schedulesGet`,e),Yn=e=>v(`schedulesByIdRunsGet`,e),q=e=>v(`secretsGet`,e),Xn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:i}=await r({...e,...t[0],signal:n,throwOnError:!0});return i},queryKey:q(e)}),J=e=>v(`skillsGet`,e),Zn=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ke({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:J(e)}),Qn=e=>({mutationFn:async t=>{let{data:n}=await Le({...e,...t,throwOnError:!0});return n}}),$n=t=>e({...Qn(),...t}),er=e=>v(`skillsByIdGet`,e),tr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Pe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:er(e)}),nr=e=>v(`skillsByIdFilesGet`,e),rr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await d({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:nr(e)}),ir=e=>v(`skillsByIdFilesContentGet`,e),ar=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await We({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:ir(e)}),or=e=>v(`skillsCategoriesGet`,e),sr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Be({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:or(e)}),Y=e=>v(`slackChannelsGet`,e),cr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await _({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Y(e)}),X=e=>v(`slackUsersGet`,e),lr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Ye({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:X(e)}),Z=e=>v(`soundsAvailableGet`,e),ur=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await l({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Z(e)}),Q=e=>v(`soundsConfigGet`,e),$=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await u({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:Q(e)}),dr=(e,t,n)=>e.setQueryData($(t).queryKey,n),fr=e=>({mutationFn:async t=>{let{data:n}=await He({...e,...t,throwOnError:!0});return n}}),pr=e=>v(`ttsProvidersGet`,e),mr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Fe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:pr(e)}),hr=e=>v(`usageBreakdownGet`,e),gr=e=>v(`usageDailyGet`,e),_r=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await Oe({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:gr(e)}),vr=e=>v(`usageSeriesGet`,e),yr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await re({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:vr(e)}),br=e=>v(`usageTotalsGet`,e),xr=e=>t({queryFn:async({queryKey:t,signal:n})=>{let{data:r}=await $e({...e,...t[0],signal:n,throwOnError:!0});return r},queryKey:br(e)}),Sr=e=>({mutationFn:async t=>{let{data:n}=await Te({...e,...t,throwOnError:!0});return n}}),Cr=t=>e({...Sr(),...t});export{yn as $,En as $t,zt as A,$ as At,rn as B,St as Bt,Nt as C,J as Ct,A as D,X as Dt,Rt as E,lr as Et,Qt as F,hr as Ft,z as G,Ut as Gt,R as H,At as Ht,I,_r as It,fn as J,P as Jt,cn as K,Gt as Kt,tn as L,yr as Lt,qt as M,dr as Mt,$t as N,fr as Nt,M as O,ur as Ot,F as P,mr as Pt,H as Q,Cn as Qt,nn as R,xr as Rt,Ot as S,Zn as St,Mt as T,Y as Tt,on as U,Ft as Ut,an as V,Dt as Vt,sn as W,Lt as Wt,gn as X,mn as Xt,B as Y,Xt as Yt,wn as Z,vn as Zt,Tt as _,q as _t,ct as a,$n as an,Ln as at,O as b,tr as bt,C as c,Hn as ct,mt as d,qn as dt,xn as en,V as et,ht as f,K as ft,bt as g,Xn as gt,vt as h,Jn as ht,b as i,Vn as in,U as it,N as j,Q as jt,j as k,Z as kt,S as l,G as lt,gt as m,Yn as mt,y as n,Fn as nn,An as nt,lt as o,Cr as on,W as ot,w as p,Kn as pt,un as q,Vt as qt,ot as r,zn as rn,In as rt,x as s,Nn as st,at as t,On as tn,Mn as tt,ut as u,Wn as ut,E as v,ar as vt,k as w,cr as wt,D as x,sr as xt,wt as y,rr as yt,L as z,ft as zt};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-BbeIx_F9.js";import{t as s}from"./client-feature-flag-store-DdDbgq_C.js";import{t as c}from"./conversation-store-BljZWolF.js";import{t as l}from"./conversation-selection-BBHkzcfy.js";import{an as u}from"./index-6YxiY2Ly.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-amTXFI-2.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{c as o}from"./routes-BbeIx_F9.js";import{t as s}from"./client-feature-flag-store-C0g8zi1W.js";import{t as c}from"./conversation-store-BljZWolF.js";import{t as l}from"./conversation-selection-BBHkzcfy.js";import{an as u}from"./index-DQjUULFO.js";var d=e(t(),1),f=a(),p=[{claim:`Software engineer based in Austin, TX`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Product engineer at an early-stage AI startup`,confidence:`confident`,sources:[`https://example.com/team`]},{claim:`Maintains an open-source CLI tool for local LLM evaluation and tooling`,confidence:`confident`,sources:[`https://github.com/example-dev`,`https://example.com/project`]},{claim:`Primarily writes TypeScript and Go`,confidence:`confident`,sources:[`https://github.com/example-dev`]},{claim:`Came up through a coding bootcamp rather than a CS degree`,confidence:`maybe`,sources:[]}],m=[{suggestion:`I'll summarize this week's AI model releases for you`,prompt:`Summarize this week's AI model releases for me.`},{suggestion:`I'll draft a technical blog post from your latest notes`,prompt:`Draft a technical blog post from my latest notes.`},{suggestion:`I'll build you a tracker for competitor product launches`,prompt:`Build me a tracker for competitor product launches.`},{suggestion:`I'll analyze a CSV of metrics and surface the trends`,prompt:`Analyze a CSV of metrics for me and surface the trends.`}];function h(e){return`https://www.google.com/s2/favicons?domain=${encodeURIComponent(e)}&sz=64`}function g(){let e=r(),t=s.use.researchOnboarding(),[a,g]=(0,d.useState)(`results`),[_,v]=(0,d.useState)(()=>new Map),y=p.map((e,t)=>({fact:e,index:t}));return t?(0,f.jsxs)(`div`,{className:`relative h-screen w-screen`,children:[(0,f.jsx)(`div`,{className:`absolute left-1/2 top-3 z-50 flex -translate-x-1/2 gap-1 rounded-full border border-[var(--border-base)] bg-[var(--surface-lift)] p-1`,children:[`loading`,`results`,`empty`].map(e=>(0,f.jsx)(n,{variant:a===e?`primary`:`ghost`,size:`compact`,onClick:()=>g(e),children:e},e))}),(0,f.jsx)(u,{mode:a,loadingContent:(0,f.jsxs)(`div`,{className:`text-[var(--content-secondary)]`,children:[(0,f.jsx)(`p`,{className:`text-lg`,children:`Getting to know you…`}),(0,f.jsx)(`p`,{className:`text-body-medium-lighter`,children:`(mock — the live flow shows the search activity feed here)`})]}),items:y,removals:_,suggestions:m,resultsTitle:`Here's what I know about you. You can remove any that aren't true:`,showSuggestions:!0,canContinue:!0,resolveFavicon:h,onRemove:e=>v(t=>t.has(e)?t:new Map(t).set(e,null)),onSetReason:(e,t)=>v(n=>new Map(n).set(e,t)),onRestore:e=>v(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n}),onSuggestionClick:t=>{let n=l();c.getState().setActiveConversationId(n),e(`${o.conversation(n)}?prompt=${encodeURIComponent(t)}`)},onContinue:()=>e(o.assistant)})]}):(0,f.jsx)(i,{to:o.assistant,replace:!0})}export{g as ResearchMockPage};