@vellumai/web 0.10.3-staging.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/assets/{account-page-BB5Phl5s.js → account-page-CCYCSy2-.js} +1 -1
  2. package/dist/assets/{advanced-page-CMAf1fno.js → advanced-page-CVnT0zH-.js} +1 -1
  3. package/dist/assets/{ai-page-DcOYf6ki.js → ai-page-kEbHR7cH.js} +1 -1
  4. package/dist/assets/{api-key-screen-A7FySG-O.js → api-key-screen-DGVn66y4.js} +1 -1
  5. package/dist/assets/{archive-page-m3yQFOvD.js → archive-page-Dl6HLIJt.js} +1 -1
  6. package/dist/assets/{billing-page-C-JoA25u.js → billing-page-Cq_yLwUC.js} +1 -1
  7. package/dist/assets/{bookmarks-page-Cl2O0te-.js → bookmarks-page-CANlE7hP.js} +1 -1
  8. package/dist/assets/{command-palette-AdQxXi8M.js → command-palette-GZu_zgQg.js} +1 -1
  9. package/dist/assets/{command-palette-window-page-9TqGuzVu.js → command-palette-window-page-CzWu42Ee.js} +1 -1
  10. package/dist/assets/{community-page-DPCIsZX3.js → community-page-Dhgypa-h.js} +1 -1
  11. package/dist/assets/{contacts-page-route-BvCp-gAp.js → contacts-page-route-C3QiOxjO.js} +1 -1
  12. package/dist/assets/{debug-page-CTD3JrfL.js → debug-page-CBozmAQQ.js} +1 -1
  13. package/dist/assets/{deploy-dialogs-C0aZYWkv.js → deploy-dialogs-jf5VL1UP.js} +1 -1
  14. package/dist/assets/{developer-page-Dx6SbGPL.js → developer-page-iEL4eJ8x.js} +1 -1
  15. package/dist/assets/{devices-page-DtqksGFR.js → devices-page-RMaPGcXe.js} +1 -1
  16. package/dist/assets/{dictation-overlay-page-B9zcq9IK.js → dictation-overlay-page-BxQCzLMY.js} +1 -1
  17. package/dist/assets/{document-viewer-page-oeRhq2Yx.js → document-viewer-page-57OuXxYw.js} +1 -1
  18. package/dist/assets/{earn-credits-modal-3vmD9Fug.js → earn-credits-modal-Nm1VymMp.js} +1 -1
  19. package/dist/assets/{emails-page-C_RKF4jL.js → emails-page-0gRZqa6y.js} +1 -1
  20. package/dist/assets/{file-editor-wIYQnMM_.js → file-editor-BNkJJbUv.js} +1 -1
  21. package/dist/assets/{general-page-Bjr3EfG_.js → general-page-aZxTpnpI.js} +1 -1
  22. package/dist/assets/{hatching-screen-OMSxOyvX.js → hatching-screen-KPinlCES.js} +1 -1
  23. package/dist/assets/{home-page-route-BDyODWxN.js → home-page-route-CudtBGg1.js} +1 -1
  24. package/dist/assets/{hosting-screen-dwUA84uS.js → hosting-screen-C14KAJ6m.js} +1 -1
  25. package/dist/assets/{identity-page-route-Ds4SXg6o.js → identity-page-route-C0BFcTAF.js} +1 -1
  26. package/dist/assets/{index-BIDC22lX.js → index-PRnvH2Y1.js} +7 -7
  27. package/dist/assets/{inspect-page-CpIdOQCU.js → inspect-page-CWasyuSO.js} +1 -1
  28. package/dist/assets/{install-b0ONV1om.js → install-C3xe8ARr.js} +1 -1
  29. package/dist/assets/{integrations-page-Dw3rJqPE.js → integrations-page-WhBpTYP2.js} +1 -1
  30. package/dist/assets/{intelligence-layout-DovsSaK4.js → intelligence-layout-CvTumtjv.js} +1 -1
  31. package/dist/assets/{keyboard-shortcuts-page-B2rDCmXw.js → keyboard-shortcuts-page-kiOEZKzE.js} +1 -1
  32. package/dist/assets/{library-detail-page-BfwLhTzc.js → library-detail-page-rPvN9G1a.js} +1 -1
  33. package/dist/assets/{library-page-CKwzimBZ.js → library-page-BHejhapZ.js} +1 -1
  34. package/dist/assets/{login-page-aWGeNMsB.js → login-page-BGLVK82t.js} +1 -1
  35. package/dist/assets/{logout-page-BgczaAe_.js → logout-page-Bl6AD21S.js} +1 -1
  36. package/dist/assets/{logs-layout-Bb4h3S2N.js → logs-layout-C9eUE1Pt.js} +1 -1
  37. package/dist/assets/{memory-router-playground-page-gcwT23uj.js → memory-router-playground-page-Dhi3uqxr.js} +1 -1
  38. package/dist/assets/{mobile-sidebar-drawer-wA5GnkLS.js → mobile-sidebar-drawer-DqXFL0Ke.js} +1 -1
  39. package/dist/assets/{notifications-page-BilxDebz.js → notifications-page-pHiDPA0p.js} +1 -1
  40. package/dist/assets/{oauth-complete-page-CzAcy6Qj.js → oauth-complete-page-DiGMWbOb.js} +1 -1
  41. package/dist/assets/{oauth-popup-complete-page-CvE_74ec.js → oauth-popup-complete-page-CwoZnzdc.js} +1 -1
  42. package/dist/assets/{pairing-page-ddUW7kSm.js → pairing-page-clFaUgzL.js} +1 -1
  43. package/dist/assets/{plugin-detail-page-B-d90SJ8.js → plugin-detail-page-IRPeI4lP.js} +1 -1
  44. package/dist/assets/{plugins-page-tUsEY9_b.js → plugins-page-BaYp2QOe.js} +1 -1
  45. package/dist/assets/{prechat-route-in5c2S6S.js → prechat-route-BaMWiiaf.js} +1 -1
  46. package/dist/assets/{privacy-page-CpYx1RMr.js → privacy-page-BUhxrIRn.js} +1 -1
  47. package/dist/assets/{privacy-screen-Cd4yErpJ.js → privacy-screen-BaHYtKEt.js} +1 -1
  48. package/dist/assets/{provider-callback-page-BCXiAoax.js → provider-callback-page-CxFC4PH1.js} +1 -1
  49. package/dist/assets/{research-mock-page-DfC4Xf4z.js → research-mock-page-ttrrPwo3.js} +1 -1
  50. package/dist/assets/{research-onboarding-route-QentSADF.js → research-onboarding-route-Cxai0fux.js} +1 -1
  51. package/dist/assets/{review-terms-screen-kUBWOFsV.js → review-terms-screen-DEiifDmK.js} +1 -1
  52. package/dist/assets/{select-assistant-screen-DDdKrCaI.js → select-assistant-screen-UoixBMN2.js} +1 -1
  53. package/dist/assets/{settings-layout-CIAca9J9.js → settings-layout-CQ3Z9Raj.js} +1 -1
  54. package/dist/assets/{share-feedback-modal-sqz1cvkl.js → share-feedback-modal-CTwByE7B.js} +1 -1
  55. package/dist/assets/{sidebar-tree-BNLVikyu.js → sidebar-tree-BJkXpCut.js} +1 -1
  56. package/dist/assets/{signup-page-DOYf5rnz.js → signup-page-CKDYl9Wb.js} +1 -1
  57. package/dist/assets/{skills-page-pXRiOYxp.js → skills-page-DVjqqfMw.js} +1 -1
  58. package/dist/assets/{sounds-page-DZjipsnL.js → sounds-page-mens6EAJ.js} +1 -1
  59. package/dist/assets/{step-indicator-dots-D1EQV6VE.js → step-indicator-dots-CEVbsP8r.js} +1 -1
  60. package/dist/assets/{subagent-detail-panel-BhMGv4KW.js → subagent-detail-panel-DVQAkMjF.js} +1 -1
  61. package/dist/assets/{system-events-page-8chSE8WO.js → system-events-page-Dro8iNrx.js} +1 -1
  62. package/dist/assets/{tiptap-document-editor-BIYDH0gu.js → tiptap-document-editor-D2t4qYzv.js} +1 -1
  63. package/dist/assets/{tool-detail-panel-CltEAL4k.js → tool-detail-panel-DRD2DIMF.js} +1 -1
  64. package/dist/assets/{trace-page-Ceqkb39z.js → trace-page-DRWPaAuQ.js} +1 -1
  65. package/dist/assets/{upgrade-cancel-page-BLYBOQhL.js → upgrade-cancel-page-Cwv5eMh9.js} +1 -1
  66. package/dist/assets/{upgrade-success-page-Besx7BnU.js → upgrade-success-page-DnJ8Kyyj.js} +1 -1
  67. package/dist/assets/{usage-page-UvJrF1jZ.js → usage-page-DJHRS0lZ.js} +1 -1
  68. package/dist/assets/{voice-page-B6ocZCAN.js → voice-page-kQZ2ya5j.js} +1 -1
  69. package/dist/assets/{weather-forecast-display-JXZ2NoLx.js → weather-forecast-display-Cu3W6OZF.js} +1 -1
  70. package/dist/assets/{welcome-screen-4_W-iOJc.js → welcome-screen-Bd7PCfAf.js} +1 -1
  71. package/dist/assets/{workflow-detail-panel-BYvRNK8S.js → workflow-detail-panel-CMmPPsuL.js} +1 -1
  72. package/dist/assets/{workspace-page-D6Ak7heg.js → workspace-page-BR4pOxs5.js} +1 -1
  73. package/dist/index.html +1 -1
  74. package/package.json +1 -1
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-DVqkwUEe.js";import{t as s}from"./client-feature-flag-store-C1kdd1EO.js";import{t as c}from"./conversation-store-DK-7gFAt.js";import{t as l}from"./conversation-selection-CtKjA5Ni.js";import{jt as u}from"./index-BIDC22lX.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-D7s2Q_uG.js";import{d as r,r as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{a as o}from"./routes-DVqkwUEe.js";import{t as s}from"./client-feature-flag-store-C1kdd1EO.js";import{t as c}from"./conversation-store-DK-7gFAt.js";import{t as l}from"./conversation-selection-CtKjA5Ni.js";import{jt as u}from"./index-PRnvH2Y1.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,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Hr1Yo2kx.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i,r as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-DvW5mxZR.js";import{t as l}from"./tag-B_-QAvJF.js";import{t as u}from"./input-C8kfrq9r.js";import{n as d,t as f}from"./create-selectors-BE0_e_Ed.js";import{t as p}from"./arrow-left-CP-EhDNF.js";import{t as m}from"./chevron-left-DghyKSEE.js";import{t as h}from"./chevron-right-B6vEpVY0.js";import{t as g}from"./loader-circle-IIzBGiwm.js";import{t as _}from"./pencil-DbB9rxpY.js";import{t as v}from"./x-KVxA2ZL0.js";import{L as y,Sn as b,X as x,en as S,tn as C,xn as w}from"./sdk.gen-1aYqVbMj.js";import{r as T}from"./api-errors-CveHbhgb.js";import{Q as E,at as D,ct as O,n as k,ot as A,st as j}from"./auth-store-Kfxhs2oI.js";import{a as ee,o as te,r as ne}from"./api-2kc3MHRz.js";import{a as re}from"./routes-DVqkwUEe.js";import{t as ie}from"./client-feature-flag-store-C1kdd1EO.js";import{c as ae,l as oe}from"./prechat-B28Vzu55.js";import{A as M,C as se,D as N,E as ce,F as le,L as ue,M as de,N as P,O as fe,P as F,R as I,S as L,T as pe,_ as me,a as R,b as he,c as z,d as ge,g as _e,h as ve,i as ye,j as be,k as xe,l as Se,m as Ce,o as we,p as Te,r as Ee,s as De,t as B,u as Oe,v as ke,w as Ae,x as je,y as Me}from"./proxy-DmIh4F51.js";import{t as Ne}from"./AnimatePresence-CgXwEO42.js";import{t as V}from"./use-reduced-motion-ChB7nOGe.js";import{At as Pe,Mt as Fe,Nt as Ie,Vt as Le,kn as Re,kt as ze,lt as H,ra as U,rt as W,yt as Be}from"./index-BIDC22lX.js";import{t as Ve}from"./prechat-names-CRduluk-.js";var He=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Ue(e,t){return xe(e)?e[He(0,e.length,t)]:e}var We=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Ge(this.animations,`duration`)}get iterationDuration(){return Ge(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Ge(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Ke=class extends We{then(e,t){return this.finished.finally(e).then(()=>{})}};function qe(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=se(i,a,o);return t?s(r):s}function Je(e,t){return e in t}var Ye=class extends De{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Je(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Se()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function Xe(e){let t=I(()=>Me(e)),{isStatic:n}=(0,G.useContext)(Ee);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function Ze(e,t){let n=Xe(t()),r=()=>n.set(t());return r(),ue(()=>{let t=()=>fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),N(r)}}),n}function Qe(e){ke.current=[],e();let t=Ze(ke.current,e);return ke.current=void 0,t}function $e(e,t,n,r){if(typeof e==`function`)return Qe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return tt(e,t,n,r);let i=typeof t==`function`?t:qe(t,n,r),a=Array.isArray(e)?et(e,i):et([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function et(e,t){let n=I(()=>[]);return Ze(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function tt(e,t,n,r){let i=I(()=>Object.keys(n)),a=I(()=>({}));for(let o of i)a[o]=$e(e,t,n[o],r);return a}function nt(e){e.values.forEach(e=>e.stop())}function rt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&me(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{rt(e,t)})})}function it(e,t){if(Array.isArray(t))return rt(e,t);if(typeof t==`string`)return rt(e,[t]);me(e,t)}function at(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){P(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Ce(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return P(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{it(e,n)})},stop(){t.forEach(e=>{nt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function ot(e){return typeof e==`object`&&!Array.isArray(e)}function st(e,t,n,r){return e==null?[]:typeof e==`string`&&ot(t)?Te(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ct(e,t,n){return e*(t+1)+n*t}function lt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function ut(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(le(e,i),r--)}}function dt(e,t,n,r,i,a){ut(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ce(i,a,r[o]),easing:Ue(n,o)})}function ft(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function pt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var mt=`easeInOut`,ht=20;function gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,lt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=lt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=yt(e),{delay:l=0,times:u=je(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=he(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&St(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=be(b));let r=pe(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&L(u,T),c.length===1&&c.unshift(null),m&&F(m<ht,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${ht} or apply repeat at the sequence level instead.`),m&&m<ht){let e=b>0?_/b:0;b=ct(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?M(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Ue(f,e-1))}ft(u,m,e)}let E=w+b;dt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(_e(p)){let e=_t(p,s);_(m,h,vt(`default`,e))}else{let e=st(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=_t(r,s);for(let e in m)_(m[e],bt(h,e),vt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(pt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(de(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(mt)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function _t(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function vt(e,t){return t[e]||(t[e]=[]),t[e]}function yt(e){return Array.isArray(e)?e:[e]}function bt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var xt=e=>typeof e==`number`,St=e=>e.every(xt);function Ct(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ge(e)&&!Oe(e)?new R(t):new we(t);n.mount(e),z.set(e,n)}function wt(e){let t=new Ye({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),z.set(e,t)}function Tt(e,t){return _e(e)||typeof e==`number`||typeof e==`string`&&!ot(t)}function Et(e,t,n,r){let i=[];if(Tt(e,t))i.push(ye(e,ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=st(e,t,r),o=a.length;P(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Ct:wt;z.has(r)||s(r);let c=z.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...ve(c,{...t,transition:l},{}))}}return i}function Dt(e,t,n){let r=[];return gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Me(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ae}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Et(n,e,t))}),r}function Ot(e){return Array.isArray(e)&&e.some(Array.isArray)}function kt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Ot(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Dt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Et(e,i,{...c,...r},t)}let l=new Ke(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{le(t.animations,l)})),l}return i}var K=kt();function At(){let e=I(at);return ue(e.mount,[]),e}var jt=12;function Mt(e){let t=e.slice(0,jt).map(e=>`- ${e.name} — ${e.description}`).join(`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-Hr1Yo2kx.js";import{t as n}from"./react-DJZBPgpf.js";import{t as r}from"./button-D7s2Q_uG.js";import{d as i,r as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./cn-DvW5mxZR.js";import{t as l}from"./tag-B_-QAvJF.js";import{t as u}from"./input-C8kfrq9r.js";import{n as d,t as f}from"./create-selectors-BE0_e_Ed.js";import{t as p}from"./arrow-left-CP-EhDNF.js";import{t as m}from"./chevron-left-DghyKSEE.js";import{t as h}from"./chevron-right-B6vEpVY0.js";import{t as g}from"./loader-circle-IIzBGiwm.js";import{t as _}from"./pencil-DbB9rxpY.js";import{t as v}from"./x-KVxA2ZL0.js";import{L as y,Sn as b,X as x,en as S,tn as C,xn as w}from"./sdk.gen-1aYqVbMj.js";import{r as T}from"./api-errors-CveHbhgb.js";import{Q as E,at as D,ct as O,n as k,ot as A,st as j}from"./auth-store-Kfxhs2oI.js";import{a as ee,o as te,r as ne}from"./api-2kc3MHRz.js";import{a as re}from"./routes-DVqkwUEe.js";import{t as ie}from"./client-feature-flag-store-C1kdd1EO.js";import{c as ae,l as oe}from"./prechat-B28Vzu55.js";import{A as M,C as se,D as N,E as ce,F as le,L as ue,M as de,N as P,O as fe,P as F,R as I,S as L,T as pe,_ as me,a as R,b as he,c as z,d as ge,g as _e,h as ve,i as ye,j as be,k as xe,l as Se,m as Ce,o as we,p as Te,r as Ee,s as De,t as B,u as Oe,v as ke,w as Ae,x as je,y as Me}from"./proxy-DmIh4F51.js";import{t as Ne}from"./AnimatePresence-CgXwEO42.js";import{t as V}from"./use-reduced-motion-ChB7nOGe.js";import{At as Pe,Mt as Fe,Nt as Ie,Vt as Le,kn as Re,kt as ze,lt as H,ra as U,rt as W,yt as Be}from"./index-PRnvH2Y1.js";import{t as Ve}from"./prechat-names-CRduluk-.js";var He=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e};function Ue(e,t){return xe(e)?e[He(0,e.length,t)]:e}var We=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return Ge(this.animations,`duration`)}get iterationDuration(){return Ge(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function Ge(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var Ke=class extends We{then(e,t){return this.finished.finally(e).then(()=>{})}};function qe(...e){let t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],a=e[2+n],o=e[3+n],s=se(i,a,o);return t?s(r):s}function Je(e,t){return e in t}var Ye=class extends De{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(Je(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return Se()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},G=e(n(),1);function Xe(e){let t=I(()=>Me(e)),{isStatic:n}=(0,G.useContext)(Ee);if(n){let[,n]=(0,G.useState)(e);(0,G.useEffect)(()=>t.on(`change`,n),[])}return t}function Ze(e,t){let n=Xe(t()),r=()=>n.set(t());return r(),ue(()=>{let t=()=>fe.preRender(r,!1,!0),n=e.map(e=>e.on(`change`,t));return()=>{n.forEach(e=>e()),N(r)}}),n}function Qe(e){ke.current=[],e();let t=Ze(ke.current,e);return ke.current=void 0,t}function $e(e,t,n,r){if(typeof e==`function`)return Qe(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!=`function`)return tt(e,t,n,r);let i=typeof t==`function`?t:qe(t,n,r),a=Array.isArray(e)?et(e,i):et([e],([e])=>i(e)),o=Array.isArray(e)?void 0:e.accelerate;return o&&!o.isTransformed&&typeof t!=`function`&&Array.isArray(n)&&r?.clamp!==!1&&(a.accelerate={...o,times:t,keyframes:n,isTransformed:!0,...r?.ease?{ease:r.ease}:{}}),a}function et(e,t){let n=I(()=>[]);return Ze(e,()=>{n.length=0;let r=e.length;for(let t=0;t<r;t++)n[t]=e[t].get();return t(n)})}function tt(e,t,n,r){let i=I(()=>Object.keys(n)),a=I(()=>({}));for(let o of i)a[o]=$e(e,t,n[o],r);return a}function nt(e){e.values.forEach(e=>e.stop())}function rt(e,t){[...t].reverse().forEach(n=>{let r=e.getVariant(n);r&&me(e,r),e.variantChildren&&e.variantChildren.forEach(e=>{rt(e,t)})})}function it(e,t){if(Array.isArray(t))return rt(e,t);if(typeof t==`string`)return rt(e,[t]);me(e,t)}function at(){let e=!1,t=new Set,n={subscribe(e){return t.add(e),()=>void t.delete(e)},start(n,r){P(e,`controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.`);let i=[];return t.forEach(e=>{i.push(Ce(e,n,{transitionOverride:r}))}),Promise.all(i)},set(n){return P(e,`controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook.`),t.forEach(e=>{it(e,n)})},stop(){t.forEach(e=>{nt(e)})},mount(){return e=!0,()=>{e=!1,n.stop()}}};return n}function ot(e){return typeof e==`object`&&!Array.isArray(e)}function st(e,t,n,r){return e==null?[]:typeof e==`string`&&ot(t)?Te(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function ct(e,t,n){return e*(t+1)+n*t}function lt(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function ut(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(le(e,i),r--)}}function dt(e,t,n,r,i,a){ut(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:ce(i,a,r[o]),easing:Ue(n,o)})}function ft(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function pt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var mt=`easeInOut`,ht=20;function gt(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}else if(!Array.isArray(o)){l.set(o.name,lt(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=lt(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=yt(e),{delay:l=0,times:u=je(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=he(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&St(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=be(b));let r=pe(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&L(u,T),c.length===1&&c.unshift(null),m&&F(m<ht,`Sequence segments can't repeat ${m} times — ignoring repeat option. Use a value below ${ht} or apply repeat at the sequence level instead.`),m&&m<ht){let e=b>0?_/b:0;b=ct(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?M(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Ue(f,e-1))}ft(u,m,e)}let E=w+b;dt(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(_e(p)){let e=_t(p,s);_(m,h,vt(`default`,e))}else{let e=st(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=_t(r,s);for(let e in m)_(m[e],bt(h,e),vt(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(pt);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(de(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(mt)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function _t(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function vt(e,t){return t[e]||(t[e]=[]),t[e]}function yt(e){return Array.isArray(e)?e:[e]}function bt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var xt=e=>typeof e==`number`,St=e=>e.every(xt);function Ct(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=ge(e)&&!Oe(e)?new R(t):new we(t);n.mount(e),z.set(e,n)}function wt(e){let t=new Ye({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),z.set(e,t)}function Tt(e,t){return _e(e)||typeof e==`number`||typeof e==`string`&&!ot(t)}function Et(e,t,n,r){let i=[];if(Tt(e,t))i.push(ye(e,ot(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=st(e,t,r),o=a.length;P(!!o,`No valid elements provided.`,`no-valid-elements`);for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?Ct:wt;z.has(r)||s(r);let c=z.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...ve(c,{...t,transition:l},{}))}}return i}function Dt(e,t,n){let r=[];return gt(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=Me(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:Ae}).forEach(({keyframes:e,transition:t},n)=>{r.push(...Et(n,e,t))}),r}function Ot(e){return Array.isArray(e)&&e.some(Array.isArray)}function kt(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),Ot(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=Dt(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=Et(e,i,{...c,...r},t)}let l=new Ke(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{le(t.animations,l)})),l}return i}var K=kt();function At(){let e=I(at);return ue(e.mount,[]),e}var jt=12;function Mt(e){let t=e.slice(0,jt).map(e=>`- ${e.name} — ${e.description}`).join(`
2
2
  `);return t?`
3
3
  Capabilities you can offer me — specialized skillsets you can invoke on my behalf, not generic chat:
4
4
  ${t}
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{d as s,i as c,n as l}from"./auth-store-Kfxhs2oI.js";import{t as u}from"./return-to-ByvaXBKr.js";import{a as d}from"./routes-DVqkwUEe.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-C_oq5G87.js";import{Gr as v,Rn as y,kt as b}from"./index-BIDC22lX.js";import{n as x,t as S}from"./consent-controls-BSZV4rW3.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=m(),[M,N]=h(),[P,F]=_(),[I,L]=p(),[R]=g(),[z]=f(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(b,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(v,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{d as s,i as c,n as l}from"./auth-store-Kfxhs2oI.js";import{t as u}from"./return-to-ByvaXBKr.js";import{a as d}from"./routes-DVqkwUEe.js";import{c as f,d as p,f as m,l as h,s as g,u as _}from"./prefs-C_oq5G87.js";import{Gr as v,Rn as y,kt as b}from"./index-PRnvH2Y1.js";import{n as x,t as S}from"./consent-controls-BSZV4rW3.js";var C=e(t(),1),w={},T={"2026-06-22":[`Introduces Together AI as a new managed model provider`]};function E(e){return w[e]??[]}function D(e){return T[e]??[]}var O=a();function k(){let e=r(),[t]=i(),a=l.use.user()?.id??null,w=l.use.logout(),T=o(),k=c(),[A,j]=m(),[M,N]=h(),[P,F]=_(),[I,L]=p(),[R]=g(),[z]=f(),[B]=(0,C.useState)(()=>!A),[V]=(0,C.useState)(()=>!M),[H]=(0,C.useState)(()=>!R),[U]=(0,C.useState)(()=>!z),W=!B&&!V&&!H&&!U,G=B||W,K=V||W,q=H||W,J=U||W,Y=!W&&!B&&!V,X=W?`Terms & privacy`:Y?`Review your privacy preferences`:`Updated terms`,Z=W?`Review your terms and privacy preferences anytime.`:Y?`Confirm your privacy preferences to continue.`:`We've updated our terms. Please review and accept to continue.`,Q=(0,C.useCallback)(()=>{s({userId:a,tos:A,privacy:M,shareAnalytics:P,shareDiagnostics:I,hasPlatformSession:k}),e(u(t.get(`returnTo`),d.assistant),{replace:!0})},[M,k,e,t,P,I,A,a]),$=(0,C.useCallback)(async()=>{await w(),y(d.account.login)},[w]),ee=G&&!A||K&&!M;return(0,O.jsx)(b,{showCreatureFooter:!1,children:(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${T?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`px-6 py-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-[var(--border-subtle)] bg-[var(--surface-lift)]`,style:{animation:`fadeInUp 0.5s ease-out 0.05s both`},children:(0,O.jsx)(v,{className:`h-6 w-6 text-[var(--content-secondary)]`,strokeWidth:1.75})}),(0,O.jsx)(`h1`,{className:`mt-5 ${T?`text-title-large`:`text-3xl font-semibold tracking-tight`}`,style:{animation:`fadeInUp 0.5s ease-out 0.12s both`},children:X}),(0,O.jsx)(`p`,{className:`text-center text-body-medium-lighter text-[var(--content-tertiary)] ${T?`mt-3`:`mt-3.5`}`,style:{animation:`fadeInUp 0.5s ease-out 0.2s both`},children:Z}),(q||J)&&(0,O.jsx)(x,{electron:T,showAnalytics:q,showDiagnostics:J,shareAnalytics:P,shareDiagnostics:I,onShareAnalyticsChange:F,onShareDiagnosticsChange:L,className:`mt-9 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.28s both`}}),(K||G)&&(0,O.jsx)(S,{electron:T,showPrivacy:K,showTos:G,privacyConsent:M,tosAccepted:A,onPrivacyChange:N,onTosChange:j,privacyNotes:K?D(`2026-06-22`):[],tosNotes:G?E(`2026-06-08`):[],className:`mt-6 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.36s both`}}),(0,O.jsxs)(`div`,{className:`mt-9 flex w-full flex-col ${T?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.44s both`},children:[(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,disabled:ee,onClick:Q,className:T?void 0:`h-11 text-base`,children:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,onClick:$,className:T?void 0:`h-11 text-base`,children:`Log out`})]})]})})}export{k as ReviewTermsScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-CfOXCE1N.js";import{t as s}from"./modal-D0Q3UWD0.js";import{D as c,M as l,et as u,k as d,ot as f,t as ee,u as p}from"./local-mode-CvrNMtPF.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Cp4J43BK.js";import{t as g}from"./check-D6WkI0gF.js";import{V as _,X as v,i as te,n as y}from"./auth-store-Kfxhs2oI.js";import{a as b}from"./routes-DVqkwUEe.js";import{t as ne}from"./use-onboarding-login-BEOH92mZ.js";import{bi as x,en as S,kt as C,tn as w,zi as T}from"./index-BIDC22lX.js";import{r as E}from"./format-date-CLlHK5gl.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,onRetire:l}){let[u,d]=(0,D.useState)(`menu`);(0,D.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,O.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,O.jsx)(o,{open:e,title:`Repair Assistant?`,message:(0,O.jsxs)(O.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,O.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,O.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,O.jsx)(s.Header,{children:(0,O.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,O.jsxs)(s.Body,{children:[(0,O.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,O.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,O.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,O.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,O.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function A(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function j(e){if(e.hatchedAt)return`Created ${E(e.hatchedAt)}`}function M(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),g=te(),x=h.use.assistants(),S=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ne(),P=e=>e.isLocal||g,F=x.filter(P),I=x.some(e=>e.isPlatformHosted)&&!g,[L,R]=(0,D.useState)(null),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(null),[G,K]=(0,D.useState)(null),[q,J]=(0,D.useState)(!1),[Y,X]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(L!=null||F.length===0)return;let e=v(S);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,S]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&c()&&(d(e)||f(e)||e instanceof ee)&&p(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},re=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await l(G.id,{repairGuardian:!0});if(e.ok){u(),Q(),Z(G);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}J(!1)}},ie=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await w(G.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}J(!1)}};(0,D.useEffect)(()=>{a||o||z||V||x.length!==0&&x.length===1&&F.length===1&&(H(!0),Z(F[0]))},[x.length,F.length]);let ae=()=>{let e=x.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(b.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(C,{children:(0,O.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,O.jsxs)(C,{children:[(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,O.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,O.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:x.map(e=>{let t=P(e);return(0,O.jsx)(N,{assistant:e,selected:L===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&R(e.id)}},e.id)})}),(0,O.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[F.length>0&&(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!L||z,children:z?`Connecting…`:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:z||T,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?M:()=>void j(),disabled:z,children:T?`Cancel`:`Log In`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:z||T,children:`Back`})]})]}),(0,O.jsx)(k,{open:G!=null,assistantName:G?A(G):``,isPending:q,errorMessage:Y??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),o=m();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,O.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,o?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,O.jsx)(x,{className:`h-5 w-5`}):(0,O.jsx)(T,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:A(e)}),r&&(0,O.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,O.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,O.jsx)(g,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./confirm-dialog-CfOXCE1N.js";import{t as s}from"./modal-D0Q3UWD0.js";import{D as c,M as l,et as u,k as d,ot as f,t as ee,u as p}from"./local-mode-CvrNMtPF.js";import{t as m}from"./is-electron-C_ZTVhv8.js";import{n as h}from"./resolved-assistants-store-Cp4J43BK.js";import{t as g}from"./check-D6WkI0gF.js";import{V as _,X as v,i as te,n as y}from"./auth-store-Kfxhs2oI.js";import{a as b}from"./routes-DVqkwUEe.js";import{t as ne}from"./use-onboarding-login-BEOH92mZ.js";import{bi as x,en as S,kt as C,tn as w,zi as T}from"./index-PRnvH2Y1.js";import{r as E}from"./format-date-CLlHK5gl.js";var D=e(t(),1),O=a();function k({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:c,onRetire:l}){let[u,d]=(0,D.useState)(`menu`);(0,D.useEffect)(()=>{e&&d(`menu`)},[e]);let f=i?(0,O.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return u===`confirm-repair`?(0,O.jsx)(o,{open:e,title:`Repair Assistant?`,message:(0,O.jsxs)(O.Fragment,{children:[`Repairing re-provisions this assistant’s authentication token. Any other devices or browser sessions connected to it will be signed out and need to reconnect.`,f]}),confirmLabel:`Repair`,isPending:r,onConfirm:c,onCancel:()=>d(`menu`)}):u===`confirm-retire`?(0,O.jsx)(S,{open:e,isPending:r,extraMessage:f,onConfirm:l,onCancel:()=>d(`menu`)}):(0,O.jsx)(s.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,O.jsxs)(s.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,O.jsx)(s.Header,{children:(0,O.jsx)(s.Title,{children:`Can’t Authenticate Assistant`})}),(0,O.jsxs)(s.Body,{children:[(0,O.jsxs)(s.Description,{children:[`The authentication token for `,t,` is missing or can no longer be refreshed, so this assistant can’t be connected. You can repair it, retire it, or pick a different assistant.`]}),f,(0,O.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,O.jsx)(n,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-repair`),children:`Wake & Repair`}),(0,O.jsx)(n,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>d(`confirm-retire`),children:`Retire Assistant`}),(0,O.jsx)(n,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:`Cancel`})]})]})]})})}function A(e){return e.name?e.name:e.isLocal?`Local Assistant`:`Cloud Assistant`}function j(e){if(e.hatchedAt)return`Created ${E(e.hatchedAt)}`}function M(){let e=r(),[t]=i(),a=t.get(`fromLogin`)===`1`,o=t.get(`noAutoSkip`)===`1`,s=m(),g=te(),x=h.use.assistants(),S=_.use.currentOrganizationId(),{loading:T,error:E,login:j,cancel:M}=ne(),P=e=>e.isLocal||g,F=x.filter(P),I=x.some(e=>e.isPlatformHosted)&&!g,[L,R]=(0,D.useState)(null),[z,B]=(0,D.useState)(!1),[V,H]=(0,D.useState)(!1),[U,W]=(0,D.useState)(null),[G,K]=(0,D.useState)(null),[q,J]=(0,D.useState)(!1),[Y,X]=(0,D.useState)(null);(0,D.useEffect)(()=>{if(L!=null||F.length===0)return;let e=v(S);R(F.find(t=>t.id===e)?.id??F[0].id)},[L,F,S]);let Z=async t=>{B(!0),W(null);try{t.isLocal?await y.getState().connectLocalAssistant(t.id):await y.getState().connectPlatformAssistant(t.id),e(b.assistant,{replace:!0})}catch(e){console.error(`selectAssistant.handleConnect failed`,e),t.isLocal&&c()&&(d(e)||f(e)||e instanceof ee)&&p(t.id)?K(t):W(`Failed to connect. Please try again.`),B(!1)}},Q=()=>{K(null),J(!1),X(null),H(!1)},re=async()=>{if(!(!G||q)){J(!0),X(null);try{let e=await l(G.id,{repairGuardian:!0});if(e.ok){u(),Q(),Z(G);return}X(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),X(`Repair failed. Please try again.`)}J(!1)}},ie=async()=>{if(!(!G||q)){J(!0),X(null);try{let t=await w(G.id);if(t.ok){Q(),e(t.nextRoute,{replace:!0});return}X(t.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),X(`Failed to retire assistant. Please try again.`)}J(!1)}};(0,D.useEffect)(()=>{a||o||z||V||x.length!==0&&x.length===1&&F.length===1&&(H(!0),Z(F[0]))},[x.length,F.length]);let ae=()=>{let e=x.find(e=>e.id===L);e&&Z(e)},oe=()=>{e(b.welcome)},$=E??U;return V&&!$&&!G?(0,O.jsx)(C,{children:(0,O.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Connecting to your assistant…`})})}):(0,O.jsxs)(C,{children:[(0,O.jsxs)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${s?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-16`} text-[var(--content-default)]`,children:[(0,O.jsx)(`h1`,{className:s?`text-title-large`:`text-3xl font-semibold tracking-tight`,style:{animation:`fadeInUp 0.5s ease-out 0.1s both`},children:`Choose an Assistant`}),(0,O.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)] ${s?`mt-3.5`:`mt-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:`Select which assistant you’d like to use.`}),$&&(0,O.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:$}),(0,O.jsx)(`div`,{className:`flex w-full flex-col ${s?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:x.map(e=>{let t=P(e);return(0,O.jsx)(N,{assistant:e,selected:L===e.id,disabled:!t,badge:!t&&e.isPlatformHosted?`Requires Account`:void 0,onSelect:()=>{t&&R(e.id)}},e.id)})}),(0,O.jsxs)(`div`,{className:`mt-8 flex w-full flex-col ${s?`gap-2.5`:`gap-2`}`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:[F.length>0&&(0,O.jsx)(n,{variant:`primary`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:ae,disabled:!L||z,children:z?`Connecting…`:`Continue`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:()=>void e(`${b.onboarding.hosting}?from=select-assistant`),disabled:z||T,children:`Create New Assistant`}),I&&(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:T?M:()=>void j(),disabled:z,children:T?`Cancel`:`Log In`}),(0,O.jsx)(n,{variant:`outlined`,size:`regular`,fullWidth:!0,className:s?void 0:`h-11 text-base`,onClick:oe,disabled:z||T,children:`Back`})]})]}),(0,O.jsx)(k,{open:G!=null,assistantName:G?A(G):``,isPending:q,errorMessage:Y??void 0,onCancel:Q,onRepair:()=>void re(),onRetire:()=>void ie()})]})}function N({assistant:e,selected:t,disabled:n,badge:r,onSelect:i}){let a=j(e),o=m();return(0,O.jsxs)(`button`,{type:`button`,onClick:i,disabled:n,className:[`group flex w-full items-center border text-left`,o?`gap-3 rounded-lg p-3`:`gap-4 rounded-2xl px-5 py-4`,`transition-all duration-200 ease-out`,n?`cursor-not-allowed opacity-50`:`cursor-pointer hover:bg-[var(--surface-secondary)]`,t&&!n?`border-[var(--primary-base)] bg-[var(--primary-base)]/[0.08] shadow-[inset_0_0_0_1px_var(--primary-base)]`:`border-[var(--border-element)] bg-transparent`].join(` `),children:[(0,O.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,o?`h-8 w-8 rounded-lg`:`h-10 w-10 rounded-xl`,t&&!n?`bg-[var(--primary-base)]/15 text-[var(--primary-base)]`:`bg-[var(--surface-tertiary)] text-[var(--content-secondary)]`].join(` `),children:e.isLocal?(0,O.jsx)(x,{className:`h-5 w-5`}):(0,O.jsx)(T,{className:`h-5 w-5`})}),(0,O.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-default)]`,children:A(e)}),r&&(0,O.jsx)(`span`,{className:`rounded-full bg-[var(--surface-tertiary)] px-2 py-0.5 text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:r})]}),a&&(0,O.jsx)(`span`,{className:`mt-0.5 block text-[var(--content-tertiary)] ${o?`text-label-medium-default`:`text-body-small-default`}`,children:a})]}),!n&&(0,O.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,t?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:t&&(0,O.jsx)(g,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})}export{M as SelectAssistantScreen};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{t as s}from"./log-in-2iOsufxq.js";import{i as c}from"./auth-store-Kfxhs2oI.js";import{a as l}from"./routes-DVqkwUEe.js";import{t as u}from"./client-feature-flag-store-C1kdd1EO.js";import{t as d}from"./use-onboarding-login-BEOH92mZ.js";import{t as f}from"./assistant-feature-flag-store-Dl92XRsM.js";import{Ln as p,an as m,ft as h,mi as g}from"./index-BIDC22lX.js";import{n as _,t as v}from"./sidebar-tree-BNLVikyu.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=u.use.platformNotifications(),a=u.use.bookmarks(),x=m({platformHostedOnly:!0}),S=m(),{pathname:C}=i(),w=n(),T=c(),{login:E}=d(),D=(0,y.useMemo)(()=>h.filter(e=>!(e.id===`notifications`&&(!t||x===`gated`)||e.id===`billing`&&S!==`full`||e.id===`bookmarks`&&!a||e.id===`devices`&&x===`gated`||e.id===`keyboard-shortcuts`&&!o()||e.id===`developer`)),[t,x,S,a]),O=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...h.filter(e=>e.id===`developer`)),t.push(T?{id:`logout`,label:`Log Out`,icon:g,onSelect:()=>void p(w)}:{id:`login`,label:`Log In`,icon:s,onSelect:()=>void E()}),t},[e,T,w,E]),k=(0,y.useMemo)(()=>{if(C===l.settings.root)return`Settings`;let e=h.find(e=>C===e.href||C.startsWith(e.href+`/`));return e?e.label:`Settings`},[C]);return(0,b.jsx)(_,{backHref:l.assistant,sidebar:(0,b.jsx)(v,{items:D,bottomItems:O,indexPath:l.settings.root}),title:k,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{d as n,i as r,u as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./is-electron-C_ZTVhv8.js";import{t as s}from"./log-in-2iOsufxq.js";import{i as c}from"./auth-store-Kfxhs2oI.js";import{a as l}from"./routes-DVqkwUEe.js";import{t as u}from"./client-feature-flag-store-C1kdd1EO.js";import{t as d}from"./use-onboarding-login-BEOH92mZ.js";import{t as f}from"./assistant-feature-flag-store-Dl92XRsM.js";import{Ln as p,an as m,ft as h,mi as g}from"./index-PRnvH2Y1.js";import{n as _,t as v}from"./sidebar-tree-BJkXpCut.js";var y=e(t(),1),b=a();function x(){let e=f.use.settingsDeveloperNav(),t=u.use.platformNotifications(),a=u.use.bookmarks(),x=m({platformHostedOnly:!0}),S=m(),{pathname:C}=i(),w=n(),T=c(),{login:E}=d(),D=(0,y.useMemo)(()=>h.filter(e=>!(e.id===`notifications`&&(!t||x===`gated`)||e.id===`billing`&&S!==`full`||e.id===`bookmarks`&&!a||e.id===`devices`&&x===`gated`||e.id===`keyboard-shortcuts`&&!o()||e.id===`developer`)),[t,x,S,a]),O=(0,y.useMemo)(()=>{let t=[];return e&&t.push(...h.filter(e=>e.id===`developer`)),t.push(T?{id:`logout`,label:`Log Out`,icon:g,onSelect:()=>void p(w)}:{id:`login`,label:`Log In`,icon:s,onSelect:()=>void E()}),t},[e,T,w,E]),k=(0,y.useMemo)(()=>{if(C===l.settings.root)return`Settings`;let e=h.find(e=>C===e.href||C.startsWith(e.href+`/`));return e?e.label:`Settings`},[C]);return(0,b.jsx)(_,{backHref:l.assistant,sidebar:(0,b.jsx)(v,{items:D,bottomItems:O,indexPath:l.settings.root}),title:k,children:(0,b.jsx)(r,{})})}export{x as SettingsLayout};
@@ -1 +1 @@
1
- import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,n as i,t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-CL8VmqrY.js";import{t as l}from"./notice-CqRgVmeL.js";import{n as u,t as d}from"./input-C8kfrq9r.js";import{t as f}from"./toggle-X_kQW5my.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{t as m}from"./bug-DDcuQ3au.js";import{t as h}from"./info-_OtUK1cX.js";import{t as ee}from"./loader-circle-IIzBGiwm.js";import{t as g}from"./x-KVxA2ZL0.js";import{Jt as _}from"./sdk.gen-1aYqVbMj.js";import{n as v}from"./auth-store-Kfxhs2oI.js";import{t as y}from"./dist-BTp54SIT.js";import{n as b}from"./diagnostics-BEB4VPwC.js";import{t as x}from"./impersonate-version-flag-n-4oNLiO.js";import{L as te}from"./react-query.gen-rp6Krcco.js";import{di as S,oi as C,pi as ne,qr as re,vi as w}from"./index-BIDC22lX.js";var T=e(n(),1),ie=e(r(),1),E=`vellum:debug:`;function D(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function O(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:x()},overrides:D()}}var k=t({ShareFeedbackModal:()=>z}),A=s(),j=[{value:`bug_report`,label:`Bug Report`,icon:m,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:w,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:S,includesLogsByDefault:!1}],M=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],ae=M.map(e=>({value:e.value,label:e.label})),N=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),P=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),F=10,I=50*1024*1024,oe={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function se(){return p()?`electron`:y.getPlatform()===`ios`?`ios`:`web`}function ce(e){if(e.size>I)return!1;if(e.type&&N.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?P.has(t):!1}return!1}function L(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function R(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await _({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function le(e,t,n,r){if(typeof CompressionStream>`u`)return null;let i=new Date,a=M.find(t=>t.value===e),o=i.getTime(),s=a?.cutoffMs==null?null:o-a.cutoffMs,c=s==null?null:new Date(s).toISOString(),l=null;try{l=r?.()??null}catch{l=null}let u=b(l),d={collected_at:i.toISOString(),time_range:e,cutoff:c,log_window:{start_time_ms:s,end_time_ms:o},assistant_id:t,active_conversation_id:n,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},f=new TextEncoder().encode(JSON.stringify(d,null,2)),m=new TextEncoder().encode(JSON.stringify(u,null,2)),h=[L(`web-client-context.json`,f),L(`web-chat-diagnostics.json`,m)],ee=new TextEncoder().encode(JSON.stringify(O(),null,2));h.push(L(`web-debug-flags.json`,ee));try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-sse-liveness-triage.json`,n))}}catch{}if(p()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));h.push(L(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);h.push(L(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await R(t,{window:{startTime:s,endTime:o},activeConversationId:n});e&&h.push(L(`platform-logs.tar.gz`,e))}h.push(new Uint8Array(1024));let g=h.reduce((e,t)=>e+t.length,0),_=new Uint8Array(g),v=0;for(let e of h)_.set(e,v),v+=e.length;let y=new Blob([_.buffer]),x=await new Response(y.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([x],`web-client-logs-${i.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,onSubmitted:r,assistantId:s,assistantVersion:m,activeConversationId:_,getDiagnosticsSnapshot:y}){let b=v.use.user()?.email,x=(0,T.useId)(),S=(0,T.useRef)(null),w=(0,T.useRef)(null),E=(0,T.useRef)(null),D=(0,T.useRef)(null),[O,k]=(0,T.useState)(n??`bug_report`),[M,N]=(0,T.useState)(``),[P,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(j.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(`past_hour`),[U,W]=(0,T.useState)([]),[G,K]=(0,T.useState)(null),[fe,q]=(0,T.useState)(!1),[J,Y]=(0,T.useState)(!1),X=o(te()),[pe,Z]=(0,T.useState)(!1),Q=X.isPending||pe,me=!b,he=(0,T.useMemo)(()=>M.trim().length>0&&P.trim().length>0,[M,P]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;k(t),N(``),I(b??``),R(j.find(e=>e.value===t)?.includesLogsByDefault??!0),B(!1),H(`past_hour`),W([]),Y(!1),K(null),Z(!1),X.reset();let r=setTimeout(()=>{b?E.current?.focus():D.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let ge=e=>{k(e),z||R(j.find(t=>t.value===e)?.includesLogsByDefault??!1)},_e=()=>{R(e=>!e),B(!0)},ve=(0,T.useCallback)(e=>{e.key===`Escape`&&!Q&&t()},[t,Q]),ye=(0,T.useCallback)(e=>{e.target===S.current&&!Q&&t()},[t,Q]),$=(0,T.useCallback)(e=>{W(t=>{let n=F-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ce(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),be=e=>{e.target.files&&$(Array.from(e.target.files)),e.target.value=``},xe=e=>{e.preventDefault(),q(!1),e.dataTransfer.files?.length&&$(Array.from(e.dataTransfer.files))},Se=e=>{e.preventDefault(),q(!0)},Ce=e=>{e.preventDefault(),e.currentTarget===e.target&&q(!1)},we=e=>{W(t=>t.filter((t,n)=>n!==e))};return e?(0,ie.createPortal)((0,A.jsx)(`div`,{ref:S,role:`dialog`,"aria-modal":`true`,"aria-labelledby":x,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:ve,onClick:ye,onDrop:xe,onDragOver:Se,onDragLeave:Ce,children:(0,A.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,A.jsx)(`h2`,{id:x,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,A.jsx)(a,{variant:`ghost`,iconOnly:(0,A.jsx)(g,{}),onClick:t,disabled:Q,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${Q?`pointer-events-none opacity-60`:``}`,children:[me&&(0,A.jsx)(d,{id:`${x}-email`,ref:D,label:`Email`,type:`email`,placeholder:`you@example.com`,value:P,onChange:e=>I(e.target.value),leftIcon:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:j.map(e=>(0,A.jsx)(ue,{option:e,isSelected:O===e.value,onSelect:()=>ge(e.value)},e.value))})]}),(0,A.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),O===`bug_report`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),O===`feature_request`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,A.jsx)(u,{id:`${x}-message`,ref:E,label:O===`bug_report`?`What went wrong?`:O===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:O===`bug_report`?`What did you expect to happen, and what happened instead?`:O===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:M,onChange:e=>N(e.target.value),fullWidth:!0}),O!==`feature_request`&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:L,onChange:_e,"aria-label":`Include browser diagnostics`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,A.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,A.jsx)(h,{className:`h-3.5 w-3.5`})})})]}),L&&(0,A.jsx)(c,{options:ae,value:V,onChange:H,"aria-label":`Diagnostics time range`})]}),p()&&_&&O!==`feature_request`&&(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:J,onChange:()=>Y(e=>!e),"aria-label":`Include the most recent conversation`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,U.length>0&&(0,A.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,U.length,`/`,F]})]}),(0,A.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,A.jsx)(C,{}),onClick:()=>w.current?.click(),disabled:U.length>=F,children:`Add files`}),(0,A.jsx)(`input`,{ref:w,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:be,className:`hidden`})]}),U.length>0&&(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:U.map((e,t)=>(0,A.jsx)(de,{file:e,onRemove:()=>we(t)},`${e.name}-${t}`))}),fe&&(0,A.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]}),G&&(0,A.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:G})]}),(0,A.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:Q?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,A.jsx)(ee,{className:`h-4 w-4 animate-spin`}),`Sending feedback…`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(re,{}),onClick:async()=>{if(!(!he||Q)){K(null),Z(!0);try{let e=L&&O!==`feature_request`?await le(V,s??null,p()?J?_??null:null:_??null,y):null;await X.mutateAsync({headers:{"Content-Type":null},body:{message:M.trim(),classification:oe[O],email:P.trim(),client:se(),client_version:void 0,...s?{assistant_id:s}:{},...m?{assistant_version:m}:{},...e?{logs_file:e}:{},...U.length?{attachments:U}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),r?.(),t()}catch(e){K(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Z(!1)}}},disabled:!he,children:`Submit`})]})})]})}),document.body):null}function ue({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,A.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function de({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,A.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,A.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,A.jsx)(C,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,A.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,A.jsx)(g,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{k as n,z as t};
1
+ import{o as e,r as t}from"./chunk-jRWAZmH_.js";import{t as n}from"./react-DJZBPgpf.js";import{O as r,n as i,t as a}from"./button-D7s2Q_uG.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./dropdown-CL8VmqrY.js";import{t as l}from"./notice-CqRgVmeL.js";import{n as u,t as d}from"./input-C8kfrq9r.js";import{t as f}from"./toggle-X_kQW5my.js";import{t as p}from"./is-electron-C_ZTVhv8.js";import{t as m}from"./bug-DDcuQ3au.js";import{t as h}from"./info-_OtUK1cX.js";import{t as ee}from"./loader-circle-IIzBGiwm.js";import{t as g}from"./x-KVxA2ZL0.js";import{Jt as _}from"./sdk.gen-1aYqVbMj.js";import{n as v}from"./auth-store-Kfxhs2oI.js";import{t as y}from"./dist-BTp54SIT.js";import{n as b}from"./diagnostics-BEB4VPwC.js";import{t as x}from"./impersonate-version-flag-n-4oNLiO.js";import{L as te}from"./react-query.gen-rp6Krcco.js";import{di as S,oi as C,pi as ne,qr as re,vi as w}from"./index-PRnvH2Y1.js";var T=e(n(),1),ie=e(r(),1),E=`vellum:debug:`;function D(){let e={};if(typeof window>`u`)return e;try{for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);if(n===null||!n.startsWith(E))continue;let r=window.localStorage.getItem(n);r!==null&&(e[n]=r)}}catch{}return e}function O(){return{collectedAt:new Date().toISOString(),resolved:{impersonateAssistantVersion:x()},overrides:D()}}var k=t({ShareFeedbackModal:()=>z}),A=s(),j=[{value:`bug_report`,label:`Bug Report`,icon:m,includesLogsByDefault:!0},{value:`feature_request`,label:`Feature Request`,icon:w,includesLogsByDefault:!1},{value:`other`,label:`Other`,icon:S,includesLogsByDefault:!1}],M=[{value:`past_hour`,label:`Past hour`,cutoffMs:3600*1e3},{value:`past_24_hours`,label:`Past 24 hours`,cutoffMs:1440*60*1e3},{value:`all_time`,label:`All time`,cutoffMs:null}],ae=M.map(e=>({value:e.value,label:e.label})),N=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`video/mp4`,`video/quicktime`,`video/webm`]),P=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`mp4`,`mov`,`webm`]),F=10,I=50*1024*1024,oe={bug_report:`bug_report`,feature_request:`feature_request`,other:`other`};function se(){return p()?`electron`:y.getPlatform()===`ios`?`ios`:`web`}function ce(e){if(e.size>I)return!1;if(e.type&&N.has(e.type))return!0;if(!e.type){let t=e.name.split(`.`).pop()?.toLowerCase();return t?P.has(t):!1}return!1}function L(e,t){let n=Math.ceil(t.length/512),r=new Uint8Array(512+n*512),i=new TextEncoder,a=(e,t,n)=>{let a=i.encode(e);r.set(a.slice(0,n),t)},o=(e,t,n)=>{a(e.toString(8).padStart(n-1,`0`)+`\0`,t,n)};a(e,0,100),o(420,100,8),o(0,108,8),o(0,116,8),o(t.length,124,12),o(Math.floor(Date.now()/1e3),136,12);for(let e=148;e<156;e++)r[e]=32;r[156]=48,a(`ustar\0`,257,6),a(`00`,263,2);let s=0;for(let e=0;e<512;e++)s+=r[e];return o(s,148,7),r[155]=32,r.set(t,512),r}async function R(e,t){try{let n={};t.window.startTime!=null&&(n.startTime=t.window.startTime,n.endTime=t.window.endTime),t.activeConversationId&&(n.conversationId=t.activeConversationId);let{data:r,error:i}=await _({path:{assistant_id:e},body:n,parseAs:`blob`,throwOnError:!1});if(i||!(r instanceof Blob))return null;let a=await r.arrayBuffer();return new Uint8Array(a)}catch{return null}}async function le(e,t,n,r){if(typeof CompressionStream>`u`)return null;let i=new Date,a=M.find(t=>t.value===e),o=i.getTime(),s=a?.cutoffMs==null?null:o-a.cutoffMs,c=s==null?null:new Date(s).toISOString(),l=null;try{l=r?.()??null}catch{l=null}let u=b(l),d={collected_at:i.toISOString(),time_range:e,cutoff:c,log_window:{start_time_ms:s,end_time_ms:o},assistant_id:t,active_conversation_id:n,user_agent:typeof navigator<`u`?navigator.userAgent:``,language:typeof navigator<`u`?navigator.language:``,platform:typeof navigator<`u`?navigator.platform:``,url:typeof window<`u`?window.location.href:``,viewport:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:null,screen:typeof screen<`u`?{width:screen.width,height:screen.height}:null,connection:typeof navigator<`u`&&`connection`in navigator?{effectiveType:navigator.connection.effectiveType,downlink:navigator.connection.downlink,rtt:navigator.connection.rtt}:null,deviceMemory:typeof navigator<`u`&&`deviceMemory`in navigator?navigator.deviceMemory:null,hardwareConcurrency:typeof navigator<`u`?navigator.hardwareConcurrency:null},f=new TextEncoder().encode(JSON.stringify(d,null,2)),m=new TextEncoder().encode(JSON.stringify(u,null,2)),h=[L(`web-client-context.json`,f),L(`web-chat-diagnostics.json`,m)],ee=new TextEncoder().encode(JSON.stringify(O(),null,2));h.push(L(`web-debug-flags.json`,ee));try{let e=typeof window<`u`?window._vellumDebug?.chat:null;if(e){let t={clientMessages:e.getClientMessages?.()??null,transcriptItems:e.getTranscriptItems?.()??null,pendingInteractions:e.listPendingInteractions?.()??null,thinkingIndicator:e.thinkingIndicator?.()??null,streamingRing:e.streamingRing?.()??null,reconciliationDiagnostics:e.getReconciliationDiagnostics?.()??null},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-chat-debug-api-triage.json`,n))}}catch{}try{let e=typeof window<`u`?window._vellumDebug?.events:null;if(e){let t={focus:typeof document<`u`?{hasFocus:typeof document.hasFocus==`function`?document.hasFocus():null,visibilityState:document.visibilityState}:null,clients:e.getClients().map(({abortSignal:e,...t})=>({...t,aborted:e.aborted})),events:e.getEvents()},n=new TextEncoder().encode(JSON.stringify(t,null,2));h.push(L(`web-sse-liveness-triage.json`,n))}}catch{}if(p()&&window.vellum?.feedback){try{let e=await window.vellum.feedback.diagnostics(),t=new TextEncoder().encode(JSON.stringify(e,null,2));h.push(L(`electron-diagnostics.json`,t))}catch{}try{let e=await window.vellum.feedback.logs();if(e){let t=new TextEncoder().encode(e);h.push(L(`electron-main-logs.txt`,t))}}catch{}}if(t){let e=await R(t,{window:{startTime:s,endTime:o},activeConversationId:n});e&&h.push(L(`platform-logs.tar.gz`,e))}h.push(new Uint8Array(1024));let g=h.reduce((e,t)=>e+t.length,0),_=new Uint8Array(g),v=0;for(let e of h)_.set(e,v),v+=e.length;let y=new Blob([_.buffer]),x=await new Response(y.stream().pipeThrough(new CompressionStream(`gzip`))).blob();return new File([x],`web-client-logs-${i.getTime()}.tar.gz`,{type:`application/gzip`})}function z({open:e,onClose:t,initialReason:n,onSubmitted:r,assistantId:s,assistantVersion:m,activeConversationId:_,getDiagnosticsSnapshot:y}){let b=v.use.user()?.email,x=(0,T.useId)(),S=(0,T.useRef)(null),w=(0,T.useRef)(null),E=(0,T.useRef)(null),D=(0,T.useRef)(null),[O,k]=(0,T.useState)(n??`bug_report`),[M,N]=(0,T.useState)(``),[P,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(j.find(e=>e.value===(n??`bug_report`))?.includesLogsByDefault??!0),[z,B]=(0,T.useState)(!1),[V,H]=(0,T.useState)(`past_hour`),[U,W]=(0,T.useState)([]),[G,K]=(0,T.useState)(null),[fe,q]=(0,T.useState)(!1),[J,Y]=(0,T.useState)(!1),X=o(te()),[pe,Z]=(0,T.useState)(!1),Q=X.isPending||pe,me=!b,he=(0,T.useMemo)(()=>M.trim().length>0&&P.trim().length>0,[M,P]);(0,T.useEffect)(()=>{if(!e)return;let t=n??`bug_report`;k(t),N(``),I(b??``),R(j.find(e=>e.value===t)?.includesLogsByDefault??!0),B(!1),H(`past_hour`),W([]),Y(!1),K(null),Z(!1),X.reset();let r=setTimeout(()=>{b?E.current?.focus():D.current?.focus()},50);return()=>clearTimeout(r)},[e]),(0,T.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let ge=e=>{k(e),z||R(j.find(t=>t.value===e)?.includesLogsByDefault??!1)},_e=()=>{R(e=>!e),B(!0)},ve=(0,T.useCallback)(e=>{e.key===`Escape`&&!Q&&t()},[t,Q]),ye=(0,T.useCallback)(e=>{e.target===S.current&&!Q&&t()},[t,Q]),$=(0,T.useCallback)(e=>{W(t=>{let n=F-t.length;if(n<=0)return t;let r=new Set(t.map(e=>`${e.name}:${e.size}`)),i=[];for(let t of e){if(i.length>=n)break;if(!ce(t))continue;let e=`${t.name}:${t.size}`;r.has(e)||(r.add(e),i.push(t))}return i.length>0?[...t,...i]:t})},[]),be=e=>{e.target.files&&$(Array.from(e.target.files)),e.target.value=``},xe=e=>{e.preventDefault(),q(!1),e.dataTransfer.files?.length&&$(Array.from(e.dataTransfer.files))},Se=e=>{e.preventDefault(),q(!0)},Ce=e=>{e.preventDefault(),e.currentTarget===e.target&&q(!1)},we=e=>{W(t=>t.filter((t,n)=>n!==e))};return e?(0,ie.createPortal)((0,A.jsx)(`div`,{ref:S,role:`dialog`,"aria-modal":`true`,"aria-labelledby":x,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,onKeyDown:ve,onClick:ye,onDrop:xe,onDragOver:Se,onDragLeave:Ce,children:(0,A.jsxs)(`div`,{className:`mx-4 flex w-full max-w-lg flex-col rounded-xl border p-6 shadow-xl`,style:{backgroundColor:`var(--surface-lift)`,borderColor:`var(--border-base)`,maxHeight:`calc(100vh - 2rem)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-4`,style:{borderColor:`var(--border-subtle)`},children:[(0,A.jsx)(`h2`,{id:x,className:`!m-0 text-title-small text-[var(--content-default)]`,children:`Share Feedback`}),(0,A.jsx)(a,{variant:`ghost`,iconOnly:(0,A.jsx)(g,{}),onClick:t,disabled:Q,"aria-label":`Close`,tintColor:`var(--content-secondary)`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-3.5 overflow-y-auto pt-4 ${Q?`pointer-events-none opacity-60`:``}`,children:[me&&(0,A.jsx)(d,{id:`${x}-email`,ref:D,label:`Email`,type:`email`,placeholder:`you@example.com`,value:P,onChange:e=>I(e.target.value),leftIcon:(0,A.jsx)(ne,{className:`h-4 w-4`,"aria-hidden":!0}),fullWidth:!0}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,A.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Category`}),(0,A.jsx)(`div`,{className:`flex gap-2`,children:j.map(e=>(0,A.jsx)(ue,{option:e,isSelected:O===e.value,onSelect:()=>ge(e.value)},e.value))})]}),(0,A.jsx)(`hr`,{className:`border-[var(--border-subtle)]`}),O===`bug_report`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Get faster support by posting in our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/community`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`Discord community`})]}),O===`feature_request`&&(0,A.jsxs)(l,{tone:`info`,children:[`Tip: Vote on features on our`,` `,(0,A.jsx)(`a`,{href:`https://vellum.ai/roadmap`,target:`_blank`,rel:`noopener noreferrer`,className:`underline text-[var(--content-default)]`,children:`public roadmap`})]}),(0,A.jsx)(u,{id:`${x}-message`,ref:E,label:O===`bug_report`?`What went wrong?`:O===`feature_request`?`Describe your idea`:`What's on your mind?`,rows:3,placeholder:O===`bug_report`?`What did you expect to happen, and what happened instead?`:O===`feature_request`?`What problem would this solve for you?`:`Share your thoughts...`,value:M,onChange:e=>N(e.target.value),fullWidth:!0}),O!==`feature_request`&&(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:L,onChange:_e,"aria-label":`Include browser diagnostics`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include diagnostics`})]}),(0,A.jsx)(i,{content:`Diagnostics include browser context, assistant logs, and timestamps — never passwords or credentials.`,children:(0,A.jsx)(`button`,{type:`button`,"aria-label":`About diagnostics`,className:`inline-flex items-center justify-center text-[var(--content-tertiary)]`,children:(0,A.jsx)(h,{className:`h-3.5 w-3.5`})})})]}),L&&(0,A.jsx)(c,{options:ae,value:V,onChange:H,"aria-label":`Diagnostics time range`})]}),p()&&_&&O!==`feature_request`&&(0,A.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-2.5`,children:[(0,A.jsx)(f,{checked:J,onChange:()=>Y(e=>!e),"aria-label":`Include the most recent conversation`}),(0,A.jsx)(`span`,{className:`text-body-medium-lighter leading-6 text-[var(--content-default)]`,children:`Include the most recent conversation`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:[`Attachments`,U.length>0&&(0,A.jsxs)(`span`,{className:`text-[var(--content-tertiary)]`,children:[` · `,U.length,`/`,F]})]}),(0,A.jsx)(a,{variant:`outlined`,size:`compact`,leftIcon:(0,A.jsx)(C,{}),onClick:()=>w.current?.click(),disabled:U.length>=F,children:`Add files`}),(0,A.jsx)(`input`,{ref:w,type:`file`,multiple:!0,accept:`image/png,image/jpeg,image/gif,image/webp,video/mp4,video/quicktime,video/webm`,onChange:be,className:`hidden`})]}),U.length>0&&(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto`,children:U.map((e,t)=>(0,A.jsx)(de,{file:e,onRemove:()=>we(t)},`${e.name}-${t}`))}),fe&&(0,A.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Drop files to attach…`})]}),G&&(0,A.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:G})]}),(0,A.jsx)(`div`,{className:`mt-4 flex items-center justify-end gap-2 border-t pt-4`,style:{borderColor:`var(--border-subtle)`},children:Q?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,A.jsx)(ee,{className:`h-4 w-4 animate-spin`}),`Sending feedback…`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(a,{variant:`ghost`,onClick:t,children:`Cancel`}),(0,A.jsx)(a,{variant:`primary`,leftIcon:(0,A.jsx)(re,{}),onClick:async()=>{if(!(!he||Q)){K(null),Z(!0);try{let e=L&&O!==`feature_request`?await le(V,s??null,p()?J?_??null:null:_??null,y):null;await X.mutateAsync({headers:{"Content-Type":null},body:{message:M.trim(),classification:oe[O],email:P.trim(),client:se(),client_version:void 0,...s?{assistant_id:s}:{},...m?{assistant_version:m}:{},...e?{logs_file:e}:{},...U.length?{attachments:U}:{}},bodySerializer:e=>{let t=new FormData;for(let[n,r]of Object.entries(e))if(r!=null){if(n===`attachments`&&Array.isArray(r)){for(let e of r)t.append(`attachments`,e);continue}r instanceof Blob?t.append(n,r):t.append(n,String(r))}return t}}),r?.(),t()}catch(e){K(e instanceof Error?e.message:`Failed to submit feedback. Please try again.`)}finally{Z(!1)}}},disabled:!he,children:`Submit`})]})})]})}),document.body):null}function ue({option:e,isSelected:t,onSelect:n}){let r=e.icon;return(0,A.jsxs)(`button`,{type:`button`,onClick:n,"aria-pressed":t,className:`flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-left transition-colors`,style:{borderColor:t?`var(--primary-base)`:`var(--border-base)`,backgroundColor:t?`color-mix(in oklab, var(--primary-base) 10%, transparent)`:`transparent`},children:[(0,A.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`,style:{color:t?`var(--primary-base)`:`var(--content-secondary)`}}),(0,A.jsx)(`span`,{className:`text-body-small-default`,style:{color:t?`var(--primary-base)`:`var(--content-default)`},children:e.label})]})}function de({file:e,onRemove:t}){let n=e.type.startsWith(`image/`),r=(0,T.useMemo)(()=>n?URL.createObjectURL(e):null,[e,n]);return(0,T.useEffect)(()=>{if(r)return()=>URL.revokeObjectURL(r)},[r]),(0,A.jsxs)(`div`,{className:`relative flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-lg border border-[var(--border-base)] bg-[var(--surface-base)]`,title:e.name,children:[n&&r?(0,A.jsx)(`img`,{src:r,alt:e.name,className:`h-full w-full object-cover`}):(0,A.jsx)(C,{className:`h-5 w-5 text-[var(--content-secondary)]`}),(0,A.jsx)(a,{variant:`ghost`,size:`compact`,iconOnly:(0,A.jsx)(g,{}),onClick:t,"aria-label":`Remove ${e.name}`,className:`absolute top-0.5 right-0.5 h-4 w-4 rounded-full bg-black/60 text-white hover:bg-black/70`,tintColor:`#fff`})]})}export{k as n,z as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-BscuIPxA.js";import{r as c}from"./src-CK6bncSg.js";import{t as l}from"./is-electron-C_ZTVhv8.js";import{t as u}from"./arrow-left-CP-EhDNF.js";import{t as d}from"./chevron-right-B6vEpVY0.js";import{a as f}from"./routes-DVqkwUEe.js";import{n as p}from"./use-is-mobile-Cy10kl9u.js";import{t as m}from"./haptics-CXHZxyAg.js";import{It as h,bn as g,nn as _}from"./index-BIDC22lX.js";var v=e(t(),1),y=20,b=100,x=.3,S=.7,C=10,w=.3,T=200,E=180,D=200,O=.25,k=50;function A(e){return Math.min(b,e*x)}function j(e,t){return Math.abs(t)>Math.abs(e)*S}function M(e,t){return Math.abs(e)<C&&Math.abs(t)<C?`pending`:j(e,t)||e<=0?`cancel`:`confirm`}function N(e,t){return e<=t?e:t+(e-t)*w}function P(e,t){return e>=t}function F(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function I({containerRef:e,onBack:t,enabled:n,navKey:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(t),o=(0,v.useRef)(n),s=(0,v.useRef)(!1);(0,v.useLayoutEffect)(()=>{a.current=t,o.current=n},[t,n]),(0,v.useEffect)(()=>{if(!g())return;let t=e.current;if(!t)return;let n=new Set,r=!1,c=(e,t)=>{let i=setTimeout(()=>{n.delete(i),r||e()},t);n.add(i)},l=()=>F(t),u=()=>A(window.innerWidth),d=e=>{t.style.transform=e===0?``:`translateX(${e}px)`},f=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null},p=e=>{if(i.current=null,e){t.style.transition=`transform ${T}ms ease-out`,d(0);let e=()=>{t.removeEventListener(`transitionend`,e),l()};t.addEventListener(`transitionend`,e,{once:!0}),c(l,T+k)}else l()},h=()=>{t.style.transition=`transform ${E}ms ease-in`,d(window.innerWidth);let e=!1,n=()=>{if(e||r)return;e=!0,t.removeEventListener(`transitionend`,n);let i=-(window.innerWidth*O);t.style.transition=`none`,t.style.transform=`translateX(${i}px)`,t.style.opacity=`0`,t.offsetWidth,s.current=!0,a.current(),c(()=>{s.current&&(s.current=!1,l())},D*2)};t.addEventListener(`transitionend`,n,{once:!0}),c(n,E+k)},_=e=>{if(!o.current||i.current||e.touches.length!==1)return;let t=e.touches[0];t&&(t.clientX>y||(i.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1}))},v=e=>{let n=i.current;if(!n)return;if(e.touches.length>1){p(!1);return}let r=f(e.touches,n.touchId);if(!r)return;let a=r.clientX-n.startX,o=r.clientY-n.startY;if(!n.confirmed){let e=M(a,o);if(e===`pending`)return;if(e===`cancel`){p(!1);return}n.confirmed=!0,t.style.transition=`none`,t.style.willChange=`transform`}let s=u();if(j(a,o)&&a<s){p(!0);return}let c=N(a,s);a>=s&&!n.hasFiredHaptic&&(n.hasFiredHaptic=!0,m.light()),d(c)},b=e=>{let t=i.current;if(!t)return;let n=f(e.changedTouches,t.touchId),r=n?n.clientX-t.startX:0;t.confirmed&&P(r,u())?(i.current=null,h()):t.confirmed?p(!0):p(!1)},x=()=>{i.current?.confirmed?p(!0):p(!1)};return document.addEventListener(`touchstart`,_,{passive:!0}),document.addEventListener(`touchmove`,v,{passive:!0}),document.addEventListener(`touchend`,b,{passive:!0}),document.addEventListener(`touchcancel`,x,{passive:!0}),()=>{r=!0;for(let e of n)clearTimeout(e);n.clear(),i.current=null,document.removeEventListener(`touchstart`,_),document.removeEventListener(`touchmove`,v),document.removeEventListener(`touchend`,b),document.removeEventListener(`touchcancel`,x),l()}},[e]),(0,v.useLayoutEffect)(()=>{if(!s.current)return;s.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),F(t))};t.style.transition=`transform ${D}ms ease-out, opacity ${D}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,D+k);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),F(t)}},[r,e])}var L=o();function R({sidebar:e,children:t,actions:o,backHref:c,title:d=`Settings`,menuRoute:m=f.settings.root}){let{pathname:g}=a(),y=r(),b=g===m,x=p(),S=(0,v.useRef)(null),C=b?c:m;I({containerRef:S,onBack:(0,v.useCallback)(()=>{y(C)},[y,C]),enabled:x&&!b,navKey:g});let w=l(),T=b?`Back from ${d}`:`Back to ${d} menu`,E=(0,L.jsx)(n,{variant:`ghost`,iconOnly:(0,L.jsx)(u,{}),"aria-label":T,tintColor:`var(--content-secondary)`,onClick:()=>y(C)}),D=(0,L.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${d}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,L.jsx)(i,{to:c,className:`flex items-center justify-center no-underline`,children:(0,L.jsx)(u,{size:16,"aria-hidden":`true`})})});return(0,L.jsxs)(`div`,{ref:S,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:w?`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 3.75rem)`:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`},children:[(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[E,(0,L.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:d}),(0,L.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),w?(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,L.jsx)(_,{placement:`electron`,className:`px-0 pt-0`}),(0,L.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,L.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[D,(0,L.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${d} navigation`,children:e}),b?(0,L.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto pb-6 md:hidden`,children:e}):null,(0,L.jsx)(`main`,{className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-6 md:flex md:px-6 md:pt-0 ${b?`hidden`:`flex`}`,children:t})]})]})]})}function z({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=(e,t,r)=>{let{href:a,onSelect:s}=e,l=a!=null&&(i===a||i.startsWith(a+`/`)||r&&n!=null&&i===n);return(0,L.jsxs)(v.Fragment,{children:[(0,L.jsx)(c.Item,{icon:e.icon,label:e.label,active:l,trailingIcon:a==null?void 0:d,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:s,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,L.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>s(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>s(e,n===t.length-1,!1))]})]})}export{R as n,z as t};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{d as r,t as i,u as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as o}from"./jsx-runtime-CVSDxk6A.js";import{t as s}from"./typography-BscuIPxA.js";import{r as c}from"./src-CK6bncSg.js";import{t as l}from"./is-electron-C_ZTVhv8.js";import{t as u}from"./arrow-left-CP-EhDNF.js";import{t as d}from"./chevron-right-B6vEpVY0.js";import{a as f}from"./routes-DVqkwUEe.js";import{n as p}from"./use-is-mobile-Cy10kl9u.js";import{t as m}from"./haptics-CXHZxyAg.js";import{It as h,bn as g,nn as _}from"./index-PRnvH2Y1.js";var v=e(t(),1),y=20,b=100,x=.3,S=.7,C=10,w=.3,T=200,E=180,D=200,O=.25,k=50;function A(e){return Math.min(b,e*x)}function j(e,t){return Math.abs(t)>Math.abs(e)*S}function M(e,t){return Math.abs(e)<C&&Math.abs(t)<C?`pending`:j(e,t)||e<=0?`cancel`:`confirm`}function N(e,t){return e<=t?e:t+(e-t)*w}function P(e,t){return e>=t}function F(e){e.style.transition=``,e.style.transform=``,e.style.willChange=``,e.style.opacity=``}function I({containerRef:e,onBack:t,enabled:n,navKey:r}){let i=(0,v.useRef)(null),a=(0,v.useRef)(t),o=(0,v.useRef)(n),s=(0,v.useRef)(!1);(0,v.useLayoutEffect)(()=>{a.current=t,o.current=n},[t,n]),(0,v.useEffect)(()=>{if(!g())return;let t=e.current;if(!t)return;let n=new Set,r=!1,c=(e,t)=>{let i=setTimeout(()=>{n.delete(i),r||e()},t);n.add(i)},l=()=>F(t),u=()=>A(window.innerWidth),d=e=>{t.style.transform=e===0?``:`translateX(${e}px)`},f=(e,t)=>{for(let n=0;n<e.length;n+=1){let r=e[n];if(r&&r.identifier===t)return r}return null},p=e=>{if(i.current=null,e){t.style.transition=`transform ${T}ms ease-out`,d(0);let e=()=>{t.removeEventListener(`transitionend`,e),l()};t.addEventListener(`transitionend`,e,{once:!0}),c(l,T+k)}else l()},h=()=>{t.style.transition=`transform ${E}ms ease-in`,d(window.innerWidth);let e=!1,n=()=>{if(e||r)return;e=!0,t.removeEventListener(`transitionend`,n);let i=-(window.innerWidth*O);t.style.transition=`none`,t.style.transform=`translateX(${i}px)`,t.style.opacity=`0`,t.offsetWidth,s.current=!0,a.current(),c(()=>{s.current&&(s.current=!1,l())},D*2)};t.addEventListener(`transitionend`,n,{once:!0}),c(n,E+k)},_=e=>{if(!o.current||i.current||e.touches.length!==1)return;let t=e.touches[0];t&&(t.clientX>y||(i.current={touchId:t.identifier,startX:t.clientX,startY:t.clientY,confirmed:!1,hasFiredHaptic:!1}))},v=e=>{let n=i.current;if(!n)return;if(e.touches.length>1){p(!1);return}let r=f(e.touches,n.touchId);if(!r)return;let a=r.clientX-n.startX,o=r.clientY-n.startY;if(!n.confirmed){let e=M(a,o);if(e===`pending`)return;if(e===`cancel`){p(!1);return}n.confirmed=!0,t.style.transition=`none`,t.style.willChange=`transform`}let s=u();if(j(a,o)&&a<s){p(!0);return}let c=N(a,s);a>=s&&!n.hasFiredHaptic&&(n.hasFiredHaptic=!0,m.light()),d(c)},b=e=>{let t=i.current;if(!t)return;let n=f(e.changedTouches,t.touchId),r=n?n.clientX-t.startX:0;t.confirmed&&P(r,u())?(i.current=null,h()):t.confirmed?p(!0):p(!1)},x=()=>{i.current?.confirmed?p(!0):p(!1)};return document.addEventListener(`touchstart`,_,{passive:!0}),document.addEventListener(`touchmove`,v,{passive:!0}),document.addEventListener(`touchend`,b,{passive:!0}),document.addEventListener(`touchcancel`,x,{passive:!0}),()=>{r=!0;for(let e of n)clearTimeout(e);n.clear(),i.current=null,document.removeEventListener(`touchstart`,_),document.removeEventListener(`touchmove`,v),document.removeEventListener(`touchend`,b),document.removeEventListener(`touchcancel`,x),l()}},[e]),(0,v.useLayoutEffect)(()=>{if(!s.current)return;s.current=!1;let t=e.current;if(!t)return;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`transitionend`,r),F(t))};t.style.transition=`transform ${D}ms ease-out, opacity ${D}ms ease-out`,t.style.transform=``,t.style.opacity=``,t.addEventListener(`transitionend`,r,{once:!0});let i=setTimeout(r,D+k);return()=>{clearTimeout(i),t.removeEventListener(`transitionend`,r),F(t)}},[r,e])}var L=o();function R({sidebar:e,children:t,actions:o,backHref:c,title:d=`Settings`,menuRoute:m=f.settings.root}){let{pathname:g}=a(),y=r(),b=g===m,x=p(),S=(0,v.useRef)(null),C=b?c:m;I({containerRef:S,onBack:(0,v.useCallback)(()=>{y(C)},[y,C]),enabled:x&&!b,navKey:g});let w=l(),T=b?`Back from ${d}`:`Back to ${d} menu`,E=(0,L.jsx)(n,{variant:`ghost`,iconOnly:(0,L.jsx)(u,{}),"aria-label":T,tintColor:`var(--content-secondary)`,onClick:()=>y(C)}),D=(0,L.jsx)(n,{asChild:!0,variant:`outlined`,"aria-label":`Back from ${d}`,className:`h-8 w-8 px-0`,tintColor:`var(--content-secondary)`,children:(0,L.jsx)(i,{to:c,className:`flex items-center justify-center no-underline`,children:(0,L.jsx)(u,{size:16,"aria-hidden":`true`})})});return(0,L.jsxs)(`div`,{ref:S,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 p-4 sm:p-6 md:gap-0`,style:{paddingTop:w?`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 3.75rem)`:`calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + 1rem)`},children:[(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 md:hidden`,children:[E,(0,L.jsx)(s,{as:`h1`,variant:`body-large-default`,className:`flex-1 truncate text-center`,style:{color:`var(--content-tertiary)`,lineHeight:1.4},children:d}),(0,L.jsx)(`div`,{className:`h-10 w-10 shrink-0`,"aria-hidden":`true`})]}),w?(0,L.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 pb-4 empty:hidden`,children:[(0,L.jsx)(_,{placement:`electron`,className:`px-0 pt-0`}),(0,L.jsx)(h,{placement:`electron`,className:`px-0 pt-0`})]}):null,(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden md:rounded-[12px] md:border md:border-[var(--border-base)] md:bg-[var(--surface-overlay)]`,children:[(0,L.jsxs)(`div`,{className:`hidden shrink-0 items-center justify-between gap-4 px-6 py-5 md:flex`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[D,(0,L.jsx)(`h1`,{className:`text-title-large truncate`,style:{color:`var(--content-emphasised)`,lineHeight:1.2},children:d})]}),(0,L.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(`aside`,{className:`hidden w-64 shrink-0 overflow-y-auto md:block`,"aria-label":`${d} navigation`,children:e}),b?(0,L.jsx)(`div`,{className:`flex min-w-0 min-h-0 flex-1 flex-col overflow-y-auto pb-6 md:hidden`,children:e}):null,(0,L.jsx)(`main`,{className:`min-w-0 min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-6 md:flex md:px-6 md:pt-0 ${b?`hidden`:`flex`}`,children:t})]})]})]})}function z({items:e,bottomItems:t,indexPath:n}){let{pathname:i}=a(),o=r(),s=(e,t,r)=>{let{href:a,onSelect:s}=e,l=a!=null&&(i===a||i.startsWith(a+`/`)||r&&n!=null&&i===n);return(0,L.jsxs)(v.Fragment,{children:[(0,L.jsx)(c.Item,{icon:e.icon,label:e.label,active:l,trailingIcon:a==null?void 0:d,trailingIconClassName:a==null?void 0:`md:hidden`,href:a,onSelect:s,onClick:a==null?void 0:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),o(a))}}),!t&&(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`my-2 h-px w-full bg-[var(--border-base)] md:hidden`})]},e.id)};return(0,L.jsxs)(`nav`,{"aria-label":`Sidebar navigation`,className:`flex min-h-full flex-col md:gap-2 md:px-6 md:pb-4`,children:[e.map((n,r)=>s(n,r===e.length-1&&!t?.length,r===0)),t&&t.length>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(`div`,{role:`presentation`,"aria-hidden":!0,className:`mx-0 my-2 h-px w-full bg-[var(--border-base)] md:mx-0`}),t.map((e,n)=>s(e,n===t.length-1,!1))]})]})}export{R as n,z as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./is-electron-C_ZTVhv8.js";import{A as o,k as s}from"./auth-store-Kfxhs2oI.js";import{a as c}from"./routes-DVqkwUEe.js";import{n as l,r as u}from"./login-flow-DPi11n3h.js";import{t as d}from"./proxy-DmIh4F51.js";import{t as f}from"./AnimatePresence-CgXwEO42.js";import{X as p,at as m}from"./index-BIDC22lX.js";import{t as h}from"./signup-shell-Bu5BM6II.js";var g=e(t(),1),_=i();function v({words:e}){let[t,n]=(0,g.useState)(0),r=(0,g.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,g.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,_.jsxs)(`span`,{className:`signup__rotating`,children:[(0,_.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,_.jsx)(f,{mode:`wait`,children:(0,_.jsxs)(d.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var y=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`],b=[{icon:(0,_.jsx)(p,{size:18}),label:`Continue with Google`,providerHint:`GoogleOAuth`},{icon:(0,_.jsx)(m,{size:18}),label:`Continue with Apple`,providerHint:`AppleOAuth`},{icon:(0,_.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,_.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,_.jsx)(`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`})]}),label:`Continue with Email`}];function x({returnTo:e}){let[t,n]=(0,g.useState)(null),i=u(e,{authIntent:`signup`}),d=t=>{n(null);let r=!!t&&!s()&&!a();o(l,i,{returnTo:e,...t?{providerHint:t}:{},...r?{}:{intent:`signup`}}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})};return(0,_.jsxs)(h,{children:[(0,_.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,_.jsx)(`br`,{}),(0,_.jsx)(v,{words:y})]}),(0,_.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,_.jsx)(`div`,{className:`signup__buttons`,children:b.map((e,t)=>(0,_.jsxs)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>d(e.providerHint),children:[t===0&&(0,_.jsx)(`span`,{className:`signup__tag`,children:`Most used`}),e.icon,e.label]},e.label))}),t&&(0,_.jsx)(`p`,{className:`signup__error`,children:t}),(0,_.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,_.jsx)(r,{to:c.account.login,className:`signup__link`,children:`Sign in`})]}),(0,_.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,_.jsx)(m,{size:16}),`Download for macOS`]})]})}function S(){let[e]=n();return(0,_.jsx)(x,{returnTo:e.get(`returnTo`)})}export{S as SignupPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{h as n,t as r}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./is-electron-C_ZTVhv8.js";import{A as o,k as s}from"./auth-store-Kfxhs2oI.js";import{a as c}from"./routes-DVqkwUEe.js";import{n as l,r as u}from"./login-flow-DPi11n3h.js";import{t as d}from"./proxy-DmIh4F51.js";import{t as f}from"./AnimatePresence-CgXwEO42.js";import{X as p,at as m}from"./index-PRnvH2Y1.js";import{t as h}from"./signup-shell-Bu5BM6II.js";var g=e(t(),1),_=i();function v({words:e}){let[t,n]=(0,g.useState)(0),r=(0,g.useMemo)(()=>e.reduce((e,t)=>e.length>=t.length?e:t),[e]);return(0,g.useEffect)(()=>{let t=setInterval(()=>{n(t=>(t+1)%e.length)},2400);return()=>clearInterval(t)},[e.length]),(0,_.jsxs)(`span`,{className:`signup__rotating`,children:[(0,_.jsxs)(`span`,{className:`signup__rotating-sizer`,"aria-hidden":!0,children:[r,`.`]}),(0,_.jsx)(f,{mode:`wait`,children:(0,_.jsxs)(d.em,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.3,ease:`easeInOut`},children:[e[t],`.`]},e[t])})]})}var y=[`Personal Intelligence`,`Software Engineer`,`Finance Ops`,`Household Manager`,`GTM Engineer`,`Product Lead`],b=[{icon:(0,_.jsx)(p,{size:18}),label:`Continue with Google`,providerHint:`GoogleOAuth`},{icon:(0,_.jsx)(m,{size:18}),label:`Continue with Apple`,providerHint:`AppleOAuth`},{icon:(0,_.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":!0,children:[(0,_.jsx)(`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`}),(0,_.jsx)(`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`})]}),label:`Continue with Email`}];function x({returnTo:e}){let[t,n]=(0,g.useState)(null),i=u(e,{authIntent:`signup`}),d=t=>{n(null);let r=!!t&&!s()&&!a();o(l,i,{returnTo:e,...t?{providerHint:t}:{},...r?{}:{intent:`signup`}}).catch(e=>{console.error(`[signup] auth flow failed:`,e),n(`Something went wrong. Please try again.`)})};return(0,_.jsxs)(h,{children:[(0,_.jsxs)(`h1`,{className:`signup__title`,children:[`Meet your new`,(0,_.jsx)(`br`,{}),(0,_.jsx)(v,{words:y})]}),(0,_.jsx)(`p`,{className:`signup__subtitle`,children:`The most powerful assistant that can handle your work and life admin tasks.`}),(0,_.jsx)(`div`,{className:`signup__buttons`,children:b.map((e,t)=>(0,_.jsxs)(`button`,{type:`button`,className:`signup__btn`,onClick:()=>d(e.providerHint),children:[t===0&&(0,_.jsx)(`span`,{className:`signup__tag`,children:`Most used`}),e.icon,e.label]},e.label))}),t&&(0,_.jsx)(`p`,{className:`signup__error`,children:t}),(0,_.jsxs)(`p`,{className:`signup__footer`,children:[`Already have an account?`,` `,(0,_.jsx)(r,{to:c.account.login,className:`signup__link`,children:`Sign in`})]}),(0,_.jsxs)(`a`,{className:`signup__download`,href:`/downloads`,children:[(0,_.jsx)(m,{size:16}),`Download for macOS`]})]})}function S(){let[e]=n();return(0,_.jsx)(x,{returnTo:e.get(`returnTo`)})}export{S as SignupPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D7s2Q_uG.js";import{h as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-BibIM9x3.js";import{n as f,t as p}from"./panel-item-nGTDevWP.js";import{t as m}from"./menu-C_97pis4.js";import"./src-CK6bncSg.js";import{t as ee}from"./confirm-dialog-CfOXCE1N.js";import{t as h}from"./popover-CL-JL6vG.js";import{t as g}from"./input-C8kfrq9r.js";import{n as _}from"./stat-square-B0S3fO7O.js";import{t as v}from"./createLucideIcon-BlMXrA59.js";import{t as y}from"./arrow-left-CP-EhDNF.js";import{a as b,c as x,i as S,n as C,o as w,r as T,s as E,t as te}from"./install-b0ONV1om.js";import{t as D}from"./calendar-CpgH8CqM.js";import{t as O}from"./check-D6WkI0gF.js";import{t as k}from"./cloud-off-rAv4OHmv.js";import{t as A}from"./code-aMX9iMYa.js";import{t as j}from"./file-text-CmK9LY1p.js";import{t as M}from"./globe-DYF_lSGm.js";import{t as N}from"./link-2-CaszbD7P.js";import{t as P}from"./loader-circle-IIzBGiwm.js";import{t as F}from"./sparkles-BICoewVE.js";import{t as I}from"./triangle-alert-DKOyShqD.js";import{t as ne}from"./x-KVxA2ZL0.js";import{Gt as re,_t as ie,gt as ae,ht as oe,mt as L,pt as R}from"./react-query.gen-CQLyoqYk.js";import{n as se}from"./use-is-mobile-Cy10kl9u.js";import{$i as z,Di as B,Ir as V,Jr as H,Kr as U,L as W,Lr as ce,Or as G,Pr as le,R as K,Ur as ue,Zi as q,ci as de,di as fe,ia as J,ji as pe,pi as me,si as he,wi as ge,yi as Y}from"./index-BIDC22lX.js";import{t as _e}from"./use-active-assistant-id-C-RHQ9f6.js";var ve=v(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),ye=v(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),X=e(r(),1),be={mail:me,calendar:D,"message-circle":fe,globe:M,zap:G,code:A,mic:de,"shopping-cart":ue,palette:ye,heart:ge,settings:U,"link-2":N};function xe(e){return be[e]}var Z=u();function Se({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a}){let o=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,Z.jsx)(Ce,{icon:Y,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,Z.jsx)(Ce,{icon:xe(r.icon)??Y,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function Ce({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,Z.jsxs)(a,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,Z.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var we=e(i(),1);function Te(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function Ee(e,t){let[n,r]=(0,X.useState)(null),i=c({...L({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Te(a,n),l=c({...R({path:{assistant_id:e,id:t},query:{path:s??``}}),select:e=>e??null,enabled:!!s});return{fileEntries:a,skillMd:o,selectedPath:n,setSelectedPath:r,activePath:s,activeFile:a.find(e=>e.path===s),isFilesLoading:i.isLoading,fileContent:l.data?.content??null,isBinary:!!l.data?.isBinary,isContentLoading:l.isLoading}}function De({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):K(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(W,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Oe({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:i,isInstalling:o=!1,isRemoving:s=!1}){let c=T(t),l=b(t),{fileEntries:u,setSelectedPath:f,activePath:p,activeFile:m,isFilesLoading:ee,fileContent:h,isBinary:g,isContentLoading:v}=Ee(e,t.id),[x,S]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{S(`preview`)},[p]);let[C,te]=(0,X.useState)(null);(0,X.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let D=m?K(m.name,void 0):!1,O=D?x:`raw`,k=(0,Z.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(ke,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(E,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(w,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(je,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(_,{iconOnly:!0,ariaLabel:`File view mode`,value:O,onChange:S,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(pe,{"aria-hidden":!0}),disabled:!D},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(A,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:ee||v?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(De,{fileName:m.name,content:h,isBinary:g,viewMode:O}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return C?(0,we.createPortal)(k,C):k}function ke({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Ae(e){return(e??``).endsWith(`/directory`)}function je({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(m.Root,{children:[(0,Z.jsx)(m.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(z,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(m.Content,{align:`start`,children:e.map(e=>{let n=Ae(e.mimeType);return(0,Z.jsx)(m.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(B,{}):(0,Z.jsx)(j,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Me(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(j,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Ne=[{value:`all`,label:`All`,icon:Y},{value:`installed`,label:`Installed`,icon:q},{value:`available`,label:`Available`,icon:J}],Pe=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:M},{value:`skillssh`,label:`skills.sh`,icon:ce},{value:`custom`,label:`Custom`,icon:le}];function Fe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(g,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(H,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(P,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=se(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ve,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(h.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(h.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(h.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(Re,{label:`Status`,options:Ne,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.jsx)(Re,{label:`Source`,options:Pe,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function Le({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(f.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(f.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(f.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(f.Header,{children:(0,Z.jsx)(f.Title,{children:`Filters`})}),(0,Z.jsxs)(f.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Ne.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:Y,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),p.map(e=>(0,Z.jsx)($,{icon:xe(e.icon)??Y,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(f.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,Z.jsx)(p,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(O,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Re({label:e,options:t,selected:n,onSelect:r}){return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(q,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function ze({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:i=!1,isRemoving:o=!1}){let s=T(e),c=b(e);return(0,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(E,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(w,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}function Be(e){return c({...oe({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}function Ve(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:return{origin:e};default:return{}}}function He(e){return[...e].sort((e,t)=>{let n=S(e);return n===S(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Ue(e,t){let[n,r]=(0,X.useState)(e);return(0,X.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var We=300,Ge=`vellum:skills:tipDismissed`;function Ke({assistantId:e,initialSkillId:r}){let i=s(),a=se(),[o,u]=(0,X.useState)(``),d=Ue(o.trim(),We),[f,p]=(0,X.useState)(`all`),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(r??null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,w]=(0,X.useState)(null),[T,E]=(0,X.useState)(()=>n(Ge,!1)),{data:D=[]}=Be(e),{origin:O,kind:k}=(0,X.useMemo)(()=>Ve(f),[f]),A=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0,category:m??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),j=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&m!==null}),M=(0,X.useCallback)(()=>{i.invalidateQueries({queryKey:ie({path:{assistant_id:e}})})},[e,i]),N=l({mutationFn:t=>te(e,t),onMutate:e=>y(e),onSettled:()=>{y(null),M()}}),P=re({onMutate:e=>x(e.path.id),onSettled:()=>{x(null),M()}}),F=(0,X.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,X.useCallback)(e=>{w(e)},[]),ne=(0,X.useCallback)(()=>{S&&(P.mutate({path:{assistant_id:e,id:S.id}}),w(null))},[e,S,P]),oe=(0,X.useCallback)(()=>{E(!0),t(Ge,!0)},[]),L=(0,X.useMemo)(()=>A.data?.skills??[],[A.data?.skills]),R=m===null?A.data:j.data,{counts:z,totalCount:B}=qe(R?.skills??L,R?.categoryCounts,R?.totalCount),V=(0,X.useMemo)(()=>He(L),[L]),H=(0,X.useMemo)(()=>g?L.find(e=>e.id===g)??null:null,[L,g]),U=(0,Z.jsx)(ee,{open:S!==null,title:`Remove skill`,message:S?`Remove "${S.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:ne,onCancel:()=>w(null)});if(H){let t={assistantId:e,skill:H,onBack:()=>_(null),onInstall:()=>F(H),onRemove:()=>I(H),isInstalling:v===(H.slug??H.id),isRemoving:b===H.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(Oe,{...t}):(0,Z.jsx)(C,{...t}),U]})}let W=A.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!T&&(0,Z.jsx)(Je,{onDismiss:oe}),(0,Z.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:p,isSearching:W,categories:D,category:m,onCategoryChange:h,counts:z,totalCount:B,showCounts:!W}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(Se,{selected:m,onSelect:h,counts:z,totalCount:B,showCounts:!W,categories:D})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:A.isLoading?(0,Z.jsx)(Ye,{}):A.isError?(0,Z.jsx)(Xe,{}):V.length===0?(0,Z.jsx)(Ze,{filter:f,category:m}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:V.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(ze,{skill:e,onSelect:()=>_(e.id),onInstall:()=>F(e),onRemove:()=>I(e),isInstalling:v===(e.slug??e.id),isRemoving:b===e.id})},e.id))})})]}),U]})}function qe(e,t,n){return(0,X.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function Je({onDismiss:e}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(ne,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(I,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function Ze({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Qe(e,t);return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function Qe(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:Y};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:G};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:q};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:he};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:M};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:ce};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:le};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=_e(),[t]=o();return(0,Z.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{a as t,t as n}from"./local-settings-lVNyIOJ_.js";import{t as r}from"./react-DJZBPgpf.js";import{O as i,t as a}from"./button-D7s2Q_uG.js";import{h as o}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as s}from"./QueryClientProvider-DKhXIxGb.js";import{t as c}from"./useQuery-B45lW1Kk.js";import{t as l}from"./useMutation-Lj4VunQV.js";import{t as u}from"./jsx-runtime-CVSDxk6A.js";import{t as d}from"./card-BibIM9x3.js";import{n as f,t as p}from"./panel-item-nGTDevWP.js";import{t as m}from"./menu-C_97pis4.js";import"./src-CK6bncSg.js";import{t as ee}from"./confirm-dialog-CfOXCE1N.js";import{t as h}from"./popover-CL-JL6vG.js";import{t as g}from"./input-C8kfrq9r.js";import{n as _}from"./stat-square-B0S3fO7O.js";import{t as v}from"./createLucideIcon-BlMXrA59.js";import{t as y}from"./arrow-left-CP-EhDNF.js";import{a as b,c as x,i as S,n as C,o as w,r as T,s as E,t as te}from"./install-C3xe8ARr.js";import{t as D}from"./calendar-CpgH8CqM.js";import{t as O}from"./check-D6WkI0gF.js";import{t as k}from"./cloud-off-rAv4OHmv.js";import{t as A}from"./code-aMX9iMYa.js";import{t as j}from"./file-text-CmK9LY1p.js";import{t as M}from"./globe-DYF_lSGm.js";import{t as N}from"./link-2-CaszbD7P.js";import{t as P}from"./loader-circle-IIzBGiwm.js";import{t as F}from"./sparkles-BICoewVE.js";import{t as I}from"./triangle-alert-DKOyShqD.js";import{t as ne}from"./x-KVxA2ZL0.js";import{Gt as re,_t as ie,gt as ae,ht as oe,mt as L,pt as R}from"./react-query.gen-CQLyoqYk.js";import{n as se}from"./use-is-mobile-Cy10kl9u.js";import{$i as z,Di as B,Ir as V,Jr as H,Kr as U,L as W,Lr as ce,Or as G,Pr as le,R as K,Ur as ue,Zi as q,ci as de,di as fe,ia as J,ji as pe,pi as me,si as he,wi as ge,yi as Y}from"./index-PRnvH2Y1.js";import{t as _e}from"./use-active-assistant-id-C-RHQ9f6.js";var ve=v(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),ye=v(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),X=e(r(),1),be={mail:me,calendar:D,"message-circle":fe,globe:M,zap:G,code:A,mic:de,"shopping-cart":ue,palette:ye,heart:ge,settings:U,"link-2":N};function xe(e){return be[e]}var Z=u();function Se({selected:e,onSelect:t,counts:n,totalCount:r,showCounts:i,categories:a}){let o=[...a].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(`nav`,{className:`flex flex-col gap-1`,"aria-label":`Skill categories`,children:[(0,Z.jsx)(Ce,{icon:Y,label:`All`,count:r,isActive:e===null,showCount:i,onClick:()=>t(null)}),o.map(r=>(0,Z.jsx)(Ce,{icon:xe(r.icon)??Y,label:r.label,count:n[r.slug]??0,isActive:e===r.slug,showCount:i,onClick:()=>t(r.slug)},r.slug))]})}function Ce({icon:e,label:t,count:n,isActive:r,showCount:i,onClick:o}){return(0,Z.jsxs)(a,{variant:`ghost`,onClick:o,"aria-pressed":r,className:`h-auto justify-between gap-3 rounded-lg border-0 bg-transparent px-3 py-2 text-left hover:bg-[var(--ghost-hover)]`,style:{backgroundColor:r?`var(--surface-active)`:void 0,color:r?`var(--content-default)`:`var(--content-secondary)`},children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,Z.jsx)(e,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`text-body-medium-default`,children:t})]}),i&&(0,Z.jsx)(`span`,{className:`text-body-small-default`,style:{color:`var(--content-tertiary)`},children:n})]})}var we=e(i(),1);function Te(e,t){return t??e.find(e=>e.name===`SKILL.md`)?.path??null}function Ee(e,t){let[n,r]=(0,X.useState)(null),i=c({...L({path:{assistant_id:e,id:t}}),select:e=>e??null}),a=(0,X.useMemo)(()=>i.data?.files??[],[i.data]),o=(0,X.useMemo)(()=>a.find(e=>e.name===`SKILL.md`),[a]),s=Te(a,n),l=c({...R({path:{assistant_id:e,id:t},query:{path:s??``}}),select:e=>e??null,enabled:!!s});return{fileEntries:a,skillMd:o,selectedPath:n,setSelectedPath:r,activePath:s,activeFile:a.find(e=>e.path===s),isFilesLoading:i.isLoading,fileContent:l.data?.content??null,isBinary:!!l.data?.isBinary,isContentLoading:l.isLoading}}function De({fileName:e,content:t,isBinary:n,viewMode:r=`preview`}){return n?(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Binary file — no preview available.`}):t===null?(0,Z.jsxs)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:[`No preview available for `,e,`.`]}):K(e,void 0)&&r===`preview`?(0,Z.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4`,style:{color:`var(--content-default)`},children:(0,Z.jsx)(W,{content:t})}):(0,Z.jsx)(`pre`,{className:`h-full overflow-y-auto whitespace-pre-wrap break-words p-4 font-mono text-body-small-default`,style:{color:`var(--content-default)`},children:t})}function Oe({assistantId:e,skill:t,onBack:n,onInstall:r,onRemove:i,isInstalling:o=!1,isRemoving:s=!1}){let c=T(t),l=b(t),{fileEntries:u,setSelectedPath:f,activePath:p,activeFile:m,isFilesLoading:ee,fileContent:h,isBinary:g,isContentLoading:v}=Ee(e,t.id),[x,S]=(0,X.useState)(`preview`);(0,X.useEffect)(()=>{S(`preview`)},[p]);let[C,te]=(0,X.useState)(null);(0,X.useEffect)(()=>{te(document.getElementById(`viewport-overlays`))},[]);let D=m?K(m.name,void 0):!1,O=D?x:`raw`,k=(0,Z.jsxs)(`div`,{className:`fixed inset-0 z-40 flex flex-col overflow-hidden bg-[var(--surface-overlay)]`,style:{paddingTop:`calc(8px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)))`,paddingBottom:`calc(8px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)))`,paddingLeft:`calc(12px + var(--safe-area-inset-left, env(safe-area-inset-left, 0px)))`,paddingRight:`calc(12px + var(--safe-area-inset-right, env(safe-area-inset-right, 0px)))`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(y,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Back to skills`,onClick:n,className:`max-md:bg-[var(--surface-active)]`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate px-2 text-center text-body-medium-default`,style:{color:`var(--content-secondary)`},children:t.name}),(0,Z.jsx)(ke,{available:c,removable:l,isInstalling:o,isRemoving:s,onInstall:r,onRemove:i})]}),(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(E,{skill:t,className:`h-6 w-6 shrink-0 text-[22px] leading-none`}),(0,Z.jsx)(`h2`,{className:`min-w-0 truncate text-title-medium`,style:{color:`var(--content-emphasised)`},children:t.name})]}),(0,Z.jsx)(w,{origin:t.origin})]}),(0,Z.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:t.description})]}),(0,Z.jsx)(d.Root,{asChild:!0,noPadding:!0,children:(0,Z.jsxs)(`div`,{className:`mt-6 flex min-h-0 flex-1 flex-col overflow-hidden rounded-2xl border bg-[var(--surface-lift)]`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b px-3 py-2`,style:{borderColor:`var(--border-hover)`},children:[(0,Z.jsx)(je,{fileEntries:u,activePath:p,activeName:m?.name??null,onSelect:f}),(0,Z.jsx)(_,{iconOnly:!0,ariaLabel:`File view mode`,value:O,onChange:S,items:[{value:`preview`,label:`Preview`,icon:(0,Z.jsx)(pe,{"aria-hidden":!0}),disabled:!D},{value:`raw`,label:`Source`,icon:(0,Z.jsx)(A,{"aria-hidden":!0})}]})]}),(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:ee||v?(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})}):m?(0,Z.jsx)(De,{fileName:m.name,content:h,isBinary:g,viewMode:O}):(0,Z.jsx)(`p`,{className:`flex h-full items-center justify-center text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Select a file to view its contents.`})})]})})]});return C?(0,we.createPortal)(k,C):k}function ke({available:e,removable:t,isInstalling:n,isRemoving:r,onInstall:i,onRemove:o}){return n||r?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,"aria-label":`Pending`,className:`max-md:bg-[var(--surface-active)]`}):e?(0,Z.jsx)(a,{variant:`ghost`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Install skill`,onClick:i,disabled:!i,className:`max-md:bg-[var(--surface-active)]`}):t?(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,"aria-label":`Remove skill`,onClick:o,disabled:!o,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`}):(0,Z.jsx)(a,{variant:`dangerGhost`,iconOnly:(0,Z.jsx)(V,{"aria-hidden":!0}),expandOnMobile:!0,disabled:!0,title:`Bundled skills cannot be removed`,"aria-label":`Bundled skill cannot be removed`,className:`max-md:rounded-full max-md:bg-[var(--system-negative-weak)]`})}function Ae(e){return(e??``).endsWith(`/directory`)}function je({fileEntries:e,activePath:t,activeName:n,onSelect:r}){let i=n??`Select a file`;return e.length===0?(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i})]}):(0,Z.jsxs)(m.Root,{children:[(0,Z.jsx)(m.Trigger,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`flex min-w-0 items-center gap-2 rounded-md text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:[(0,Z.jsx)(Me,{}),(0,Z.jsx)(`span`,{className:`truncate`,children:i}),(0,Z.jsx)(z,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0})]})}),(0,Z.jsx)(m.Content,{align:`start`,children:e.map(e=>{let n=Ae(e.mimeType);return(0,Z.jsx)(m.Item,{onSelect:()=>r(e.path),leftIcon:n?(0,Z.jsx)(B,{}):(0,Z.jsx)(j,{}),"aria-current":e.path===t?`true`:void 0,children:e.name},e.path)})})]})}function Me(){return(0,Z.jsx)(`span`,{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,"aria-hidden":!0,children:(0,Z.jsx)(j,{className:`h-4 w-4`,style:{color:`var(--content-secondary)`}})})}var Ne=[{value:`all`,label:`All`,icon:Y},{value:`installed`,label:`Installed`,icon:q},{value:`available`,label:`Available`,icon:J}],Pe=[{value:`vellum`,label:`Vellum`,icon:x},{value:`clawhub`,label:`Clawhub`,icon:M},{value:`skillssh`,label:`skills.sh`,icon:ce},{value:`custom`,label:`Custom`,icon:le}];function Fe({search:e,onSearchChange:t,filter:n,onFilterChange:r,isSearching:i,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(g,{type:`search`,value:e,onChange:e=>{t(e.target.value)},placeholder:`Search skills`,"aria-label":`Search skills`,leftIcon:(0,Z.jsx)(H,{className:`h-4 w-4`,"aria-hidden":!0}),rightIcon:i?(0,Z.jsx)(P,{className:`h-4 w-4 animate-spin`,"aria-hidden":!0}):void 0,fullWidth:!0,wrapperClassName:`flex-1`}),(0,Z.jsx)(Ie,{filter:n,onFilterChange:r,categories:a,category:o,onCategoryChange:s,counts:c,totalCount:l,showCounts:u})]})}function Ie(e){let t=se(),[n,r]=(0,X.useState)(!1),i=(0,Z.jsx)(a,{type:`button`,variant:`outlined`,iconOnly:(0,Z.jsx)(ve,{"aria-hidden":!0}),"aria-label":`Filter skills`,"aria-haspopup":t?`dialog`:`listbox`,"aria-expanded":n,tintColor:`var(--primary-base)`});return t?(0,Z.jsx)(Le,{...e,open:n,onOpenChange:r,trigger:i}):(0,Z.jsxs)(h.Root,{open:n,onOpenChange:r,children:[(0,Z.jsx)(h.Trigger,{asChild:!0,children:i}),(0,Z.jsx)(h.Content,{align:`end`,sideOffset:4,className:`w-44 overflow-hidden p-0`,children:(0,Z.jsxs)(`ul`,{role:`listbox`,children:[(0,Z.jsx)(Re,{label:`Status`,options:Ne,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}}),(0,Z.jsx)(`div`,{className:`border-t`,style:{borderColor:`var(--border-base)`}}),(0,Z.jsx)(Re,{label:`Source`,options:Pe,selected:e.filter,onSelect:t=>{e.onFilterChange(t),r(!1)}})]})})]})}function Le({filter:e,onFilterChange:t,categories:n,category:r,onCategoryChange:i,counts:o,totalCount:s,showCounts:c,open:l,onOpenChange:u,trigger:d}){let p=[...n].sort((e,t)=>e.label.localeCompare(t.label));return(0,Z.jsxs)(f.Root,{open:l,onOpenChange:u,children:[(0,Z.jsx)(f.Trigger,{asChild:!0,children:d}),(0,Z.jsxs)(f.Content,{className:`max-h-[85dvh]`,"aria-describedby":void 0,children:[(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-[var(--border-element)]`}),(0,Z.jsx)(f.Header,{children:(0,Z.jsx)(f.Title,{children:`Filters`})}),(0,Z.jsxs)(f.Body,{className:`flex flex-col gap-3 pt-2`,children:[(0,Z.jsx)(Q,{label:`Status`,children:Ne.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsx)(Q,{label:`Source`,children:Pe.map(n=>(0,Z.jsx)($,{icon:n.icon,label:n.label,active:e===n.value,onSelect:()=>t(n.value)},n.value))}),(0,Z.jsxs)(Q,{label:`Categories`,children:[(0,Z.jsx)($,{icon:Y,label:`All`,active:r===null,badge:c?s:void 0,onSelect:()=>i(null)}),p.map(e=>(0,Z.jsx)($,{icon:xe(e.icon)??Y,label:e.label,active:r===e.slug,badge:c?o[e.slug]??0:void 0,onSelect:()=>i(e.slug)},e.slug))]})]}),(0,Z.jsx)(f.Footer,{children:(0,Z.jsx)(a,{type:`button`,variant:`primary`,fullWidth:!0,onClick:()=>u(!1),children:`Done`})})]})]})}function Q({label:e,children:t}){return(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`px-2 pb-1 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),t]})}function $({icon:e,label:t,active:n,badge:r,onSelect:i}){return(0,Z.jsx)(p,{icon:e,label:t,active:n,activeVariant:`branded`,badge:r,trailingAction:n&&r==null?(0,Z.jsx)(O,{className:`h-4 w-4 text-[var(--primary-base)]`,"aria-hidden":!0}):void 0,onSelect:i})}function Re({label:e,options:t,selected:n,onSelect:r}){return(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`div`,{className:`px-3 pb-1 pt-2 text-body-small-default uppercase tracking-wide`,style:{color:`var(--content-tertiary)`},children:e}),(0,Z.jsx)(`ul`,{children:t.map(e=>{let t=e.icon,i=n===e.value;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>r(e.value),role:`option`,"aria-selected":i,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-body-medium-lighter transition-colors hover:bg-[var(--surface-hover)]`,style:{color:i?`var(--primary-base)`:`var(--content-default)`},children:[(0,Z.jsx)(t,{className:`h-4 w-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),i&&(0,Z.jsx)(q,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})},e.value)})})]})}function ze({skill:e,onSelect:t,onInstall:n,onRemove:r,isInstalling:i=!1,isRemoving:o=!1}){let s=T(e),c=b(e);return(0,Z.jsx)(d.Root,{asChild:!0,children:(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),t())},className:`flex cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors hover:bg-[var(--surface-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]`,children:[(0,Z.jsx)(`div`,{className:`flex shrink-0 items-center justify-center text-[28px] leading-none`,children:(0,Z.jsx)(E,{skill:e,className:`h-7 w-7`})}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-body-medium-default`,style:{color:`var(--content-emphasised)`},children:e.name}),(0,Z.jsx)(w,{origin:e.origin})]}),(0,Z.jsx)(`p`,{className:`mt-1 truncate text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.description})]}),s?i?(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}),disabled:!0,"aria-label":`Installing`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,iconOnly:(0,Z.jsx)(J,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),n?.()},disabled:!n,"aria-label":`Install skill`,expandOnMobile:!1}):(0,Z.jsx)(a,{type:`button`,variant:`dangerOutline`,iconOnly:o?(0,Z.jsx)(P,{className:`animate-spin`,"aria-hidden":!0}):(0,Z.jsx)(V,{"aria-hidden":!0}),onClick:e=>{e.stopPropagation(),r?.()},disabled:!c||o||!r,"aria-label":c?`Remove skill`:`Bundled skill cannot be removed`,title:c?void 0:`Bundled skills cannot be removed`,expandOnMobile:!1})]})})}function Be(e){return c({...oe({path:{assistant_id:e}}),select:e=>e.categories,staleTime:300*1e3})}function Ve(e){switch(e){case`installed`:return{kind:`installed`};case`available`:return{kind:`available`};case`vellum`:case`clawhub`:case`skillssh`:case`custom`:return{origin:e};default:return{}}}function He(e){return[...e].sort((e,t)=>{let n=S(e);return n===S(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})}function Ue(e,t){let[n,r]=(0,X.useState)(e);return(0,X.useEffect)(()=>{let n=setTimeout(()=>{r(e)},t);return()=>clearTimeout(n)},[e,t]),n}var We=300,Ge=`vellum:skills:tipDismissed`;function Ke({assistantId:e,initialSkillId:r}){let i=s(),a=se(),[o,u]=(0,X.useState)(``),d=Ue(o.trim(),We),[f,p]=(0,X.useState)(`all`),[m,h]=(0,X.useState)(null),[g,_]=(0,X.useState)(r??null),[v,y]=(0,X.useState)(null),[b,x]=(0,X.useState)(null),[S,w]=(0,X.useState)(null),[T,E]=(0,X.useState)(()=>n(Ge,!1)),{data:D=[]}=Be(e),{origin:O,kind:k}=(0,X.useMemo)(()=>Ve(f),[f]),A=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0,category:m??void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e}),j=c({...ae({path:{assistant_id:e},query:{include:`catalog`,origin:O,kind:k,q:d||void 0}}),select:e=>({skills:e.skills,categoryCounts:e.categoryCounts,totalCount:e.totalCount}),enabled:!!e&&m!==null}),M=(0,X.useCallback)(()=>{i.invalidateQueries({queryKey:ie({path:{assistant_id:e}})})},[e,i]),N=l({mutationFn:t=>te(e,t),onMutate:e=>y(e),onSettled:()=>{y(null),M()}}),P=re({onMutate:e=>x(e.path.id),onSettled:()=>{x(null),M()}}),F=(0,X.useCallback)(e=>{N.mutate(e.slug??e.id)},[N]),I=(0,X.useCallback)(e=>{w(e)},[]),ne=(0,X.useCallback)(()=>{S&&(P.mutate({path:{assistant_id:e,id:S.id}}),w(null))},[e,S,P]),oe=(0,X.useCallback)(()=>{E(!0),t(Ge,!0)},[]),L=(0,X.useMemo)(()=>A.data?.skills??[],[A.data?.skills]),R=m===null?A.data:j.data,{counts:z,totalCount:B}=qe(R?.skills??L,R?.categoryCounts,R?.totalCount),V=(0,X.useMemo)(()=>He(L),[L]),H=(0,X.useMemo)(()=>g?L.find(e=>e.id===g)??null:null,[L,g]),U=(0,Z.jsx)(ee,{open:S!==null,title:`Remove skill`,message:S?`Remove "${S.name}" from this assistant?`:``,confirmLabel:`Remove`,destructive:!0,onConfirm:ne,onCancel:()=>w(null)});if(H){let t={assistantId:e,skill:H,onBack:()=>_(null),onInstall:()=>F(H),onRemove:()=>I(H),isInstalling:v===(H.slug??H.id),isRemoving:b===H.id};return(0,Z.jsxs)(Z.Fragment,{children:[a?(0,Z.jsx)(Oe,{...t}):(0,Z.jsx)(C,{...t}),U]})}let W=A.isFetching&&!!d;return(0,Z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col gap-4`,children:[!T&&(0,Z.jsx)(Je,{onDismiss:oe}),(0,Z.jsx)(Fe,{search:o,onSearchChange:u,filter:f,onFilterChange:p,isSearching:W,categories:D,category:m,onCategoryChange:h,counts:z,totalCount:B,showCounts:!W}),(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-6`,children:[(0,Z.jsx)(`aside`,{className:`hidden w-56 shrink-0 overflow-y-auto sm:block`,children:(0,Z.jsx)(Se,{selected:m,onSelect:h,counts:z,totalCount:B,showCounts:!W,categories:D})}),(0,Z.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:A.isLoading?(0,Z.jsx)(Ye,{}):A.isError?(0,Z.jsx)(Xe,{}):V.length===0?(0,Z.jsx)(Ze,{filter:f,category:m}):(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2`,children:V.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(ze,{skill:e,onSelect:()=>_(e.id),onInstall:()=>F(e),onRemove:()=>I(e),isInstalling:v===(e.slug??e.id),isRemoving:b===e.id})},e.id))})})]}),U]})}function qe(e,t,n){return(0,X.useMemo)(()=>{if(t&&Object.keys(t).length>0)return{counts:t,totalCount:n??e.length};let r={};for(let t of e){let e=t.category??`system`;r[e]=(r[e]??0)+1}return{counts:r,totalCount:n??e.length}},[e,t,n])}function Je({onDismiss:e}){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg px-4 py-2.5 text-body-small-default`,style:{backgroundColor:`var(--surface-base)`,color:`var(--content-secondary)`},children:[(0,Z.jsx)(F,{className:`h-4 w-4 shrink-0`,style:{color:`var(--primary-base)`}}),(0,Z.jsx)(`p`,{className:`flex-1`,children:`You can create a new custom skill by describing what you want in chat.`}),(0,Z.jsx)(a,{type:`button`,variant:`ghost`,size:`compact`,iconOnly:(0,Z.jsx)(ne,{"aria-hidden":!0}),onClick:e,"aria-label":`Dismiss tip`,tintColor:`var(--content-tertiary)`,expandOnMobile:!1})]})}function Ye(){return(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,Z.jsx)(P,{className:`h-6 w-6 animate-spin`,style:{color:`var(--content-tertiary)`}})})}function Xe(){return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(I,{className:`mb-3 h-8 w-8`,style:{color:`var(--system-danger)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:`Failed to load skills`}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Something went wrong. Try refreshing the page.`})]})})}function Ze({filter:e,category:t}){let{title:n,subtitle:r,Icon:i}=Qe(e,t);return(0,Z.jsx)(d.Root,{children:(0,Z.jsxs)(d.Body,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,Z.jsx)(i,{className:`mb-3 h-8 w-8`,style:{color:`var(--content-tertiary)`},"aria-hidden":!0}),(0,Z.jsx)(`h3`,{className:`text-title-small`,style:{color:`var(--content-default)`},children:n}),(0,Z.jsx)(`p`,{className:`mt-1 max-w-sm text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:r})]})})}function Qe(e,t){if(t)return{title:`No skills in this category`,subtitle:`Try selecting a different category or clearing the filter.`,Icon:Y};switch(e){case`installed`:return{title:`No Skills Installed`,subtitle:`Ask your assistant in chat to search for and install new skills.`,Icon:G};case`available`:return{title:`No Skills Available`,subtitle:`All available skills have been installed.`,Icon:q};case`vellum`:return{title:`No Vellum Skills`,subtitle:`No bundled Vellum skills found.`,Icon:he};case`clawhub`:return{title:`No Clawhub Skills`,subtitle:`No Clawhub skills found. Try searching the catalog.`,Icon:M};case`skillssh`:return{title:`No skills.sh Skills`,subtitle:`No skills.sh skills found. Try searching the catalog.`,Icon:ce};case`custom`:return{title:`No Custom Skills`,subtitle:`Create a custom skill by describing what you want in chat.`,Icon:le};default:return{title:`No Skills Available`,subtitle:`Check your connection to the Vellum catalog.`,Icon:k}}}function $e(){let e=_e(),[t]=o();return(0,Z.jsx)(Ke,{assistantId:e,initialSkillId:t.get(`skill`)??void 0})}export{$e as SkillsPage};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./useMutation-Lj4VunQV.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import{t as s}from"./toggle-X_kQW5my.js";import{Ct as c,St as l,bt as u,vt as d}from"./react-query.gen-CQLyoqYk.js";import{a as f,i as p,n as m,r as h,t as g}from"./sound-manager-CzslfzDO.js";import{$i as _,Ir as v,ni as y}from"./index-BIDC22lX.js";import{t as b}from"./use-active-assistant-id-C-RHQ9f6.js";var x=e(t(),1),S=a();function C({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(s,{checked:n,disabled:r,onChange:i,label:e})]})}function w(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function T({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:c}){let[l,u]=(0,x.useState)(!1),d=n.filter(e=>!t.sounds.includes(e.filename)),p=n.length>0&&d.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m[e]}),(0,S.jsx)(s,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${m[e]}`})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:f(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,S.jsx)(y,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,S.jsx)(v,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):p?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,S.jsx)(_,{className:`h-3 w-3`})]}),l&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>u(!1),children:d.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),u(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function E(){let e=n(),t=b(),a=(0,x.useMemo)(()=>u({path:{assistant_id:t}}),[t]),s=(0,x.useMemo)(()=>d({path:{assistant_id:t}}),[t]),{data:f}=r(a),{data:m}=r(s),_=f??p(),v=m?.sounds??[],E=(0,x.useMemo)(()=>({path:{assistant_id:t}}),[t]),D=i({...c(E),onMutate:async t=>{await e.cancelQueries({queryKey:a.queryKey});let n=e.getQueryData(a.queryKey);return l(e,E,t.body),{previous:n}},onError:(t,n,r)=>{r?.previous!==void 0&&l(e,E,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:a.queryKey})}}),O=(0,x.useCallback)(n=>{let r=n(e.getQueryData(a.queryKey)??p());D.mutate({path:{assistant_id:t},body:r})},[t,a.queryKey,e,D]),k=e=>{O(t=>({...t,globalEnabled:e}))},A=e=>{O(t=>({...t,volume:e}))},[j,M]=(0,x.useState)(null),N=j??_.volume,P=(e,t)=>{O(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},F=(e,t)=>{O(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},I=(e,t)=>{O(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},L=()=>{g().previewFallbackBlip(_.volume)},R=e=>{g().previewSound(e,_.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(C,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:_.globalEnabled,onChange:k}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:N,onChange:e=>M(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},className:`h-1 w-48 cursor-pointer`,disabled:!_.globalEnabled,"aria-label":`Sound effect volume`}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(N*100),`%`]})]}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,S.jsxs)(`button`,{type:`button`,onClick:L,disabled:!_.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(y,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,S.jsxs)(o,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:h.map(e=>(0,S.jsx)(T,{event:e,eventConfig:_.events[e]??{enabled:!1,sounds:[]},availableSounds:v,globalEnabled:_.globalEnabled,onToggle:t=>P(e,t),onAddSound:t=>F(e,t),onRemoveSound:t=>I(e,t),onPreview:e=>R(e)},e))})]})]})}export{E as SoundsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{n}from"./QueryClientProvider-DKhXIxGb.js";import{t as r}from"./useQuery-B45lW1Kk.js";import{t as i}from"./useMutation-Lj4VunQV.js";import{t as a}from"./jsx-runtime-CVSDxk6A.js";import{t as o}from"./card-BibIM9x3.js";import{t as s}from"./toggle-X_kQW5my.js";import{Ct as c,St as l,bt as u,vt as d}from"./react-query.gen-CQLyoqYk.js";import{a as f,i as p,n as m,r as h,t as g}from"./sound-manager-CzslfzDO.js";import{$i as _,Ir as v,ni as y}from"./index-PRnvH2Y1.js";import{t as b}from"./use-active-assistant-id-C-RHQ9f6.js";var x=e(t(),1),S=a();function C({label:e,description:t,checked:n,disabled:r,onChange:i}){return(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:e}),t&&(0,S.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:t})]}),(0,S.jsx)(s,{checked:n,disabled:r,onChange:i,label:e})]})}function w(){return(0,S.jsx)(`div`,{className:`border-t border-[var(--border-base)]`})}function T({event:e,eventConfig:t,availableSounds:n,globalEnabled:r,onToggle:i,onAddSound:a,onRemoveSound:o,onPreview:c}){let[l,u]=(0,x.useState)(!1),d=n.filter(e=>!t.sounds.includes(e.filename)),p=n.length>0&&d.length===0;return(0,S.jsxs)(`div`,{className:`py-3`,children:[(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:m[e]}),(0,S.jsx)(s,{checked:t.enabled,disabled:!r,onChange:i,label:`Enable ${m[e]}`})]}),t.enabled&&(0,S.jsxs)(`div`,{className:`mt-2 space-y-1 pl-2`,children:[t.sounds.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Default Blip`}):t.sounds.map(e=>(0,S.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,S.jsx)(`span`,{className:`truncate text-body-small-default text-[var(--content-secondary)]`,title:e,children:f(e)}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Preview ${e}`,children:(0,S.jsx)(y,{className:`h-3 w-3`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>o(e),className:`inline-flex items-center rounded-md px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)] hover:bg-[var(--surface-base)] dark:text-[var(--content-disabled)] dark:hover:bg-[var(--ghost-hover)]`,"aria-label":`Remove ${e}`,children:(0,S.jsx)(v,{className:`h-3 w-3`})})]})]},e)),n.length===0?(0,S.jsx)(`p`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`No sound files yet. Drop audio files into data/sounds/ in your workspace.`}):p?(0,S.jsx)(`button`,{type:`button`,disabled:!0,className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-disabled)] disabled:cursor-not-allowed dark:bg-[var(--surface-lift)] dark:text-[var(--content-tertiary)]`,children:`All sounds added`}):(0,S.jsxs)(`div`,{className:`relative inline-block`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`inline-flex items-center gap-1 rounded-md border border-[var(--border-base)] bg-white px-2 py-1 text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[`Add sound`,(0,S.jsx)(_,{className:`h-3 w-3`})]}),l&&(0,S.jsx)(`div`,{className:`absolute left-0 z-10 mt-1 max-h-64 w-56 overflow-auto rounded-md border border-[var(--border-base)] bg-white p-1 shadow-lg dark:bg-[var(--surface-lift)]`,onMouseLeave:()=>u(!1),children:d.map(e=>(0,S.jsx)(`button`,{type:`button`,onClick:()=>{a(e.filename),u(!1)},className:`block w-full truncate rounded px-2 py-1 text-left text-body-small-default text-[var(--content-default)] hover:bg-[var(--surface-base)] dark:hover:bg-[var(--ghost-hover)]`,title:e.filename,children:e.label},e.filename))})]})]})]})}function E(){let e=n(),t=b(),a=(0,x.useMemo)(()=>u({path:{assistant_id:t}}),[t]),s=(0,x.useMemo)(()=>d({path:{assistant_id:t}}),[t]),{data:f}=r(a),{data:m}=r(s),_=f??p(),v=m?.sounds??[],E=(0,x.useMemo)(()=>({path:{assistant_id:t}}),[t]),D=i({...c(E),onMutate:async t=>{await e.cancelQueries({queryKey:a.queryKey});let n=e.getQueryData(a.queryKey);return l(e,E,t.body),{previous:n}},onError:(t,n,r)=>{r?.previous!==void 0&&l(e,E,r.previous)},onSettled:()=>{e.invalidateQueries({queryKey:a.queryKey})}}),O=(0,x.useCallback)(n=>{let r=n(e.getQueryData(a.queryKey)??p());D.mutate({path:{assistant_id:t},body:r})},[t,a.queryKey,e,D]),k=e=>{O(t=>({...t,globalEnabled:e}))},A=e=>{O(t=>({...t,volume:e}))},[j,M]=(0,x.useState)(null),N=j??_.volume,P=(e,t)=>{O(n=>({...n,events:{...n.events,[e]:{...n.events[e]??{enabled:!1,sounds:[]},enabled:t}}}))},F=(e,t)=>{O(n=>{let r=n.events[e]??{enabled:!0,sounds:[]};return r.sounds.includes(t)?n:{...n,events:{...n.events,[e]:{...r,sounds:[...r.sounds,t]}}}})},I=(e,t)=>{O(n=>{let r=n.events[e];return r?{...n,events:{...n.events,[e]:{...r,sounds:r.sounds.filter(e=>e!==t)}}}:n})},L=()=>{g().previewFallbackBlip(_.volume)},R=e=>{g().previewSound(e,_.volume)};return(0,S.jsxs)(`div`,{className:`space-y-6`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(C,{label:`Enable sound effects`,description:`Master switch for every event-driven sound.`,checked:_.globalEnabled,onChange:k}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center gap-3 py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Volume`}),(0,S.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:N,onChange:e=>M(parseFloat(e.target.value)),onPointerUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onKeyUp:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},onBlur:e=>{let t=parseFloat(e.currentTarget.value);M(null),t!==_.volume&&A(t)},className:`h-1 w-48 cursor-pointer`,disabled:!_.globalEnabled,"aria-label":`Sound effect volume`}),(0,S.jsxs)(`span`,{className:`tabular-nums text-body-small-default text-[var(--content-tertiary)]`,children:[Math.round(N*100),`%`]})]}),(0,S.jsx)(w,{}),(0,S.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,S.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Preview default blip`}),(0,S.jsxs)(`button`,{type:`button`,onClick:L,disabled:!_.globalEnabled,className:`inline-flex items-center gap-1.5 rounded-md border border-[var(--border-base)] bg-white px-3 py-1.5 text-body-medium-lighter text-[var(--content-default)] hover:bg-[var(--surface-base)] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-[var(--surface-lift)] dark:hover:bg-[var(--ghost-hover)]`,children:[(0,S.jsx)(y,{className:`h-3.5 w-3.5`}),`Preview`]})]})]}),(0,S.jsxs)(o,{children:[(0,S.jsxs)(`div`,{className:`pb-2`,children:[(0,S.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:`Sound Events`}),(0,S.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Add one or more sounds per event. When multiple are configured, one plays at random.`})]}),(0,S.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:h.map(e=>(0,S.jsx)(T,{event:e,eventConfig:_.events[e]??{enabled:!1,sounds:[]},availableSounds:v,globalEnabled:_.globalEnabled,onToggle:t=>P(e,t),onAddSound:t=>F(e,t),onRemoveSound:t=>I(e,t),onPreview:e=>R(e)},e))})]})]})}export{E as SoundsPage};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{a as t}from"./prefs-C_oq5G87.js";import{Bn as n}from"./index-BIDC22lX.js";var r=`onboarding_v3_2026_05`,i=`onboarding.funnelSessionId`,a=`onboarding.funnelVariant`,o={control:`control`,paredDown:`pared_down`};function s(e){return e===`variant-a`?o.paredDown:o.control}var c={privacyTos:{stepName:`privacy_tos`,stepIndex:0},nameVibe:{stepName:`name_vibe`,stepIndex:1},controlWorkType:{stepName:`work_type`,stepIndex:2},controlTools:{stepName:`tools`,stepIndex:3},controlPriorAssistants:{stepName:`prior_assistants`,stepIndex:4},controlGmailConnect:{stepName:`gmail_connect`,stepIndex:5},controlGetApp:{stepName:`get_app`,stepIndex:6},gmailConnect:{stepName:`gmail_connect`,stepIndex:2}};function l(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function u(){if(typeof window>`u`)return crypto.randomUUID();let e=``;try{e=sessionStorage.getItem(i)??``}catch{e=``}if(e)return e;let t=crypto.randomUUID();try{sessionStorage.setItem(i,t)}catch{}return t}function d(e){return e===o.control||e===o.paredDown}function f(){if(typeof window>`u`)return null;try{let e=sessionStorage.getItem(a);return d(e)?e:null}catch{return null}}function p(e){let t=f();if(t)return t;if(typeof window>`u`)return e;try{sessionStorage.setItem(a,e)}catch{}return e}function m(e,t={}){let n=Date.now(),i=t.variant??f()??o.control;return{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:n,screen:e.stepName,session_id:u(),step_name:e.stepName,step_index:e.stepIndex,completed_at:new Date(n).toISOString(),user_id:t.userId??null,funnel_version:r,ab_variant:i}}function h(e,r={}){if(typeof window>`u`||!t())return;let i=l(m(e,r)),a=JSON.stringify({device_id:n(),assistant_version:`web-dev`,events:[i]});fetch(`/v1/telemetry/ingest/`,{method:`POST`,headers:{"Content-Type":`application/json`},body:a,keepalive:!0}).catch(()=>{})}var g=e();function _({current:e,total:t,color:n}){return(0,g.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Step ${e+1} of ${t}`,children:Array.from({length:t},(t,r)=>(0,g.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors`,style:n?{backgroundColor:n,opacity:r<=e?1:.3}:void 0,children:n?null:(0,g.jsx)(`div`,{className:`h-full w-full rounded-full bg-[var(--content-default)] ${r<=e?``:`opacity-20`}`})},r))})}export{u as a,p as c,h as i,c as n,s as o,o as r,f as s,_ as t};
1
+ import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{a as t}from"./prefs-C_oq5G87.js";import{Bn as n}from"./index-PRnvH2Y1.js";var r=`onboarding_v3_2026_05`,i=`onboarding.funnelSessionId`,a=`onboarding.funnelVariant`,o={control:`control`,paredDown:`pared_down`};function s(e){return e===`variant-a`?o.paredDown:o.control}var c={privacyTos:{stepName:`privacy_tos`,stepIndex:0},nameVibe:{stepName:`name_vibe`,stepIndex:1},controlWorkType:{stepName:`work_type`,stepIndex:2},controlTools:{stepName:`tools`,stepIndex:3},controlPriorAssistants:{stepName:`prior_assistants`,stepIndex:4},controlGmailConnect:{stepName:`gmail_connect`,stepIndex:5},controlGetApp:{stepName:`get_app`,stepIndex:6},gmailConnect:{stepName:`gmail_connect`,stepIndex:2}};function l(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}function u(){if(typeof window>`u`)return crypto.randomUUID();let e=``;try{e=sessionStorage.getItem(i)??``}catch{e=``}if(e)return e;let t=crypto.randomUUID();try{sessionStorage.setItem(i,t)}catch{}return t}function d(e){return e===o.control||e===o.paredDown}function f(){if(typeof window>`u`)return null;try{let e=sessionStorage.getItem(a);return d(e)?e:null}catch{return null}}function p(e){let t=f();if(t)return t;if(typeof window>`u`)return e;try{sessionStorage.setItem(a,e)}catch{}return e}function m(e,t={}){let n=Date.now(),i=t.variant??f()??o.control;return{type:`onboarding`,daemon_event_id:crypto.randomUUID(),recorded_at:n,screen:e.stepName,session_id:u(),step_name:e.stepName,step_index:e.stepIndex,completed_at:new Date(n).toISOString(),user_id:t.userId??null,funnel_version:r,ab_variant:i}}function h(e,r={}){if(typeof window>`u`||!t())return;let i=l(m(e,r)),a=JSON.stringify({device_id:n(),assistant_version:`web-dev`,events:[i]});fetch(`/v1/telemetry/ingest/`,{method:`POST`,headers:{"Content-Type":`application/json`},body:a,keepalive:!0}).catch(()=>{})}var g=e();function _({current:e,total:t,color:n}){return(0,g.jsx)(`div`,{className:`flex items-center gap-1.5`,role:`group`,"aria-label":`Step ${e+1} of ${t}`,children:Array.from({length:t},(t,r)=>(0,g.jsx)(`div`,{"aria-hidden":`true`,className:`h-[3px] w-8 rounded-full transition-colors`,style:n?{backgroundColor:n,opacity:r<=e?1:.3}:void 0,children:n?null:(0,g.jsx)(`div`,{className:`h-full w-full rounded-full bg-[var(--content-default)] ${r<=e?``:`opacity-20`}`})},r))})}export{u as a,p as c,h as i,c as n,s as o,o as r,f as s,_ as t};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-BscuIPxA.js";import"./src-CK6bncSg.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{i as o,n as s,r as c,t as l}from"./status-badge-pill-DYlAnX5m.js";import{W as u,p as d,s as f}from"./risk-badge-BA8R-HCI.js";import{t as p}from"./brain-Bs6LnfHO.js";import{t as m}from"./chevron-right-B6vEpVY0.js";import{t as h}from"./globe-DYF_lSGm.js";import{t as g}from"./x-KVxA2ZL0.js";import{t as _}from"./misc-BN2o2MEB.js";import{a as v,i as y,r as b}from"./subagent-store-BLHGkTJR.js";import{n as x,t as S}from"./three-dot-indicator-CLs7Rl-I.js";import{$ as C,$i as w,A as T,Br as E,C as D,D as O,E as k,M as A,N as j,O as M,P as N,Q as P,S as F,T as I,et as ee,ia as te,it as L,j as R,k as z,nt as B,rt as V,tt as H,w as U}from"./index-BIDC22lX.js";import{CodeBlock as W,ToolDetailBody as ne}from"./tool-detail-panel-CltEAL4k.js";var G=e(t(),1),K=r();function q({status:e}){return(0,K.jsx)(l,{color:y(e),label:v(e)})}function J(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?A(n,t):``}`}function Y(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function X(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function Z(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function re(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return n.text}}function Q(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ie({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,G.useState)(new Set),s=n??a,c=(0,G.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,G.useMemo)(()=>T(e),[e]);return l.length===0?null:(0,K.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=J(e,n),a=n===l.length-1;return(0,K.jsx)(ae,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var ae=(0,G.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:r,sectionKeyValue:a,onToggle:o,onStepDetailClick:s}){let c=R(e.steps),l=c===`running`&&!n?`completed`:c,u=l===`running`||n,d=e.steps[0]?.kind===`thinking`,f=e.steps.length,m=e.label===`Searching the web`,g=m?Z(e):void 0,v=f>=2,y=e.steps.some(e=>j(e)||!!s&&!!Q(e)),b=l===`running`?``:N(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),x=l===`running`?Y(e):void 0,S=l===`running`&&!m?X(x,e.label):``,C=m&&(l===`running`||!!g),w=g??e.label,T=d&&u,E=T?re(e)??e.label:void 0,O=l===`running`||C||T||!!b,P=`${f} step${f===1?``:`s`}`;return(0,K.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:_(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,K.jsx)(M,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,K.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!y,onClick:y?()=>o(a):void 0,className:_(`flex h-[22px] w-full items-center gap-2 text-left`,y&&`cursor-pointer`),children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,K.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,K.jsx)(z,{status:u?`running`:l,isThinking:d&&!u}),(0,K.jsx)(i,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),O&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),C?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(h,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:w})]}):T?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(p,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:E??e.label})]}):l===`running`?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(p,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:S})]}):b?(0,K.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:`Worked for ${b}`}):null,y&&v&&(0,K.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,K.jsx)(i,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:P})})]}),y&&r&&(0,K.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=s?Q(e):void 0;if(n&&s){if(e.kind===`tool`)return(0,K.jsx)(I,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,riskLevel:e.riskLevel,tone:e.status===`error`||e.status===`denied`?`error`:`default`,ariaLabel:`View tool details`,onClick:()=>s(n)},A(e,t));if(e.kind===`thinking`)return(0,K.jsx)(I,{variant:`tool`,iconName:`brain`,label:e.text,ariaLabel:`View reasoning`,onClick:()=>s(n)},A(e,t));if(e.kind===`web_search`)return(0,K.jsx)(I,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:`View search details`,onClick:()=>s(n)},A(e,t));if(e.kind===`web_search_error`)return(0,K.jsx)(I,{variant:`tool`,iconName:`globe`,label:e.errorMessage,tone:`error`,ariaLabel:`View search error`,onClick:()=>s(n)},A(e,t))}return e.kind===`web_search`?(0,K.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,K.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,K.jsx)(U,{step:e})]},A(e,t)):e.kind===`web_search_error`?(0,K.jsx)(D,{step:e},A(e,t)):(0,K.jsx)(k,{step:e},A(e,t))})})]})}),oe=`
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D7s2Q_uG.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import{t as i}from"./typography-BscuIPxA.js";import"./src-CK6bncSg.js";import{t as a}from"./arrow-left-CP-EhDNF.js";import{i as o,n as s,r as c,t as l}from"./status-badge-pill-DYlAnX5m.js";import{W as u,p as d,s as f}from"./risk-badge-BA8R-HCI.js";import{t as p}from"./brain-Bs6LnfHO.js";import{t as m}from"./chevron-right-B6vEpVY0.js";import{t as h}from"./globe-DYF_lSGm.js";import{t as g}from"./x-KVxA2ZL0.js";import{t as _}from"./misc-BN2o2MEB.js";import{a as v,i as y,r as b}from"./subagent-store-BLHGkTJR.js";import{n as x,t as S}from"./three-dot-indicator-CLs7Rl-I.js";import{$ as C,$i as w,A as T,Br as E,C as D,D as O,E as k,M as A,N as j,O as M,P as N,Q as P,S as F,T as I,et as ee,ia as te,it as L,j as R,k as z,nt as B,rt as V,tt as H,w as U}from"./index-PRnvH2Y1.js";import{CodeBlock as W,ToolDetailBody as ne}from"./tool-detail-panel-DRD2DIMF.js";var G=e(t(),1),K=r();function q({status:e}){return(0,K.jsx)(l,{color:y(e),label:v(e)})}function J(e,t){let n=e.steps[0];return`${t}-${e.label}-${n?A(n,t):``}`}function Y(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`tool`&&n.status===`running`||n.kind===`web_search`&&n.title===`Searching the web`)return n}}function X(e,t){return e&&e.kind===`tool`&&(e.activity||e.info)||t}function Z(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`web_search`&&n.query)return n.query}}function re(e){for(let t=e.steps.length-1;t>=0;t--){let n=e.steps[t];if(n.kind===`thinking`&&n.text)return n.text}}function Q(e){if(e.kind===`tool`)return e.toolCallId||void 0;if(e.kind===`thinking`||e.kind===`web_search`||e.kind===`web_search_error`)return e.detailKey}function ie({steps:e,onStepDetailClick:t,expandedKeys:n,onExpandedKeysChange:r,isRunning:i=!1}){let[a,o]=(0,G.useState)(new Set),s=n??a,c=(0,G.useCallback)(e=>{let t=t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n};if(r){r(t);return}o(t)},[r]),l=(0,G.useMemo)(()=>T(e),[e]);return l.length===0?null:(0,K.jsx)(`div`,{className:`flex w-full flex-col`,children:l.map((e,n)=>{let r=J(e,n),a=n===l.length-1;return(0,K.jsx)(ae,{section:e,isLast:a,isActiveTail:a&&i,expanded:s.has(r),sectionKeyValue:r,onToggle:c,onStepDetailClick:t},r)})})}var ae=(0,G.memo)(function({section:e,isLast:t,isActiveTail:n,expanded:r,sectionKeyValue:a,onToggle:o,onStepDetailClick:s}){let c=R(e.steps),l=c===`running`&&!n?`completed`:c,u=l===`running`||n,d=e.steps[0]?.kind===`thinking`,f=e.steps.length,m=e.label===`Searching the web`,g=m?Z(e):void 0,v=f>=2,y=e.steps.some(e=>j(e)||!!s&&!!Q(e)),b=l===`running`?``:N(e.steps.map(e=>`durationLabel`in e?e.durationLabel:``)),x=l===`running`?Y(e):void 0,S=l===`running`&&!m?X(x,e.label):``,C=m&&(l===`running`||!!g),w=g??e.label,T=d&&u,E=T?re(e)??e.label:void 0,O=l===`running`||C||T||!!b,P=`${f} step${f===1?``:`s`}`;return(0,K.jsxs)(`div`,{"data-testid":`subagent-phase-section`,"data-phase-label":e.label,className:_(`relative flex flex-col gap-2`,!t&&`pb-4`),children:[!t&&(0,K.jsx)(M,{className:`top-[17.5px] -bottom-[4.5px]`}),(0,K.jsxs)(`button`,{type:`button`,"data-testid":`subagent-phase-header`,disabled:!y,onClick:y?()=>o(a):void 0,className:_(`flex h-[22px] w-full items-center gap-2 text-left`,y&&`cursor-pointer`),children:[(0,K.jsx)(`span`,{"aria-hidden":!0,className:`flex h-[14px] w-[14px] shrink-0 items-center justify-center`,children:(0,K.jsx)(`span`,{className:`h-[5px] w-[5px] rounded-full bg-[var(--content-disabled)]`})}),(0,K.jsx)(z,{status:u?`running`:l,isThinking:d&&!u}),(0,K.jsx)(i,{variant:`body-medium-default`,className:`shrink-0 text-[var(--content-default)]`,children:e.label}),O&&(0,K.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 leading-none text-[var(--content-tertiary)] opacity-10`,children:`|`}),C?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(h,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:w})]}):T?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(p,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:E??e.label})]}):l===`running`?(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1`,children:[(0,K.jsx)(p,{"aria-hidden":`true`,className:`h-3.5 w-3.5 shrink-0 text-[var(--content-tertiary)]`}),(0,K.jsx)(B,{currentStepTitle:``,currentStepInfo:S})]}):b?(0,K.jsx)(i,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:`Worked for ${b}`}):null,y&&v&&(0,K.jsx)(`span`,{"data-testid":`subagent-phase-step-count`,className:`ml-auto inline-flex shrink-0 items-center self-stretch whitespace-nowrap rounded-full bg-[var(--surface-base)] px-2`,children:(0,K.jsx)(i,{variant:`body-small-default`,className:`whitespace-nowrap text-[var(--content-secondary)]`,children:P})})]}),y&&r&&(0,K.jsx)(`div`,{className:`flex flex-col items-start gap-1 pl-[22px]`,children:e.steps.map((e,t)=>{let n=s?Q(e):void 0;if(n&&s){if(e.kind===`tool`)return(0,K.jsx)(I,{variant:`tool`,iconName:e.iconName,label:e.activity||e.info||e.title,riskLevel:e.riskLevel,tone:e.status===`error`||e.status===`denied`?`error`:`default`,ariaLabel:`View tool details`,onClick:()=>s(n)},A(e,t));if(e.kind===`thinking`)return(0,K.jsx)(I,{variant:`tool`,iconName:`brain`,label:e.text,ariaLabel:`View reasoning`,onClick:()=>s(n)},A(e,t));if(e.kind===`web_search`)return(0,K.jsx)(I,{variant:`tool`,iconName:`globe`,label:e.query||e.title,ariaLabel:`View search details`,onClick:()=>s(n)},A(e,t));if(e.kind===`web_search_error`)return(0,K.jsx)(I,{variant:`tool`,iconName:`globe`,label:e.errorMessage,tone:`error`,ariaLabel:`View search error`,onClick:()=>s(n)},A(e,t))}return e.kind===`web_search`?(0,K.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[e.query?(0,K.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-secondary)]`,children:`"${e.query}"`}):null,(0,K.jsx)(U,{step:e})]},A(e,t)):e.kind===`web_search_error`?(0,K.jsx)(D,{step:e},A(e,t)):(0,K.jsx)(k,{step:e},A(e,t))})})]})}),oe=`
2
2
  Content:
3
3
  `;function se(e){return C(e)||e}function ce(e,t){let n=e??``,r=n.indexOf(oe),i=r>=0?n.slice(0,r):``,a=r>=0?n.slice(r+10):n,o=e=>{let t=i.match(RegExp(`^${e}:[ \\t]*(.+)$`,`m`));return t?t[1].trim():null},s=[],c=i.indexOf(`Notices:`);if(c>=0)for(let e of i.slice(c).split(`
4
4
  `)){let t=e.match(/^\s*-\s+(.*)$/);t&&t[1].trim()&&s.push(t[1].trim())}a=a.trim();let l=null,u=a.match(/^<external_content\b([^>]*)>\s*/);if(u){let e=u[1].match(/origin="([^"]+)"/);e&&(l=e[1]),a=a.slice(u[0].length).replace(/\s*<\/external_content>\s*$/,``)}return{url:o(`Final URL`)||o(`Requested URL`)||l||t||null,status:o(`Status`),notices:s,content:a.trim()}}function le({url:e,status:t}){let n=se(e),r=t?/^\s*2\d\d/.test(t):!1;return(0,K.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3 transition-colors hover:border-[var(--border-hover)]`,children:[(0,K.jsx)(F,{domain:n,title:n}),(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,K.jsx)(i,{variant:`body-medium-default`,as:`span`,className:`truncate text-[var(--content-default)]`,children:n}),(0,K.jsx)(i,{variant:`body-small-default`,as:`span`,className:`truncate text-[var(--content-tertiary)]`,children:e})]}),t&&(0,K.jsx)(`span`,{className:`shrink-0 rounded-[6px] px-2 py-0.5 text-body-small-emphasised ${r?`text-[var(--system-positive-strong)]`:`text-[var(--content-tertiary)]`}`,children:t})]})}function ue({detail:e}){let[t,n]=(0,G.useState)(!1),r=typeof e.input?.url==`string`?e.input.url:void 0,a=(0,G.useMemo)(()=>ce(e.result??``,r),[e.result,r]);return e.status===`error`?(0,K.jsx)(W,{text:e.result??`Fetch failed.`}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[a.url&&(0,K.jsx)(le,{url:a.url,status:a.status}),a.notices.length>0&&(0,K.jsx)(`div`,{className:`flex flex-col gap-1 rounded-lg border border-[var(--border-base)] bg-[var(--surface-overlay)] p-3`,children:a.notices.map((e,t)=>(0,K.jsx)(i,{variant:`body-small-default`,as:`p`,className:`text-[var(--content-tertiary)]`,children:e},t))}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:t?`Raw result`:`Content`}),e.result&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`cursor-pointer text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:(0,K.jsx)(i,{variant:`label-small-default`,as:`span`,children:t?`View extracted`:`View raw`})})]}),t?(0,K.jsx)(W,{text:e.result??``}):a.content?(0,K.jsx)(f,{content:a.content}):(0,K.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e.status===`running`?`Fetching…`:`No content extracted.`})]})]})}function de({detail:e}){let t=e.searchQuery??``,n=e.searchResults??[];return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[t?(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:`Query`}),(0,K.jsx)(i,{variant:`body-medium-lighter`,as:`p`,className:`break-words leading-relaxed text-[var(--content-default)]`,children:`"${t}"`})]}):null,(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`text-[var(--content-emphasised)]`,children:n.length>0?`Sources (${n.length})`:`Sources`}),n.length>0?(0,K.jsx)(U,{step:{kind:`web_search`,title:`Searched the web`,durationLabel:``,linkCount:n.length,results:n}}):(0,K.jsx)(i,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:`No sources found.`})]})]})}function $(e){return new Map(e.map(e=>[e.toolCallId,e]))}function fe(e=P){let t=null,n=[],r=[],i=new Map;function a(a){let o=[],s=[];for(let t of a)e(o,s,t);return t=a,n=o,r=s,i=$(n),i}function o(o){let s=H(t,o);switch(s.kind){case`identity`:return i;case`first`:return a(o);case`append`:{let a=o.length,c=n.slice(),l=r.slice();for(let t=s.from;t<a;t++)e(c,l,o[t]);return t=o,n=c,r=l,i=$(n),i}case`mutate-last`:{let a=o.length,s=n.slice(),c=r.slice(),l=s[s.length-1];return l&&l.kind===`thinking`&&l.toolCallId===o[a-1].id&&(s.pop(),c.pop()),e(s,c,o[a-1]),t=o,n=s,r=c,i=$(n),i}case`fallback`:return a(o)}}return{project:o}}function pe(e){let t=(0,G.useRef)(null);return t.current??=fe(),t.current.project(e)}function me(e){return e.kind===`web_search`?`globe`:e.kind===`thinking`?`brain`:d(e.toolName,e.input).iconName}function he({detail:e}){return e.status===`running`?(0,K.jsx)(S,{className:`shrink-0`,"data-testid":`nested-detail-running`}):(0,K.jsx)(O[me(e)]??u,{"aria-hidden":!0,className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`})}function ge({entry:e,onClose:t,onStop:r,onRequestDetail:l}){let u=b(e.status),d=V(),p=(0,G.useMemo)(()=>x(e.subagentId),[e.subagentId]),{steps:h}=ee(e.events),_=pe(e.events),[v,y]=(0,G.useState)(null),S=(0,G.useRef)(_);S.current=_;let C=(0,G.useCallback)(e=>{S.current.has(e)&&y(e)},[]),[T,D]=(0,G.useState)(new Set),[O,k]=(0,G.useState)(!1),[A,j]=(0,G.useState)(!1),M=(0,G.useRef)(null),[N,P]=(0,G.useState)(e.subagentId);N!==e.subagentId&&(P(e.subagentId),k(!1),j(!1),y(null),D(new Set)),(0,G.useLayoutEffect)(()=>{if(O)return;let e=M.current;e&&j(e.scrollHeight>e.clientHeight)},[e.subagentId,e.objective,O]),(0,G.useEffect)(()=>{l&&e.conversationId&&e.events.length===0&&l(e.subagentId)},[e.subagentId,e.conversationId,e.events.length,l]);let F=v?_.get(v):void 0,I=(0,G.useCallback)(()=>y(null),[]),R=F?F.activity||F.title:``,z=F?R:e.label;return(0,K.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden rounded-xl bg-[var(--surface-lift)]`,children:[F&&(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-hover)] px-5 py-3`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:I,title:e.label,className:`min-w-0 shrink cursor-pointer truncate text-left text-[var(--content-default)] hover:underline`,children:(0,K.jsx)(i,{variant:`body-small-default`,as:`span`,children:e.label})}),(0,K.jsx)(m,{className:`h-2.5 w-2.5 shrink-0 text-[var(--content-tertiary)]`,"aria-hidden":!0}),(0,K.jsx)(i,{variant:`body-small-default`,as:`span`,title:R,className:`min-w-0 shrink truncate text-[var(--content-secondary)]`,children:R})]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 items-center gap-3 border-b border-[var(--border-hover)] px-5 py-4`,children:[F&&(0,K.jsx)(n,{variant:`outlined`,iconOnly:(0,K.jsx)(a,{}),onClick:I,"aria-label":`Back to timeline`,tooltip:`Back`,className:`shrink-0 rounded-lg`}),F?(0,K.jsx)(he,{detail:F}):d?(0,K.jsx)(L,{components:d,bodyShapeId:p.bodyShape,eyeStyleId:p.eyeStyle,colorId:p.color,size:32}):(0,K.jsx)(`div`,{style:{width:32,height:32,flexShrink:0},"aria-hidden":!0}),(0,K.jsx)(i,{variant:`title-medium`,title:z,className:`min-w-0 shrink truncate leading-snug text-[var(--content-default)]`,children:z}),(0,K.jsx)(q,{status:e.status}),(0,K.jsx)(`span`,{className:`flex-1`}),u&&r&&(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Stop subagent`,onClick:()=>r(e.subagentId),className:`flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-lg border border-[var(--system-negative-strong)] bg-transparent px-2.5 py-1.5 text-[var(--system-negative-strong)] transition-colors hover:bg-[var(--system-negative-weak)]`,children:[(0,K.jsx)(E,{className:`h-3 w-3`,fill:`currentColor`}),(0,K.jsx)(i,{variant:`label-small-default`,children:`Stop`})]}),(0,K.jsx)(n,{variant:`outlined`,iconOnly:(0,K.jsx)(g,{}),onClick:t,"aria-label":`Close subagent detail`,tooltip:`Close`,className:`shrink-0 rounded-lg`})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 py-5`,children:F?(0,K.jsx)(K.Fragment,{children:F.kind===`thinking`?(0,K.jsx)(f,{content:F.thinkingText??``,hardLineBreaks:!0}):F.kind===`web_search`&&F.status!==`error`?(0,K.jsx)(de,{detail:F}):F.toolName===`web_fetch`?(0,K.jsx)(ue,{detail:F}):(0,K.jsx)(ne,{detail:F,showTechnicalDetailsLabel:!1})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mb-5 grid grid-cols-2 gap-3`,children:[(0,K.jsx)(s,{icon:(0,K.jsx)(te,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.inputTokens,format:e=>c(Math.round(e)),label:`Input`}),(0,K.jsx)(s,{icon:(0,K.jsx)(o,{className:`h-4 w-4 shrink-0`,style:{color:`var(--content-secondary)`}}),target:e.outputTokens,format:e=>c(Math.round(e)),label:`Output`})]}),e.objective&&(0,K.jsxs)(`div`,{className:`mb-5`,children:[(0,K.jsx)(i,{variant:`body-medium-default`,as:`h3`,className:`mb-2 text-[var(--content-emphasised)]`,children:`Objective`}),(0,K.jsx)(i,{ref:M,variant:`body-medium-lighter`,as:`p`,className:`whitespace-pre-wrap break-words leading-relaxed text-[var(--content-default)] ${O?``:`line-clamp-5`}`,children:e.objective}),A&&(0,K.jsxs)(`button`,{type:`button`,onClick:()=>k(e=>!e),className:`mt-1.5 flex cursor-pointer items-center gap-1 text-[var(--content-secondary)] transition-colors hover:text-[var(--content-default)]`,children:[(0,K.jsx)(i,{variant:`label-small-default`,children:O?`Show less`:`Show more`}),(0,K.jsx)(w,{className:`h-3.5 w-3.5 transition-transform ${O?`rotate-180`:``}`,"aria-hidden":!0})]}),(0,K.jsx)(`div`,{className:`mt-5 h-px w-full bg-[var(--border-hover)]`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(i,{variant:`title-medium`,as:`h3`,className:`mb-4 text-[var(--content-emphasised)]`,children:`Timeline`}),e.events.length>0?(0,K.jsx)(ie,{steps:h,expandedKeys:T,onExpandedKeysChange:D,onStepDetailClick:C,isRunning:u},e.subagentId):(0,K.jsx)(i,{variant:`body-small-default`,className:`py-4 text-center text-[var(--content-tertiary)]`,children:`No events yet`})]})]})})]})}export{ge as SubagentDetailPanel};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-CK6bncSg.js";import{t as i}from"./notice-CqRgVmeL.js";import{t as a}from"./tag-B_-QAvJF.js";import{t as o}from"./loader-circle-IIzBGiwm.js";import{t as s}from"./triangle-alert-DKOyShqD.js";import{a as c}from"./routes-DVqkwUEe.js";import{N as l}from"./react-query.gen-rp6Krcco.js";import{$i as u,Gi as d,Zi as f,aa as p,an as m,qi as h,rn as g,x as _}from"./index-BIDC22lX.js";import{t as v}from"./use-active-assistant-id-C-RHQ9f6.js";var y=e(t(),1),b=r();function x(e){switch(e){case`lifecycle`:return`Lifecycle`;case`upgrade`:return`Upgrade`;case`rollback`:return`Rollback`;case`crash`:return`Crash`;case`idle_sleep`:return`Idle Sleep`;case`wake`:return`Wake`;case`profiler`:return`Profiler`;case`other`:return`Other`;default:return e}}function S(e){switch(e){case`started`:return`Started`;case`succeeded`:return`Succeeded`;case`failed`:return`Failed`;case`in_progress`:return`In Progress`;default:return e}}function C(e){return e===`succeeded`}function w(e){return e===`failed`}function T(e){return new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){if(e.type!==`idle_sleep`)return!1;let t=e.details?.idle_timeout_seconds;return typeof t==`number`&&t>=21600}function D(e,t){switch(e){case`wake`:return`positive`;case`rollback`:return`warning`;case`crash`:return`negative`;case`idle_sleep`:return t&&E(t)?`warning`:`neutral`;default:return`neutral`}}function O({type:e,event:t}){return(0,b.jsx)(a,{tone:D(e,t),children:x(e)})}function k({status:e}){let t=S(e);return C(e)?(0,b.jsx)(a,{tone:`positive`,leftIcon:(0,b.jsx)(f,{}),children:t}):w(e)?(0,b.jsx)(a,{tone:`negative`,leftIcon:(0,b.jsx)(h,{}),children:t}):(0,b.jsx)(a,{tone:`neutral`,children:t})}function A({event:e}){let[t,n]=(0,y.useState)(!1),r=e.details!==null&&e.details!==void 0&&Object.keys(e.details).length>0;return(0,b.jsxs)(`div`,{className:`rounded-xl border p-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,b.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.display_text}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,b.jsx)(O,{type:e.type,event:e}),(0,b.jsx)(k,{status:e.event_status}),E(e)&&(0,b.jsx)(a,{tone:`warning`,leftIcon:(0,b.jsx)(s,{className:`h-3 w-3`}),children:`Long sleep`})]})]}),(0,b.jsxs)(`div`,{className:`text-body-small-default flex shrink-0 items-center gap-1.5`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(d,{className:`h-3 w-3`}),(0,b.jsx)(`span`,{children:T(e.occurred_at)})]})]}),r&&(0,b.jsxs)(`div`,{className:`mt-2`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`text-body-small-default flex items-center gap-1`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(u,{className:`h-3 w-3 transition-transform ${t?`rotate-180`:``}`}),t?`Hide details`:`Show details`]}),t&&(0,b.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-md p-3 text-body-small-default`,style:{background:`var(--surface-base)`,color:`var(--content-default)`},children:JSON.stringify(e.details,null,2)})]})]})}function j({assistantId:e}){let{data:t,isLoading:n,isError:r,isFetchingNextPage:i,hasNextPage:a,fetchNextPage:c}=p({...l({path:{assistant_id:e}}),initialPageParam:0,getNextPageParam:(e,t)=>{if(e.next)return t.reduce((e,t)=>e+t.results.length,0)}}),u=t?.pages.flatMap(e=>e.results)??[];return(0,b.jsxs)(`div`,{className:`space-y-4`,children:[(0,b.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Lifecycle events for your assistant from the last 30 days, newest first.`}),n?(0,b.jsxs)(`div`,{className:`text-body-medium-lighter flex items-center gap-2`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading system events...`]}):r?(0,b.jsxs)(`div`,{className:`text-body-medium-lighter flex items-center gap-2`,style:{color:`var(--system-negative-strong)`},children:[(0,b.jsx)(s,{className:`h-4 w-4 shrink-0`}),`Failed to load system events. Please refresh and try again.`]}):u.length===0?(0,b.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No system events recorded in the last 30 days.`}):(0,b.jsxs)(`div`,{className:`space-y-2`,children:[u.map(e=>(0,b.jsx)(A,{event:e},e.id)),a&&(0,b.jsx)(`div`,{className:`pt-2 text-center`,children:(0,b.jsx)(`button`,{type:`button`,onClick:()=>c(),disabled:i,className:`text-body-medium-default flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,style:{borderColor:`var(--border-element)`,color:`var(--content-secondary)`},children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading older events...`]}):`Load older events`})})]})]})}function M(){let e=m({platformHostedOnly:!0}),t=g(),r=v();return e===`gated`?(0,b.jsx)(n,{replace:!0,to:c.logs.root}):e===`disabled`?(0,b.jsx)(_,{children:`Log in to the Vellum platform to view system events.`}):t?(0,b.jsx)(j,{assistantId:r}):(0,b.jsx)(i,{tone:`warning`,children:`System events aren't available for the current assistant.`})}export{M as SystemEventsPage};
1
+ import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{r as n}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{t as r}from"./jsx-runtime-CVSDxk6A.js";import"./src-CK6bncSg.js";import{t as i}from"./notice-CqRgVmeL.js";import{t as a}from"./tag-B_-QAvJF.js";import{t as o}from"./loader-circle-IIzBGiwm.js";import{t as s}from"./triangle-alert-DKOyShqD.js";import{a as c}from"./routes-DVqkwUEe.js";import{N as l}from"./react-query.gen-rp6Krcco.js";import{$i as u,Gi as d,Zi as f,aa as p,an as m,qi as h,rn as g,x as _}from"./index-PRnvH2Y1.js";import{t as v}from"./use-active-assistant-id-C-RHQ9f6.js";var y=e(t(),1),b=r();function x(e){switch(e){case`lifecycle`:return`Lifecycle`;case`upgrade`:return`Upgrade`;case`rollback`:return`Rollback`;case`crash`:return`Crash`;case`idle_sleep`:return`Idle Sleep`;case`wake`:return`Wake`;case`profiler`:return`Profiler`;case`other`:return`Other`;default:return e}}function S(e){switch(e){case`started`:return`Started`;case`succeeded`:return`Succeeded`;case`failed`:return`Failed`;case`in_progress`:return`In Progress`;default:return e}}function C(e){return e===`succeeded`}function w(e){return e===`failed`}function T(e){return new Date(e).toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function E(e){if(e.type!==`idle_sleep`)return!1;let t=e.details?.idle_timeout_seconds;return typeof t==`number`&&t>=21600}function D(e,t){switch(e){case`wake`:return`positive`;case`rollback`:return`warning`;case`crash`:return`negative`;case`idle_sleep`:return t&&E(t)?`warning`:`neutral`;default:return`neutral`}}function O({type:e,event:t}){return(0,b.jsx)(a,{tone:D(e,t),children:x(e)})}function k({status:e}){let t=S(e);return C(e)?(0,b.jsx)(a,{tone:`positive`,leftIcon:(0,b.jsx)(f,{}),children:t}):w(e)?(0,b.jsx)(a,{tone:`negative`,leftIcon:(0,b.jsx)(h,{}),children:t}):(0,b.jsx)(a,{tone:`neutral`,children:t})}function A({event:e}){let[t,n]=(0,y.useState)(!1),r=e.details!==null&&e.details!==void 0&&Object.keys(e.details).length>0;return(0,b.jsxs)(`div`,{className:`rounded-xl border p-4`,style:{background:`var(--surface-lift)`,borderColor:`var(--border-base)`},children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1.5`,children:[(0,b.jsx)(`p`,{className:`text-body-medium-default`,style:{color:`var(--content-default)`},children:e.display_text}),(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,b.jsx)(O,{type:e.type,event:e}),(0,b.jsx)(k,{status:e.event_status}),E(e)&&(0,b.jsx)(a,{tone:`warning`,leftIcon:(0,b.jsx)(s,{className:`h-3 w-3`}),children:`Long sleep`})]})]}),(0,b.jsxs)(`div`,{className:`text-body-small-default flex shrink-0 items-center gap-1.5`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(d,{className:`h-3 w-3`}),(0,b.jsx)(`span`,{children:T(e.occurred_at)})]})]}),r&&(0,b.jsxs)(`div`,{className:`mt-2`,children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`text-body-small-default flex items-center gap-1`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(u,{className:`h-3 w-3 transition-transform ${t?`rotate-180`:``}`}),t?`Hide details`:`Show details`]}),t&&(0,b.jsx)(`pre`,{className:`mt-2 overflow-x-auto rounded-md p-3 text-body-small-default`,style:{background:`var(--surface-base)`,color:`var(--content-default)`},children:JSON.stringify(e.details,null,2)})]})]})}function j({assistantId:e}){let{data:t,isLoading:n,isError:r,isFetchingNextPage:i,hasNextPage:a,fetchNextPage:c}=p({...l({path:{assistant_id:e}}),initialPageParam:0,getNextPageParam:(e,t)=>{if(e.next)return t.reduce((e,t)=>e+t.results.length,0)}}),u=t?.pages.flatMap(e=>e.results)??[];return(0,b.jsxs)(`div`,{className:`space-y-4`,children:[(0,b.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`Lifecycle events for your assistant from the last 30 days, newest first.`}),n?(0,b.jsxs)(`div`,{className:`text-body-medium-lighter flex items-center gap-2`,style:{color:`var(--content-tertiary)`},children:[(0,b.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading system events...`]}):r?(0,b.jsxs)(`div`,{className:`text-body-medium-lighter flex items-center gap-2`,style:{color:`var(--system-negative-strong)`},children:[(0,b.jsx)(s,{className:`h-4 w-4 shrink-0`}),`Failed to load system events. Please refresh and try again.`]}):u.length===0?(0,b.jsx)(`p`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:`No system events recorded in the last 30 days.`}):(0,b.jsxs)(`div`,{className:`space-y-2`,children:[u.map(e=>(0,b.jsx)(A,{event:e},e.id)),a&&(0,b.jsx)(`div`,{className:`pt-2 text-center`,children:(0,b.jsx)(`button`,{type:`button`,onClick:()=>c(),disabled:i,className:`text-body-medium-default flex w-full items-center justify-center gap-2 rounded-md border px-4 py-2 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,style:{borderColor:`var(--border-element)`,color:`var(--content-secondary)`},children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{className:`h-4 w-4 animate-spin`}),`Loading older events...`]}):`Load older events`})})]})]})}function M(){let e=m({platformHostedOnly:!0}),t=g(),r=v();return e===`gated`?(0,b.jsx)(n,{replace:!0,to:c.logs.root}):e===`disabled`?(0,b.jsx)(_,{children:`Log in to the Vellum platform to view system events.`}):t?(0,b.jsx)(j,{assistantId:r}):(0,b.jsx)(i,{tone:`warning`,children:`System events aren't available for the current assistant.`})}export{M as SystemEventsPage};