@openhands/agent-canvas 1.0.0-rc.3 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/README.windows.md +2 -2
- package/build/assets/{analytics-consent-form-modal-Ce-_Skcd.js → analytics-consent-form-modal-D4ndXdkQ.js} +1 -1
- package/build/assets/{automations-list-Ces5shz5.js → automations-list-CoYj4o97.js} +1 -1
- package/build/assets/{home-sJAFzI6v.js → home-D77Xasws.js} +1 -1
- package/build/assets/install-server-modal-BjmEphcZ.js +1 -0
- package/build/assets/{manifest-d3e8504d.js → manifest-08c25e0c.js} +1 -1
- package/build/assets/{mcp-kJYdM8aJ.js → mcp-CiokQDek.js} +2 -2
- package/build/assets/{onboarding-CZ_7nd-M.js → onboarding-CGUaLHfQ.js} +1 -1
- package/build/assets/{recommended-automations-launcher-B1kfmFTQ.js → recommended-automations-launcher-C1_CKGHa.js} +1 -1
- package/build/assets/{root-CIZ7Rv1X.js → root-DVv3y8Fb.js} +1 -1
- package/build/assets/{root-layout-B5ijp9At.js → root-layout-lUjioorg.js} +2 -2
- package/build/assets/telemetry--BA6QguL.js +2 -0
- package/build/index.html +3 -3
- package/config/defaults.json +2 -6
- package/dist/api/mcp-service/mcp-service.api.cjs +1 -1
- package/dist/api/mcp-service/mcp-service.api.cjs.map +1 -1
- package/dist/api/mcp-service/mcp-service.api.js +19 -14
- package/dist/api/mcp-service/mcp-service.api.js.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.cjs.map +1 -1
- package/dist/components/features/mcp-page/custom-server-editor.js +63 -62
- package/dist/components/features/mcp-page/custom-server-editor.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +3 -1
- package/dist/package.js.map +1 -1
- package/package.json +3 -1
- package/scripts/check-sdk-version-sync.mjs +6 -6
- package/scripts/dev-safe.mjs +32 -8
- package/scripts/dev-with-automation.mjs +25 -1
- package/scripts/logger.mjs +77 -0
- package/build/assets/install-server-modal-BjEzlLF5.js +0 -1
- package/build/assets/telemetry-j9SLrtY7.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-CCaPYVqW.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-z_QOzaRV.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-DveauQfg.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Dr8Ly0at.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js","assets/declaration-IA661TBv.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-CbuXadI-.js","assets/react-dom-hVBnwgwZ.js","assets/llm-client-BnqeDPua.js","assets/settings-client-BUlG0Gzq.js","assets/useQuery-JDs8UaWj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js","assets/suspense-C9MBE_9N.js","assets/QueryClientProvider-7oLZ1RtQ.js","assets/useTranslation-CbJtty1g.js","assets/context-BBqptpXX.js","assets/agent-server-client-options-Dvgeb3x4.js","assets/proxy-wIasY2Po.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js","assets/brand-button-BoiPxAGm.js","assets/utils-CVcuFUYj.js","assets/common-Cfviy7yT.js","assets/combobox-caret-DwMmhrrA.js","assets/sdk-settings-schema-B0KrqqPX.js","assets/dist-B-SKiGDl.js","assets/sdk-settings-field-metadata-CETNItbo.js","assets/map-provider-XSFHmdDs.js","assets/settings-input-DsoZj8Dm.js","assets/base-modal-Ba5WcNb6.js","assets/modal-body-2Po2nl1e.js","assets/modal-classes-9XTtWCtF.js","assets/modal-backdrop-B1si6TUd.js","assets/navigation-context-CszaA-CJ.js","assets/use-save-settings-CP23emUY.js","assets/useMutation-7hG0GuPx.js","assets/mutation-CaJwPR9O.js","assets/settings-service.api-4u2RKC8k.js","assets/settings-BgL2HUsU.js","assets/query-keys-CQaji0wJ.js","assets/use-settings-0qFqC-r6.js","assets/active-backend-context-CQTk4wD8.js","assets/health-store-d-d2ssv4.js","assets/use-tracking-CjLZgh8X.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js","assets/settings-utils-chxTa1vn.js","assets/add-backend-modal-BdYxoUdL.js","assets/backend-form-modal-BUy-PzZN.js","assets/server-client-Cz8PyIbN.js","assets/organization-service.api-D79cdERN.js","assets/agent-server-compatibility-BANjmMTo.js","assets/modal-close-button-DY-rVmld.js","assets/manage-backends-modal-CTA-2x4F.js","assets/pencil-COslZGUC.js","assets/createLucideIcon-C9OEnwvX.js","assets/plus-D8aJZRkD.js","assets/trash-2-DAKXV2Wm.js","assets/confirmation-modal-BPgWqWRI.js","assets/environment-switch-overlay-Cow6h62p.js","assets/environment-switch-store-BpKxp6Xq.js","assets/analytics-consent-form-modal-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{d as h,f as g,t as _}from"./path-utils-0KWEiRs9.js";import{o as v,t as y}from"./declaration-IA661TBv.js";import{t as b}from"./useQuery-JDs8UaWj.js";import{r as x}from"./recommended-automations-launcher-B1kfmFTQ.js";import{t as S}from"./useTranslation-CbJtty1g.js";import{a as C}from"./i18n-CyvU1o95.js";import{t as w}from"./createLucideIcon-C9OEnwvX.js";import{t as T}from"./vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js";import{a as E,i as D,o as O}from"./vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js";import{t as k}from"./check-BDAbW7je.js";import{a as A,c as j,d as M,f as N,i as P,l as F,o as I,r as L,s as ee,t as R,u as z}from"./sidebar-mobile-menu-toggle-BDXWzhyB.js";import{a as te,c as ne,d as re,f as ie,i as ae,l as oe,n as se,o as ce,r as le,s as ue,t as de,u as fe}from"./onboarding-CZ_7nd-M.js";import{n as pe,r as me}from"./custom-toast-handlers-fgD4IYsu.js";import{t as he}from"./plus-D8aJZRkD.js";import{t as ge}from"./trash-2-DAKXV2Wm.js";import{t as _e}from"./x-8AbJWTbX.js";import{t as B,v as ve,x as ye,y as be}from"./utils-CVcuFUYj.js";import{t as V}from"./common-Cfviy7yT.js";import{p as xe}from"./agent-server-client-options-Dvgeb3x4.js";import{n as Se,r as H}from"./active-backend-context-CQTk4wD8.js";import{n as Ce}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js";import{t as U}from"./agent-server-conversation-service.api-js3oYcdU.js";import{t as we}from"./modal-backdrop-B1si6TUd.js";import{n as Te}from"./modal-body-2Po2nl1e.js";import{i as Ee,r as W}from"./base-modal-Ba5WcNb6.js";import{g as De,s as Oe}from"./brand-button-BoiPxAGm.js";import{t as ke}from"./loading-spinner-CFuA0UNt.js";import{t as Ae}from"./use-config-DSzkljTq.js";import{t as je}from"./openhands-logo-B-IDE1ER.js";import{n as Me,t as Ne}from"./navigation-context-CszaA-CJ.js";import{t as G}from"./navigation-link-DXg4oo29.js";import{a as Pe,d as Fe,f as Ie,i as Le,m as Re,n as ze,o as Be,p as Ve,s as He,t as Ue}from"./use-cloud-current-user-id-e1Pk7NxQ.js";import{n as We,t as Ge}from"./sidebar-nav-link-Bhlzlhp8.js";import{t as Ke}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js";import{t as qe}from"./styled-tooltip-GXy1qxsO.js";import{a as Je,d as Ye,f as Xe,i as K,l as Ze,n as Qe,o as $e,r as et,u as tt}from"./dropdown-classes-lT1LUsbO.js";import{r as nt,t as rt}from"./combobox-caret-DwMmhrrA.js";import{_ as it,a as at,c as ot,d as st,f as ct,g as lt,h as ut,i as dt,l as ft,m as pt,n as mt,o as ht,p as gt,r as _t,u as vt,v as yt}from"./chat-send-button-qKFZuB9E.js";import{o as bt,r as xt}from"./backend-form-modal-BUy-PzZN.js";import{s as St}from"./environment-switch-store-BpKxp6Xq.js";import{t as Ct}from"./react-CuAHzoGi.js";import{i as wt,n as Tt,t as Et}from"./conversation-store-CiYGBud3.js";import{t as Dt}from"./add-backend-modal-BdYxoUdL.js";import{t as Ot}from"./manage-backends-modal-CTA-2x4F.js";import{c as kt,l as At,o as jt}from"./acp-providers-C55k29rf.js";import{t as Mt}from"./use-is-authed-fNsj-Adj.js";import{t as Nt}from"./use-click-outside-element-Bu2A3s59.js";import{r as Pt,t as Ft}from"./use-settings-0qFqC-r6.js";import{t as It}from"./use-tracking-CjLZgh8X.js";import{t as Lt}from"./use-create-conversation-CzvaVA5A.js";import{t as Rt}from"./vscode-url-helper-DOCkV_-G.js";import{t as zt}from"./conversation-service.api-y_eB_43m.js";import{r as Bt,t as Vt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js";import{n as Ht,t as q}from"./context-menu-list-item-CHWCx1Mc.js";import{i as J,r as Ut,t as Wt}from"./ellipsis-button-CiLx8dqc.js";import{t as Gt}from"./u-edit-foF02hwH.js";import{t as Kt}from"./skills-BDOWVle-.js";import{o as qt,s as Jt,t as Yt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js";import{t as Xt}from"./search-BqXT2Ied.js";import{t as Zt}from"./handle-capture-consent-DDnXMC9Y.js";import{t as Qt}from"./use-save-settings-CP23emUY.js";import{t as $t}from"./use-user-conversation-CQ5IwnZk.js";import{t as en}from"./conversation-state-store-DpgQaK_O.js";var tn=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),nn=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),rn=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),an=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),on=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),sn=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),cn=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),ln=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),un=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),dn=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fn=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=v(),pn=46,mn=30;function hn({className:e,logoClassName:t,logoWidth:n=pn,logoHeight:r=mn}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(G,{to:`/conversations`,"aria-label":i(y.BRANDING$OPENHANDS_LOGO),className:B(e),children:(0,X.jsx)(je,{width:n,height:r,className:B(`shrink-0`,t)})})}function gn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-white/20 border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function _n({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(_e,{size:14})})}function vn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:B(nt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(rt,{})})}function yn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:B(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:B(`p-0`,K)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:B($e,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:tt,children:e.prefix}):null,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yt,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function bn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:B(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,Oe,`px-0 not-italic text-inherit`)})})}var xn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Sn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:E,openMenu:D,closeMenu:O,getToggleButtonProps:k,getMenuProps:A,getItemProps:j,getInputProps:M}=T({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===T.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),N=r||i,P=w?e.find(e=>e.value===w.value)??w:null,F=e=>M({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:B(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),D()}:void 0,onMouseLeave:m?()=>{_.current=setTimeout(()=>O(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...F({"aria-label":a??`Filter options`,tabIndex:-1}),style:xn}),(0,X.jsx)(`button`,{type:`button`,...k({tabIndex:-1}),style:xn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:B(Xe,g?`w-auto`:`w-full`,N&&`cursor-not-allowed opacity-60`,l),children:[P?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:P.prefix}):null,(0,X.jsx)(bn,{placeholder:a,isDisabled:N,getInputProps:F,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(gn,{}),n&&w&&(0,X.jsx)(_n,{onClear:()=>E(null)}),(0,X.jsx)(vn,{isOpen:C,isDisabled:N,getToggleButtonProps:k})]}),(0,X.jsx)(yn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:A,getItemProps:j,footer:u,openUpward:d,fitContent:g})]})}var Cn=`::`;function wn(e,t){return t?`${e}${Cn}${t}`:e}function Tn(e){let[t,n]=e.split(Cn);return{backendId:t,orgId:n??null}}function En(e){return(0,X.jsx)(xt,{isConnected:e?.isConnected??null})}function Dn(){return(0,X.jsx)(xt,{isConnected:`unavailable`})}function On(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:wn(e.id,null),label:e.name,prefix:En(i[e.id])});for(let e of s){let o=n[e.id],s=En(i[e.id]);if(!o||o.orgs.length===0)a.push({value:wn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:wn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function kn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=H(),p=ze(),m=Ue(),h=bt(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),b=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(y.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>On(u,D,p,m,h),[u,D,p,m,h]),k=xe(d.backend),A=l(y.BACKEND$NO_BACKEND_AVAILABLE),j=wn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(y.SIDEBAR$SETTINGS),F=Et(e=>e.isRightPanelShown),I=!c||b&&F?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let ee=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),R=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),z=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=(0,X.jsxs)(`div`,{className:K,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:z,onClick:ee,className:B(Qe,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(he,{width:16,height:16})}),l(y.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:z,onClick:R,className:B(Qe,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(dn,{width:16,height:16})}),l(y.BACKEND$MANAGE)]})]}),ne=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=Tn(e),r=u.find(e=>e.id===t);r&&(St(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,b,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(Sn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?Dn():En(h[d.backend.id])},footer:te,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ne(e.value)},placeholder:k?A:d.backend.name,loading:L,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(qe,{content:P,placement:I,offset:10,children:(0,X.jsx)(G,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:B(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,De),children:(0,X.jsx)(dn,{width:16,height:16})})})]}),C?(0,X.jsx)(Dt,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(Ot,{onClose:()=>E(!1)}):null]})}var An=(e=20)=>{let{data:t}=Mt(),n=Se(),r=!xe(n.backend);return g({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await U.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},jn=(e=10)=>b({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Mn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(we,{onClose:n,children:(0,X.jsxs)(Te,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(W,{title:r(y.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Ee,{text:r(y.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Ee,{text:r(y.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var Nn=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Pn=e=>{let t=typeof e==`string`?Nn(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Fn({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:B(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var In=e=>{switch(e){case V.FINISHED:return`check`;case V.RUNNING:return`working`;case V.IDLE:case V.WAITING_FOR_CONFIRMATION:return`active`;case V.PAUSED:return`paused`;case V.ERROR:case V.STUCK:return`error`;default:return`unknown`}},Ln=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function Rn(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function zn({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:In(e),o=r(Ln(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(Vt,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):Rn(a)});return n?(0,X.jsx)(qe,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Bn({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Fn,{title:e,titleMode:t,onSave:n,isConversationArchived:i===`MISSING`||i===`ERROR`})]})}var Vn=e(m(),1);function Hn({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=Se(),m=Nt(e,d),h=p.kind===`cloud`?y.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:y.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(yt,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(Ht,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Gt,{width:16,height:16}),text:f(y.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ut,{width:16,height:16}),text:f(y.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Kt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(y.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(pt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(j,{width:16,height:16}),text:f(y.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(j,{width:16,height:16}),text:f(y.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ee,{width:16,height:16}),text:f(y.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Ut,{width:16,height:16}),text:f(y.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Un({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ye(s),d=be(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Wt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:B(u&&`opacity-60`)}),e&&m&&h?(0,Vn.createPortal)((0,X.jsx)(Hn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var Wn={bitbucket:Yt,bitbucket_data_center:Yt,github:qt,gitlab:Jt};function Gn({selectedRepository:e}){let t=e.git_provider?Wn[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(gt,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(Bt,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function Kn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?_(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(ct,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(y.COMMON$NO_REPOSITORY)})]})}function qn({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=ye(r),p=null;if(c)if(l===`acp`){let e=jt(u)??d(y.CONVERSATION$ACP_AGENT_GENERIC),t=kt(u,s),n=t??e;p={kind:At(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:B(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(ie,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:B(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Gn,{selectedRepository:e}):(0,X.jsx)(Kn,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${Pn(t??n)} ${d(y.CONVERSATION$AGO)}`})})})]})]})}function Jn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(st,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(y.COMMON$ERROR)})]})}function Yn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let{trackDownloadVsCodeButtonClicked:x}=It(),[S,C]=Y.useState(`view`),{mutateAsync:w}=vt(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x(),l)try{let e=await zt.getVSCodeUrl(l);if(e.vscode_url){let t=Rt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:B(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Bn,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Jn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:B(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Pn(s??c)})}),j&&(0,X.jsx)(`div`,{className:B(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Un,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(qn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function Xn({taskStatus:e}){return(0,X.jsx)(`div`,{className:B(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function Zn({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:B(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:t(ve(e))})}function Qn({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)(Xn,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Zn,{taskStatus:t})]})}function $n({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:B(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(Gn,{selectedRepository:e}):(0,X.jsx)(Kn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Pn(t)} ${r(y.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function er({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(y.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:B(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(Qn,{title:r,taskStatus:e.status})}),(0,X.jsx)($n,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function tr({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function nr({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Ke,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(qn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(G,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>B(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var rr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=Ct()(wt(e=>({...rr,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:Tt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),ir=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,ar=`px-2 pb-1 pt-1`,or=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function sr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:B(ar,or),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:B(`flex items-baseline justify-between gap-2`,ar),children:[(0,X.jsx)(`span`,{className:B(`min-w-0 truncate text-left`,or),children:e}),t]})}function cr(){return(0,X.jsx)(yt,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:B(`group`,$e,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:B(`h-3.5 w-3.5`,Ze),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(k,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function lr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),b=v(r===`local`?y.CONVERSATION_PANEL$BY_WORKSPACE:y.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:B(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,et),children:(0,X.jsx)(cn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:B(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,K,Ye),children:[(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:E,label:b,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:nn,label:v(y.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:tn,label:v(y.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:rn,label:v(y.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:ln,label:v(y.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:fn,label:v(y.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:O,label:v(y.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:D,label:v(y.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(y.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(y.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?an:on,label:ir(v(u?y.CONVERSATION$HIDE:y.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ge,label:ir(v(y.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var ur=B(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Je);function dr(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function fr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Me(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=dr(u,{open:s,enabled:i}),{data:f,error:p}=ue(),m=f?.workspaceParents??[],{mutate:h}=oe(),{mutate:g}=fe(),{mutate:_}=ne(),{mutate:v}=re(),{workspaces:b}=ce(),C=te(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=Lt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=$e,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),F=Y.useCallback(()=>{c(e=>!e)},[]),I=s&&(!i||d!==null),L=!!C,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:L,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!L&&T(!0)},className:N,children:a(y.HOME$ADD_WORKSPACES)}),z=C?(0,X.jsx)(qe,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:F,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),I&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(ur,!i&&B(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,K),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(y.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(ft,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:B(`flex flex-col`,K),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(yt,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),z,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(y.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(ae,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(le,{isOpen:E,workspaces:b,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function pr({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(ft,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function mr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Me(),{providers:s}=ot(),{lastSelectedProvider:c,setLastSelectedProvider:l}=_t(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=dr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),b=dt(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=ht({provider:h}),{data:k,isLoading:A}=at(b,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=b?k??[]:j,{mutate:N,isPending:P}=Lt(),F=x(),I=P||F;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let L=e=>{I||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),v(``)},R=$e;Y.useEffect(()=>{u&&(b||!E||D||w||M.length===0||M.length>=10||O())},[u,b,E,D,w,M.length,O]);let z=b?A:w,te=!b&&E&&M.length>0,ne=Y.useCallback(()=>{d(e=>!e)},[]),re=u&&(!i||m!==null),ie=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ne,"aria-expanded":u,"aria-haspopup":`menu`,disabled:I})}),re&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(ur,!i&&B(`absolute top-full mt-0`,n)),style:ie,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ee(e),className:B(`flex items-center gap-1 rounded border px-2 py-1 text-xs`,`transition-none`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(mt,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(Xt,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(y.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:B(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(yt,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,K),children:[z&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(y.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(y.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!z&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(y.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(pr,{repo:e,disabled:I,onSelect:L,itemClass:R},`${e.git_provider}:${e.id}`)),te&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?y.HOME$LOADING_MORE_REPOSITORIES:y.CONVERSATION$LOAD_MORE)})})})]})]})]})}var hr=B(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function gr({backendKind:e}){let{t}=S(`openhands`),n=t(y.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(sn,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(fr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:hr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(mr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:hr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function _r(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function vr(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function yr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function br(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>yr(t[n])-yr(e[n]))}function xr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function Sr(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function Cr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?xr(n):Sr(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=br(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:vr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,yr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var wr=()=>{},Tr=3600*1e3,Er=e=>{let t=Date.now()-Tr,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function Dr({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Me(),{backend:a}=Se(),o=Nt(e??wr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),C=Z(e=>e.toggleShowLlmProfiles),w=Z(e=>e.organizeMode),T=Z(e=>e.setOrganizeMode),D=Z(e=>e.conversationSort),O=Z(e=>e.setConversationSort),k=Z(e=>e.threadScope),A=Z(e=>e.setThreadScope),[j,N]=Y.useState(!1),[P,I]=Y.useState(!1),L=Nt(()=>{N(!1)}),[ee,R]=Y.useState(()=>new Set),[te,ne]=Y.useState(()=>new Set),re=Y.useCallback(e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ie=Y.useCallback(e=>{ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{w!==`grouped`&&(R(new Set),ne(new Set))},[w]);let ae=Y.useRef(null),[oe,se]=Y.useState(null),[ce,le]=Y.useState(null),[ue,de]=Y.useState(null),{data:fe,isLoading:ge,isFetched:_e,hasNextPage:ve,isFetchingNextPage:ye,fetchNextPage:V}=An(),{data:xe}=jn(),H=Y.useMemo(()=>fe?.pages.flatMap(e=>e.items)??[],[fe]),Ce=Y.useMemo(()=>k===`relevant`?H.filter(e=>be(e.execution_status)):H,[H,k]),{recent:U,older:we}=Y.useMemo(()=>Er(Ce),[Ce]),Te=Y.useMemo(()=>br(h?[...U,...we]:U,D),[U,we,h,D]),Ee=Y.useMemo(()=>({emptyWorkspace:n(y.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(y.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),W=Y.useMemo(()=>t||w!==`grouped`?null:Cr([...U,...h?we:[]],a.kind,D,Ee),[a.kind,t,D,Ee,we,w,U,h]),De=Y.useMemo(()=>br(U.filter(e=>be(e.execution_status)),D),[D,U]),Oe=Te.length,Ae=Y.useMemo(()=>W?W.reduce((e,t)=>e+t.conversations.length,0):0,[W]),je=w===`grouped`&&!t?Ae===0:Oe===0,{mutate:Ne,mutateAsync:Pe}=it(),{mutate:Fe}=lt(),{mutate:Ie}=F(),Le=we.length>0&&!h,Re=!!ve&&!Le&&!t&&!je,{mutate:ze}=Lt(),Be=x(),Ve=Y.useCallback(e=>{Be||ze({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[ze,Be,i]),He=Y.useCallback((e,t)=>{c(!0),se(e),le(t)},[]),Ue=Y.useCallback(e=>{u(!0),se(e)},[]),We=Y.useCallback((e,t)=>{Ie({conversationId:e,newTitle:t},{onSuccess:()=>{me(n(y.CONVERSATION$TITLE_UPDATED))}})},[n,Ie]),Ge=()=>{oe&&Ne({conversationId:oe},{onSuccess:()=>{oe===r&&i(`/conversations`)}})},Ke=()=>{oe&&Fe({conversationId:oe})},qe=async()=>{let e=H.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Pe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&pe(`${a} conversation${a===1?``:`s`} could not be deleted.`)},Je=Y.useCallback(n=>t?(0,X.jsx)(nr,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(G,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Yn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>We(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:ue===n.id,onContextMenuToggle:e=>de(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,We,He,Ue,e,ue,_,b]),Ye=ge||!_e,Xe=_e&&!ge&&!t&&je&&!xe?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:B(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,P?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(y.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(gr,{backendKind:a.kind}),(0,X.jsx)(lr,{filterMenuOpen:j,setFilterMenuOpen:N,menuRef:L,backendKind:a.kind,organizeMode:w,setOrganizeMode:T,conversationSort:D,setConversationSort:O,threadScope:k,setThreadScope:A,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:b,toggleShowLlmProfiles:C,totalConversationsCount:H.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:ae,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{I(e.currentTarget.scrollTop>0)},className:B(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[Ye&&(0,X.jsx)(tr,{compact:t}),!t&&Xe&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(y.CONVERSATION$NO_CONVERSATIONS)})}),!t&&xe?.map(t=>(0,X.jsx)(G,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(er,{task:t})},t.id)),!Ye&&t?De.map(Je):null,!Ye&&!t&&w===`grouped`&&W&&W.length>0?(0,X.jsx)(`nav`,{"aria-label":n(y.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:W.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!ee.has(e.id),o=te.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=_r(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:B(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>re(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(E,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:B(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(y.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(he,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(Je),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>ie(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?y.CONVERSATION_PANEL$LESS:y.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!Ye&&!t&&w===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Te.map(Je)}):null,Re&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:ye?(0,X.jsx)(ke,{size:`small`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:()=>V(),className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(y.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(M,{onConfirm:()=>{Ge(),c(!1),le(null)},onCancel:()=>{c(!1),le(null)},conversationTitle:ce??void 0}),p&&(0,X.jsx)(M,{title:n(y.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(y.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:H.length}),onConfirm:async()=>{await qe(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(z,{onConfirm:()=>{Ke(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(Mn,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function Or({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(Dr,{})})})}var kr=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,Ar=34,jr=Math.round(Ar*30/46);function Mr({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:g,onOpenAddBackend:_,onOpenManageBackends:v}){let{t:b}=S(`openhands`),x=g;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Fe(e),children:[(0,X.jsxs)(`div`,{className:B(e&&t?Le:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:B(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(hn,{logoWidth:Ar,logoHeight:jr,logoClassName:`max-w-none`,className:B(He,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:B(Pe,c?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(h,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:o,className:B(`hidden md:inline-flex ml-auto`,Be,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(N,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":b(y.SIDEBAR$CLOSE_MENU),className:B(`inline-flex ml-auto`,Be,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(N,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:Ve(e),children:[(0,X.jsx)(Ge,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(he,{width:$,height:$})}),(0,X.jsx)(Ge,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(Ge,{to:`/automations`,label:b(y.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(kr,{width:$,height:$})})]}),(0,X.jsx)(Or,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:B(Ve(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(qe,{content:b(y.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(G,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":b(y.SIDEBAR$SETTINGS),className:Re({collapsed:!0}),children:[(0,X.jsx)(We,{active:u.startsWith(`/settings`),children:(0,X.jsx)(dn,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Ie(!0),children:b(y.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":b(y.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:B(Re({collapsed:!0}),`relative`),children:[(0,X.jsx)(We,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(xt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(un,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Ie(!0),children:b(y.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(kn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:_,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:B(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)(kn,{sidebarCollapsed:e,openUpward:!0})})]})}var Nr=`openhands-sidebar`,Pr=`openhands-sidebar-collapsed`,Fr=Ct()(wt(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:Nr,storage:Tt(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(Pr);window.localStorage.getItem(Nr)===null&&(e===`true`||e===`false`)&&Fr.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(Pr)}catch{}var Ir=Y.lazy(()=>n(()=>import(`./settings-modal-CCaPYVqW.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),Lr=Y.lazy(()=>n(()=>import(`./add-backend-modal-BdYxoUdL.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([51,1,9,52,14,53,54,16,17,10,18,23,21,22,15,19,20,55,46,24,25,7,26,32,36,12,34,56,37,45,35]))),Rr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-CTA-2x4F.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([57,1,53,14,15,16,17,9,10,18,58,59,60,61,19,20,21,52,54,23,22,55,46,24,25,7,26,32,36,12,34,56,37,45,35,62]))),zr=250;function Br(){let{t:e}=S(`openhands`),{currentPath:t}=Me(),{data:n}=Ae(),{data:r,error:i,isError:a,isFetching:o}=Pt(),{backends:s,active:c}=H(),l=bt(s)[c.backend.id],u=Fr(e=>e.collapsed),d=Fr(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[b,x]=Y.useState(!1),[C,w]=Y.useState(!1),T=Y.useRef(!1),[,E]=Y.useReducer(e=>e+1,0),{isOpen:D,close:O}=I(),[k,A]=Y.useState(!1),[j,M]=Y.useState(!1),N=Nt(()=>h(!1)),P=Ft(i);Y.useEffect(()=>{O()},[t,O]),Y.useEffect(()=>{if(D){A(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{A(!1)},zr);return()=>window.clearTimeout(e)},[D]),Y.useEffect(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D,O]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&P!==404?pe(`Something went wrong while fetching settings. Please reload the page.`):P===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,P,n?.feature_flags?.hide_llm_settings]);let F=r?.email_verified===!1,L=e(u?y.SIDEBAR$EXPAND:y.SIDEBAR$COLLAPSE),ee=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),R={linkDisabled:F,collapseToggleLabel:L,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,E(),d(!0),window.setTimeout(()=>{T.current=!1,E()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ee,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:B(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(Mr,{collapsed:u,showCollapseToggle:!0,...R})}),k?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:B(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,j?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${zr}ms`},onClick:O,"aria-hidden":!j}),(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!j,className:B(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,j?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${zr}ms`},children:(0,X.jsx)(Mr,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:O,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Ir,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Lr,{onClose:()=>v(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Rr,{onClose:()=>x(!1)})})]})}var Vr=`/settings`,Hr=`/customize`,Ur=[`/skills`,`/mcp`,`/plugins`];function Wr(e){return e===Vr?{mode:`menu`}:e.startsWith(`${Vr}/`)&&e.length>9?{mode:`back`,backTo:Vr,backLabelKey:y.SETTINGS$TITLE}:e===Hr?{mode:`menu`}:Ur.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Hr,backLabelKey:y.NAV$CUSTOMIZE}:{mode:`menu`}}function Gr(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Me(),r=Wr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(R,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??y.COMMON$BACK),className:L,children:(0,X.jsx)(N,{size:20,className:P,"aria-hidden":!0,strokeWidth:2})}):null]})}var Kr=()=>{let e=Ce(),{mutate:t}=Qt();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{Zt(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}},qr=()=>{let e=Ce(),{data:t}=Pt();Y.useEffect(()=>{!e||t===void 0||Zt(e,t.user_consents_to_analytics===!0)},[e,t])},Jr=()=>{let e=Ce(),{backend:t}=Se(),{data:n}=Pt(),r=Ue(),i=Y.useRef(!1),a=t.kind===`cloud`,o=a?r[t.id]?.userId??null:null,s=n?.user_consents_to_analytics;Y.useEffect(()=>{if(!(!e||!a||n===void 0)){if(s===!0&&o){e.identify(o,{email:n.email??n.git_user_email??void 0}),i.current=!0;return}(s===!1||i.current&&!o)&&(e.reset(),i.current=!1)}},[e,a,s,o,n?.email,n])};function Yr(e){switch(e){case V.RUNNING:return`🟢`;case V.FINISHED:case V.IDLE:case V.WAITING_FOR_CONFIRMATION:return`✅`;case V.PAUSED:return`⚪`;case V.ERROR:case V.STUCK:return`🔴`;default:return null}}var Xr=`OpenHands`,Zr=()=>{let{conversationId:e}=l(),{data:t}=$t(e??null),n=en(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Xr}`:Xr;if(!e)return i;let a=Yr(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Qr({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(Ne,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var $r=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-Cow6h62p.js`),__vite__mapDeps([63,1,12,10,9,19,20,64]))),ei=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-Ce-_Skcd.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([65,48,1,49,10,9,19,20,66,4,24,25,7,26,33,34,35,36,12,38,39,16,40,18,41,14,21,22,23,42,43,44,15,17,45,46,47,67]))),ti=Y.lazy(()=>n(()=>import(`./alert-banner-BzU93oDh.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([68,1,69,10,9,19,20,70,71,25,7,26,37,72,73,29]))),ni=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(y.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(y.ERROR$UNKNOWN)})})}),ri=o(function(){let e=p(),t=Zr(),{data:n}=Pt(),{migrateUserConsent:r}=Kr(),i=Ae(),[a,o]=Y.useState(!1);if(qr(),Jr(),Y.useEffect(()=>{n?.language&&C.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(ke,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname),c=se(e.search);return(0,X.jsx)(Qr,{children:(0,X.jsxs)(A,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(Br,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Gr,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ti,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ei,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)($r,{})}),c?(0,X.jsx)(de,{}):null]})})});export{ni as ErrorBoundary,ri as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-CCaPYVqW.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-z_QOzaRV.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-iPAfRWNQ.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-DveauQfg.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~bok0tgtf-Dr8Ly0at.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~ntycl9e1-DspdqGPW.js","assets/declaration-IA661TBv.js","assets/react-CM_dJw1Z.js","assets/vendor~root-layout~home~mcp~llm-settings~agent-settings~condenser-settings~verification-set~o7tv66sg-CbuXadI-.js","assets/react-dom-hVBnwgwZ.js","assets/llm-client-BnqeDPua.js","assets/settings-client-BUlG0Gzq.js","assets/useQuery-JDs8UaWj.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js","assets/suspense-C9MBE_9N.js","assets/QueryClientProvider-7oLZ1RtQ.js","assets/useTranslation-CbJtty1g.js","assets/context-BBqptpXX.js","assets/agent-server-client-options-Dvgeb3x4.js","assets/proxy-wIasY2Po.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~e9ykmtgh-DMH1jSwL.js","assets/brand-button-BoiPxAGm.js","assets/utils-CVcuFUYj.js","assets/common-Cfviy7yT.js","assets/combobox-caret-DwMmhrrA.js","assets/sdk-settings-schema-B0KrqqPX.js","assets/dist-B-SKiGDl.js","assets/sdk-settings-field-metadata-CETNItbo.js","assets/map-provider-XSFHmdDs.js","assets/settings-input-DsoZj8Dm.js","assets/base-modal-Ba5WcNb6.js","assets/modal-body-2Po2nl1e.js","assets/modal-classes-9XTtWCtF.js","assets/modal-backdrop-B1si6TUd.js","assets/navigation-context-CszaA-CJ.js","assets/use-save-settings-CP23emUY.js","assets/useMutation-7hG0GuPx.js","assets/mutation-CaJwPR9O.js","assets/settings-service.api-4u2RKC8k.js","assets/settings-BgL2HUsU.js","assets/query-keys-CQaji0wJ.js","assets/use-settings-0qFqC-r6.js","assets/active-backend-context-CQTk4wD8.js","assets/health-store-d-d2ssv4.js","assets/use-tracking-CjLZgh8X.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js","assets/settings-utils-chxTa1vn.js","assets/add-backend-modal-BdYxoUdL.js","assets/backend-form-modal-BUy-PzZN.js","assets/server-client-Cz8PyIbN.js","assets/organization-service.api-D79cdERN.js","assets/agent-server-compatibility-BANjmMTo.js","assets/modal-close-button-DY-rVmld.js","assets/manage-backends-modal-CTA-2x4F.js","assets/pencil-COslZGUC.js","assets/createLucideIcon-C9OEnwvX.js","assets/plus-D8aJZRkD.js","assets/trash-2-DAKXV2Wm.js","assets/confirmation-modal-BPgWqWRI.js","assets/environment-switch-overlay-Cow6h62p.js","assets/environment-switch-store-BpKxp6Xq.js","assets/analytics-consent-form-modal-D4ndXdkQ.js","assets/telemetry--BA6QguL.js","assets/handle-capture-consent-DDnXMC9Y.js","assets/alert-banner-BzU93oDh.js","assets/vendor~conversation-panel~conversation~alert-banner-BnHToS5O.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js","assets/iconBase-1A_WRQ4E.js","assets/close-CbOsKMRg.js","assets/typography-Cx7uw7z3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{d as h,f as g,t as _}from"./path-utils-0KWEiRs9.js";import{o as v,t as y}from"./declaration-IA661TBv.js";import{t as b}from"./useQuery-JDs8UaWj.js";import{r as x}from"./recommended-automations-launcher-C1_CKGHa.js";import{t as S}from"./useTranslation-CbJtty1g.js";import{a as C}from"./i18n-CyvU1o95.js";import{t as w}from"./createLucideIcon-C9OEnwvX.js";import{t as T}from"./vendor~root-layout~home~conversation-panel~conversation-Cg0nXqVs.js";import{a as E,i as D,o as O}from"./vendor~root-layout~home~mcp~automations-list-DGOI7kQz.js";import{t as k}from"./check-BDAbW7je.js";import{a as A,c as j,d as M,f as N,i as P,l as F,o as I,r as L,s as ee,t as R,u as z}from"./sidebar-mobile-menu-toggle-BDXWzhyB.js";import{a as te,c as ne,d as re,f as ie,i as ae,l as oe,n as se,o as ce,r as le,s as ue,t as de,u as fe}from"./onboarding-CGUaLHfQ.js";import{n as pe,r as me}from"./custom-toast-handlers-fgD4IYsu.js";import{t as he}from"./plus-D8aJZRkD.js";import{t as ge}from"./trash-2-DAKXV2Wm.js";import{t as _e}from"./x-8AbJWTbX.js";import{t as B,v as ve,x as ye,y as be}from"./utils-CVcuFUYj.js";import{t as V}from"./common-Cfviy7yT.js";import{p as xe}from"./agent-server-client-options-Dvgeb3x4.js";import{n as Se,r as H}from"./active-backend-context-CQTk4wD8.js";import{n as Ce}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js";import{t as U}from"./agent-server-conversation-service.api-js3oYcdU.js";import{t as we}from"./modal-backdrop-B1si6TUd.js";import{n as Te}from"./modal-body-2Po2nl1e.js";import{i as Ee,r as W}from"./base-modal-Ba5WcNb6.js";import{g as De,s as Oe}from"./brand-button-BoiPxAGm.js";import{t as ke}from"./loading-spinner-CFuA0UNt.js";import{t as Ae}from"./use-config-DSzkljTq.js";import{t as je}from"./openhands-logo-B-IDE1ER.js";import{n as Me,t as Ne}from"./navigation-context-CszaA-CJ.js";import{t as G}from"./navigation-link-DXg4oo29.js";import{a as Pe,d as Fe,f as Ie,i as Le,m as Re,n as ze,o as Be,p as Ve,s as He,t as Ue}from"./use-cloud-current-user-id-e1Pk7NxQ.js";import{n as We,t as Ge}from"./sidebar-nav-link-Bhlzlhp8.js";import{t as Ke}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~mcp~~jpfhx3ls-zdl_Rltz.js";import{t as qe}from"./styled-tooltip-GXy1qxsO.js";import{a as Je,d as Ye,f as Xe,i as K,l as Ze,n as Qe,o as $e,r as et,u as tt}from"./dropdown-classes-lT1LUsbO.js";import{r as nt,t as rt}from"./combobox-caret-DwMmhrrA.js";import{_ as it,a as at,c as ot,d as st,f as ct,g as lt,h as ut,i as dt,l as ft,m as pt,n as mt,o as ht,p as gt,r as _t,u as vt,v as yt}from"./chat-send-button-qKFZuB9E.js";import{o as bt,r as xt}from"./backend-form-modal-BUy-PzZN.js";import{s as St}from"./environment-switch-store-BpKxp6Xq.js";import{t as Ct}from"./react-CuAHzoGi.js";import{i as wt,n as Tt,t as Et}from"./conversation-store-CiYGBud3.js";import{t as Dt}from"./add-backend-modal-BdYxoUdL.js";import{t as Ot}from"./manage-backends-modal-CTA-2x4F.js";import{c as kt,l as At,o as jt}from"./acp-providers-C55k29rf.js";import{t as Mt}from"./use-is-authed-fNsj-Adj.js";import{t as Nt}from"./use-click-outside-element-Bu2A3s59.js";import{r as Pt,t as Ft}from"./use-settings-0qFqC-r6.js";import{t as It}from"./use-tracking-CjLZgh8X.js";import{t as Lt}from"./use-create-conversation-CzvaVA5A.js";import{t as Rt}from"./vscode-url-helper-DOCkV_-G.js";import{t as zt}from"./conversation-service.api-y_eB_43m.js";import{r as Bt,t as Vt}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DToubnIU.js";import{n as Ht,t as q}from"./context-menu-list-item-CHWCx1Mc.js";import{i as J,r as Ut,t as Wt}from"./ellipsis-button-CiLx8dqc.js";import{t as Gt}from"./u-edit-foF02hwH.js";import{t as Kt}from"./skills-BDOWVle-.js";import{o as qt,s as Jt,t as Yt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-BwbkftxT.js";import{t as Xt}from"./search-BqXT2Ied.js";import{t as Zt}from"./handle-capture-consent-DDnXMC9Y.js";import{t as Qt}from"./use-save-settings-CP23emUY.js";import{t as $t}from"./use-user-conversation-CQ5IwnZk.js";import{t as en}from"./conversation-state-store-DpgQaK_O.js";var tn=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),nn=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),rn=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),an=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),on=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),sn=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),cn=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),ln=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),un=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),dn=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fn=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=v(),pn=46,mn=30;function hn({className:e,logoClassName:t,logoWidth:n=pn,logoHeight:r=mn}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(G,{to:`/conversations`,"aria-label":i(y.BRANDING$OPENHANDS_LOGO),className:B(e),children:(0,X.jsx)(je,{width:n,height:r,className:B(`shrink-0`,t)})})}function gn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-white/20 border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function _n({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(_e,{size:14})})}function vn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:B(nt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(rt,{})})}function yn({isOpen:e,filteredOptions:t,selectedItem:n,emptyMessage:r,getMenuProps:i,getItemProps:a,footer:o,openUpward:s=!1,fitContent:c=!1}){return(0,X.jsxs)(`div`,{className:B(`absolute z-50 overflow-hidden text-white`,c?`min-w-full w-max`:`w-full`,s?`bottom-full mb-1`:`mt-1`,`bg-tertiary rounded-[6px] context-menu-box-shadow p-1`,`max-h-60 overflow-auto`,!e&&`hidden`),children:[(0,X.jsxs)(`ul`,{...i({className:B(`p-0`,K)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:B($e,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:tt,children:e.prefix}):null,(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:e.label})]},e.value))]}),e&&o?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(yt,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function bn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:B(`outline-none bg-transparent text-white not-italic`,i?`w-auto field-sizing-content whitespace-nowrap text-sm`:`flex-1 min-w-0`,r&&`placeholder:italic placeholder:text-tertiary-alt`,!r&&`placeholder:text-tertiary-alt`,Oe,`px-0 not-italic text-inherit`)})})}var xn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Sn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:E,openMenu:D,closeMenu:O,getToggleButtonProps:k,getMenuProps:A,getItemProps:j,getInputProps:M}=T({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===T.stateChangeTypes.InputClick&&e.isOpen?{...t.changes,isOpen:!0}:t.changes,initialIsOpen:p,onInputValueChange:({inputValue:e})=>{y(e??``),x(e??``)},defaultSelectedItem:o,onSelectedItemChange:({selectedItem:e})=>{s?.(e??null)},onIsOpenChange:({isOpen:e,selectedItem:t})=>{e?(y(``),x(``)):(y(t?.label??``),x(``))}}),N=r||i,P=w?e.find(e=>e.value===w.value)??w:null,F=e=>M({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:B(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),D()}:void 0,onMouseLeave:m?()=>{_.current=setTimeout(()=>O(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...F({"aria-label":a??`Filter options`,tabIndex:-1}),style:xn}),(0,X.jsx)(`button`,{type:`button`,...k({tabIndex:-1}),style:xn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:B(Xe,g?`w-auto`:`w-full`,N&&`cursor-not-allowed opacity-60`,l),children:[P?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:P.prefix}):null,(0,X.jsx)(bn,{placeholder:a,isDisabled:N,getInputProps:F,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(gn,{}),n&&w&&(0,X.jsx)(_n,{onClear:()=>E(null)}),(0,X.jsx)(vn,{isOpen:C,isDisabled:N,getToggleButtonProps:k})]}),(0,X.jsx)(yn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:A,getItemProps:j,footer:u,openUpward:d,fitContent:g})]})}var Cn=`::`;function wn(e,t){return t?`${e}${Cn}${t}`:e}function Tn(e){let[t,n]=e.split(Cn);return{backendId:t,orgId:n??null}}function En(e){return(0,X.jsx)(xt,{isConnected:e?.isConnected??null})}function Dn(){return(0,X.jsx)(xt,{isConnected:`unavailable`})}function On(e,t,n,r,i){let a=[],o=e.filter(e=>e.kind===`local`),s=e.filter(e=>e.kind===`cloud`);for(let e of o)a.push({value:wn(e.id,null),label:e.name,prefix:En(i[e.id])});for(let e of s){let o=n[e.id],s=En(i[e.id]);if(!o||o.orgs.length===0)a.push({value:wn(e.id,null),label:e.name,prefix:s});else{let n=r[e.id]?.userId??null;for(let r of o.orgs){let i=n&&n===r.id?t:r.name;a.push({value:wn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function kn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=H(),p=ze(),m=Ue(),h=bt(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),b=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(y.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>On(u,D,p,m,h),[u,D,p,m,h]),k=xe(d.backend),A=l(y.BACKEND$NO_BACKEND_AVAILABLE),j=wn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(y.SIDEBAR$SETTINGS),F=Et(e=>e.isRightPanelShown),I=!c||b&&F?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let ee=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),R=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),z=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=(0,X.jsxs)(`div`,{className:K,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:z,onClick:ee,className:B(Qe,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(he,{width:16,height:16})}),l(y.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:z,onClick:R,className:B(Qe,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(dn,{width:16,height:16})}),l(y.BACKEND$MANAGE)]})]}),ne=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=Tn(e),r=u.find(e=>e.id===t);r&&(St(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,b,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(Sn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?Dn():En(h[d.backend.id])},footer:te,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ne(e.value)},placeholder:k?A:d.backend.name,loading:L,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(qe,{content:P,placement:I,offset:10,children:(0,X.jsx)(G,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:B(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,De),children:(0,X.jsx)(dn,{width:16,height:16})})})]}),C?(0,X.jsx)(Dt,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(Ot,{onClose:()=>E(!1)}):null]})}var An=(e=20)=>{let{data:t}=Mt(),n=Se(),r=!xe(n.backend);return g({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await U.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},jn=(e=10)=>b({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Mn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(we,{onClose:n,children:(0,X.jsxs)(Te,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(W,{title:r(y.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Ee,{text:r(y.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Ee,{text:r(y.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var Nn=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Pn=e=>{let t=typeof e==`string`?Nn(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Fn({titleMode:e,title:t,onSave:n,isConversationArchived:r}){return e===`edit`?(0,X.jsx)(`input`,{autoFocus:!0,"data-testid":`conversation-card-title`,onClick:e=>{e.preventDefault(),e.stopPropagation()},onBlur:e=>{n(e.currentTarget?.value?.trim?.()??``)},onKeyUp:e=>{e.nativeEvent.isComposing||e.key===`Enter`&&e.currentTarget.blur()},type:`text`,defaultValue:t,className:`text-sm leading-6 font-semibold bg-transparent w-full`}):(0,X.jsx)(`p`,{"data-testid":`conversation-card-title`,className:B(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var In=e=>{switch(e){case V.FINISHED:return`check`;case V.RUNNING:return`working`;case V.IDLE:case V.WAITING_FOR_CONFIRMATION:return`active`;case V.PAUSED:return`paused`;case V.ERROR:case V.STUCK:return`error`;default:return`unknown`}},Ln=(e,t)=>{if(t)return`COMMON$ARCHIVED`;switch(e){case`check`:return`COMMON$FINISHED`;case`working`:case`active`:return`COMMON$WORKING`;case`paused`:return`COMMON$PAUSED`;case`error`:return`COMMON$ERROR`;default:return`COMMON$STOPPED`}};function Rn(e){switch(e){case`check`:return(0,X.jsx)(`svg`,{"data-testid":`conversation-status-check`,viewBox:`0 0 12 12`,className:`w-2.5 h-2.5 stroke-[var(--oh-status-success)]`,fill:`none`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:`M2.5 6.5 5 9l4.5-5.5`})});case`working`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-working`,className:`w-1.5 h-1.5 rounded-full animate-pulse bg-[var(--oh-status-success)]`});case`active`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-active`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-success)]`});case`paused`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-paused`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-muted)]`});case`error`:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-error`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-status-error)]`});default:return(0,X.jsx)(`span`,{"data-testid":`conversation-status-unknown`,className:`w-1.5 h-1.5 rounded-full bg-[var(--oh-color-tertiary)]`})}}function zn({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:In(e),o=r(Ln(a,i)),s=(0,X.jsx)(`div`,{className:`w-2.5 h-2.5 flex items-center justify-center shrink-0`,children:i?(0,X.jsx)(Vt,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):Rn(a)});return n?(0,X.jsx)(qe,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Bn({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Fn,{title:e,titleMode:t,onSave:n,isConversationArchived:i===`MISSING`||i===`ERROR`})]})}var Vn=e(m(),1);function Hn({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=Se(),m=Nt(e,d),h=p.kind===`cloud`?y.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:y.COMMON$STOP_CONVERSATION,g=(0,Y.useCallback)((e,t,n)=>{let r=e.filter(e=>e!=null);return r.length>0?n?(0,X.jsx)(Y.Fragment,{children:r},t):(0,X.jsxs)(Y.Fragment,{children:[r,(0,X.jsx)(yt,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(Ht,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Gt,{width:16,height:16}),text:f(y.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ut,{width:16,height:16}),text:f(y.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Kt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(y.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(pt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(j,{width:16,height:16}),text:f(y.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(j,{width:16,height:16}),text:f(y.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(ee,{width:16,height:16}),text:f(y.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Ut,{width:16,height:16}),text:f(y.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Un({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ye(s),d=be(s),f=(0,Y.useRef)(null),[,p]=(0,Y.useReducer)(e=>e+1,0);(0,Y.useLayoutEffect)(()=>{if(!e)return;p();let t=0,n=()=>{t||=window.requestAnimationFrame(()=>{t=0,p()})};return window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{t&&window.cancelAnimationFrame(t),window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[e]);let m=(()=>{if(!e||!f.current)return;let t=f.current.getBoundingClientRect(),n=Number(window.innerWidth)||0,r=Number(window.innerHeight)||0,i=Number(t.bottom)||0,a=Number(t.right)||0;return{position:`fixed`,top:i+280+8>r?Math.max(8,t.top-280-4):i+4,right:Math.max(8,n-a),zIndex:1e5}})(),h=typeof document<`u`?document.body:null;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Wt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:B(u&&`opacity-60`)}),e&&m&&h?(0,Vn.createPortal)((0,X.jsx)(Hn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var Wn={bitbucket:Yt,bitbucket_data_center:Yt,github:qt,gitlab:Jt};function Gn({selectedRepository:e}){let t=e.git_provider?Wn[e.git_provider]:null;return(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[t&&(0,X.jsx)(t,{size:14,className:`shrink-0 text-[var(--oh-muted)]`}),e.git_provider===`azure_devops`&&(0,X.jsx)(gt,{className:`h-[14px] w-[14px] shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-repository`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_repository})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,X.jsx)(Bt,{size:12,className:`shrink-0 text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{"data-testid":`conversation-card-selected-branch`,className:`min-w-0 truncate text-xs text-[var(--oh-muted)]`,children:e.selected_branch})]})]})}function Kn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?_(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(ct,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(y.COMMON$NO_REPOSITORY)})]})}function qn({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=ye(r),p=null;if(c)if(l===`acp`){let e=jt(u)??d(y.CONVERSATION$ACP_AGENT_GENERIC),t=kt(u,s),n=t??e;p={kind:At(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:B(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(ie,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:B(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Gn,{selectedRepository:e}):(0,X.jsx)(Kn,{workspaceWorkingDir:i})),(0,X.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 ml-auto`,children:o&&(n??t)&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] text-right`,children:(0,X.jsx)(`time`,{children:`${Pn(t??n)} ${d(y.CONVERSATION$AGO)}`})})})]})]})}function Jn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(st,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(y.COMMON$ERROR)})]})}function Yn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let{trackDownloadVsCodeButtonClicked:x}=It(),[S,C]=Y.useState(`view`),{mutateAsync:w}=vt(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x(),l)try{let e=await zt.getVSCodeUrl(l);if(e.vscode_url){let t=Rt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:B(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Bn,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Jn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:B(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Pn(s??c)})}),j&&(0,X.jsx)(`div`,{className:B(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Un,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(qn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function Xn({taskStatus:e}){return(0,X.jsx)(`div`,{className:B(`w-2 h-2 rounded-full flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500`;case`ERROR`:return`bg-red-500`;case`WORKING`:case`WAITING_FOR_SANDBOX`:case`PREPARING_REPOSITORY`:case`RUNNING_SETUP_SCRIPT`:case`SETTING_UP_GIT_HOOKS`:case`SETTING_UP_SKILLS`:case`STARTING_CONVERSATION`:return`bg-yellow-500 animate-pulse`;default:return`bg-[var(--oh-interactive-selected)]`}})()),"aria-label":`Task status: ${e}`})}function Zn({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:B(`text-xs font-medium px-2 py-0.5 rounded border flex-shrink-0`,(()=>{switch(e){case`READY`:return`bg-green-500/10 text-green-400 border-green-500/20`;case`ERROR`:return`bg-red-500/10 text-red-400 border-red-500/20`;default:return`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`}})()),children:t(ve(e))})}function Qn({title:e,taskStatus:t}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden mr-2`,children:[(0,X.jsx)(`div`,{className:`flex items-center`,children:(0,X.jsx)(Xn,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Zn,{taskStatus:t})]})}function $n({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:B(`flex flex-col gap-1 mt-1`),children:[(0,X.jsxs)(`div`,{className:`flex flex-row justify-between items-center`,children:[e?(0,X.jsx)(Gn,{selectedRepository:e}):(0,X.jsx)(Kn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Pn(t)} ${r(y.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function er({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(y.CONVERSATION$STARTING_CONVERSATION),i=e.request.selected_repository?{selected_repository:e.request.selected_repository,selected_branch:e.request.selected_branch||null,git_provider:e.request.git_provider||null}:null;return(0,X.jsxs)(`div`,{"data-testid":`start-task-card`,onClick:t,className:B(`relative h-auto w-full p-3.5 border-b border-[var(--oh-border)] cursor-pointer`,`hover:bg-tertiary`),children:[(0,X.jsx)(`div`,{className:`flex items-center justify-between w-full`,children:(0,X.jsx)(Qn,{title:r,taskStatus:e.status})}),(0,X.jsx)($n,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function tr({compact:e=!1}){return e?(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton-compact`,className:`skeleton-stagger flex flex-col items-center gap-1.5 py-1`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-1.5 w-7 shrink-0 skeleton`},`conversation-skeleton-compact-${e}`))}):(0,X.jsx)(`div`,{"data-testid":`conversation-card-skeleton`,className:`skeleton-stagger flex flex-col gap-1.5 py-0.5`,"aria-hidden":!0,children:[0,1,2].map(e=>(0,X.jsx)(`div`,{className:`h-6 min-h-6 w-full skeleton`},`conversation-skeleton-row-${e}`))})}function nr({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Ke,{content:(0,X.jsxs)(`div`,{className:`w-[260px] p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(qn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(G,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>B(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(zn,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var rr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=Ct()(wt(e=>({...rr,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:Tt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),ir=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,ar=`px-2 pb-1 pt-1`,or=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function sr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:B(ar,or),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:B(`flex items-baseline justify-between gap-2`,ar),children:[(0,X.jsx)(`span`,{className:B(`min-w-0 truncate text-left`,or),children:e}),t]})}function cr(){return(0,X.jsx)(yt,{inset:`menu`})}function Q({icon:e,label:t,selected:n,onClick:r,testId:i,disabled:a}){return(0,X.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,"aria-checked":n===void 0?void 0:!!n,"data-testid":i,disabled:a,onClick:r,className:B(`group`,$e,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:B(`h-3.5 w-3.5`,Ze),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(k,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function lr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),b=v(r===`local`?y.CONVERSATION_PANEL$BY_WORKSPACE:y.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:B(`inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`,et),children:(0,X.jsx)(cn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(y.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:B(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,K,Ye),children:[(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:E,label:b,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:nn,label:v(y.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:tn,label:v(y.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:rn,label:v(y.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:ln,label:v(y.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:fn,label:v(y.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{children:v(y.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:O,label:v(y.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:D,label:v(y.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(sr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(y.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(y.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?an:on,label:ir(v(u?y.CONVERSATION$HIDE:y.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(cr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ge,label:ir(v(y.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var ur=B(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Je);function dr(e,t){let{open:n,enabled:r,targetWidth:i=256}=t,[a,o]=Y.useState(null),s=Y.useCallback(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect(),r=Math.min(i,window.innerWidth-16),a=n.right-r;a<8&&(a=8),a+r>window.innerWidth-8&&(a=Math.max(8,window.innerWidth-8-r)),o({top:n.bottom+4,left:a,width:r})},[e,i]);return Y.useLayoutEffect(()=>{if(!n||!r){o(null);return}return s(),window.addEventListener(`resize`,s),window.addEventListener(`scroll`,s,!0),()=>{window.removeEventListener(`resize`,s),window.removeEventListener(`scroll`,s,!0)}},[n,r,s]),a}function fr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Me(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=dr(u,{open:s,enabled:i}),{data:f,error:p}=ue(),m=f?.workspaceParents??[],{mutate:h}=oe(),{mutate:g}=fe(),{mutate:_}=ne(),{mutate:v}=re(),{workspaces:b}=ce(),C=te(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=Lt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=$e,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),F=Y.useCallback(()=>{c(e=>!e)},[]),I=s&&(!i||d!==null),L=!!C,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,R=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:L,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!L&&T(!0)},className:N,children:a(y.HOME$ADD_WORKSPACES)}),z=C?(0,X.jsx)(qe,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:R})}):R;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:F,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),I&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(ur,!i&&B(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,K),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(y.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(ft,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:B(`flex flex-col`,K),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(yt,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),z,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(y.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(ae,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(le,{isOpen:E,workspaces:b,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function pr({repo:e,disabled:t,onSelect:n,itemClass:r}){return(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:t,"data-testid":`launch-repository`,"data-repo-name":e.full_name,onClick:()=>n(e),className:r,children:[(0,X.jsx)(`span`,{className:tt,"aria-hidden":!0,children:(0,X.jsx)(ft,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function mr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Me(),{providers:s}=ot(),{lastSelectedProvider:c,setLastSelectedProvider:l}=_t(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=dr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),b=dt(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=ht({provider:h}),{data:k,isLoading:A}=at(b,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=b?k??[]:j,{mutate:N,isPending:P}=Lt(),F=x(),I=P||F;Y.useEffect(()=>{if(!u)return;let e=e=>{f.current&&!f.current.contains(e.target)&&d(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[u]),Y.useEffect(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let L=e=>{I||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),v(``)},R=$e;Y.useEffect(()=>{u&&(b||!E||D||w||M.length===0||M.length>=10||O())},[u,b,E,D,w,M.length,O]);let z=b?A:w,te=!b&&E&&M.length>0,ne=Y.useCallback(()=>{d(e=>!e)},[]),re=u&&(!i||m!==null),ie=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:B(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ne,"aria-expanded":u,"aria-haspopup":`menu`,disabled:I})}),re&&(0,X.jsxs)(`div`,{"data-testid":r,className:B(ur,!i&&B(`absolute top-full mt-0`,n)),style:ie,children:[s.length>1&&(0,X.jsx)(`div`,{className:`flex items-center gap-1 px-1 py-1`,"data-testid":`cloud-provider-tabs`,children:s.map(e=>{let t=e===h;return(0,X.jsxs)(`button`,{type:`button`,"data-testid":`cloud-provider-tab-${e}`,onClick:()=>ee(e),className:B(`flex items-center gap-1 rounded border px-2 py-1 text-xs`,`transition-none`,t?`border-[var(--oh-border-subtle)] bg-[var(--oh-interactive-hover)] text-white`:`border-transparent text-[var(--oh-text-secondary)] hover:text-white`),children:[(0,X.jsx)(mt,{gitProvider:e}),(0,X.jsx)(`span`,{className:`capitalize`,children:e})]},e)})}),(0,X.jsx)(`div`,{className:`px-2`,children:(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(Xt,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(y.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:B(`w-full border-0 bg-transparent py-1.5 pl-6 pr-0 text-sm text-white`,`outline-none placeholder:text-[var(--oh-muted)]`,`focus:outline-none focus:ring-0`,`disabled:cursor-not-allowed disabled:opacity-60`)})]})}),(0,X.jsx)(yt,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:B(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,K),children:[z&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(y.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(y.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!z&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(y.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(pr,{repo:e,disabled:I,onSelect:L,itemClass:R},`${e.git_provider}:${e.id}`)),te&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:R,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?y.HOME$LOADING_MORE_REPOSITORIES:y.CONVERSATION$LOAD_MORE)})})})]})]})]})}var hr=B(`inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`);function gr({backendKind:e}){let{t}=S(`openhands`),n=t(y.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(sn,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(fr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:hr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})}):(0,X.jsx)(mr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:hr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function _r(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function vr(e,t,n){if(t===`local`)return e===`__none_workspace`?{}:e.startsWith(`ws:`)?{workingDir:e.slice(3)}:{};if(e===`__none_repo`)return{};if(e.startsWith(`repo:`)){let t=e.slice(5),r=n[0];return{repository:{name:t,gitProvider:r?.git_provider??`github`,branch:r?.selected_branch??`main`}}}return{}}function yr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function br(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>yr(t[n])-yr(e[n]))}function xr(e){let t=e.selected_workspace?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_workspace`,label:``};let n=t.split(`/`).filter(Boolean).pop()??t;return{id:`ws:${t}`,label:n}}function Sr(e){let t=e.selected_repository?.trim().replace(/\/+$/,``);if(!t)return{id:`__none_repo`,label:``};let n=t.split(`/`).filter(Boolean),r=n.length?(n[n.length-1]??t).replace(/\.git$/,``):t.replace(/\.git$/,``);return{id:`repo:${t}`,label:r}}function Cr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?xr(n):Sr(n),o=e===`__none_workspace`?r.emptyWorkspace:e===`__none_repo`?r.emptyRepository:a,s=i.get(e);s?s.conversations.push(n):i.set(e,{label:o,conversations:[n]})}let a=[...i.entries()].map(([e,r])=>{let i=br(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:vr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,yr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var wr=()=>{},Tr=3600*1e3,Er=e=>{let t=Date.now()-Tr,n=[],r=[];for(let i of e){let e=i.updated_at?Date.parse(i.updated_at):NaN;Number.isFinite(e)&&e<t?r.push(i):n.push(i)}return{recent:n,older:r}};function Dr({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Me(),{backend:a}=Se(),o=Nt(e??wr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),C=Z(e=>e.toggleShowLlmProfiles),w=Z(e=>e.organizeMode),T=Z(e=>e.setOrganizeMode),D=Z(e=>e.conversationSort),O=Z(e=>e.setConversationSort),k=Z(e=>e.threadScope),A=Z(e=>e.setThreadScope),[j,N]=Y.useState(!1),[P,I]=Y.useState(!1),L=Nt(()=>{N(!1)}),[ee,R]=Y.useState(()=>new Set),[te,ne]=Y.useState(()=>new Set),re=Y.useCallback(e=>{R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ie=Y.useCallback(e=>{ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{w!==`grouped`&&(R(new Set),ne(new Set))},[w]);let ae=Y.useRef(null),[oe,se]=Y.useState(null),[ce,le]=Y.useState(null),[ue,de]=Y.useState(null),{data:fe,isLoading:ge,isFetched:_e,hasNextPage:ve,isFetchingNextPage:ye,fetchNextPage:V}=An(),{data:xe}=jn(),H=Y.useMemo(()=>fe?.pages.flatMap(e=>e.items)??[],[fe]),Ce=Y.useMemo(()=>k===`relevant`?H.filter(e=>be(e.execution_status)):H,[H,k]),{recent:U,older:we}=Y.useMemo(()=>Er(Ce),[Ce]),Te=Y.useMemo(()=>br(h?[...U,...we]:U,D),[U,we,h,D]),Ee=Y.useMemo(()=>({emptyWorkspace:n(y.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(y.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),W=Y.useMemo(()=>t||w!==`grouped`?null:Cr([...U,...h?we:[]],a.kind,D,Ee),[a.kind,t,D,Ee,we,w,U,h]),De=Y.useMemo(()=>br(U.filter(e=>be(e.execution_status)),D),[D,U]),Oe=Te.length,Ae=Y.useMemo(()=>W?W.reduce((e,t)=>e+t.conversations.length,0):0,[W]),je=w===`grouped`&&!t?Ae===0:Oe===0,{mutate:Ne,mutateAsync:Pe}=it(),{mutate:Fe}=lt(),{mutate:Ie}=F(),Le=we.length>0&&!h,Re=!!ve&&!Le&&!t&&!je,{mutate:ze}=Lt(),Be=x(),Ve=Y.useCallback(e=>{Be||ze({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[ze,Be,i]),He=Y.useCallback((e,t)=>{c(!0),se(e),le(t)},[]),Ue=Y.useCallback(e=>{u(!0),se(e)},[]),We=Y.useCallback((e,t)=>{Ie({conversationId:e,newTitle:t},{onSuccess:()=>{me(n(y.CONVERSATION$TITLE_UPDATED))}})},[n,Ie]),Ge=()=>{oe&&Ne({conversationId:oe},{onSuccess:()=>{oe===r&&i(`/conversations`)}})},Ke=()=>{oe&&Fe({conversationId:oe})},qe=async()=>{let e=H.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Pe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&pe(`${a} conversation${a===1?``:`s`} could not be deleted.`)},Je=Y.useCallback(n=>t?(0,X.jsx)(nr,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(G,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Yn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>We(n.id,e),title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},lastUpdatedAt:n.updated_at,createdAt:n.created_at,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,conversationId:n.id,contextMenuOpen:ue===n.id,onContextMenuToggle:e=>de(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,We,He,Ue,e,ue,_,b]),Ye=ge||!_e,Xe=_e&&!ge&&!t&&je&&!xe?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:B(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,P?`border-[var(--oh-border)]`:`border-transparent`),children:(0,X.jsxs)(`div`,{"data-testid":`older-conversations-summary`,className:`flex min-w-0 flex-nowrap items-center gap-x-2 py-2 pl-4 pr-2.5 text-[var(--oh-muted)]`,children:[(0,X.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-[var(--oh-muted)]`,children:n(y.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(gr,{backendKind:a.kind}),(0,X.jsx)(lr,{filterMenuOpen:j,setFilterMenuOpen:N,menuRef:L,backendKind:a.kind,organizeMode:w,setOrganizeMode:T,conversationSort:D,setConversationSort:O,threadScope:k,setThreadScope:A,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:b,toggleShowLlmProfiles:C,totalConversationsCount:H.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:ae,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{I(e.currentTarget.scrollTop>0)},className:B(`flex min-h-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain custom-scrollbar-always`,!t&&`conversation-panel-list-scroll`),children:[Ye&&(0,X.jsx)(tr,{compact:t}),!t&&Xe&&(0,X.jsx)(`div`,{"data-testid":`conversation-panel-empty-state`,className:`flex min-h-0 flex-1 flex-col items-center justify-center px-4 py-8`,children:(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)]`,children:n(y.CONVERSATION$NO_CONVERSATIONS)})}),!t&&xe?.map(t=>(0,X.jsx)(G,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(er,{task:t})},t.id)),!Ye&&t?De.map(Je):null,!Ye&&!t&&w===`grouped`&&W&&W.length>0?(0,X.jsx)(`nav`,{"aria-label":n(y.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:W.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!ee.has(e.id),o=te.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=_r(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:B(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>re(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(E,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:B(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(y.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(he,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(Je),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>ie(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?y.CONVERSATION_PANEL$LESS:y.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!Ye&&!t&&w===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Te.map(Je)}):null,Re&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:ye?(0,X.jsx)(ke,{size:`small`}):(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:()=>V(),className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(y.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(M,{onConfirm:()=>{Ge(),c(!1),le(null)},onCancel:()=>{c(!1),le(null)},conversationTitle:ce??void 0}),p&&(0,X.jsx)(M,{title:n(y.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(y.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:H.length}),onConfirm:async()=>{await qe(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(z,{onConfirm:()=>{Ke(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(Mn,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function Or({collapsed:e}){return e?null:(0,X.jsx)(`div`,{className:`flex flex-col flex-1 min-h-0`,children:(0,X.jsx)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col`,children:(0,X.jsx)(Dr,{})})})}var kr=e=>(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 20 20`,fill:`none`,...e,children:[(0,X.jsx)(`mask`,{id:`mask0_18339_1445`,style:{maskType:`luminance`},maskUnits:`userSpaceOnUse`,x:1,y:1,width:18,height:18,children:(0,X.jsx)(`path`,{d:`M19 1H1V19H19V1Z`,fill:`white`})}),(0,X.jsxs)(`g`,{mask:`url(#mask0_18339_1445)`,children:[(0,X.jsx)(`path`,{d:`M10 18.1818V16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 1.81836V3.45472`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M1.81824 10H3.4546`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M18.1818 10H16.5454`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.93359 17.1019L6.74359 15.6782`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0663 2.89844L13.2563 4.32208`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.89819 5.93359L4.32183 6.74359`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.1019 14.0663L15.6782 13.2563`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M5.92542 2.90625L6.7436 4.3217`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M14.0909 17.0854L13.2727 15.6699`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M17.0855 5.90918L15.67 6.72736`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M2.91455 14.0911L4.33001 13.2729`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M10 16.5455C13.615 16.5455 16.5455 13.615 16.5455 10C16.5455 6.38509 13.615 3.45459 10 3.45459C6.38509 3.45459 3.45459 6.38509 3.45459 10C3.45459 13.615 6.38509 16.5455 10 16.5455Z`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,X.jsx)(`path`,{d:`M12.5854 9.77916L8.80545 7.59461C8.63363 7.49643 8.41272 7.61916 8.41272 7.81552V12.1846C8.41272 12.381 8.62545 12.5119 8.80545 12.4055L12.5854 10.221C12.7573 10.1228 12.7573 9.86916 12.5854 9.77098V9.77916Z`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:1.67,strokeLinecap:`round`,strokeLinejoin:`round`})]})]}),$=18,Ar=34,jr=Math.round(Ar*30/46);function Mr({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:g,onOpenAddBackend:_,onOpenManageBackends:v}){let{t:b}=S(`openhands`),x=g;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Fe(e),children:[(0,X.jsxs)(`div`,{className:B(e&&t?Le:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:B(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(hn,{logoWidth:Ar,logoHeight:jr,logoClassName:`max-w-none`,className:B(He,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:B(Pe,c?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(h,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:o,className:B(`hidden md:inline-flex ml-auto`,Be,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(N,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":b(y.SIDEBAR$CLOSE_MENU),className:B(`inline-flex ml-auto`,Be,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(N,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:Ve(e),children:[(0,X.jsx)(Ge,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(he,{width:$,height:$})}),(0,X.jsx)(Ge,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(Ge,{to:`/automations`,label:b(y.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(kr,{width:$,height:$})})]}),(0,X.jsx)(Or,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:B(Ve(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(qe,{content:b(y.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(G,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":b(y.SIDEBAR$SETTINGS),className:Re({collapsed:!0}),children:[(0,X.jsx)(We,{active:u.startsWith(`/settings`),children:(0,X.jsx)(dn,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Ie(!0),children:b(y.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":b(y.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:B(Re({collapsed:!0}),`relative`),children:[(0,X.jsx)(We,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(xt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(un,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Ie(!0),children:b(y.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(kn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:_,onOpenManageBackends:v})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:B(`flex flex-col items-stretch max-w-none box-border shrink-0`,`-ml-2.5 w-[calc(100%+0.625rem)] border-t border-[var(--oh-border)] pt-2 px-2.5`),children:(0,X.jsx)(kn,{sidebarCollapsed:e,openUpward:!0})})]})}var Nr=`openhands-sidebar`,Pr=`openhands-sidebar-collapsed`,Fr=Ct()(wt(e=>({collapsed:!1,setCollapsed:t=>e(e=>({collapsed:typeof t==`function`?t(e.collapsed):t})),toggleCollapsed:()=>e(e=>({collapsed:!e.collapsed}))}),{name:Nr,storage:Tt(()=>localStorage),partialize:e=>({collapsed:e.collapsed})}));if(typeof window<`u`)try{let e=window.localStorage.getItem(Pr);window.localStorage.getItem(Nr)===null&&(e===`true`||e===`false`)&&Fr.setState({collapsed:e===`true`}),e!==null&&window.localStorage.removeItem(Pr)}catch{}var Ir=Y.lazy(()=>n(()=>import(`./settings-modal-CCaPYVqW.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50]))),Lr=Y.lazy(()=>n(()=>import(`./add-backend-modal-BdYxoUdL.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([51,1,9,52,14,53,54,16,17,10,18,23,21,22,15,19,20,55,46,24,25,7,26,32,36,12,34,56,37,45,35]))),Rr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-CTA-2x4F.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([57,1,53,14,15,16,17,9,10,18,58,59,60,61,19,20,21,52,54,23,22,55,46,24,25,7,26,32,36,12,34,56,37,45,35,62]))),zr=250;function Br(){let{t:e}=S(`openhands`),{currentPath:t}=Me(),{data:n}=Ae(),{data:r,error:i,isError:a,isFetching:o}=Pt(),{backends:s,active:c}=H(),l=bt(s)[c.backend.id],u=Fr(e=>e.collapsed),d=Fr(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[b,x]=Y.useState(!1),[C,w]=Y.useState(!1),T=Y.useRef(!1),[,E]=Y.useReducer(e=>e+1,0),{isOpen:D,close:O}=I(),[k,A]=Y.useState(!1),[j,M]=Y.useState(!1),N=Nt(()=>h(!1)),P=Ft(i);Y.useEffect(()=>{O()},[t,O]),Y.useEffect(()=>{if(D){A(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{A(!1)},zr);return()=>window.clearTimeout(e)},[D]),Y.useEffect(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D,O]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&P!==404?pe(`Something went wrong while fetching settings. Please reload the page.`):P===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,P,n?.feature_flags?.hide_llm_settings]);let F=r?.email_verified===!1,L=e(u?y.SIDEBAR$EXPAND:y.SIDEBAR$COLLAPSE),ee=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),R={linkDisabled:F,collapseToggleLabel:L,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,E(),d(!0),window.setTimeout(()=>{T.current=!1,E()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ee,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:B(`max-md:hidden flex bg-base flex-col min-h-0 transition-[width,min-width] duration-200`,`md:border-r md:border-[var(--oh-border)] md:h-full`,u?`md:w-[60px] md:min-w-[60px] md:px-2.5`:`md:w-[300px] md:min-w-[300px] pb-2 md:pl-2.5 md:pr-0`,t===`/`&&`md:pb-3`),children:(0,X.jsx)(Mr,{collapsed:u,showCollapseToggle:!0,...R})}),k?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:B(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,j?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${zr}ms`},onClick:O,"aria-hidden":!j}),(0,X.jsx)(`aside`,{"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!j,className:B(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,j?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${zr}ms`},children:(0,X.jsx)(Mr,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:O,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Ir,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Lr,{onClose:()=>v(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Rr,{onClose:()=>x(!1)})})]})}var Vr=`/settings`,Hr=`/customize`,Ur=[`/skills`,`/mcp`,`/plugins`];function Wr(e){return e===Vr?{mode:`menu`}:e.startsWith(`${Vr}/`)&&e.length>9?{mode:`back`,backTo:Vr,backLabelKey:y.SETTINGS$TITLE}:e===Hr?{mode:`menu`}:Ur.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Hr,backLabelKey:y.NAV$CUSTOMIZE}:{mode:`menu`}}function Gr(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Me(),r=Wr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(y.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(R,{}),r.mode===`back`&&r.backTo?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-back-button`,onClick:()=>n(r.backTo),"aria-label":e(r.backLabelKey??y.COMMON$BACK),className:L,children:(0,X.jsx)(N,{size:20,className:P,"aria-hidden":!0,strokeWidth:2})}):null]})}var Kr=()=>{let e=Ce(),{mutate:t}=Qt();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{Zt(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}},qr=()=>{let e=Ce(),{data:t}=Pt();Y.useEffect(()=>{!e||t===void 0||Zt(e,t.user_consents_to_analytics===!0)},[e,t])},Jr=()=>{let e=Ce(),{backend:t}=Se(),{data:n}=Pt(),r=Ue(),i=Y.useRef(!1),a=t.kind===`cloud`,o=a?r[t.id]?.userId??null:null,s=n?.user_consents_to_analytics;Y.useEffect(()=>{if(!(!e||!a||n===void 0)){if(s===!0&&o){e.identify(o,{email:n.email??n.git_user_email??void 0}),i.current=!0;return}(s===!1||i.current&&!o)&&(e.reset(),i.current=!1)}},[e,a,s,o,n?.email,n])};function Yr(e){switch(e){case V.RUNNING:return`🟢`;case V.FINISHED:case V.IDLE:case V.WAITING_FOR_CONFIRMATION:return`✅`;case V.PAUSED:return`⚪`;case V.ERROR:case V.STUCK:return`🔴`;default:return null}}var Xr=`OpenHands`,Zr=()=>{let{conversationId:e}=l(),{data:t}=$t(e??null),n=en(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Xr}`:Xr;if(!e)return i;let a=Yr(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Qr({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(Ne,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var $r=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-Cow6h62p.js`),__vite__mapDeps([63,1,12,10,9,19,20,64]))),ei=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-D4ndXdkQ.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([65,48,1,49,10,9,19,20,66,4,24,25,7,26,33,34,35,36,12,38,39,16,40,18,41,14,21,22,23,42,43,44,15,17,45,46,47,67]))),ti=Y.lazy(()=>n(()=>import(`./alert-banner-BzU93oDh.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([68,1,69,10,9,19,20,70,71,25,7,26,37,72,73,29]))),ni=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(y.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(y.ERROR$UNKNOWN)})})}),ri=o(function(){let e=p(),t=Zr(),{data:n}=Pt(),{migrateUserConsent:r}=Kr(),i=Ae(),[a,o]=Y.useState(!1);if(qr(),Jr(),Y.useEffect(()=>{n?.language&&C.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(ke,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname),c=se(e.search);return(0,X.jsx)(Qr,{children:(0,X.jsxs)(A,{children:[(0,X.jsxs)(`div`,{"data-testid":`root-layout`,className:`h-screen lg:min-w-5xl flex flex-col md:flex-row bg-base overflow-hidden p-0`,children:[(0,X.jsx)(`title`,{children:t}),(0,X.jsx)(Br,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Gr,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ti,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ei,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)($r,{})}),c?(0,X.jsx)(de,{}):null]})})});export{ni as ErrorBoundary,ri as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js","assets/rolldown-runtime-BFRubm34.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-CT1Z6Pdu.js";var t={name:`@openhands/agent-canvas`,version:`1.0.0-rc.5`,description:`Agent Canvas UI for OpenHands - run AI coding agents with a visual interface`,license:`MIT`,private:!1,type:`module`,repository:{type:`git`,url:`https://github.com/OpenHands/agent-canvas`},homepage:`https://github.com/OpenHands/agent-canvas#readme`,bugs:{url:`https://github.com/OpenHands/agent-canvas/issues`},bin:{"agent-canvas":`bin/agent-canvas.mjs`},engines:{node:`>=22.12.0`},dependencies:{"@heroui/react":`2.8.10`,"@microlink/react-json-view":`1.31.20`,"@monaco-editor/react":`4.7.0`,"@openhands/extensions":`github:OpenHands/extensions#8a6690071e0e9229ae70b30ff0352aff9e6fca21`,"@openhands/typescript-client":`1.24.3`,"@react-router/node":`7.14.2`,"@react-router/serve":`7.14.2`,"@tailwindcss/vite":`4.2.4`,"@tanstack/react-query":`5.100.9`,"@types/shell-quote":`^1.7.5`,"@uidotdev/usehooks":`2.4.1`,"@xterm/addon-fit":`0.11.0`,"@xterm/xterm":`6.0.0`,axios:`1.16.0`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,downshift:`9.3.2`,"framer-motion":`12.38.0`,i18next:`26.0.8`,"i18next-browser-languagedetector":`8.2.1`,"i18next-http-backend":`4.0.0`,isbot:`5.1.39`,"lucide-react":`1.14.0`,"monaco-editor":`0.55.1`,"posthog-js":`1.372.6`,react:`19.2.5`,"react-dom":`19.2.5`,"react-hot-toast":`2.6.0`,"react-i18next":`17.0.6`,"react-icons":`5.6.0`,"react-markdown":`10.1.0`,"react-router":`7.14.2`,"react-syntax-highlighter":`16.1.1`,"rehype-raw":`7.0.0`,"rehype-sanitize":`6.0.0`,"remark-breaks":`4.0.0`,"remark-gfm":`4.0.1`,"shell-quote":`^1.8.3`,"sirv-cli":`3.0.1`,"socket.io-client":`4.8.3`,"tailwind-merge":`3.5.0`,"tailwind-scrollbar":`4.0.2`,"unist-util-visit":`5.1.0`,uuid:`14.0.0`,vite:`8.0.10`,winston:`^3.19.0`,"winston-daily-rotate-file":`^5.0.0`,zustand:`5.0.12`},scripts:{dev:`node --env-file-if-exists=.env scripts/dev-with-automation.mjs`,"dev:static":`node --env-file-if-exists=.env scripts/dev-static.mjs`,"dev:extra-backend":`node --env-file-if-exists=.env scripts/dev-extra-backend.mjs`,"dev:minimal":`node --env-file-if-exists=.env scripts/dev-safe.mjs`,"dev:frontend":`npm run make-i18n && cross-env VITE_MOCK_API=false react-router dev`,"dev:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router dev`,build:`npm run build:app`,"build:mock":`npm run make-i18n && cross-env VITE_MOCK_API=true react-router build`,start:`npx sirv-cli build/ --single`,test:`npm run make-i18n && vitest run`,"test:e2e":`playwright test --pass-with-no-tests`,"test:e2e:live":`node --env-file-if-exists=.env tests/e2e/live/scripts/run-live-e2e.mjs`,"test:e2e:mock-llm":`playwright test --config=playwright.mock-llm.config.ts`,"test:e2e:mock-llm:docker":`playwright test --config=playwright.mock-llm-docker.config.ts`,"test:e2e:snapshots":`playwright test tests/e2e/snapshots --project=chromium --retries=0`,"test:e2e:snapshots:update":`playwright test tests/e2e/snapshots --project=chromium --update-snapshots`,"test:coverage":`npm run make-i18n && vitest run --coverage`,dev_wsl:`VITE_WATCH_USE_POLLING=true vite`,preview:`vite preview`,"make-i18n":`node scripts/make-i18n-translations.cjs`,prelint:`npm run make-i18n`,lint:`npm run typecheck && eslint src && prettier --check src/**/*.{ts,tsx}`,"lint:fix":`eslint src --fix && prettier --write src/**/*.{ts,tsx}`,prepare:`husky`,typecheck:`react-router typegen && tsc`,"typecheck:staged":`react-router typegen && npx tsc --noEmit --skipLibCheck`,"check-translation-completeness":`node scripts/check-translation-completeness.cjs`,"build:app":`npm run make-i18n && react-router build`,"build:lib":`npm run make-i18n && react-router typegen && cross-env BUILD_LIB=true VITE_APP_ENV=production vite build && tsc -p tsconfig.lib.json`,"build:docker":`node scripts/docker-build.mjs`},"lint-staged":{"src/**/*.{ts,tsx,js}":[`eslint --fix`,`prettier --write`],"src/**/*.{ts,tsx}":[`bash -c 'npm run typecheck:staged'`],"src/**/*":[`npm run check-translation-completeness`]},devDependencies:{"@eslint/eslintrc":`3.3.1`,"@eslint/js":`9.39.4`,"@mswjs/socket.io-binding":`0.2.0`,"@playwright/test":`1.59.1`,"@react-router/dev":`7.14.2`,"@tailwindcss/typography":`0.5.19`,"@tanstack/eslint-plugin-query":`5.100.9`,"@testing-library/dom":`10.4.1`,"@testing-library/jest-dom":`6.9.1`,"@testing-library/react":`16.3.2`,"@testing-library/user-event":`14.6.1`,"@types/mdast":`4.0.4`,"@types/node":`25.6.0`,"@types/react":`19.2.14`,"@types/react-dom":`19.2.3`,"@types/react-syntax-highlighter":`15.5.13`,"@typescript-eslint/eslint-plugin":`8.59.2`,"@typescript-eslint/parser":`8.59.2`,"@vercel/react-router":`1.3.0`,"@vitest/coverage-v8":`4.1.5`,"cross-env":`10.1.0`,eslint:`9.39.4`,"eslint-config-prettier":`10.1.8`,"eslint-import-resolver-typescript":`4.4.4`,"eslint-plugin-i18next":`6.1.4`,"eslint-plugin-import-x":`4.16.2`,"eslint-plugin-jsx-a11y":`6.10.2`,"eslint-plugin-prettier":`5.5.5`,"eslint-plugin-react":`7.37.5`,"eslint-plugin-react-hooks":`7.1.1`,"eslint-plugin-unused-imports":`4.4.1`,globals:`16.5.0`,husky:`9.1.7`,jsdom:`29.1.1`,"lint-staged":`16.4.0`,msw:`2.14.2`,"postcss-prefix-selector":`2.1.1`,prettier:`3.8.3`,tailwindcss:`4.2.4`,typescript:`6.0.3`,"vite-plugin-svgr":`5.2.0`,vitest:`4.1.5`},packageManager:`npm@10.5.0`,volta:{node:`22.12.0`},msw:{workerDirectory:[`public`]},overrides:{dompurify:`3.3.2`},main:`./dist/index.cjs`,module:`./dist/index.js`,types:`./dist/index.d.ts`,files:[`dist`,`bin`,`build`,`config`,`scripts`,`tools`],exports:{".":{types:`./dist/index.d.ts`,import:`./dist/index.js`,require:`./dist/index.cjs`},"./browser":{types:`./dist/components/browser/index.d.ts`,import:`./dist/components/browser/index.js`,require:`./dist/components/browser/index.cjs`},"./conversation":{types:`./dist/components/conversation/index.d.ts`,import:`./dist/components/conversation/index.js`,require:`./dist/components/conversation/index.cjs`},"./files":{types:`./dist/components/files/index.d.ts`,import:`./dist/components/files/index.js`,require:`./dist/components/files/index.cjs`},"./settings":{types:`./dist/components/settings/index.d.ts`,import:`./dist/components/settings/index.js`,require:`./dist/components/settings/index.cjs`},"./sidebar":{types:`./dist/components/sidebar/index.d.ts`,import:`./dist/components/sidebar/index.js`,require:`./dist/components/sidebar/index.cjs`},"./terminal":{types:`./dist/components/terminal/index.d.ts`,import:`./dist/components/terminal/index.js`,require:`./dist/components/terminal/index.cjs`},"./i18n":{types:`./dist/i18n/index.d.ts`,import:`./dist/i18n/index.js`,require:`./dist/i18n/index.cjs`},"./package.json":`./package.json`},peerDependencies:{react:`19.2.5`,"react-dom":`19.2.5`,"react-router":`7.14.2`}},n=`openhands-telemetry-consent`,r=`openhands-telemetry-first-use`,i=`openhands-telemetry-session`,a=`phc_kBtz5nKmxVRRQ7HtPwr2QX9eMC5j65zE86QKocVNwb4U`,o=`https://z.openhands.dev`,s=`https://us.posthog.com`,c=!1,l=null;function u(){return typeof window<`u`&&typeof localStorage<`u`}async function d(){if(!u())return null;if(l)return l;try{let{default:t}=await e(async()=>{let{default:e}=await import(`./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js`).then(e=>e.n);return{default:e}},__vite__mapDeps([0,1]));return l=t,t}catch{return null}}function f(){return typeof process<`u`&&{}?.DO_NOT_TRACK===`1`||typeof navigator<`u`&&(navigator.doNotTrack===`1`||typeof window<`u`&&window.doNotTrack===`1`)}async function p(e=!1){if(c)return l;let n=await d();return n?(n.init(a,{api_host:o,ui_host:s,opt_out_capturing_by_default:!e,capture_pageview:!1,autocapture:!1,persistence:`localStorage`,disable_session_recording:!0,loaded:e=>{e.register({package_name:t.name,package_version:t.version})}}),c=!0,n):null}function m(){if(!u())return`pending`;if(f())return`denied`;try{let e=localStorage.getItem(n);if(e===`granted`||e===`denied`)return e}catch{}return`pending`}async function h(e){if(u())try{localStorage.setItem(n,e);let t=await p();if(!t)return;e===`granted`?t.opt_in_capturing():t.opt_out_capturing()}catch{}}function g(){return m()===`granted`}function _(){if(!u())return!1;try{return localStorage.getItem(r)===`true`}catch{return!1}}function v(){if(u())try{localStorage.setItem(r,`true`)}catch{}}async function y(){if(f()||_())return;let e=await p(!0);e&&((e.has_opted_out_capturing?.()??!1)&&e.opt_in_capturing(),e.capture(`canvas_install`,{platform:typeof navigator<`u`?navigator.platform:`unknown`,user_agent:typeof navigator<`u`?navigator.userAgent:`unknown`,referrer:typeof document<`u`?document.referrer:``,url_origin:typeof window<`u`?window.location.origin:``,embedded:typeof window<`u`&&window.self!==window.top}),v(),m()!==`granted`&&e.opt_out_capturing())}function b(){if(!u())return!1;try{return sessionStorage.getItem(i)===`true`}catch{return!1}}function x(){if(u())try{sessionStorage.setItem(i,`true`)}catch{}}async function S(){if(!g()||b())return;let e=await p();e&&(e.capture(`canvas_new_session`,{is_first_use:!_()}),x())}async function C(e,t={}){if(!g())return;let n=await p();n&&n.capture(e,t)}async function w(){if(u())try{localStorage.removeItem(n),localStorage.removeItem(r),sessionStorage.removeItem(i),c&&l&&l.reset()}catch{}}export{y as a,C as i,m as n,S as o,h as r,w as t};
|
package/build/index.html
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>OpenHands</title><meta name="description" content="Let's Start Building!"/><link rel="icon" type="image/svg+xml" href="/favicon.svg"/><link rel="modulepreload" href="/assets/manifest-
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>OpenHands</title><meta name="description" content="Let's Start Building!"/><link rel="icon" type="image/svg+xml" href="/favicon.svg"/><link rel="modulepreload" href="/assets/manifest-08c25e0c.js"/><link rel="modulepreload" href="/assets/entry.client-Db3BpFL_.js"/><link rel="modulepreload" href="/assets/rolldown-runtime-BFRubm34.js"/><link rel="modulepreload" href="/assets/preload-helper-CT1Z6Pdu.js"/><link rel="modulepreload" href="/assets/vendor~entry.client-CySJvEhK.js"/><link rel="modulepreload" href="/assets/providers-Bpq3xFRA.js"/><link rel="modulepreload" href="/assets/declaration-IA661TBv.js"/><link rel="modulepreload" href="/assets/vendor~entry.client-Du9GpFmX.js"/><link rel="modulepreload" href="/assets/react-CM_dJw1Z.js"/><link rel="modulepreload" href="/assets/i18n-CyvU1o95.js"/><link rel="modulepreload" href="/assets/react-dom-hVBnwgwZ.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js"/><link rel="modulepreload" href="/assets/query-client-config-CITeuHD7.js"/><link rel="modulepreload" href="/assets/QueryClientProvider-7oLZ1RtQ.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~oli4dvxu-CBEOG8NF.js"/><link rel="modulepreload" href="/assets/context-BBqptpXX.js"/><link rel="modulepreload" href="/assets/option-service.api-DHOGfYKh.js"/><link rel="modulepreload" href="/assets/utils-CVcuFUYj.js"/><link rel="modulepreload" href="/assets/active-backend-context-CQTk4wD8.js"/><link rel="modulepreload" href="/assets/query-keys-CQaji0wJ.js"/><link rel="modulepreload" href="/assets/agent-server-ui-style-scope-Bhc5vpWO.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~h07fzaqi-D15MEcqi.js"/><link rel="modulepreload" href="/assets/mutation-CaJwPR9O.js"/><link rel="modulepreload" href="/assets/custom-toast-handlers-fgD4IYsu.js"/><link rel="modulepreload" href="/assets/health-store-d-d2ssv4.js"/><link rel="modulepreload" href="/assets/retrieve-axios-error-message-DbnSBc_1.js"/><link rel="modulepreload" href="/assets/createLucideIcon-C9OEnwvX.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~j8sdb9mk-oCzr0-9g.js"/><link rel="modulepreload" href="/assets/common-Cfviy7yT.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~skills-settings~m~o9nrx3fm-87v-LliW.js"/><link rel="modulepreload" href="/assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~lpdshwee-CTmh4bwd.js"/><link rel="modulepreload" href="/assets/llm-client-BnqeDPua.js"/><link rel="modulepreload" href="/assets/agent-server-client-options-Dvgeb3x4.js"/><link rel="modulepreload" href="/assets/agent-server-compatibility-BANjmMTo.js"/><link rel="modulepreload" href="/assets/settings-client-BUlG0Gzq.js"/><link rel="modulepreload" href="/assets/server-client-Cz8PyIbN.js"/><link rel="modulepreload" href="/assets/root-DVv3y8Fb.js"/><link rel="modulepreload" href="/assets/useTranslation-CbJtty1g.js"/><link rel="modulepreload" href="/assets/telemetry--BA6QguL.js"/><link rel="modulepreload" href="/assets/brand-button-BoiPxAGm.js"/><link rel="modulepreload" href="/assets/base-modal-Ba5WcNb6.js"/><link rel="modulepreload" href="/assets/loading-spinner-CFuA0UNt.js"/><link rel="modulepreload" href="/assets/modal-backdrop-B1si6TUd.js"/><link rel="modulepreload" href="/assets/modal-body-2Po2nl1e.js"/><link rel="modulepreload" href="/assets/use-config-DSzkljTq.js"/><link rel="modulepreload" href="/assets/color-themes-B9n7pBQl.js"/><link rel="modulepreload" href="/assets/modal-classes-9XTtWCtF.js"/><link rel="modulepreload" href="/assets/useQuery-JDs8UaWj.js"/><link rel="modulepreload" href="/assets/suspense-C9MBE_9N.js"/><link rel="stylesheet" href="/assets/root-CN7qsvxg.css"/></head><body data-agent-server-ui="" class="m-0"><div data-agent-server-ui="" style="--oh-color-logo:#cfb755;--oh-color-base:var(--cool-grey-950);--oh-color-base-secondary:var(--cool-grey-925);--oh-color-danger:#e76a5e;--oh-color-success:#a5e75e;--oh-color-basic:var(--cool-grey-400);--oh-color-tertiary:var(--cool-grey-800);--oh-color-tertiary-light:var(--cool-grey-300);--oh-color-content:var(--cool-grey-100);--oh-color-content-2:var(--cool-grey-50);--oh-background:var(--cool-grey-950);--oh-foreground:var(--cool-grey-100);--oh-surface:var(--cool-grey-925);--oh-surface-foreground:var(--cool-grey-100);--oh-surface-raised:var(--cool-grey-900);--oh-surface-deep:var(--cool-grey-975);--oh-overlay:var(--cool-grey-925);--oh-overlay-foreground:var(--cool-grey-100);--oh-muted:var(--cool-grey-400);--oh-text-secondary:var(--cool-grey-300);--oh-text-tertiary:var(--cool-grey-200);--oh-text-dim:var(--cool-grey-500);--oh-text-subtle:var(--cool-grey-600);--oh-interactive-hover:var(--cool-grey-700);--oh-interactive-hover-low:var(--cool-grey-900);--oh-interactive-active:var(--cool-grey-800);--oh-interactive-selected:var(--cool-grey-600);--oh-scrollbar:color-mix(in srgb, var(--cool-grey-400) 30%, transparent);--oh-scrollbar-hover:color-mix(in srgb, var(--cool-grey-400) 50%, transparent);--oh-default:var(--cool-grey-800);--oh-default-foreground:var(--cool-grey-100);--oh-accent-foreground:var(--cool-grey-950);--oh-success:#a5e75e;--oh-success-foreground:var(--cool-grey-950);--oh-warning-foreground:var(--cool-grey-950);--oh-danger:#e76a5e;--oh-danger-foreground:var(--cool-grey-50);--oh-segment:var(--cool-grey-925);--oh-segment-foreground:var(--cool-grey-100);--oh-border-width:1px;--oh-field-border-width:1px;--oh-border:var(--cool-grey-700);--oh-border-input:var(--cool-grey-600);--oh-border-subtle:var(--cool-grey-800);--oh-separator:rgba(113, 120, 136, 0.5);--oh-focus:#ffffff;--oh-status-success:#1FBD53;--oh-status-error:#FF684E;--oh-link:var(--cool-grey-100);--oh-radius:8px;--oh-field-radius:8px;--oh-surface-shadow:none;--oh-overlay-shadow:none;--oh-field-shadow:none;--oh-bg-dark:var(--cool-grey-950);--oh-bg-light:var(--cool-grey-900);--oh-bg-input:var(--cool-grey-800);--oh-bg-workspace:var(--cool-grey-925);--oh-text-editor-base:var(--cool-grey-400);--oh-text-editor-active:var(--cool-grey-300);--oh-bg-editor-sidebar:var(--cool-grey-925);--oh-bg-editor-active:var(--cool-grey-900);--oh-border-editor-sidebar:var(--cool-grey-800);--oh-bg-neutral-muted:color-mix(in srgb, var(--cool-grey-300) 20%, transparent)"><div class="dark min-h-screen text-foreground" data-theme="dark"><script>
|
|
2
2
|
console.log(
|
|
3
3
|
"💿 Hey developer 👋. You can provide a way better UX than this " +
|
|
4
4
|
"when your app is loading JS modules and/or running `clientLoader` " +
|
|
5
5
|
"functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback " +
|
|
6
6
|
"for more information."
|
|
7
7
|
);
|
|
8
|
-
</script><div data-rht-toaster="" style="position:fixed;z-index:9999;top:16px;left:16px;right:16px;bottom:16px;pointer-events:none"></div><div id="modal-portal-exit"></div></div></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_optimizeDeps":false,"unstable_passThroughRequests":false,"unstable_subResourceIntegrity":false,"unstable_trailingSlashAwareDataRequests":false,"unstable_previewServerPrerendering":false,"v8_middleware":false,"v8_splitRouteModules":false,"v8_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-
|
|
9
|
-
import * as route0 from "/assets/root-
|
|
8
|
+
</script><div data-rht-toaster="" style="position:fixed;z-index:9999;top:16px;left:16px;right:16px;bottom:16px;pointer-events:none"></div><div id="modal-portal-exit"></div></div></div><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_optimizeDeps":false,"unstable_passThroughRequests":false,"unstable_subResourceIntegrity":false,"unstable_trailingSlashAwareDataRequests":false,"unstable_previewServerPrerendering":false,"v8_middleware":false,"v8_splitRouteModules":false,"v8_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-08c25e0c.js";
|
|
9
|
+
import * as route0 from "/assets/root-DVv3y8Fb.js";
|
|
10
10
|
|
|
11
11
|
window.__reactRouterRouteModules = {"root":route0};
|
|
12
12
|
|
package/config/defaults.json
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Single source of truth for version pins, ports, paths, and defaults shared across the npm and Docker install paths. Read by scripts/dev-safe.mjs, scripts/dev-with-automation.mjs, docker/entrypoint.sh (via generated defaults.env), and .github/workflows/docker.yml.",
|
|
3
|
-
|
|
4
3
|
"versions": {
|
|
5
|
-
"agentServer": "1.
|
|
4
|
+
"agentServer": "1.26.0",
|
|
5
|
+
"agentCanvas": "1.0.0-rc.5",
|
|
6
6
|
"automation": "1.0.0a6",
|
|
7
7
|
"automationSdk": "1.22.1"
|
|
8
8
|
},
|
|
9
|
-
|
|
10
9
|
"images": {
|
|
11
10
|
"agentServer": "ghcr.io/openhands/agent-server",
|
|
12
11
|
"agentCanvas": "ghcr.io/openhands/agent-canvas"
|
|
13
12
|
},
|
|
14
|
-
|
|
15
13
|
"ports": {
|
|
16
14
|
"agentServer": 18000,
|
|
17
15
|
"automation": 18001,
|
|
18
16
|
"proxy": 8000
|
|
19
17
|
},
|
|
20
|
-
|
|
21
18
|
"paths": {
|
|
22
19
|
"stateSubdir": "agent-canvas",
|
|
23
20
|
"conversations": "agent-canvas/conversations",
|
|
24
21
|
"bashEvents": "agent-canvas/bash_events",
|
|
25
22
|
"automationDb": "automation/automations.db"
|
|
26
23
|
},
|
|
27
|
-
|
|
28
24
|
"packages": {
|
|
29
25
|
"agentServer": "openhands-agent-server",
|
|
30
26
|
"automation": "openhands-automation",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs`),
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../backend-registry/active-store.cjs`),t=require(`../../node_modules/@openhands/typescript-client/dist/client/mcp-client.cjs`),n=require(`../agent-server-client-options.cjs`);function r(e){return e.type===`stdio`?{type:`stdio`,command:e.command,...e.args?.length&&{args:e.args},...e.env&&Object.keys(e.env).length>0&&{env:e.env}}:{type:e.type,url:e.url,...e.api_key?{api_key:e.api_key}:{}}}var i=class{static async testServer(i){if(e.getActiveBackend().backend.kind===`cloud`)return{ok:!0,tools:[]};let{host:a,apiKey:o}=n.getAgentServerClientOptions(),s=new t.MCPClient({host:a,...o?{apiKey:o}:{}});try{return await s.testServer({server:r(i),...i.name?{name:i.name}:{},...i.timeout?{timeout:i.timeout}:{}})}finally{s.close()}}};exports.default=i;
|
|
2
2
|
//# sourceMappingURL=mcp-service.api.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-service.api.cjs","names":[],"sources":["../../../src/api/mcp-service/mcp-service.api.ts"],"sourcesContent":["import { MCPClient } from \"@openhands/typescript-client/clients\";\nimport type {\n MCPServerSpec,\n MCPTestResponse,\n} from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\nimport type { MCPServerConfig } from \"#/types/mcp-server\";\n\nfunction toMcpServerSpec(server: MCPServerConfig): MCPServerSpec {\n if (server.type === \"stdio\") {\n return {\n type: \"stdio\",\n command: server.command!,\n ...(server.args?.length && { args: server.args }),\n ...(server.env &&\n Object.keys(server.env).length > 0 && { env: server.env }),\n };\n }\n return {\n type: server.type,\n url: server.url!,\n ...(server.api_key ? { api_key: server.api_key } : {}),\n };\n}\n\nclass McpService {\n static async testServer(server: MCPServerConfig): Promise<MCPTestResponse> {\n const { host, apiKey } = getAgentServerClientOptions();\n const client = new MCPClient({ host, ...(apiKey ? { apiKey } : {}) });\n try {\n return await client.testServer({\n server: toMcpServerSpec(server),\n ...(server.name ? { name: server.name } : {}),\n ...(server.timeout ? { timeout: server.timeout } : {}),\n });\n } finally {\n client.close();\n }\n }\n}\n\nexport default McpService;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-service.api.cjs","names":[],"sources":["../../../src/api/mcp-service/mcp-service.api.ts"],"sourcesContent":["import { MCPClient } from \"@openhands/typescript-client/clients\";\nimport type {\n MCPServerSpec,\n MCPTestResponse,\n} from \"@openhands/typescript-client\";\nimport { getAgentServerClientOptions } from \"../agent-server-client-options\";\nimport { getActiveBackend } from \"../backend-registry/active-store\";\nimport type { MCPServerConfig } from \"#/types/mcp-server\";\n\nfunction toMcpServerSpec(server: MCPServerConfig): MCPServerSpec {\n if (server.type === \"stdio\") {\n return {\n type: \"stdio\",\n command: server.command!,\n ...(server.args?.length && { args: server.args }),\n ...(server.env &&\n Object.keys(server.env).length > 0 && { env: server.env }),\n };\n }\n return {\n type: server.type,\n url: server.url!,\n ...(server.api_key ? { api_key: server.api_key } : {}),\n };\n}\n\nclass McpService {\n static async testServer(server: MCPServerConfig): Promise<MCPTestResponse> {\n // The MCP connectivity-test endpoint lives on the local agent-server. It\n // spawns the configured stdio command / opens an SSE-or-SHTTP connection\n // from that process's environment. Cloud backends don't expose this\n // endpoint to the frontend — the MCP server would actually run inside the\n // cloud sandbox, which isn't reachable from the browser before the user\n // starts a conversation. Calling `getAgentServerClientOptions()` here for\n // a cloud-active session would throw `NoBackendAvailableError(\"No backend\n // is configured.\")` and block the install flow entirely. Short-circuit\n // with a synthetic success so saving proceeds; any real connection\n // failure surfaces inside the conversation runtime instead.\n if (getActiveBackend().backend.kind === \"cloud\") {\n return { ok: true, tools: [] };\n }\n const { host, apiKey } = getAgentServerClientOptions();\n const client = new MCPClient({ host, ...(apiKey ? { apiKey } : {}) });\n try {\n return await client.testServer({\n server: toMcpServerSpec(server),\n ...(server.name ? { name: server.name } : {}),\n ...(server.timeout ? { timeout: server.timeout } : {}),\n });\n } finally {\n client.close();\n }\n }\n}\n\nexport default McpService;\n"],"mappings":"gPASA,SAAS,EAAgB,EAAwC,CAU/D,OATI,EAAO,OAAS,QACX,CACL,KAAM,QACN,QAAS,EAAO,QAChB,GAAI,EAAO,MAAM,QAAU,CAAE,KAAM,EAAO,KAAM,CAChD,GAAI,EAAO,KACT,OAAO,KAAK,EAAO,IAAI,CAAC,OAAS,GAAK,CAAE,IAAK,EAAO,IAAK,CAC5D,CAEI,CACL,KAAM,EAAO,KACb,IAAK,EAAO,IACZ,GAAI,EAAO,QAAU,CAAE,QAAS,EAAO,QAAS,CAAG,EAAE,CACtD,CAGH,IAAM,EAAN,KAAiB,CACf,aAAa,WAAW,EAAmD,CAWzE,GAAI,EAAA,kBAAkB,CAAC,QAAQ,OAAS,QACtC,MAAO,CAAE,GAAI,GAAM,MAAO,EAAE,CAAE,CAEhC,GAAM,CAAE,OAAM,UAAW,EAAA,6BAA6B,CAChD,EAAS,IAAI,EAAA,UAAU,CAAE,OAAM,GAAI,EAAS,CAAE,SAAQ,CAAG,EAAE,CAAG,CAAC,CACrE,GAAI,CACF,OAAO,MAAM,EAAO,WAAW,CAC7B,OAAQ,EAAgB,EAAO,CAC/B,GAAI,EAAO,KAAO,CAAE,KAAM,EAAO,KAAM,CAAG,EAAE,CAC5C,GAAI,EAAO,QAAU,CAAE,QAAS,EAAO,QAAS,CAAG,EAAE,CACtD,CAAC,QACM,CACR,EAAO,OAAO"}
|