@openhands/agent-canvas 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README.windows.md +2 -2
- package/build/assets/{active-backend-context-B9942JGX.js → active-backend-context-BlZPzZNU.js} +1 -1
- package/build/assets/{agent-context-settings-BwAakl29.js → agent-context-settings-CTaN-Iw9.js} +1 -1
- package/build/assets/{agent-profiles-settings-BYU6aWus.js → agent-profiles-settings-CR4VTqv_.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-D7qh9amG.js → agent-server-conversation-service.api-Btmi4q6d.js} +3 -3
- package/build/assets/{agent-settings-DEPFl5hR.js → agent-settings-BIOsUglV.js} +1 -1
- package/build/assets/agent-settings-KQs-occT.js +1 -0
- package/build/assets/{api-key-entry-screen-B2kVLRDQ.js → api-key-entry-screen-BhR24gkM.js} +1 -1
- package/build/assets/{app-settings-B92bjTei.js → app-settings-Bs4sY8WP.js} +1 -1
- package/build/assets/{automation-detail-DoVSHQLs.js → automation-detail-CwDnJbYR.js} +1 -1
- package/build/assets/{automation-export-Ca2ehC-k.js → automation-export-Bu-r-EzL.js} +1 -1
- package/build/assets/{automations-list-ZHQSW8qD.js → automations-list-CYw7_6FR.js} +1 -1
- package/build/assets/{backend-form-modal-C0CIsQvd.js → backend-form-modal-Ce-KRHOJ.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-DdUfuSN8.js → backend-synced-settings-badge-BNpEylNP.js} +1 -1
- package/build/assets/{badge-B6q3sVom.js → badge-DwgrwohM.js} +1 -1
- package/build/assets/{browser-tab-Cir7KbAL.js → browser-tab-CEApjoEV.js} +1 -1
- package/build/assets/client-source-1v-kWLNU.js +1 -0
- package/build/assets/{cloud-funnel-analytics-CnCkPgQa.js → cloud-funnel-analytics-CasMM7EO.js} +1 -1
- package/build/assets/{condenser-settings-jNGOKFGz.js → condenser-settings-Czi8cKxV.js} +1 -1
- package/build/assets/conversation-C25pc2dT.js +1 -0
- package/build/assets/{conversation-DceG4LFS.js → conversation-CObLYSJd.js} +3 -3
- package/build/assets/conversation-panel-C25pc2dT.js +1 -0
- package/build/assets/{conversation-state-store-BORusMiV.js → conversation-state-store-DTq4hFoP.js} +1 -1
- package/build/assets/{entry.client-CCrlta8r.js → entry.client-DETaouwO.js} +1 -1
- package/build/assets/{extensions-hub-B2WudOET.js → extensions-hub-BKftOQ-X.js} +1 -1
- package/build/assets/{extensions-navigation-CYjIM65d.js → extensions-navigation-DF24q1H1.js} +1 -1
- package/build/assets/{files-tab-LSBijbEi.js → files-tab-SAiFCnS5.js} +1 -1
- package/build/assets/{git-provider-icon-DeQUgZVE.js → git-provider-icon-BREx-yUX.js} +1 -1
- package/build/assets/home-EPNFgzUh.js +1 -0
- package/build/assets/{home-BZclW6kd.js → home-sN90Xcxp.js} +1 -1
- package/build/assets/index-home-EPNFgzUh.js +1 -0
- package/build/assets/{install-server-modal-xCf76eim.js → install-server-modal-BI8yUfmr.js} +1 -1
- package/build/assets/{launch-Bik37u9Y.js → launch-Ccnhte5b.js} +1 -1
- package/build/assets/{llm-not-configured-banner-znJFsW_O.js → llm-not-configured-banner-DTWzISnk.js} +1 -1
- package/build/assets/llm-settings-BXk5_Pac.js +1 -0
- package/build/assets/{llm-settings-BYo9SN0I.js → llm-settings-C1vpgWam.js} +1 -1
- package/build/assets/{llm-subscription-service-_QUsVybQ.js → llm-subscription-service-W5BprsNA.js} +1 -1
- package/build/assets/{manage-backends-modal-n6PtHOER.js → manage-backends-modal-DhflyGTf.js} +1 -1
- package/build/assets/{manifest-e9bbad7b.js → manifest-8082e879.js} +1 -1
- package/build/assets/{markdown-renderer-Dkmjmx_d.js → markdown-renderer-CvOO0YIr.js} +1 -1
- package/build/assets/{mcp-BJUOnO6v.js → mcp-CxLPda-W.js} +1 -1
- package/build/assets/{messages-CYztjKLQ.js → messages-DINDkPNK.js} +1 -1
- package/build/assets/{onboarding-9pEMFGtN.js → onboarding-BegDrOKn.js} +1 -1
- package/build/assets/{onboarding-modal-dYsjXJwx.js → onboarding-modal-DdvE6rzw.js} +1 -1
- package/build/assets/{organization-service.api-HsxJhNCf.js → organization-service.api-CT2OQlLz.js} +1 -1
- package/build/assets/{planner-tab-Dr8B-ZBI.js → planner-tab-w6HT0N_A.js} +1 -1
- package/build/assets/{plugins-management-service-DEjBqDoT.js → plugins-management-service-DVkoM3eA.js} +1 -1
- package/build/assets/{profiles-service.api-BddMsEhq.js → profiles-service.api-CBafmAPO.js} +1 -1
- package/build/assets/{providers-BxJi3BMO.js → providers-9UzRB9mT.js} +1 -1
- package/build/assets/{proxy-CN3HaaOW.js → proxy-C79PCMjo.js} +1 -1
- package/build/assets/{recommended-automations-launcher-Dye8Li08.js → recommended-automations-launcher-BF2mtAKw.js} +1 -1
- package/build/assets/{root-D4hpCAq9.js → root-Sj7W28yE.js} +2 -2
- package/build/assets/{root-layout-a4-4sfbh.js → root-layout-DbhKVoc7.js} +3 -3
- package/build/assets/{schema-field-CZSs0hQP.js → schema-field-CV6bFnoL.js} +1 -1
- package/build/assets/{sdk-section-page-Di5mT86Y.js → sdk-section-page-BW-i45yr.js} +1 -1
- package/build/assets/{secrets-service-i4CCd-UN.js → secrets-service-BjK-bPN2.js} +1 -1
- package/build/assets/{secrets-settings-DPlA3moO.js → secrets-settings-D7U1ErCH.js} +1 -1
- package/build/assets/{settings-SHSt9Rq2.js → settings-Bj5Oo45A.js} +1 -1
- package/build/assets/{settings-index-D5dDKrDt.js → settings-index-COAdxm2Q.js} +1 -1
- package/build/assets/{settings-modal-DsJk2THd.js → settings-modal-CFnbQ8_4.js} +1 -1
- package/build/assets/{settings-service.api-i_HHIqJP.js → settings-service.api-DryhKdSr.js} +1 -1
- package/build/assets/{shared-conversation-DU1kwDTF.js → shared-conversation-CnMxy7p_.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-BlmI8OrA.js → sidebar-mobile-menu-toggle-U78hQRJ1.js} +1 -1
- package/build/assets/{skills-plugins-YJSV6A0M.js → skills-plugins-BPhaNpfx.js} +1 -1
- package/build/assets/{skills-settings-BbREHv_-.js → skills-settings-CcwMtnnJ.js} +1 -1
- package/build/assets/{task-list-tab-Dzim5ftn.js → task-list-tab-BmaTwjaS.js} +1 -1
- package/build/assets/{telemetry-B-2fXtqV.js → telemetry-cmCL3o6Z.js} +1 -1
- package/build/assets/{terminal-CYFAMiXx.js → terminal-BRcoba5B.js} +1 -1
- package/build/assets/{use-acp-credential-form-CuBXKNvP.js → use-acp-credential-form-B0_pZ_uS.js} +1 -1
- package/build/assets/{use-activate-agent-profile-CXDcjVt8.js → use-activate-agent-profile-DH33MvVj.js} +1 -1
- package/build/assets/{use-agent-profiles-CliaHofi.js → use-agent-profiles-Dmd_4H8q.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Uai-HHx2.js → use-can-manage-org-profiles-CrG1km7R.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-BzamKpu-.js → use-cloud-current-user-id-B6DP3s47.js} +1 -1
- package/build/assets/{use-config-DPEYpfIj.js → use-config-Csy8EAP9.js} +1 -1
- package/build/assets/{use-create-conversation-DzcM79TE.js → use-create-conversation-Dsa4nzU9.js} +1 -1
- package/build/assets/{use-create-secret-2YLjoQw-.js → use-create-secret-BnxuAjDt.js} +1 -1
- package/build/assets/{use-llm-profiles-Ci3zAVzV.js → use-llm-profiles-BMQoc612.js} +1 -1
- package/build/assets/{use-onboarding-completion-STApsofr.js → use-onboarding-completion-B-2BTS-y.js} +1 -1
- package/build/assets/{use-plugins-marketplace-CzzdrUSK.js → use-plugins-marketplace-PBc_XNz_.js} +1 -1
- package/build/assets/{use-save-agent-profile-Q2M72WgR.js → use-save-agent-profile-2Mk9ZX37.js} +1 -1
- package/build/assets/{use-save-settings-BZK7zVsK.js → use-save-settings-BRh9p_fv.js} +1 -1
- package/build/assets/{use-settings-BKpkUS4y.js → use-settings-DBI44RnH.js} +1 -1
- package/build/assets/{use-settings-nav-items-BlXge_bf.js → use-settings-nav-items-Cva28C-c.js} +1 -1
- package/build/assets/{use-skills-BltA9XrV.js → use-skills-RQsCtdzN.js} +1 -1
- package/build/assets/{use-tracking-De7qByD4.js → use-tracking-CN1nIMnY.js} +1 -1
- package/build/assets/{use-user-conversation-43duhf7D.js → use-user-conversation-GnGhs_Ob.js} +1 -1
- package/build/assets/{verification-settings-B4DL3Tez.js → verification-settings-CaCzojbc.js} +1 -1
- package/build/index.html +4 -4
- package/config/defaults.json +1 -1
- package/dist/config/defaults.cjs +1 -1
- package/dist/config/defaults.cjs.map +1 -1
- package/dist/config/defaults.js +1 -1
- package/dist/config/defaults.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +6 -1
- package/dist/package.js.map +1 -1
- package/package.json +6 -1
- package/scripts/stryker-diff.mjs +137 -0
- package/build/assets/agent-settings-BbNLRtoh.js +0 -1
- package/build/assets/client-source-D8jWKBfE.js +0 -1
- package/build/assets/conversation-Do2Vg7uo.js +0 -1
- package/build/assets/conversation-panel-Do2Vg7uo.js +0 -1
- package/build/assets/home-C_R5pEbs.js +0 -1
- package/build/assets/index-home-C_R5pEbs.js +0 -1
- package/build/assets/llm-settings-BaM0zJg5.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{F as i,R as a,U as o,_ as s,d as c,m as l,u,v as d,z as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{C as h,j as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as _}from"./useQuery-B38jBavx.js";import{r as v}from"./providers-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-DhflyGTf.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Bcgpimp9.js","assets/active-backend-context-BlZPzZNU.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js","assets/utils-qjs_KuS4.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js","assets/useQuery-B38jBavx.js","assets/pencil-8_lvWDoZ.js","assets/plus-vIbGD459.js","assets/refresh-cw-D7CYLy-d.js","assets/trash-2-Bq4lHbTB.js","assets/backend-form-modal-Ce-KRHOJ.js","assets/client-source-1v-kWLNU.js","assets/use-tracking-CN1nIMnY.js","assets/proxy-C79PCMjo.js","assets/telemetry-cmCL3o6Z.js","assets/segmented-toggle-DbbD3Tve.js","assets/use-onboarding-completion-B-2BTS-y.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js","assets/useQueries-B3T1a7qt.js","assets/organization-service.api-CT2OQlLz.js","assets/brand-button-CQO8oqVo.js","assets/form-control-classes-CSPevi7c.js","assets/settings-input-BjW_zyTN.js","assets/modal-backdrop-X-vKo61e.js","assets/modal-body-DQhiw-AR.js","assets/modal-close-button-turIYn0t.js","assets/navigation-context-BOGzIng3.js","assets/cloud-funnel-analytics-CasMM7EO.js","assets/modal-classes-YaEEa5eZ.js","assets/confirmation-modal-gZtbojCm.js","assets/use-cloud-current-user-id-B6DP3s47.js","assets/api-key-entry-screen-BhR24gkM.js","assets/onboarding-modal-DdvE6rzw.js","assets/recommended-automations-launcher-BF2mtAKw.js","assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js","assets/use-is-creating-conversation-CIAcnd8M.js","assets/conversation-store-C6hSXHw0.js","assets/settings-service.api-DryhKdSr.js","assets/settings-Chfn5xTD.js","assets/install-server-modal-BI8yUfmr.js","assets/useMutation-DyQXZFEF.js","assets/v4-DDdyfk2q.js","assets/secrets-service-BjK-bPN2.js","assets/styled-tooltip-DsjDnR_W.js","assets/use-settings-DBI44RnH.js","assets/skill-card-pill-row-D7XCz5uk.js","assets/extension-module-card-classes-Bo43vY5V.js","assets/circle-plus-check-toggle-E3Ecb_gg.js","assets/checkmark-CxdXtM3b.js","assets/x-mark-jcTkPiOB.js","assets/use-create-conversation-Dsa4nzU9.js","assets/use-agent-profiles-Dmd_4H8q.js","assets/agent-server-conversation-service.api-Btmi4q6d.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js","assets/profiles-service.api-CBafmAPO.js","assets/llm-subscription-service-W5BprsNA.js","assets/llm-subscription-DTqtBCWz.js","assets/acp-providers-BHKZvEm5.js","assets/plugins-management-service-DVkoM3eA.js","assets/use-llm-profiles-BMQoc612.js","assets/chat-send-button-D4614wUz.js","assets/check-BMOG005H.js","assets/circle-check-lvN_jFN5.js","assets/loader-circle-6zlEYCJw.js","assets/llm-settings-C1vpgWam.js","assets/back-nav-button-Be_L157B.js","assets/navigation-link-Bxmn-pCs.js","assets/copy-B8Y5ufoR.js","assets/external-link-Cnnd6ikC.js","assets/use-can-manage-org-profiles-CrG1km7R.js","assets/dropdown-classes-DQlj-MpS.js","assets/badge-DwgrwohM.js","assets/base-modal-CSHhJTSr.js","assets/sdk-section-page-BW-i45yr.js","assets/switch-skeleton-BQoOhQTB.js","assets/schema-field-CV6bFnoL.js","assets/dist-hOnv1nn2.js","assets/settings-dropdown-input-Dx6vlkgf.js","assets/combobox-caret-C8_eGdp2.js","assets/settings-switch-UNSf8K8I.js","assets/toggle-switch-BptY3XRG.js","assets/use-is-authed-BsS4XwSL.js","assets/typography-C6fuRTTT.js","assets/use-save-settings-BRh9p_fv.js","assets/copy-to-clipboard-button-C4l3CMSd.js","assets/copy-z7idLzWO.js","assets/loading-spinner-CcpnCr_d.js","assets/settings-section-header-context-CnIIQAUn.js","assets/u-check-circle-DBEvndTS.js","assets/u-edit-809W9D9T.js","assets/map-provider-CXU6issd.js","assets/settings-list-classes-gQdBahdt.js","assets/use-acp-credential-form-B0_pZ_uS.js","assets/use-create-secret-BnxuAjDt.js","assets/openhands-logo-CmYvJXBa.js","assets/use-activate-agent-profile-DH33MvVj.js","assets/use-save-agent-profile-2Mk9ZX37.js","assets/terminal-cMS3RgVE.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{St as t,xt as n,yt as r}from"./vendor-styling-Bcgpimp9.js";import{F as i,R as a,U as o,_ as s,d as c,m as l,u,v as d,z as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{n as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js";import{t as m}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{C as h,j as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as _}from"./useQuery-B38jBavx.js";import{r as v}from"./providers-9UzRB9mT.js";import{J as y,L as b,X as ee,Z as x,f as S,h as C,n as w,nt as T,pt as E,q as D,r as te,x as ne,y as re,yt as O}from"./active-backend-context-BlZPzZNU.js";import{z as k}from"./utils-qjs_KuS4.js";import{f as A}from"./telemetry-cmCL3o6Z.js";import{n as j,o as M,r as N,t as P}from"./use-onboarding-completion-B-2BTS-y.js";import{t as F}from"./loading-spinner-CcpnCr_d.js";import{t as I}from"./use-config-Csy8EAP9.js";import{n as L}from"./use-settings-DBI44RnH.js";import{t as R}from"./use-save-settings-BRh9p_fv.js";import{t as z}from"./modal-backdrop-X-vKo61e.js";import{n as B}from"./modal-body-DQhiw-AR.js";import{n as V,r as H}from"./base-modal-CSHhJTSr.js";import{t as U}from"./brand-button-CQO8oqVo.js";import{t as W}from"./navigation-context-BOGzIng3.js";import{i as G,n as K}from"./color-themes-DTj5Ylbr.js";var q=e(t(),1),ie=`/api/authenticate`,J=`/login`,Y=`returnTo`,ae=new Set([`localhost`,`127.0.0.1`,`::1`]);function oe(){return typeof window>`u`?`/`:`${window.location.pathname}${window.location.search}${window.location.hash}`}function se(){return typeof window>`u`?!1:ae.has(window.location.hostname)}function ce(){return D()===`cookie`&&!se()}async function le(){try{return await g.post(ie,null,{withCredentials:!0}),!0}catch(e){if(g.isAxiosError(e)&&e.response?.status===401)return!1;throw e}}function ue(e=oe()){return`${J}?${new URLSearchParams({[Y]:e}).toString()}`}function de(){typeof window>`u`||window.location.assign(ue())}var X=r();function fe({backend:e,onChoice:t}){let{t:n,ready:r}=m(E),i=M([e])[e.id]?.isConnected===!0,{data:a,isSuccess:o}=L(),{mutateAsync:s,isPending:c}=R(),[l,u]=q.useState(!1),[d,f]=q.useState(!1);q.useEffect(()=>{f(!1)},[e.id]);let p=i&&o&&a?.user_consents_to_analytics===null&&!d;return q.useEffect(()=>{if(r&&p){let e=setTimeout(()=>u(!0),50);return()=>clearTimeout(e)}u(!1)},[r,p]),!p||!l?null:(0,X.jsx)(z,{elevated:!0,"aria-label":n(k.TELEMETRY$CONSENT_TITLE),children:(0,X.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:async e=>{e.preventDefault();let n=new FormData(e.currentTarget).get(`analytics`)===`on`;try{await s({user_consents_to_analytics:n})}catch{return}f(!0),await A(n?`granted`:`denied`),t?.(n)},className:`flex flex-col gap-2`,children:(0,X.jsxs)(B,{className:`border border-[var(--oh-border)]`,children:[(0,X.jsx)(H,{title:n(k.TELEMETRY$CONSENT_TITLE)}),(0,X.jsx)(V,{children:n(k.TELEMETRY$CONSENT_DESCRIPTION)}),(0,X.jsx)(`p`,{className:`text-xs text-neutral-400`,children:n(k.TELEMETRY$BACKEND_SCOPE,{name:e.name,host:e.host})}),(0,X.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,X.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),n(k.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,X.jsx)(U,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,isDisabled:c,children:n(k.TELEMETRY$CONFIRM_PREFERENCES)})]})})})}function Z({onChoice:e}){let{backend:t}=w();return y()!==null||t.kind!==`local`?null:(0,X.jsx)(fe,{backend:t,onChoice:e})}function pe(){return q.useEffect(()=>{K(G())},[]),null}var me=q.lazy(()=>n(()=>import(`./manage-backends-modal-DhflyGTf.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__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]))),Q=q.lazy(()=>n(()=>import(`./api-key-entry-screen-BhR24gkM.js`),__vite__mapDeps([35,1,2,3,4,5,6,7,8,14,9,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32]))),he=q.lazy(()=>n(()=>import(`./onboarding-modal-DdvE6rzw.js`).then(e=>e.n).then(e=>({default:e.OnboardingModal})),__vite__mapDeps([36,1,2,3,4,5,6,7,37,38,8,39,30,40,16,15,17,18,41,42,43,44,45,46,24,25,26,47,27,29,48,9,32,49,50,51,52,53,54,55,56,57,21,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,23,74,75,76,28,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,14,19,20,22,31,98,99,100,101]))),ge=q.lazy(()=>n(()=>import(`./backend-form-modal-Ce-KRHOJ.js`).then(e=>e.i).then(e=>({default:e.BackendFormModal})),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32])));function _e({children:e}){return(0,X.jsxs)(`html`,{lang:`en`,children:[(0,X.jsxs)(`head`,{children:[(0,X.jsx)(`meta`,{charSet:`utf-8`}),(0,X.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,X.jsx)(c,{}),(0,X.jsx)(u,{})]}),(0,X.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,X.jsxs)(v,{contentClassName:`min-h-screen`,children:[(0,X.jsx)(pe,{}),e,(0,X.jsx)(h,{toastOptions:T}),(0,X.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,X.jsx)(d,{}),(0,X.jsx)(s,{})]})]})}function $(){return(0,X.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,X.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,X.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,X.jsx)(F,{size:`large`})})})})}function ve(){let e=p(),t=q.useCallback(()=>{b()&&(C(),e.invalidateQueries({queryKey:S.WEB_CLIENT_CONFIG}))},[e]);return(0,X.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(q.Suspense,{fallback:null,children:(0,X.jsx)(me,{onClose:t,recoveryMode:!0})})})}function ye({onClose:e}){let t=i(),n=a(),r=f(),o=t.pathname.match(/^\/conversations\/([^/]+)/)?.[1]??null,s=q.useMemo(()=>({currentPath:t.pathname,conversationId:o,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[o,t.pathname,n,r.location]);return y()===null?(0,X.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(W,{value:s,children:(0,X.jsx)(q.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(he,{onClose:e})})})}):(0,X.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,X.jsx)(q.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(ge,{mode:`add`,onClose:e,source:`manage_backends_modal`,hideCloseButton:!0})})})}var be=()=>[{rel:`icon`,type:`image/svg+xml`,href:O(`/favicon.svg`)}],xe=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],Se=o(function(){let e=ee(),t=!!b()?.apiKey,n=e&&!t,{active:r}=te(),i=y(),a=D(),o=i!==null,s=o&&r.backend.kind===`cloud`&&x(r.backend.host,i),{isCompleted:c,markCompleted:u}=P(),d=ce(),f=o?!d&&(!s||a!==`cookie`&&!c):!c,p=_({queryKey:S.MAIN_APP_COOKIE_AUTH,queryFn:le,enabled:d&&!f,retry:!1,staleTime:1e3*60*5,meta:{disableToast:!0}}),m=d&&!f&&p.isPending&&!p.isError,h=d&&p.data===!1,g=!d||p.data===!0||p.isError;q.useEffect(()=>{h&&de()},[h]);let v=I({enabled:!n&&!f&&g}),C=M(r.backend.kind===`cloud`&&g?[r.backend]:[])[r.backend.id],w=r.backend.kind===`cloud`&&C?.isConnected===!1&&N(C.lastError),T=r.backend.kind===`cloud`&&C?.disabled===!0&&j(C.lastError);return f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ye,{onClose:u}),(0,X.jsx)(Z,{})]}):m||h?(0,X.jsx)($,{}):n||re(v.error)?(0,X.jsx)(q.Suspense,{fallback:(0,X.jsx)($,{}),children:(0,X.jsx)(Q,{})}):v.isPending||v.isLoading?(0,X.jsx)($,{}):w||T||ne(v.error)?(0,X.jsx)(ve,{}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(l,{}),(0,X.jsx)(Z,{})]})});export{_e as Layout,Se as default,be as links,xe as meta};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-
|
|
2
|
-
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,bt as r,i,xt as a,yt as o}from"./vendor-styling-Bcgpimp9.js";import{B as s,F as c,I as l,L as u,R as d,U as f,V as p,W as m,k as h,m as g,z as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as v}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{a as y,l as b,o as x,t as S,u as C}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{E as w}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as T}from"./useQuery-B38jBavx.js";import{t as E}from"./use-is-creating-conversation-CIAcnd8M.js";import{J as D,gt as O,it as k,n as A,r as j,rt as M,z as N}from"./active-backend-context-B9942JGX.js";import{C as P,S as F,b as I,t as L,y as ee,z as R}from"./utils-qjs_KuS4.js";import{n as z}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as te}from"./check-BMOG005H.js";import{n as B,t as V}from"./vendor~root-layout~conversation-panel~conversation-DpA6fir3.js";import{r as H}from"./onboarding-modal-dYsjXJwx.js";import{n as U,t as ne}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js";import{a as re,c as ie,d as ae,f as oe,i as se,l as ce,n as W,o as le,p as ue,r as de,s as fe,t as pe,u as me}from"./onboarding-9pEMFGtN.js";import{n as he,t as ge}from"./format-time-delta-DuhE50B-.js";import{t as _e}from"./plus-vIbGD459.js";import{t as ve}from"./search-sKuYKllf.js";import{n as ye,r as be,t as xe}from"./sidebar-store-DwrYKwYr.js";import{a as Se}from"./llm-settings-BYo9SN0I.js";import{t as Ce}from"./trash-2-Bq4lHbTB.js";import{t as we}from"./x-EjvKGawc.js";import{a as Te,d as Ee,f as De,o as G,p as Oe,t as ke}from"./telemetry-B-2fXtqV.js";import{o as K}from"./use-onboarding-completion-STApsofr.js";import{t as Ae}from"./loading-spinner-CcpnCr_d.js";import{t as je}from"./use-config-DPEYpfIj.js";import{n as Me,t as Ne}from"./use-tracking-De7qByD4.js";import{n as q,t as Pe}from"./use-settings-BKpkUS4y.js";import{t as Fe}from"./use-save-settings-BZK7zVsK.js";import{t as Ie}from"./modal-backdrop-X-vKo61e.js";import{n as Le}from"./modal-body-DQhiw-AR.js";import{i as Re,r as ze}from"./base-modal-CSHhJTSr.js";import{_ as Be,c as Ve}from"./form-control-classes-CSPevi7c.js";import{n as He,t as Ue}from"./navigation-context-BOGzIng3.js";import{t as We}from"./openhands-logo-CmYvJXBa.js";import{t as Ge}from"./navigation-link-Bxmn-pCs.js";import{a as Ke,d as qe,f as Je,i as Ye,l as Xe,n as Ze,r as Qe,u as $e}from"./sidebar-layout-DXHtbEj1.js";import{n as et,t as tt}from"./sidebar-nav-link-pvUivfK2.js";import{t as nt}from"./styled-tooltip-DsjDnR_W.js";import{a as rt,d as it,f as at,i as ot,l as st,n as ct,o as J,r as lt,u as ut}from"./dropdown-classes-DQlj-MpS.js";import{r as dt,t as ft}from"./combobox-caret-C8_eGdp2.js";import{_ as pt,a as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,p as wt,r as Tt,t as Et,u as Dt,v as Ot}from"./git-provider-icon-DeQUgZVE.js";import{n as kt,t as At}from"./use-cloud-current-user-id-BzamKpu-.js";import{s as jt}from"./environment-switch-store-DVQZLFbj.js";import{d as Mt,f as Nt,l as Pt,t as Ft}from"./conversation-store-C6hSXHw0.js";import{o as It,r as Lt}from"./backend-form-modal-C0CIsQvd.js";import{t as Rt}from"./manage-backends-modal-n6PtHOER.js";import{n as zt,t as Bt}from"./agent-server-conversation-service.api-D7qh9amG.js";import{c as Vt,d as Ht,u as Ut}from"./acp-providers-BHKZvEm5.js";import{t as Wt}from"./use-is-authed-BsS4XwSL.js";import{a as Gt,i as Kt,n as qt,t as Jt}from"./conversation-state-store-BORusMiV.js";import{a as Yt,c as Xt,d as Zt,f as Qt,i as $t,l as en,o as tn,r as nn,s as rn,t as an,u as on}from"./sidebar-mobile-menu-toggle-BlmI8OrA.js";import{t as sn}from"./use-click-outside-element-DKqpqEEm.js";import{t as cn}from"./use-llm-profiles-Ci3zAVzV.js";import{n as ln}from"./use-create-conversation-DzcM79TE.js";import{r as un,t as dn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{n as fn,t as pn}from"./context-menu-list-item-BTHGFhIx.js";import{a as mn,i as hn,n as gn}from"./use-can-manage-org-profiles-Uai-HHx2.js";import{t as _n}from"./u-edit-809W9D9T.js";import{t as vn}from"./skills-CYFLsN5U.js";import{t as yn}from"./search-7DRiGm4Z.js";import{t as bn}from"./use-user-conversation-43duhf7D.js";var xn=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`}]]),Sn=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Cn=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`}]]),wn=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`}]]),Tn=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`}]]),En=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`}]]),Dn=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),On=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`}]]),kn=w(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),An=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`}]]),jn=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`}]]),Mn=w(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Y=e(n(),1),X=o(),Nn=46,Pn=30;function Fn({className:e,logoClassName:t,logoWidth:n=Nn,logoHeight:r=Pn}={}){let{t:i}=v(`openhands`);return(0,X.jsx)(Ge,{to:`/conversations`,"aria-label":i(R.BRANDING$OPENHANDS_LOGO),className:L(e),children:(0,X.jsx)(We,{width:n,height:r,className:L(`shrink-0`,t)})})}function In(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function Ln({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)(we,{size:14})})}function Rn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:L(dt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(ft,{})})}function zn({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:L(`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:L(`p-0`,ot)}),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:L(J,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:ut,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)(Ot,{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:L(`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`,Ve,`px-0 not-italic text-inherit`)})})}var Vn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Hn({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)(``);Y.useEffect(()=>()=>{_.current&&=(clearTimeout(_.current),null)},[]);let S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=ne({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===ne.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(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:L(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:Vn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Vn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:L(at,g?`w-auto`:`w-full`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,X.jsx)(Bn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(In,{}),n&&w&&(0,X.jsx)(Ln,{onClear:()=>T(null)}),(0,X.jsx)(Rn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(zn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Un=t({AddBackendModal:()=>Wn});function Wn({onClose:e}){return(0,X.jsx)(Lt,{mode:`add`,onClose:e})}var Gn=`::`;function Kn(e,t){return t?`${e}${Gn}${t}`:e}function qn(e){let[t,n]=e.split(Gn);return{backendId:t,orgId:n??null}}function Jn(e){return(0,X.jsx)(It,{isConnected:e?.isConnected??null})}function Yn(){return(0,X.jsx)(It,{isConnected:`unavailable`})}function Xn(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:Kn(e.id,null),label:e.name,prefix:Jn(i[e.id])});for(let e of s){let o=n[e.id],s=Jn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Kn(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:Kn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Zn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:o=!1}={}){let{t:s}=v(`openhands`),{backends:c,active:u,setActive:f}=j(),p=kt(),m=At(),h=K(c),g=d(),_=l(`/settings`),y=l(`/settings/*`),b=l(`/conversations/:conversationId`),x=l(`/automations/:automationId`),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),E=s(R.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>Xn(c,E,p,m,h),[c,E,p,m,h]),k=N(u.backend),A=s(R.BACKEND$NO_BACKEND_AVAILABLE),M=Kn(u.backend.id,u.orgId),P=k?void 0:O.find(e=>e.value===M),F=!!(_||y),I=s(R.SIDEBAR$SETTINGS),ee=Ft(e=>e.isRightPanelShown),z=!o||b&&ee?`top`:`left`,te=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||u.backend.kind!==`cloud`||u.orgId)return;let{backend:e}=u,t=p[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=m[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&f(e.id,a.id)},[u,p,m,f,k]);let B=Y.useCallback(()=>{if(i){i(),r?.();return}C(!0)},[i,r]),V=Y.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),H=D()!==null,U=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ne=Y.useCallback(e=>{U(e),B()},[B,U]),re=Y.useCallback(e=>{U(e),B()},[B,U]),ie=Y.useCallback(e=>{U(e),V()},[V,U]),ae=Y.useCallback(e=>{U(e),V()},[V,U]),oe=(0,X.jsxs)(`div`,{className:ot,children:[H?null:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:U,onTouchStart:U,onTouchEnd:re,onClick:ne,className:L(ct,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(_e,{width:16,height:16})}),s(R.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:U,onTouchStart:U,onTouchEnd:ae,onClick:ie,className:L(ct,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(be,{width:16,height:16})}),s(H?R.BACKEND$RECONNECT_CLOUD:R.BACKEND$MANAGE)]})]}),se=Y.useCallback(async e=>{if(e===M)return;let{backendId:t,orgId:n}=qn(e),i=c.find(e=>e.id===t);i&&(jt(O.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(i.id,n),r?.())},[M,c,b,x,g,O,f,s,r]);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)(Hn,{testId:`backend-selector`,defaultValue:P??{value:M,label:k?A:u.backend.name,prefix:k?Yn():Jn(h[u.backend.id])},footer:oe,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&se(e.value)},placeholder:k?A:u.backend.name,loading:te,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`},`${M}-${P?.label??``}`)}),t?null:(0,X.jsx)(nt,{content:I,placement:z,offset:10,children:(0,X.jsx)(Ge,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":F,"aria-label":I,className:L(F?`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`,Be),children:(0,X.jsx)(be,{width:16,height:16})})})]}),S?(0,X.jsx)(Wn,{onClose:()=>C(!1)}):null,w?(0,X.jsx)(Rt,{onClose:()=>T(!1)}):null]})}var Qn=`command-menu-trigger`,$n=18;function er({collapsed:e}){let{t}=v(`openhands`),n=ye(e=>e.open),r=t(R.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":Qn,"aria-label":r,onClick:n,className:L(Je({collapsed:e}),e?`cursor-pointer`:`group justify-between border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]/50 hover:border-[var(--oh-border)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e?(0,X.jsx)(et,{active:!1,children:(0,X.jsx)(ve,{width:$n,height:$n})}):(0,X.jsx)(`span`,{className:L(Ke,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(ve,{width:$n,height:$n})}),(0,X.jsx)(`span`,{className:$e(e),children:r})]}),e?null:(0,X.jsx)(`kbd`,{className:`rounded-md border border-[var(--oh-border)] bg-black/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--oh-text-dim)]`,children:t(R.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(nt,{content:r,placement:`right`,children:i}):i}var tr=(e=20)=>{let{data:t}=Wt(),n=A(),r=!N(n.backend);return C({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await Bt.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},nr=(e=10)=>T({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function rr({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=v(`openhands`);return(0,X.jsx)(Ie,{onClose:n,children:(0,X.jsxs)(Le,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(ze,{title:r(R.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Re,{text:r(R.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Re,{text:r(R.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function ir({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:L(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var ar=e=>{switch(e){case P.FINISHED:return`check`;case P.RUNNING:return`working`;case P.IDLE:case P.WAITING_FOR_CONFIRMATION:return`active`;case P.PAUSED:return`paused`;case P.ERROR:case P.STUCK:return`error`;default:return`unknown`}},or=(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 sr(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 cr({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=v(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:ar(e),o=r(or(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)(dn,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):sr(a)});return n?(0,X.jsx)(nt,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function lr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=yt(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)(cr,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(ir,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var ur=e(r(),1);function dr({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}=v(`openhands`),{backend:p}=A(),m=sn(e,d),h=p.kind===`cloud`?R.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:R.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)(Ot,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(fn,{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)(pn,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(_n,{width:16,height:16}),text:f(R.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(pn,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(St,{width:16,height:16}),text:f(R.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(pn,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(vn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(R.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(pn,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(wt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(pn,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(Xt,{width:16,height:16}),text:f(R.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(pn,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(Xt,{width:16,height:16}),text:f(R.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(pn,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(rn,{width:16,height:16}),text:f(R.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(pn,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(hn,{width:16,height:16}),text:f(R.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function fr({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=F(s),d=I(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)(gn,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:L(u&&`opacity-60`)}),e&&m&&h?(0,ur.createPortal)((0,X.jsx)(dr,{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]})}function pr(e){return e?e.split(`/`).pop()||e:null}var mr={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function hr({selectedRepository:e}){let t=e.git_provider?mr[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)(_t,{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)(un,{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 gr({workspaceWorkingDir:e}){let{t}=v(`openhands`),n=e?qt(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)(Kt,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(R.COMMON$NO_REPOSITORY)})]})}function _r({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,tags:d=null,showTags:f=!1}){let{t:p}=v(`openhands`),m=F(r),h=null;if(c)if(l===`acp`){let e=Vt(u)??p(R.CONVERSATION$ACP_AGENT_GENERIC),t=Ut(u,s),n=t??e;h={kind:Ht(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(h={kind:`openhands`,text:pr(s)??s,tooltip:s});let g=r===void 0?void 0:`pl-[26px]`,_=f?zt(d):[],y=_.slice(0,3),b=_.slice(3);return(0,X.jsxs)(`div`,{className:L(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,m&&`opacity-60`),children:[h?(0,X.jsx)(`div`,{className:g,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:h.tooltip,children:[(0,X.jsx)(H,{kind:h.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:h.text})]})}):null,_.length>0?(0,X.jsxs)(`div`,{className:L(`flex flex-row flex-wrap items-center gap-1 min-w-0`,g),children:[y.map(([e,t])=>(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-chip`,title:`${e}: ${t}`,className:`inline-flex max-w-full min-w-0 items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:(0,X.jsx)(`span`,{className:`truncate`,children:`${e}: ${t}`})},e)),b.length>0?(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-overflow`,title:b.map(([e,t])=>`${e}: ${t}`).join(`
|
|
3
|
-
`),className:`inline-flex items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:`+${b.length}`}):null]}):null,(0,X.jsxs)(`div`,{className:L(`flex flex-row items-center gap-2 w-full min-w-0`,a&&g),children:[a&&(e?.selected_repository?(0,X.jsx)(hr,{selectedRepository:e}):(0,X.jsx)(gr,{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:`${ge(t??n)} ${p(R.CONVERSATION$AGO)}`})})})]})]})}function vr(){let{t:e}=v(`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)(gt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(R.COMMON$ERROR)})]})}function yr({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:y=!1,agentKind:b=null,acpServer:x=null,tags:S=null,showTags:C=!1,isPinned:w=!1,onTogglePin:T,alwaysShowPinIcon:E=!1}){let{t:D}=v(`openhands`),{trackDownloadVsCodeButtonClicked:O}=Ne(),[k,A]=Y.useState(`view`),{mutateAsync:j}=Dt(),M=e=>{e!==``&&e!==a&&r?.(e),A(`view`)},N=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},F=e=>{e.preventDefault(),e.stopPropagation(),A(`edit`),p?.(!1)},I=async e=>{if(e.preventDefault(),e.stopPropagation(),O(),l)try{let e=await Gt.getVSCodeUrl(l);if(e.vscode_url){let t=en(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},ee=async e=>{e.preventDefault(),e.stopPropagation(),l&&await j(l),p?.(!1)},z=e=>{e.preventDefault(),e.stopPropagation(),T?.()},te=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":w,"aria-label":D(w?R.CONVERSATION_PANEL$UNPIN_CONVERSATION:R.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:z,className:L(`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`),children:(0,X.jsx)(kn,{className:L(`h-3.5 w-3.5`,w&&`fill-current`),"aria-hidden":!0})}),B=!!(t||r||i),V=B||!!T,H=E&&w&&!!T,U=g||y&&(b===`acp`||!!_)||C&&zt(S).length>0;return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:L(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,!f&&`hover:bg-[var(--oh-surface)]`,(m||f)&&`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)(lr,{title:a,titleMode:k,onTitleSave:M,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(vr,{})]}),(0,X.jsxs)(`div`,{className:L(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,H?`min-w-[3.75rem]`:V&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!H&&(c??s)&&(0,X.jsx)(`p`,{className:L(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,V&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:ge(s??c)})}),V?(0,X.jsxs)(`div`,{className:L(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,H?`pointer-events-auto visible opacity-100`:L(`pointer-events-none opacity-0 invisible`,`group-hover:pointer-events-auto group-hover:opacity-100 group-hover:visible`,`group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-focus-within:visible`),f&&`pointer-events-auto visible opacity-100`),children:[T?te():null,H&&(c??s)&&B?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:L(!f&&`invisible pointer-events-none group-hover:visible group-hover:pointer-events-auto group-focus-within:visible group-focus-within:pointer-events-auto`),children:(0,X.jsx)(fr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:ee,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:L(`pointer-events-none absolute inset-0 flex items-center justify-end`,`text-xs text-[var(--oh-muted)] whitespace-nowrap -translate-x-1.5`,`group-hover:hidden group-focus-within:hidden`,f&&`hidden`),children:(0,X.jsx)(`time`,{children:ge(s??c)})})]}):null,!H&&B?(0,X.jsx)(fr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:ee,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),U&&(0,X.jsx)(_r,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:y,agentKind:b,acpServer:x,tags:S,showTags:C})]})}var br={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function xr({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,X.jsx)(`span`,{className:`w-20 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-[var(--oh-foreground)]`,children:t})]})}function Sr({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,createdAt:o}){let{t:s}=v(`openhands`),c=r?.selected_repository??null,l=r?.selected_branch??null,u=r?.git_provider??null,d=u?br[u]:null,f=o?new Date(o).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null;return(0,X.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-3 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[t===void 0?null:(0,X.jsx)(`div`,{className:`mt-0.5`,children:(0,X.jsx)(cr,{executionStatus:t,sandboxStatus:n,showTooltip:!1})}),(0,X.jsx)(`span`,{className:`break-words text-sm font-medium text-white`,children:e})]}),(0,X.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xr,{label:s(R.CONVERSATION$REPOSITORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[d?(0,X.jsx)(d,{size:12,className:`mt-0.5 shrink-0`}):null,u===`azure_devops`?(0,X.jsx)(_t,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(xr,{label:s(R.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(un,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(xr,{label:s(R.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(ue,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(xr,{label:s(R.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(xr,{label:s(R.CONVERSATION$CREATED),children:f}):null]})]})}function Cr({taskStatus:e}){return(0,X.jsx)(`div`,{className:L(`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 wr({taskStatus:e}){let{t}=v(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:L(`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(ee(e))})}function Tr({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)(Cr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(wr,{taskStatus:t})]})}function Er({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=v(`openhands`);return(0,X.jsxs)(`div`,{className:L(`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)(hr,{selectedRepository:e}):(0,X.jsx)(gr,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${ge(t)} ${r(R.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function Dr({task:e,onClick:t}){let{t:n}=v(`openhands`),r=e.request.title||e.detail||n(R.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:L(`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)(Tr,{title:r,taskStatus:e.status})}),(0,X.jsx)(Er,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function Or({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 kr({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:a,lastUpdatedAt:o,createdAt:s,workspaceWorkingDir:c,isActive:l=!1,onClose:u,showRepositoryMetadata:d=!0,llmModel:f=null,showLlmProfiles:p=!1,agentKind:m=null,acpServer:h=null,tags:g=null,showTags:_=!1}){let{t:y}=v(`openhands`);return(0,X.jsx)(i,{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)(cr,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||y(R.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(_r,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:r,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h,tags:g,showTags:_})]}),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)(Ge,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>L(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||l?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(cr,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var Ar={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showTagsMetadata:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=Nt()(Mt(e=>({...Ar,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})),setShowTagsMetadata:t=>e(()=>({showTagsMetadata:t})),toggleShowTagsMetadata:()=>e(e=>({showTagsMetadata:!e.showTagsMetadata})),setShowHoverMetadata:t=>e(()=>({showHoverMetadata:t})),toggleShowHoverMetadata:()=>e(e=>({showHoverMetadata:!e.showHoverMetadata})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t})),setGroupFolderOrder:t=>e(()=>({groupFolderOrder:[...t]}))}),{name:`conversation-panel-preferences`,storage:Pt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showTagsMetadata:e.showTagsMetadata,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,groupFolderOrder:e.groupFolderOrder})})),jr=`px-2 pb-1 pt-1`,Mr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Nr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:L(jr,Mr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:L(`flex items-baseline justify-between gap-2`,jr),children:[(0,X.jsx)(`span`,{className:L(`min-w-0 truncate text-left`,Mr),children:e}),t]})}function Pr(){return(0,X.jsx)(Ot,{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:L(`group`,J,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:L(`h-3.5 w-3.5`,st),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(te,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Fr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Ir({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,showTagsMetadata:g,toggleShowTagsMetadata:_,showHoverMetadata:y,toggleShowHoverMetadata:b,totalConversationsCount:x,onRequestDeleteAll:S}){let{t:C}=v(`openhands`),w=C(r===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(e);return Y.useEffect(()=>{e?(E.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():D.current&&T.current?.focus(),D.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:T,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":C(R.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:L(`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)]`,lt),children:(0,X.jsx)(Dn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:E,role:`menu`,"aria-orientation":`vertical`,"aria-label":C(R.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=E.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:L(`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`,ot,it),children:[(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:ue,label:w,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:Sn,label:C(R.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:xn,label:C(R.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:Cn,label:C(R.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:On,label:C(R.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:jn,label:C(R.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:z,label:C(R.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:oe,label:C(R.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:Mn,label:C(R.CONVERSATION_PANEL$TAGS),selected:g,testId:`toggle-tags-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Q,{icon:he,label:C(R.CONVERSATION_PANEL$HOVER_METADATA),selected:y,testId:`toggle-hover-metadata`,onClick:()=>{b(),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:C(R.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:C(R.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?wn:Tn,label:Fr(C(u?R.CONVERSATION$HIDE:R.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:Ce,label:Fr(C(R.CONVERSATION$DELETE_ALL)),disabled:x===0,onClick:()=>{x!==0&&(S(),t(!1))}})]}):null]})}var Lr=L(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,rt);function Rr(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 zr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=He(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Rr(u,{open:s,enabled:i}),{data:f,error:p}=fe(),m=f?.workspaceParents??[],{mutate:h}=ce(),{mutate:g}=me(),{mutate:_}=ie(),{mutate:y}=ae(),{workspaces:b}=le(),x=re(p,a),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),{mutate:D,isPending:O}=ln(),k=E(),A=O||k;Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,S,w]),Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,S,w]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=J,N=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!x,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,z=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&C(!0)},className:M,children:a(R.HOME$ADD_WORKSPACES)}),te=x?(0,X.jsx)(nt,{content:x,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:z})}):z;return(0,X.jsxs)(`div`,{className:L(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:P,"aria-expanded":s,"aria-haspopup":`menu`,disabled:A})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:L(Lr,!i&&L(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:L(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,ot),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:A,"data-testid":`launch-no-workspace`,onClick:()=>j(),className:M,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(R.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:A,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>j(e.path),className:M,children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(xt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:L(`flex flex-col`,ot),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(Ot,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),te,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),T(!0)},className:M,children:a(R.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(se,{isOpen:S,onClose:()=>C(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(de,{isOpen:w,workspaces:b,workspaceParents:m,onClose:()=>T(!1),onRemove:e=>g(e),onRemoveParent:e=>y(e)})]})}function Br({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:ut,"aria-hidden":!0,children:(0,X.jsx)(xt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Vr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=He(),{providers:s}=ht(),{lastSelectedProvider:c,setLastSelectedProvider:l}=Ct(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Rr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,y]=Y.useState(``),b=Tt(_,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:x,isLoading:S,isError:C,hasNextPage:w,isFetchingNextPage:T,fetchNextPage:D}=mt({provider:h}),{data:O,isLoading:k}=bt(b,h),A=Y.useMemo(()=>x?.pages.flatMap(e=>e.items)??[],[x]),j=b?O??[]:A,{mutate:M,isPending:N}=ln(),P=E(),F=N||P;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 I=e=>{F||M({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`},entryPoint:`sidebar_cloud_menu`},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),y(``)},z=J;Y.useEffect(()=>{u&&(b||!w||T||S||j.length===0||j.length>=10||D())},[u,b,w,T,S,j.length,D]);let te=b?k:S,B=!b&&w&&j.length>0,V=Y.useCallback(()=>{d(e=>!e)},[]),H=u&&(!i||m!==null),U=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:L(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:V,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),H&&(0,X.jsxs)(`div`,{"data-testid":r,className:L(Lr,!i&&L(`absolute top-full mt-0`,n)),style:U,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:L(`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)(Et,{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)(yn,{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=>y(e.target.value),placeholder:a(R.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:L(`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)(Ot,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:L(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,ot),children:[te&&j.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(R.HOME$LOADING_REPOSITORIES)}),C&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(R.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!te&&!C&&j.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(R.GITHUB$NO_RESULTS)}),j.map(e=>(0,X.jsx)(Br,{repo:e,disabled:F,onSelect:I,itemClass:z},`${e.git_provider}:${e.id}`)),B&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:T,onClick:()=>D(),className:z,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(T?R.HOME$LOADING_MORE_REPOSITORIES:R.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Hr=L(`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 Ur({backendKind:e}){let{t}=v(`openhands`),n=t(R.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(En,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(zr,{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)(Vr,{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 Wr(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 Gr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Kr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function qr(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 Jr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Yr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Jr(t[n])-Jr(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 Zr(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 Qr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?Xr(n):Zr(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=Yr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:qr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Jr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function $r(e,t){if(t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function ei(e,t,n,r,i=`after`){if(n===r)return[...e];let a=$r(t.map(e=>({id:e})),e).map(e=>e.id),o=a.indexOf(n),s=a.indexOf(r);if(o<0||s<0)return[...e];let c=[...a];c.splice(o,1);let l=c.indexOf(r),u=i===`before`?l:l+1;return c.splice(u,0,n),c}function ti({group:e,expanded:t,previewExpanded:n,isDragging:r,dropIndicatorPosition:i,animateLayout:a,isCreatingConversationFlow:o,activeConversationId:s,onToggleExpanded:c,onDragStart:l,onDragEnd:u,onDragOver:d,onDragLeave:f,onDrop:p,onTogglePreviewExpanded:m,onLaunchFromGroup:h,renderConversationCard:g}){let{t:_}=v(`openhands`),y=(0,Y.useRef)(null),b=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,x=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:S,isPreviewTruncated:C,isShowingAll:w}=Wr(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(V.section,{ref:y,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":b,"data-testid":`thread-folder-${x}`,onDragOver:d,onDragLeave:f,onDrop:p,className:`relative rounded-md`,children:[i?(0,X.jsx)(`div`,{"aria-hidden":!0,"data-testid":`thread-folder-drop-indicator-${x}`,className:L(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-[var(--oh-accent)]`,i===`before`?`-top-0.5`:`-bottom-0.5`)}):null,(0,X.jsxs)(`div`,{className:L(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:L(`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`,draggable:!0,id:b,"aria-expanded":t,"aria-controls":`thread-folder-content-${x}`,"data-testid":`thread-folder-drag-${x}`,"aria-label":_(t?R.CONVERSATION_PANEL$COLLAPSE_FOLDER:R.CONVERSATION_PANEL$EXPAND_FOLDER,{label:e.label}),onClick:c,onDragStart:t=>{t.stopPropagation();let{dataTransfer:n}=t;if(n){n.effectAllowed=`move`,n.setData(`text/plain`,e.id);let r=y.current;if(r&&typeof n.setDragImage==`function`){let e=r.getBoundingClientRect(),i=r.cloneNode(!0);i.style.position=`fixed`,i.style.top=`0`,i.style.left=`-9999px`,i.style.width=`${e.width}px`,i.style.margin=`0`,i.style.pointerEvents=`none`,i.style.borderRadius=`0.5rem`,i.style.padding=`0.25rem`,i.style.backgroundColor=`var(--oh-surface-raised)`,i.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.35)`,document.body.appendChild(i),n.setDragImage(i,t.clientX-e.left,t.clientY-e.top),window.setTimeout(()=>i.remove(),0)}}l()},onDragEnd:e=>{e.stopPropagation(),u()},className:L(`group/folder flex min-h-8 min-w-0 flex-1 cursor-grab items-center gap-2 rounded-md py-1 text-left text-inherit outline-none active:cursor-grabbing`,`focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`),children:[(0,X.jsx)(ue,{className:L(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(U,{className:L(`h-4 w-4 shrink-0`,t?`block group-hover/folder:hidden`:`hidden group-hover/folder:block`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:L(`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:o,"aria-label":_(R.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${x}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h()},children:(0,X.jsx)(_e,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,X.jsxs)(`div`,{id:`thread-folder-content-${x}`,className:`mt-0.5 space-y-0.5`,children:[S.map(g),C?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${x}`,onClick:m,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:_(w?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function ni({groups:e,groupIds:t,groupFolderOrder:n,setGroupFolderOrder:r,collapsedGroupIds:i,expandedGroupPreviewIds:a,onToggleGroupCollapsed:o,onToggleGroupPreviewExpanded:s,isCreatingConversationFlow:c,activeConversationId:l,onLaunchFromGroup:u,renderConversationCard:d}){let{t:f}=v(`openhands`),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),S=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=(0,Y.useCallback)(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1),S.current=null},300)},[]),w=(0,Y.useCallback)(()=>{m(null),g(null),y(null)},[]),T=(0,Y.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),E=(0,Y.useCallback)((e,i)=>{if(!p||p===e){w(),C();return}r(ei(n,t,p,e,i)),w(),C()},[p,n,t,w,r,C]);return(0,X.jsx)(`nav`,{"aria-label":f(R.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(ti,{group:e,expanded:!i.has(e.id),previewExpanded:a.has(e.id),isDragging:p===e.id,dropIndicatorPosition:h===e.id&&p!==e.id?_:null,animateLayout:b,isCreatingConversationFlow:c,activeConversationId:l,onToggleExpanded:()=>o(e.id),onDragStart:()=>{x(!0),m(e.id)},onDragEnd:()=>{w(),C()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),g(e.id),y(T(t))},onDragLeave:()=>{g(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),E(e.id,T(t))},onTogglePreviewExpanded:()=>s(e.id),onLaunchFromGroup:()=>u(e.launch),renderConversationCard:d},e.id))})}function ri({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=v(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Wr(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:L(`pt-1`,i?`mb-2 border-b border-[var(--oh-border-subtle)] pb-2`:`pb-2`),children:[(0,X.jsxs)(`h3`,{className:`flex items-center gap-1.5 py-1.5 pl-2 text-sm font-normal text-[var(--oh-muted)]`,children:[(0,X.jsx)(kn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(R.CONVERSATION_PANEL$PINNED)]}),(0,X.jsx)(`div`,{className:`space-y-0.5`,children:s.map(a)}),c?(0,X.jsx)(`div`,{className:`pl-2 pt-0.5`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`conversation-panel-pinned-view-more`,onClick:n,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:o(l?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]})}var ii={pinsByBackendId:{}};function ai(e,t){return e[t]??[]}var oi=Nt()(Mt((e,t)=>({...ii,pinConversation:(n,r)=>{let i=ai(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=ai(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{ai(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=ai(t().pinsByBackendId,n),o=a.filter(e=>i.has(e));o.length!==a.length&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:o}}))}}),{name:`pinned-conversations`,storage:Pt(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),si=()=>{},ci=[],li=3600*1e3,ui=e=>{let t=Date.now()-li,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 di({onClose:e,compact:t=!1}){let{t:n}=v(`openhands`),{conversationId:r,navigate:a}=He(),{backend:o}=A(),s=sn(e??si),[c,l]=Y.useState(!1),[u,d]=Y.useState(!1),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Z(e=>e.showOlderConversations),_=Z(e=>e.toggleShowOlderConversations),y=Z(e=>e.showRepoBranchMetadata),b=Z(e=>e.toggleShowRepoBranchMetadata),x=Z(e=>e.showLlmProfiles),S=Z(e=>e.toggleShowLlmProfiles),C=Z(e=>e.showTagsMetadata),w=Z(e=>e.toggleShowTagsMetadata),T=Z(e=>e.showHoverMetadata),D=Z(e=>e.toggleShowHoverMetadata),O=Z(e=>e.organizeMode),j=Z(e=>e.setOrganizeMode),N=Z(e=>e.conversationSort),P=Z(e=>e.setConversationSort),F=Z(e=>e.threadScope),ee=Z(e=>e.setThreadScope),z=Z(e=>e.groupFolderOrder),te=Z(e=>e.setGroupFolderOrder),[B,V]=Y.useState(!1),[H,U]=Y.useState(!1),ne=sn(()=>{V(!1)}),[re,ie]=Y.useState(()=>new Set),[ae,oe]=Y.useState(()=>new Set),[se,ce]=Y.useState(!1),W=oi(e=>e.pinsByBackendId[o.id]??ci),le=oi(e=>e.togglePin),ue=oi(e=>e.pruneMissingConversations),de=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),fe=Y.useCallback(e=>{oe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{O!==`grouped`&&(ie(new Set),oe(new Set))},[O]);let pe=Y.useRef(null),[me,he]=Y.useState(null),[ge,_e]=Y.useState(null),[ve,ye]=Y.useState(null),{data:be,isLoading:xe,isFetched:Se,hasNextPage:Ce,isFetching:we,isFetchingNextPage:Te,fetchNextPage:Ee}=tr(),{data:De}=nr(),G=Y.useMemo(()=>{let e=be?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[be]),Oe=Y.useMemo(()=>Gr(W,G),[G,W]);Y.useEffect(()=>{Se&&ue(o.id,G.map(e=>e.id))},[o.id,G,Se,ue]),Y.useEffect(()=>{W.length===0&&ce(!1)},[W.length]);let ke=Y.useMemo(()=>{let e=F===`relevant`?G.filter(e=>I(e.execution_status)):G;return t?e:Kr(e,W)},[t,G,W,F]),{recent:K,older:Ae}=Y.useMemo(()=>ui(ke),[ke]),je=Y.useMemo(()=>Yr(g?[...K,...Ae]:K,N),[K,Ae,g,N]),Me=Y.useMemo(()=>({emptyWorkspace:n(R.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(R.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),Ne=Y.useMemo(()=>t||O!==`grouped`?null:Qr([...K,...g?Ae:[]],o.kind,N,Me),[o.kind,t,N,Me,Ae,O,K,g]),q=Y.useMemo(()=>Ne?$r(Ne,z):null,[Ne,z]),Pe=Y.useMemo(()=>Ne?.map(e=>e.id)??[],[Ne]),Fe=Y.useMemo(()=>Yr(K.filter(e=>I(e.execution_status)),N),[N,K]),Ie=je.length,Le=Y.useMemo(()=>q?q.reduce((e,t)=>e+t.conversations.length,0):0,[q]),Re=O===`grouped`&&!t?Le===0:Ie===0,ze=O===`grouped`&&!t?Le:Ie,[Be,Ve]=Y.useState(null),Ue=Y.useRef(ze);Ue.current=ze;let We=Y.useCallback(()=>{Ce&&Ve(Ue.current)},[Ce]);Y.useEffect(()=>{if(Be!==null){if(ze>Be){Ve(null);return}if(!Ce){Ve(null);return}we||Te||Ee()}},[Be,ze,Ce,we,Te,Ee]);let Ke=Be!==null||Te,{mutate:qe,mutateAsync:Je}=pt(),{mutate:Ye}=vt(),{mutate:Xe}=on(),Ze=Ae.length>0&&!g,Qe=!!Ce&&!Ze&&!t&&!Re,{mutate:$e}=ln(),et=E(),tt=Y.useCallback(e=>{et||$e({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[$e,et,a]),nt=Y.useCallback((e,t)=>{l(!0),he(e),_e(t)},[]),rt=Y.useCallback(e=>{d(!0),he(e)},[]),it=Y.useCallback((e,t)=>{Xe({conversationId:e,newTitle:t},{onSuccess:()=>{k(n(R.CONVERSATION$TITLE_UPDATED))}})},[n,Xe]),at=()=>{me&&qe({conversationId:me},{onSuccess:()=>{me===r&&a(`/conversations`)}})},ot=()=>{me&&Ye({conversationId:me})},st=async()=>{let e=G.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Je({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),i=t.length-n.length;r!==null&&n.includes(r)&&a(`/conversations`),i>0&&M(`${i} conversation${i===1?``:`s`} could not be deleted.`)},ct=Y.useCallback((n,a)=>{let s=W.includes(n.id);return t?(0,X.jsx)(kr,{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:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C},n.id):(0,X.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!T||ve===n.id,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,content:(0,X.jsx)(Sr,{title:n.title??``,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,llmModel:n.llm_model,createdAt:n.created_at}),children:(0,X.jsx)(Ge,{to:`/conversations/${n.id}`,onClick:e,className:L(`block rounded-md transition-colors`,ve!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||ve===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(yr,{onDelete:()=>nt(n.id,n.title??``),onStop:()=>rt(n.id),onChangeTitle:e=>it(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:ve===n.id,onContextMenuToggle:e=>ye(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C,isPinned:s,onTogglePin:()=>le(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,r,it,nt,rt,e,ve,W,y,x,C,T,le]),J=xe||!Se,lt=!t&&!J&&Oe.length>0,ut=Se&&!xe&&!t&&Re&&!lt&&!De?.length;return(0,X.jsxs)(`div`,{ref:s,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:L(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,H?`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(R.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(Ur,{backendKind:o.kind}),(0,X.jsx)(Ir,{filterMenuOpen:B,setFilterMenuOpen:V,menuRef:ne,backendKind:o.kind,organizeMode:O,setOrganizeMode:j,conversationSort:N,setConversationSort:P,threadScope:F,setThreadScope:ee,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:y,toggleShowRepoBranchMetadata:b,showLlmProfiles:x,toggleShowLlmProfiles:S,showTagsMetadata:C,toggleShowTagsMetadata:w,showHoverMetadata:T,toggleShowHoverMetadata:D,totalConversationsCount:G.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:pe,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{U(e.currentTarget.scrollTop>0)},className:L(`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:[J&&(0,X.jsx)(Or,{compact:t}),!t&&ut&&(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(R.CONVERSATION$NO_CONVERSATIONS)})}),lt?(0,X.jsx)(ri,{pinnedConversations:Oe,isPreviewExpanded:se,onTogglePreviewExpanded:()=>ce(e=>!e),activeConversationId:r,showDivider:!t&&O===`chronological`,renderConversationCard:e=>ct(e,{inPinnedSection:!0})}):null,!t&&De?.map(t=>(0,X.jsx)(Ge,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Dr,{task:t})},t.id)),!J&&t?Fe.map(e=>ct(e)):null,!J&&!t&&O===`grouped`&&q&&q.length>0?(0,X.jsx)(ni,{groups:q,groupIds:Pe,groupFolderOrder:z,setGroupFolderOrder:te,collapsedGroupIds:re,expandedGroupPreviewIds:ae,onToggleGroupCollapsed:de,onToggleGroupPreviewExpanded:fe,isCreatingConversationFlow:et,activeConversationId:r,onLaunchFromGroup:tt,renderConversationCard:e=>ct(e)}):null,!J&&!t&&O===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:je.map(e=>ct(e))}):null,Qe&&(Ke?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(Or,{compact:t})}):(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:We,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(R.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(Qt,{onConfirm:()=>{at(),l(!1),_e(null)},onCancel:()=>{l(!1),_e(null)},conversationTitle:ge??void 0}),m&&(0,X.jsx)(Qt,{title:n(R.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(R.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:G.length}),onConfirm:async()=>{await st(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)(Zt,{onConfirm:()=>{ot(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(rr,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function fi({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)(di,{})})})}var pi=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,mi=34,hi=Math.round(mi*30/46);function gi({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,collapseToggleLabel:i,onCollapse:a,onExpand:o,showCollapsedExpandButton:s,isExtensionsActive:c,currentPath:l,activeBackendHealth:u,collapsedBackendPopoverOpen:d,setCollapsedBackendPopoverOpen:f,collapsedBackendPopoverRef:p,collapsedBackendCloseTimer:m,onOpenAddBackend:h,onOpenManageBackends:g}){let{t:_}=v(`openhands`),y=m;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Xe(e),children:[(0,X.jsxs)(`div`,{className:L(e&&t?Ze:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:L(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&s&&`opacity-0`),children:(0,X.jsx)(Fn,{logoWidth:mi,logoHeight:hi,logoClassName:`max-w-none`,className:L(Ke,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:L(Qe,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(b,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:a,className:L(`hidden md:inline-flex ml-auto`,Ye,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(B,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(R.SIDEBAR$CLOSE_MENU),className:L(`inline-flex ml-auto`,Ye,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(B,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:qe(e),children:[(0,X.jsx)(er,{collapsed:e}),(0,X.jsx)(tt,{to:`/conversations`,end:!0,label:_(R.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(_e,{width:$,height:$})}),(0,X.jsx)(tt,{to:`/customize`,label:_(R.NAV$CUSTOMIZE),testId:`sidebar-skills-link`,collapsed:e,forceActive:c,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)(tt,{to:`/automations`,label:_(R.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(pi,{width:$,height:$})})]}),(0,X.jsx)(fi,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:L(qe(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(nt,{content:_(R.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Ge,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(R.SIDEBAR$SETTINGS),className:Je({collapsed:!0}),children:[(0,X.jsx)(et,{active:l.startsWith(`/settings`),children:(0,X.jsx)(be,{width:$,height:$})}),(0,X.jsx)(`span`,{className:$e(!0),children:_(R.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:p,onMouseEnter:()=>{y.current&&=(clearTimeout(y.current),null),f(!0)},onMouseLeave:()=>{y.current=setTimeout(()=>f(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":_(R.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:L(Je({collapsed:!0}),`relative`),children:[(0,X.jsx)(et,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(It,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(An,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:$e(!0),children:_(R.BACKEND$MANAGE)})]}),d?(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)(Zn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:L(`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)(Zn,{sidebarCollapsed:e,openUpward:!0})})]})}var _i=Y.lazy(()=>a(()=>import(`./settings-modal-DsJk2THd.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,51,52,53,54,55,56,57,58,59,60,61]))),vi=Y.lazy(()=>a(()=>Promise.resolve().then(()=>Un).then(e=>({default:e.AddBackendModal})),void 0)),yi=Y.lazy(()=>a(()=>import(`./manage-backends-modal-n6PtHOER.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([62,1,2,3,4,5,6,7,8,11,63,64,65,66,67,47,46,18,48,68,69,26,70,25,34,15,29,33,31,71,14,72,32,73,74]))),bi=250;function xi(){let{t:e}=v(`openhands`),{currentPath:t}=He(),{data:n}=je(),{data:r,error:i,isError:a,isFetching:o}=q(),{backends:s,active:c}=j(),l=K(s)[c.backend.id],u=xe(e=>e.collapsed),d=xe(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,y]=Y.useState(!1),[b,x]=Y.useState(!1),[S,C]=Y.useState(!1),w=Y.useRef(!1),[,T]=Y.useReducer(e=>e+1,0),{isOpen:E,close:D}=tn(),[O,k]=Y.useState(!1),[A,N]=Y.useState(!1),P=sn(()=>h(!1)),F=Pe(i);Y.useEffect(()=>{D()},[t,D]),Y.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{N(!0)});return()=>cancelAnimationFrame(e)}N(!1);let e=window.setTimeout(()=>{k(!1)},bi);return()=>window.clearTimeout(e)},[E]),Y.useEffect(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,D]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&F!==404?M(e(R.SETTINGS$FETCH_ERROR)):F===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,F,n?.feature_flags?.hide_llm_settings,e]);let I=e(u?R.SIDEBAR$EXPAND:R.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]),z={collapseToggleLabel:I,onCollapse:Y.useCallback(()=>{C(!1),w.current=!0,T(),d(!0),window.setTimeout(()=>{w.current=!1,T()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&S&&!w.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:P,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>y(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ee,onMouseEnter:()=>{u&&C(!0)},onMouseLeave:()=>{C(!1)},className:L(`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)(gi,{collapsed:u,showCollapseToggle:!0,...z})}),O?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:L(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,A?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${bi}ms`},onClick:D,"aria-hidden":!A}),(0,X.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:L(`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`,A?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${bi}ms`},children:(0,X.jsx)(gi,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...z})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(_i,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(vi,{onClose:()=>y(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(yi,{onClose:()=>x(!1)})})]})}var Si=`/settings`,Ci=`/customize`,wi=[`/skills`,`/mcp`,`/plugins`];function Ti(e){return e===Si?{mode:`menu`}:e.startsWith(`${Si}/`)&&e.length>9?{mode:`back`,backTo:Si,backLabelKey:R.SETTINGS$TITLE}:e===Ci?{mode:`menu`}:wi.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Ci,backLabelKey:R.NAV$CUSTOMIZE}:{mode:`menu`}}function Ei(){let{t:e}=v(`openhands`),{currentPath:t,navigate:n}=He(),r=Ti(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(an,{}),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??R.COMMON$BACK),className:nn,children:(0,X.jsx)(B,{size:20,className:$t,"aria-hidden":!0,strokeWidth:2})}):null]})}function Di(){let{backend:e}=A(),t=e.kind===`local`,{data:n}=cn(),{mutate:r,isPending:i}=Se(),a=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{a.current=null},[e.id]),(0,Y.useEffect)(()=>{if(!t||i||!n)return;let{profiles:e,active_profile:o}=n,s=o!=null&&e.some(e=>e.name===o);if(e.length===0||s){a.current=null;return}let c=e.find(e=>e.api_key_set)??e[0];a.current!==c.name&&(a.current=c.name,r(c.name))},[t,n,i,r])}var Oi=()=>{let{backend:e}=A(),{data:t}=q(),{mutate:n,isPending:r}=Fe(`personal`,{retry:2}),i=Y.useSyncExternalStore(Oe,Te,()=>null),a=Y.useRef(null);Y.useEffect(()=>{if(t!==void 0){if(i!==null){if((t.user_consents_to_analytics===!0?`granted`:t.user_consents_to_analytics===!1?`denied`:null)===i){a.current=null,e.kind===`cloud`&&ke(i);return}if(e.kind!==`cloud`)return;let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}t.user_consents_to_analytics!==null&&De(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function ki(){let{backend:e}=A(),t=Y.useSyncExternalStore(Oe,G,()=>`pending`),n=Y.useRef(null);Y.useEffect(()=>{if(e.kind!==`local`||t===`pending`)return;let r=`${e.id}:${e.host}:${e.apiKey??``}:${t}`;n.current!==r&&(n.current=r,Me.syncTelemetryConsent(t).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Ai=`agent_canvas_cloud_cookie_backend_added`,ji=new Set;function Mi(e,t){return`${Ai}:${e}:${t}`}function Ni(e,t){let n=Mi(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||ji.has(n)}catch{return ji.has(n)}}function Pi(e,t){let n=Mi(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{ji.add(n)}}var Fi=()=>{let{backend:e,orgId:t}=A(),{data:n}=q(),{trackBackendAdded:r}=Ne(),i=Y.useRef(r),a=At(),o=e.kind===`cloud`?a[e.id]:void 0,s=o?.isLoading??!0,c=o?.userId??null,l=(n?.email||n?.git_user_email)?.trim()||void 0;Y.useEffect(()=>{i.current=r},[r]),Y.useEffect(()=>{if(e.kind!==`cloud`){Ee(null);return}if(!s){if(!c){Ee(null);return}Ee({userId:c,email:l,orgId:t}),e.authMode===`cookie`&&l&&!Ni(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),Pi(e.id,c))}},[e.authMode,e.id,e.kind,l,s,t,c])};function Ii(e){switch(e){case P.RUNNING:return`🟢`;case P.FINISHED:case P.IDLE:case P.WAITING_FOR_CONFIRMATION:return`✅`;case P.PAUSED:return`⚪`;case P.ERROR:case P.STUCK:return`🔴`;default:return null}}var Li=`OpenHands`,Ri=()=>{let{conversationId:e}=s(),{data:t}=bn(e??null),n=Jt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Li}`:Li;if(!e)return i;let a=Ii(n??t?.execution_status??null);return a?`${a} ${i}`:i};function zi({children:e}){let{pathname:t}=c(),n=d(),r=_(),i=u(),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)(Ue,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Bi=Y.lazy(()=>a(()=>import(`./environment-switch-overlay-D0FgCMqs.js`),__vite__mapDeps([75,1,2,8,5,6,76,7]))),Vi=Y.lazy(()=>a(()=>import(`./alert-banner-C1nzoXBC.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([77,1,2,78,4,5,8,6,11,79,80,7,14,81,44,38]))),Hi=Y.lazy(()=>a(()=>import(`./command-menu-N_BriUy8.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([82,1,2,83,4,5,8,6,84,85,86,87,88,7,14]))),Ui=m(function(){let e=p(),{t}=v(`openhands`);return h(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(R.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(R.ERROR$UNKNOWN)})})}),Wi=f(function(){let e=c(),t=Ri(),{data:n}=q(),r=je();if(ki(),Oi(),Fi(),Di(),Y.useEffect(()=>{n?.language&&O.changeLanguage(n.language)},[n?.language]),r.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(Ae,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=W(e.search);return(0,X.jsx)(zi,{children:(0,X.jsxs)(Yt,{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)(xi,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[i?null:(0,X.jsx)(Ei,{}),r.data&&(r.data.maintenance_start_time||r.data.faulty_models&&r.data.faulty_models.length>0||r.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Vi,{maintenanceStartTime:r.data.maintenance_start_time,faultyModels:r.data.faulty_models,errorMessage:r.data.error_message,updatedAt:r.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(g,{})})]})]}),(0,X.jsxs)(Y.Suspense,{fallback:null,children:[(0,X.jsx)(Bi,{}),(0,X.jsx)(Hi,{})]}),a?(0,X.jsx)(pe,{}):null]})})});export{Ui as ErrorBoundary,Wi as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-CFnbQ8_4.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/vendor-styling-Bcgpimp9.js","assets/active-backend-context-BlZPzZNU.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js","assets/utils-qjs_KuS4.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js","assets/llm-settings-C1vpgWam.js","assets/useMutation-DyQXZFEF.js","assets/useQuery-B38jBavx.js","assets/back-nav-button-Be_L157B.js","assets/navigation-link-Bxmn-pCs.js","assets/navigation-context-BOGzIng3.js","assets/form-control-classes-CSPevi7c.js","assets/copy-B8Y5ufoR.js","assets/external-link-Cnnd6ikC.js","assets/proxy-C79PCMjo.js","assets/profiles-service.api-CBafmAPO.js","assets/settings-service.api-DryhKdSr.js","assets/settings-Chfn5xTD.js","assets/llm-subscription-service-W5BprsNA.js","assets/llm-subscription-DTqtBCWz.js","assets/use-can-manage-org-profiles-CrG1km7R.js","assets/organization-service.api-CT2OQlLz.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-Bw4AuHN1.js","assets/dropdown-classes-DQlj-MpS.js","assets/badge-DwgrwohM.js","assets/settings-input-BjW_zyTN.js","assets/base-modal-CSHhJTSr.js","assets/modal-body-DQhiw-AR.js","assets/modal-classes-YaEEa5eZ.js","assets/modal-backdrop-X-vKo61e.js","assets/brand-button-CQO8oqVo.js","assets/sdk-section-page-BW-i45yr.js","assets/switch-skeleton-BQoOhQTB.js","assets/schema-field-CV6bFnoL.js","assets/dist-hOnv1nn2.js","assets/settings-dropdown-input-Dx6vlkgf.js","assets/combobox-caret-C8_eGdp2.js","assets/settings-switch-UNSf8K8I.js","assets/toggle-switch-BptY3XRG.js","assets/use-is-authed-BsS4XwSL.js","assets/typography-C6fuRTTT.js","assets/use-save-settings-BRh9p_fv.js","assets/use-tracking-CN1nIMnY.js","assets/client-source-1v-kWLNU.js","assets/telemetry-cmCL3o6Z.js","assets/use-settings-DBI44RnH.js","assets/extension-module-card-classes-Bo43vY5V.js","assets/copy-to-clipboard-button-C4l3CMSd.js","assets/checkmark-CxdXtM3b.js","assets/copy-z7idLzWO.js","assets/loading-spinner-CcpnCr_d.js","assets/settings-section-header-context-CnIIQAUn.js","assets/use-llm-profiles-BMQoc612.js","assets/u-check-circle-DBEvndTS.js","assets/u-edit-809W9D9T.js","assets/map-provider-CXU6issd.js","assets/settings-list-classes-gQdBahdt.js","assets/settings-utils-BL_Z9uIe.js","assets/manage-backends-modal-DhflyGTf.js","assets/pencil-8_lvWDoZ.js","assets/plus-vIbGD459.js","assets/refresh-cw-D7CYLy-d.js","assets/trash-2-Bq4lHbTB.js","assets/backend-form-modal-Ce-KRHOJ.js","assets/segmented-toggle-DbbD3Tve.js","assets/use-onboarding-completion-B-2BTS-y.js","assets/useQueries-B3T1a7qt.js","assets/modal-close-button-turIYn0t.js","assets/cloud-funnel-analytics-CasMM7EO.js","assets/confirmation-modal-gZtbojCm.js","assets/use-cloud-current-user-id-B6DP3s47.js","assets/environment-switch-overlay-D0FgCMqs.js","assets/environment-switch-store-DVQZLFbj.js","assets/alert-banner-C1nzoXBC.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js","assets/iconBase-B2rQun3J.js","assets/vendor~conversation-panel~conversation~alert-banner-BNzz5FuZ.js","assets/close-CDAVqnTn.js","assets/command-menu-N_BriUy8.js","assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js","assets/list-todo-_BXQzOiB.js","assets/search-sKuYKllf.js","assets/sidebar-store-DwrYKwYr.js","assets/conversation-store-C6hSXHw0.js","assets/x-EjvKGawc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,r as t}from"./rolldown-runtime-Cyuzqnbw.js";import{St as n,bt as r,i,xt as a,yt as o}from"./vendor-styling-Bcgpimp9.js";import{B as s,F as c,I as l,L as u,R as d,U as f,V as p,W as m,k as h,m as g,z as _}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js";import{t as v}from"./vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js";import{a as y,l as b,o as x,t as S,u as C}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-DD_UNO02.js";import{E as w}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CJ7amdtQ.js";import{t as T}from"./useQuery-B38jBavx.js";import{t as E}from"./use-is-creating-conversation-CIAcnd8M.js";import{J as D,gt as O,it as k,n as A,r as j,rt as M,z as N}from"./active-backend-context-BlZPzZNU.js";import{C as P,S as F,b as I,t as L,y as ee,z as R}from"./utils-qjs_KuS4.js";import{n as z}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-Be63Q2Ln.js";import{t as te}from"./check-BMOG005H.js";import{n as B,t as V}from"./vendor~root-layout~conversation-panel~conversation-DpA6fir3.js";import{r as H}from"./onboarding-modal-DdvE6rzw.js";import{n as U,t as ne}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-EShpjxey.js";import{a as re,c as ie,d as ae,f as oe,i as se,l as ce,n as W,o as le,p as ue,r as de,s as fe,t as pe,u as me}from"./onboarding-BegDrOKn.js";import{n as he,t as ge}from"./format-time-delta-DuhE50B-.js";import{t as _e}from"./plus-vIbGD459.js";import{t as ve}from"./search-sKuYKllf.js";import{n as ye,r as be,t as xe}from"./sidebar-store-DwrYKwYr.js";import{a as Se}from"./llm-settings-C1vpgWam.js";import{t as Ce}from"./trash-2-Bq4lHbTB.js";import{t as we}from"./x-EjvKGawc.js";import{a as Te,d as Ee,f as De,o as G,p as Oe,t as ke}from"./telemetry-cmCL3o6Z.js";import{o as K}from"./use-onboarding-completion-B-2BTS-y.js";import{t as Ae}from"./loading-spinner-CcpnCr_d.js";import{t as je}from"./use-config-Csy8EAP9.js";import{n as Me,t as Ne}from"./use-tracking-CN1nIMnY.js";import{n as q,t as Pe}from"./use-settings-DBI44RnH.js";import{t as Fe}from"./use-save-settings-BRh9p_fv.js";import{t as Ie}from"./modal-backdrop-X-vKo61e.js";import{n as Le}from"./modal-body-DQhiw-AR.js";import{i as Re,r as ze}from"./base-modal-CSHhJTSr.js";import{_ as Be,c as Ve}from"./form-control-classes-CSPevi7c.js";import{n as He,t as Ue}from"./navigation-context-BOGzIng3.js";import{t as We}from"./openhands-logo-CmYvJXBa.js";import{t as Ge}from"./navigation-link-Bxmn-pCs.js";import{a as Ke,d as qe,f as Je,i as Ye,l as Xe,n as Ze,r as Qe,u as $e}from"./sidebar-layout-DXHtbEj1.js";import{n as et,t as tt}from"./sidebar-nav-link-pvUivfK2.js";import{t as nt}from"./styled-tooltip-DsjDnR_W.js";import{a as rt,d as it,f as at,i as ot,l as st,n as ct,o as J,r as lt,u as ut}from"./dropdown-classes-DQlj-MpS.js";import{r as dt,t as ft}from"./combobox-caret-C8_eGdp2.js";import{_ as pt,a as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,p as wt,r as Tt,t as Et,u as Dt,v as Ot}from"./git-provider-icon-BREx-yUX.js";import{n as kt,t as At}from"./use-cloud-current-user-id-B6DP3s47.js";import{s as jt}from"./environment-switch-store-DVQZLFbj.js";import{d as Mt,f as Nt,l as Pt,t as Ft}from"./conversation-store-C6hSXHw0.js";import{o as It,r as Lt}from"./backend-form-modal-Ce-KRHOJ.js";import{t as Rt}from"./manage-backends-modal-DhflyGTf.js";import{n as zt,t as Bt}from"./agent-server-conversation-service.api-Btmi4q6d.js";import{c as Vt,d as Ht,u as Ut}from"./acp-providers-BHKZvEm5.js";import{t as Wt}from"./use-is-authed-BsS4XwSL.js";import{a as Gt,i as Kt,n as qt,t as Jt}from"./conversation-state-store-DTq4hFoP.js";import{a as Yt,c as Xt,d as Zt,f as Qt,i as $t,l as en,o as tn,r as nn,s as rn,t as an,u as on}from"./sidebar-mobile-menu-toggle-U78hQRJ1.js";import{t as sn}from"./use-click-outside-element-DKqpqEEm.js";import{t as cn}from"./use-llm-profiles-BMQoc612.js";import{n as ln}from"./use-create-conversation-Dsa4nzU9.js";import{r as un,t as dn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DRblkyXD.js";import{n as fn,t as pn}from"./context-menu-list-item-BTHGFhIx.js";import{a as mn,i as hn,n as gn}from"./use-can-manage-org-profiles-CrG1km7R.js";import{t as _n}from"./u-edit-809W9D9T.js";import{t as vn}from"./skills-CYFLsN5U.js";import{t as yn}from"./search-7DRiGm4Z.js";import{t as bn}from"./use-user-conversation-GnGhs_Ob.js";var xn=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`}]]),Sn=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Cn=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`}]]),wn=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`}]]),Tn=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`}]]),En=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`}]]),Dn=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),On=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`}]]),kn=w(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),An=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`}]]),jn=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`}]]),Mn=w(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Y=e(n(),1),X=o(),Nn=46,Pn=30;function Fn({className:e,logoClassName:t,logoWidth:n=Nn,logoHeight:r=Pn}={}){let{t:i}=v(`openhands`);return(0,X.jsx)(Ge,{to:`/conversations`,"aria-label":i(R.BRANDING$OPENHANDS_LOGO),className:L(e),children:(0,X.jsx)(We,{width:n,height:r,className:L(`shrink-0`,t)})})}function In(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-transparent border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function Ln({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)(we,{size:14})})}function Rn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:L(dt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(ft,{})})}function zn({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:L(`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:L(`p-0`,ot)}),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:L(J,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:ut,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)(Ot,{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:L(`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`,Ve,`px-0 not-italic text-inherit`)})})}var Vn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function Hn({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)(``);Y.useEffect(()=>()=>{_.current&&=(clearTimeout(_.current),null)},[]);let S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=ne({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===ne.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(``))}}),M=r||i,N=w?e.find(e=>e.value===w.value)??w:null,P=e=>j({...e,onChange:e=>{y(e.target.value),x(e.target.value)}});return(0,X.jsxs)(`div`,{className:L(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.current&&clearTimeout(_.current),_.current=setTimeout(()=>D(),150)}:void 0,children:[f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{...P({"aria-label":a??`Filter options`,tabIndex:-1}),style:Vn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Vn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:L(at,g?`w-auto`:`w-full`,M&&`cursor-not-allowed opacity-60`,l),children:[N?.prefix?(0,X.jsx)(`span`,{className:`flex items-center shrink-0`,children:N.prefix}):null,(0,X.jsx)(Bn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(In,{}),n&&w&&(0,X.jsx)(Ln,{onClear:()=>T(null)}),(0,X.jsx)(Rn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(zn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Un=t({AddBackendModal:()=>Wn});function Wn({onClose:e}){return(0,X.jsx)(Lt,{mode:`add`,onClose:e})}var Gn=`::`;function Kn(e,t){return t?`${e}${Gn}${t}`:e}function qn(e){let[t,n]=e.split(Gn);return{backendId:t,orgId:n??null}}function Jn(e){return(0,X.jsx)(It,{isConnected:e?.isConnected??null})}function Yn(){return(0,X.jsx)(It,{isConnected:`unavailable`})}function Xn(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:Kn(e.id,null),label:e.name,prefix:Jn(i[e.id])});for(let e of s){let o=n[e.id],s=Jn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Kn(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:Kn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Zn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:o=!1}={}){let{t:s}=v(`openhands`),{backends:c,active:u,setActive:f}=j(),p=kt(),m=At(),h=K(c),g=d(),_=l(`/settings`),y=l(`/settings/*`),b=l(`/conversations/:conversationId`),x=l(`/automations/:automationId`),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),E=s(R.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>Xn(c,E,p,m,h),[c,E,p,m,h]),k=N(u.backend),A=s(R.BACKEND$NO_BACKEND_AVAILABLE),M=Kn(u.backend.id,u.orgId),P=k?void 0:O.find(e=>e.value===M),F=!!(_||y),I=s(R.SIDEBAR$SETTINGS),ee=Ft(e=>e.isRightPanelShown),z=!o||b&&ee?`top`:`left`,te=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||u.backend.kind!==`cloud`||u.orgId)return;let{backend:e}=u,t=p[e.id];if(!t||t.orgs.length===0)return;let n=t.currentOrgId?t.orgs.find(e=>e.id===t.currentOrgId):void 0,r=m[e.id]?.userId??null,i=r?t.orgs.find(e=>e.id===r):void 0,a=n??i??t.orgs[0];a&&f(e.id,a.id)},[u,p,m,f,k]);let B=Y.useCallback(()=>{if(i){i(),r?.();return}C(!0)},[i,r]),V=Y.useCallback(()=>{if(a){a(),r?.();return}T(!0)},[a,r]),H=D()!==null,U=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ne=Y.useCallback(e=>{U(e),B()},[B,U]),re=Y.useCallback(e=>{U(e),B()},[B,U]),ie=Y.useCallback(e=>{U(e),V()},[V,U]),ae=Y.useCallback(e=>{U(e),V()},[V,U]),oe=(0,X.jsxs)(`div`,{className:ot,children:[H?null:(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:U,onTouchStart:U,onTouchEnd:re,onClick:ne,className:L(ct,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(_e,{width:16,height:16})}),s(R.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:U,onTouchStart:U,onTouchEnd:ae,onClick:ie,className:L(ct,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(be,{width:16,height:16})}),s(H?R.BACKEND$RECONNECT_CLOUD:R.BACKEND$MANAGE)]})]}),se=Y.useCallback(async e=>{if(e===M)return;let{backendId:t,orgId:n}=qn(e),i=c.find(e=>e.id===t);i&&(jt(O.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),b?g(`/conversations`):x&&g(`/automations`),f(i.id,n),r?.())},[M,c,b,x,g,O,f,s,r]);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)(Hn,{testId:`backend-selector`,defaultValue:P??{value:M,label:k?A:u.backend.name,prefix:k?Yn():Jn(h[u.backend.id])},footer:oe,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&se(e.value)},placeholder:k?A:u.backend.name,loading:te,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`},`${M}-${P?.label??``}`)}),t?null:(0,X.jsx)(nt,{content:I,placement:z,offset:10,children:(0,X.jsx)(Ge,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":F,"aria-label":I,className:L(F?`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`,Be),children:(0,X.jsx)(be,{width:16,height:16})})})]}),S?(0,X.jsx)(Wn,{onClose:()=>C(!1)}):null,w?(0,X.jsx)(Rt,{onClose:()=>T(!1)}):null]})}var Qn=`command-menu-trigger`,$n=18;function er({collapsed:e}){let{t}=v(`openhands`),n=ye(e=>e.open),r=t(R.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":Qn,"aria-label":r,onClick:n,className:L(Je({collapsed:e}),e?`cursor-pointer`:`group justify-between border border-[var(--oh-border-subtle)] bg-[var(--oh-surface)]/50 hover:border-[var(--oh-border)] hover:bg-[var(--oh-surface-raised)]`),children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e?(0,X.jsx)(et,{active:!1,children:(0,X.jsx)(ve,{width:$n,height:$n})}):(0,X.jsx)(`span`,{className:L(Ke,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(ve,{width:$n,height:$n})}),(0,X.jsx)(`span`,{className:$e(e),children:r})]}),e?null:(0,X.jsx)(`kbd`,{className:`rounded-md border border-[var(--oh-border)] bg-black/20 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-[0.12em] text-[var(--oh-text-dim)]`,children:t(R.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(nt,{content:r,placement:`right`,children:i}):i}var tr=(e=20)=>{let{data:t}=Wt(),n=A(),r=!N(n.backend);return C({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await Bt.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},nr=(e=10)=>T({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function rr({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=v(`openhands`);return(0,X.jsx)(Ie,{onClose:n,children:(0,X.jsxs)(Le,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(ze,{title:r(R.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Re,{text:r(R.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Re,{text:r(R.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function ir({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:L(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var ar=e=>{switch(e){case P.FINISHED:return`check`;case P.RUNNING:return`working`;case P.IDLE:case P.WAITING_FOR_CONFIRMATION:return`active`;case P.PAUSED:return`paused`;case P.ERROR:case P.STUCK:return`error`;default:return`unknown`}},or=(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 sr(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 cr({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=v(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:ar(e),o=r(or(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)(dn,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):sr(a)});return n?(0,X.jsx)(nt,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function lr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=yt(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)(cr,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(ir,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var ur=e(r(),1);function dr({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}=v(`openhands`),{backend:p}=A(),m=sn(e,d),h=p.kind===`cloud`?R.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:R.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)(Ot,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(fn,{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)(pn,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(_n,{width:16,height:16}),text:f(R.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(pn,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(St,{width:16,height:16}),text:f(R.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(pn,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(vn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(R.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(pn,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(wt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(pn,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(Xt,{width:16,height:16}),text:f(R.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(pn,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(Xt,{width:16,height:16}),text:f(R.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(pn,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(rn,{width:16,height:16}),text:f(R.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(pn,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(mn,{icon:(0,X.jsx)(hn,{width:16,height:16}),text:f(R.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function fr({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=F(s),d=I(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)(gn,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:L(u&&`opacity-60`)}),e&&m&&h?(0,ur.createPortal)((0,X.jsx)(dr,{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]})}function pr(e){return e?e.split(`/`).pop()||e:null}var mr={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function hr({selectedRepository:e}){let t=e.git_provider?mr[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)(_t,{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)(un,{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 gr({workspaceWorkingDir:e}){let{t}=v(`openhands`),n=e?qt(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)(Kt,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(R.COMMON$NO_REPOSITORY)})]})}function _r({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,tags:d=null,showTags:f=!1}){let{t:p}=v(`openhands`),m=F(r),h=null;if(c)if(l===`acp`){let e=Vt(u)??p(R.CONVERSATION$ACP_AGENT_GENERIC),t=Ut(u,s),n=t??e;h={kind:Ht(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(h={kind:`openhands`,text:pr(s)??s,tooltip:s});let g=r===void 0?void 0:`pl-[26px]`,_=f?zt(d):[],y=_.slice(0,3),b=_.slice(3);return(0,X.jsxs)(`div`,{className:L(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,m&&`opacity-60`),children:[h?(0,X.jsx)(`div`,{className:g,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:h.tooltip,children:[(0,X.jsx)(H,{kind:h.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:h.text})]})}):null,_.length>0?(0,X.jsxs)(`div`,{className:L(`flex flex-row flex-wrap items-center gap-1 min-w-0`,g),children:[y.map(([e,t])=>(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-chip`,title:`${e}: ${t}`,className:`inline-flex max-w-full min-w-0 items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:(0,X.jsx)(`span`,{className:`truncate`,children:`${e}: ${t}`})},e)),b.length>0?(0,X.jsx)(`span`,{"data-testid":`conversation-card-tag-overflow`,title:b.map(([e,t])=>`${e}: ${t}`).join(`
|
|
3
|
+
`),className:`inline-flex items-center rounded-sm bg-[var(--oh-surface-raised)] px-1 py-px text-[10px] leading-4 text-[var(--oh-muted)]`,children:`+${b.length}`}):null]}):null,(0,X.jsxs)(`div`,{className:L(`flex flex-row items-center gap-2 w-full min-w-0`,a&&g),children:[a&&(e?.selected_repository?(0,X.jsx)(hr,{selectedRepository:e}):(0,X.jsx)(gr,{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:`${ge(t??n)} ${p(R.CONVERSATION$AGO)}`})})})]})]})}function vr(){let{t:e}=v(`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)(gt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(R.COMMON$ERROR)})]})}function yr({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:y=!1,agentKind:b=null,acpServer:x=null,tags:S=null,showTags:C=!1,isPinned:w=!1,onTogglePin:T,alwaysShowPinIcon:E=!1}){let{t:D}=v(`openhands`),{trackDownloadVsCodeButtonClicked:O}=Ne(),[k,A]=Y.useState(`view`),{mutateAsync:j}=Dt(),M=e=>{e!==``&&e!==a&&r?.(e),A(`view`)},N=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},F=e=>{e.preventDefault(),e.stopPropagation(),A(`edit`),p?.(!1)},I=async e=>{if(e.preventDefault(),e.stopPropagation(),O(),l)try{let e=await Gt.getVSCodeUrl(l);if(e.vscode_url){let t=en(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},ee=async e=>{e.preventDefault(),e.stopPropagation(),l&&await j(l),p?.(!1)},z=e=>{e.preventDefault(),e.stopPropagation(),T?.()},te=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":w,"aria-label":D(w?R.CONVERSATION_PANEL$UNPIN_CONVERSATION:R.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:z,className:L(`flex shrink-0 cursor-pointer items-center justify-center rounded-md p-1`,`text-[var(--oh-muted)] hover:bg-white/10 hover:text-white`),children:(0,X.jsx)(kn,{className:L(`h-3.5 w-3.5`,w&&`fill-current`),"aria-hidden":!0})}),B=!!(t||r||i),V=B||!!T,H=E&&w&&!!T,U=g||y&&(b===`acp`||!!_)||C&&zt(S).length>0;return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:L(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,!f&&`hover:bg-[var(--oh-surface)]`,(m||f)&&`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)(lr,{title:a,titleMode:k,onTitleSave:M,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(vr,{})]}),(0,X.jsxs)(`div`,{className:L(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,H?`min-w-[3.75rem]`:V&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!H&&(c??s)&&(0,X.jsx)(`p`,{className:L(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,V&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:ge(s??c)})}),V?(0,X.jsxs)(`div`,{className:L(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,H?`pointer-events-auto visible opacity-100`:L(`pointer-events-none opacity-0 invisible`,`group-hover:pointer-events-auto group-hover:opacity-100 group-hover:visible`,`group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-focus-within:visible`),f&&`pointer-events-auto visible opacity-100`),children:[T?te():null,H&&(c??s)&&B?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:L(!f&&`invisible pointer-events-none group-hover:visible group-hover:pointer-events-auto group-focus-within:visible group-focus-within:pointer-events-auto`),children:(0,X.jsx)(fr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:ee,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:L(`pointer-events-none absolute inset-0 flex items-center justify-end`,`text-xs text-[var(--oh-muted)] whitespace-nowrap -translate-x-1.5`,`group-hover:hidden group-focus-within:hidden`,f&&`hidden`),children:(0,X.jsx)(`time`,{children:ge(s??c)})})]}):null,!H&&B?(0,X.jsx)(fr,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&N,onStop:n&&P,onEdit:r&&F,onDownloadViaVSCode:I,onDownloadConversation:ee,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),U&&(0,X.jsx)(_r,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:y,agentKind:b,acpServer:x,tags:S,showTags:C})]})}var br={bitbucket:S,bitbucket_data_center:S,github:y,gitlab:x};function xr({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex items-start gap-2 text-xs`,children:[(0,X.jsx)(`span`,{className:`w-20 shrink-0 text-[var(--oh-muted)]`,children:e}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-[var(--oh-foreground)]`,children:t})]})}function Sr({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,createdAt:o}){let{t:s}=v(`openhands`),c=r?.selected_repository??null,l=r?.selected_branch??null,u=r?.git_provider??null,d=u?br[u]:null,f=o?new Date(o).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):null;return(0,X.jsxs)(`div`,{className:`flex w-[280px] flex-col gap-3 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2`,children:[t===void 0?null:(0,X.jsx)(`div`,{className:`mt-0.5`,children:(0,X.jsx)(cr,{executionStatus:t,sandboxStatus:n,showTooltip:!1})}),(0,X.jsx)(`span`,{className:`break-words text-sm font-medium text-white`,children:e})]}),(0,X.jsxs)(`dl`,{className:`flex flex-col gap-1.5`,children:[c?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(xr,{label:s(R.CONVERSATION$REPOSITORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[d?(0,X.jsx)(d,{size:12,className:`mt-0.5 shrink-0`}):null,u===`azure_devops`?(0,X.jsx)(_t,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(xr,{label:s(R.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(un,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(xr,{label:s(R.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(ue,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(xr,{label:s(R.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(xr,{label:s(R.CONVERSATION$CREATED),children:f}):null]})]})}function Cr({taskStatus:e}){return(0,X.jsx)(`div`,{className:L(`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 wr({taskStatus:e}){let{t}=v(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:L(`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(ee(e))})}function Tr({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)(Cr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(wr,{taskStatus:t})]})}function Er({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=v(`openhands`);return(0,X.jsxs)(`div`,{className:L(`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)(hr,{selectedRepository:e}):(0,X.jsx)(gr,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${ge(t)} ${r(R.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function Dr({task:e,onClick:t}){let{t:n}=v(`openhands`),r=e.request.title||e.detail||n(R.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:L(`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)(Tr,{title:r,taskStatus:e.status})}),(0,X.jsx)(Er,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function Or({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 kr({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:a,lastUpdatedAt:o,createdAt:s,workspaceWorkingDir:c,isActive:l=!1,onClose:u,showRepositoryMetadata:d=!0,llmModel:f=null,showLlmProfiles:p=!1,agentKind:m=null,acpServer:h=null,tags:g=null,showTags:_=!1}){let{t:y}=v(`openhands`);return(0,X.jsx)(i,{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)(cr,{executionStatus:r,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||y(R.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(_r,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:r,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h,tags:g,showTags:_})]}),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)(Ge,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>L(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||l?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(cr,{executionStatus:r,sandboxStatus:a,showTooltip:!1})})})}var Ar={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showTagsMetadata:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=Nt()(Mt(e=>({...Ar,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})),setShowTagsMetadata:t=>e(()=>({showTagsMetadata:t})),toggleShowTagsMetadata:()=>e(e=>({showTagsMetadata:!e.showTagsMetadata})),setShowHoverMetadata:t=>e(()=>({showHoverMetadata:t})),toggleShowHoverMetadata:()=>e(e=>({showHoverMetadata:!e.showHoverMetadata})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t})),setGroupFolderOrder:t=>e(()=>({groupFolderOrder:[...t]}))}),{name:`conversation-panel-preferences`,storage:Pt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showTagsMetadata:e.showTagsMetadata,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,groupFolderOrder:e.groupFolderOrder})})),jr=`px-2 pb-1 pt-1`,Mr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Nr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:L(jr,Mr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:L(`flex items-baseline justify-between gap-2`,jr),children:[(0,X.jsx)(`span`,{className:L(`min-w-0 truncate text-left`,Mr),children:e}),t]})}function Pr(){return(0,X.jsx)(Ot,{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:L(`group`,J,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:L(`h-3.5 w-3.5`,st),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(te,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Fr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Ir({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,showTagsMetadata:g,toggleShowTagsMetadata:_,showHoverMetadata:y,toggleShowHoverMetadata:b,totalConversationsCount:x,onRequestDeleteAll:S}){let{t:C}=v(`openhands`),w=C(r===`local`?R.CONVERSATION_PANEL$BY_WORKSPACE:R.CONVERSATION_PANEL$BY_REPOSITORY),T=Y.useRef(null),E=Y.useRef(null),D=Y.useRef(e);return Y.useEffect(()=>{e?(E.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():D.current&&T.current?.focus(),D.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:T,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":C(R.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:L(`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)]`,lt),children:(0,X.jsx)(Dn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:E,role:`menu`,"aria-orientation":`vertical`,"aria-label":C(R.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=E.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:L(`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`,ot,it),children:[(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:ue,label:w,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:Sn,label:C(R.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:xn,label:C(R.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:Cn,label:C(R.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:On,label:C(R.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:jn,label:C(R.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{children:C(R.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:z,label:C(R.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:oe,label:C(R.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:Mn,label:C(R.CONVERSATION_PANEL$TAGS),selected:g,testId:`toggle-tags-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Q,{icon:he,label:C(R.CONVERSATION_PANEL$HOVER_METADATA),selected:y,testId:`toggle-hover-metadata`,onClick:()=>{b(),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Nr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:C(R.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:C(R.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?wn:Tn,label:Fr(C(u?R.CONVERSATION$HIDE:R.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Pr,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:Ce,label:Fr(C(R.CONVERSATION$DELETE_ALL)),disabled:x===0,onClick:()=>{x!==0&&(S(),t(!1))}})]}):null]})}var Lr=L(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,rt);function Rr(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 zr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=He(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Rr(u,{open:s,enabled:i}),{data:f,error:p}=fe(),m=f?.workspaceParents??[],{mutate:h}=ce(),{mutate:g}=me(),{mutate:_}=ie(),{mutate:y}=ae(),{workspaces:b}=le(),x=re(p,a),[S,C]=Y.useState(!1),[w,T]=Y.useState(!1),{mutate:D,isPending:O}=ln(),k=E(),A=O||k;Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,S,w]),Y.useEffect(()=>{if(!s||S||w)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,S,w]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=J,N=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!x,ee=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,z=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&C(!0)},className:M,children:a(R.HOME$ADD_WORKSPACES)}),te=x?(0,X.jsx)(nt,{content:x,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:z})}):z;return(0,X.jsxs)(`div`,{className:L(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:P,"aria-expanded":s,"aria-haspopup":`menu`,disabled:A})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:L(Lr,!i&&L(`absolute top-full mt-0`,n)),style:ee,children:[(0,X.jsxs)(`ul`,{className:L(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,ot),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:A,"data-testid":`launch-no-workspace`,onClick:()=>j(),className:M,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(R.HOME$NO_WORKSPACE_OPTION)})})}),b.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:A,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>j(e.path),className:M,children:[(0,X.jsx)(`span`,{className:ut,"aria-hidden":!0,children:(0,X.jsx)(xt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:L(`flex flex-col`,ot),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(Ot,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),te,(b.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),T(!0)},className:M,children:a(R.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(se,{isOpen:S,onClose:()=>C(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(de,{isOpen:w,workspaces:b,workspaceParents:m,onClose:()=>T(!1),onRemove:e=>g(e),onRemoveParent:e=>y(e)})]})}function Br({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:ut,"aria-hidden":!0,children:(0,X.jsx)(xt,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Vr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=v(`openhands`),{navigate:o}=He(),{providers:s}=ht(),{lastSelectedProvider:c,setLastSelectedProvider:l}=Ct(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Rr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,y]=Y.useState(``),b=Tt(_,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:x,isLoading:S,isError:C,hasNextPage:w,isFetchingNextPage:T,fetchNextPage:D}=mt({provider:h}),{data:O,isLoading:k}=bt(b,h),A=Y.useMemo(()=>x?.pages.flatMap(e=>e.items)??[],[x]),j=b?O??[]:A,{mutate:M,isPending:N}=ln(),P=E(),F=N||P;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 I=e=>{F||M({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`},entryPoint:`sidebar_cloud_menu`},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},ee=e=>{g(e),l(e),y(``)},z=J;Y.useEffect(()=>{u&&(b||!w||T||S||j.length===0||j.length>=10||D())},[u,b,w,T,S,j.length,D]);let te=b?k:S,B=!b&&w&&j.length>0,V=Y.useCallback(()=>{d(e=>!e)},[]),H=u&&(!i||m!==null),U=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:L(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:V,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),H&&(0,X.jsxs)(`div`,{"data-testid":r,className:L(Lr,!i&&L(`absolute top-full mt-0`,n)),style:U,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:L(`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)(Et,{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)(yn,{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=>y(e.target.value),placeholder:a(R.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:L(`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)(Ot,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:L(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,ot),children:[te&&j.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(R.HOME$LOADING_REPOSITORIES)}),C&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(R.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!te&&!C&&j.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(R.GITHUB$NO_RESULTS)}),j.map(e=>(0,X.jsx)(Br,{repo:e,disabled:F,onSelect:I,itemClass:z},`${e.git_provider}:${e.id}`)),B&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:T,onClick:()=>D(),className:z,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(T?R.HOME$LOADING_MORE_REPOSITORIES:R.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Hr=L(`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 Ur({backendKind:e}){let{t}=v(`openhands`),n=t(R.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(En,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(zr,{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)(Vr,{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 Wr(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 Gr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Kr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function qr(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 Jr(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Yr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Jr(t[n])-Jr(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 Zr(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 Qr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?Xr(n):Zr(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=Yr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:qr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Jr(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function $r(e,t){if(t.length===0)return[...e];let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set;for(let e of t){let t=n.get(e);t&&(r.push(t),i.add(e))}for(let t of e)i.has(t.id)||r.push(t);return r}function ei(e,t,n,r,i=`after`){if(n===r)return[...e];let a=$r(t.map(e=>({id:e})),e).map(e=>e.id),o=a.indexOf(n),s=a.indexOf(r);if(o<0||s<0)return[...e];let c=[...a];c.splice(o,1);let l=c.indexOf(r),u=i===`before`?l:l+1;return c.splice(u,0,n),c}function ti({group:e,expanded:t,previewExpanded:n,isDragging:r,dropIndicatorPosition:i,animateLayout:a,isCreatingConversationFlow:o,activeConversationId:s,onToggleExpanded:c,onDragStart:l,onDragEnd:u,onDragOver:d,onDragLeave:f,onDrop:p,onTogglePreviewExpanded:m,onLaunchFromGroup:h,renderConversationCard:g}){let{t:_}=v(`openhands`),y=(0,Y.useRef)(null),b=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,x=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:S,isPreviewTruncated:C,isShowingAll:w}=Wr(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(V.section,{ref:y,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":b,"data-testid":`thread-folder-${x}`,onDragOver:d,onDragLeave:f,onDrop:p,className:`relative rounded-md`,children:[i?(0,X.jsx)(`div`,{"aria-hidden":!0,"data-testid":`thread-folder-drop-indicator-${x}`,className:L(`pointer-events-none absolute inset-x-0 z-10 h-0.5 rounded-full bg-[var(--oh-accent)]`,i===`before`?`-top-0.5`:`-bottom-0.5`)}):null,(0,X.jsxs)(`div`,{className:L(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:L(`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`,draggable:!0,id:b,"aria-expanded":t,"aria-controls":`thread-folder-content-${x}`,"data-testid":`thread-folder-drag-${x}`,"aria-label":_(t?R.CONVERSATION_PANEL$COLLAPSE_FOLDER:R.CONVERSATION_PANEL$EXPAND_FOLDER,{label:e.label}),onClick:c,onDragStart:t=>{t.stopPropagation();let{dataTransfer:n}=t;if(n){n.effectAllowed=`move`,n.setData(`text/plain`,e.id);let r=y.current;if(r&&typeof n.setDragImage==`function`){let e=r.getBoundingClientRect(),i=r.cloneNode(!0);i.style.position=`fixed`,i.style.top=`0`,i.style.left=`-9999px`,i.style.width=`${e.width}px`,i.style.margin=`0`,i.style.pointerEvents=`none`,i.style.borderRadius=`0.5rem`,i.style.padding=`0.25rem`,i.style.backgroundColor=`var(--oh-surface-raised)`,i.style.boxShadow=`0 8px 24px rgba(0, 0, 0, 0.35)`,document.body.appendChild(i),n.setDragImage(i,t.clientX-e.left,t.clientY-e.top),window.setTimeout(()=>i.remove(),0)}}l()},onDragEnd:e=>{e.stopPropagation(),u()},className:L(`group/folder flex min-h-8 min-w-0 flex-1 cursor-grab items-center gap-2 rounded-md py-1 text-left text-inherit outline-none active:cursor-grabbing`,`focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`),children:[(0,X.jsx)(ue,{className:L(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(U,{className:L(`h-4 w-4 shrink-0`,t?`block group-hover/folder:hidden`:`hidden group-hover/folder:block`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:L(`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:o,"aria-label":_(R.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${x}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h()},children:(0,X.jsx)(_e,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,X.jsxs)(`div`,{id:`thread-folder-content-${x}`,className:`mt-0.5 space-y-0.5`,children:[S.map(g),C?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${x}`,onClick:m,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:_(w?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function ni({groups:e,groupIds:t,groupFolderOrder:n,setGroupFolderOrder:r,collapsedGroupIds:i,expandedGroupPreviewIds:a,onToggleGroupCollapsed:o,onToggleGroupPreviewExpanded:s,isCreatingConversationFlow:c,activeConversationId:l,onLaunchFromGroup:u,renderConversationCard:d}){let{t:f}=v(`openhands`),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(!1),S=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{S.current&&clearTimeout(S.current)},[]);let C=(0,Y.useCallback)(()=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{x(!1),S.current=null},300)},[]),w=(0,Y.useCallback)(()=>{m(null),g(null),y(null)},[]),T=(0,Y.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),E=(0,Y.useCallback)((e,i)=>{if(!p||p===e){w(),C();return}r(ei(n,t,p,e,i)),w(),C()},[p,n,t,w,r,C]);return(0,X.jsx)(`nav`,{"aria-label":f(R.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(ti,{group:e,expanded:!i.has(e.id),previewExpanded:a.has(e.id),isDragging:p===e.id,dropIndicatorPosition:h===e.id&&p!==e.id?_:null,animateLayout:b,isCreatingConversationFlow:c,activeConversationId:l,onToggleExpanded:()=>o(e.id),onDragStart:()=>{x(!0),m(e.id)},onDragEnd:()=>{w(),C()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),g(e.id),y(T(t))},onDragLeave:()=>{g(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),E(e.id,T(t))},onTogglePreviewExpanded:()=>s(e.id),onLaunchFromGroup:()=>u(e.launch),renderConversationCard:d},e.id))})}function ri({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=v(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Wr(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:L(`pt-1`,i?`mb-2 border-b border-[var(--oh-border-subtle)] pb-2`:`pb-2`),children:[(0,X.jsxs)(`h3`,{className:`flex items-center gap-1.5 py-1.5 pl-2 text-sm font-normal text-[var(--oh-muted)]`,children:[(0,X.jsx)(kn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(R.CONVERSATION_PANEL$PINNED)]}),(0,X.jsx)(`div`,{className:`space-y-0.5`,children:s.map(a)}),c?(0,X.jsx)(`div`,{className:`pl-2 pt-0.5`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`conversation-panel-pinned-view-more`,onClick:n,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:o(l?R.CONVERSATION_PANEL$LESS:R.CONVERSATION_PANEL$MORE)})}):null]})}var ii={pinsByBackendId:{}};function ai(e,t){return e[t]??[]}var oi=Nt()(Mt((e,t)=>({...ii,pinConversation:(n,r)=>{let i=ai(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=ai(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{ai(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=ai(t().pinsByBackendId,n),o=a.filter(e=>i.has(e));o.length!==a.length&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:o}}))}}),{name:`pinned-conversations`,storage:Pt(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),si=()=>{},ci=[],li=3600*1e3,ui=e=>{let t=Date.now()-li,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 di({onClose:e,compact:t=!1}){let{t:n}=v(`openhands`),{conversationId:r,navigate:a}=He(),{backend:o}=A(),s=sn(e??si),[c,l]=Y.useState(!1),[u,d]=Y.useState(!1),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Z(e=>e.showOlderConversations),_=Z(e=>e.toggleShowOlderConversations),y=Z(e=>e.showRepoBranchMetadata),b=Z(e=>e.toggleShowRepoBranchMetadata),x=Z(e=>e.showLlmProfiles),S=Z(e=>e.toggleShowLlmProfiles),C=Z(e=>e.showTagsMetadata),w=Z(e=>e.toggleShowTagsMetadata),T=Z(e=>e.showHoverMetadata),D=Z(e=>e.toggleShowHoverMetadata),O=Z(e=>e.organizeMode),j=Z(e=>e.setOrganizeMode),N=Z(e=>e.conversationSort),P=Z(e=>e.setConversationSort),F=Z(e=>e.threadScope),ee=Z(e=>e.setThreadScope),z=Z(e=>e.groupFolderOrder),te=Z(e=>e.setGroupFolderOrder),[B,V]=Y.useState(!1),[H,U]=Y.useState(!1),ne=sn(()=>{V(!1)}),[re,ie]=Y.useState(()=>new Set),[ae,oe]=Y.useState(()=>new Set),[se,ce]=Y.useState(!1),W=oi(e=>e.pinsByBackendId[o.id]??ci),le=oi(e=>e.togglePin),ue=oi(e=>e.pruneMissingConversations),de=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),fe=Y.useCallback(e=>{oe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{O!==`grouped`&&(ie(new Set),oe(new Set))},[O]);let pe=Y.useRef(null),[me,he]=Y.useState(null),[ge,_e]=Y.useState(null),[ve,ye]=Y.useState(null),{data:be,isLoading:xe,isFetched:Se,hasNextPage:Ce,isFetching:we,isFetchingNextPage:Te,fetchNextPage:Ee}=tr(),{data:De}=nr(),G=Y.useMemo(()=>{let e=be?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[be]),Oe=Y.useMemo(()=>Gr(W,G),[G,W]);Y.useEffect(()=>{Se&&ue(o.id,G.map(e=>e.id))},[o.id,G,Se,ue]),Y.useEffect(()=>{W.length===0&&ce(!1)},[W.length]);let ke=Y.useMemo(()=>{let e=F===`relevant`?G.filter(e=>I(e.execution_status)):G;return t?e:Kr(e,W)},[t,G,W,F]),{recent:K,older:Ae}=Y.useMemo(()=>ui(ke),[ke]),je=Y.useMemo(()=>Yr(g?[...K,...Ae]:K,N),[K,Ae,g,N]),Me=Y.useMemo(()=>({emptyWorkspace:n(R.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(R.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),Ne=Y.useMemo(()=>t||O!==`grouped`?null:Qr([...K,...g?Ae:[]],o.kind,N,Me),[o.kind,t,N,Me,Ae,O,K,g]),q=Y.useMemo(()=>Ne?$r(Ne,z):null,[Ne,z]),Pe=Y.useMemo(()=>Ne?.map(e=>e.id)??[],[Ne]),Fe=Y.useMemo(()=>Yr(K.filter(e=>I(e.execution_status)),N),[N,K]),Ie=je.length,Le=Y.useMemo(()=>q?q.reduce((e,t)=>e+t.conversations.length,0):0,[q]),Re=O===`grouped`&&!t?Le===0:Ie===0,ze=O===`grouped`&&!t?Le:Ie,[Be,Ve]=Y.useState(null),Ue=Y.useRef(ze);Ue.current=ze;let We=Y.useCallback(()=>{Ce&&Ve(Ue.current)},[Ce]);Y.useEffect(()=>{if(Be!==null){if(ze>Be){Ve(null);return}if(!Ce){Ve(null);return}we||Te||Ee()}},[Be,ze,Ce,we,Te,Ee]);let Ke=Be!==null||Te,{mutate:qe,mutateAsync:Je}=pt(),{mutate:Ye}=vt(),{mutate:Xe}=on(),Ze=Ae.length>0&&!g,Qe=!!Ce&&!Ze&&!t&&!Re,{mutate:$e}=ln(),et=E(),tt=Y.useCallback(e=>{et||$e({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[$e,et,a]),nt=Y.useCallback((e,t)=>{l(!0),he(e),_e(t)},[]),rt=Y.useCallback(e=>{d(!0),he(e)},[]),it=Y.useCallback((e,t)=>{Xe({conversationId:e,newTitle:t},{onSuccess:()=>{k(n(R.CONVERSATION$TITLE_UPDATED))}})},[n,Xe]),at=()=>{me&&qe({conversationId:me},{onSuccess:()=>{me===r&&a(`/conversations`)}})},ot=()=>{me&&Ye({conversationId:me})},st=async()=>{let e=G.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Je({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),i=t.length-n.length;r!==null&&n.includes(r)&&a(`/conversations`),i>0&&M(`${i} conversation${i===1?``:`s`} could not be deleted.`)},ct=Y.useCallback((n,a)=>{let s=W.includes(n.id);return t?(0,X.jsx)(kr,{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:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C},n.id):(0,X.jsx)(i,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!T||ve===n.id,disableAnimation:!1,className:`rounded-xl border border-[var(--oh-border)] bg-base-secondary p-0 text-white shadow-xl`,content:(0,X.jsx)(Sr,{title:n.title??``,executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,llmModel:n.llm_model,createdAt:n.created_at}),children:(0,X.jsx)(Ge,{to:`/conversations/${n.id}`,onClick:e,className:L(`block rounded-md transition-colors`,ve!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===r||ve===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(yr,{onDelete:()=>nt(n.id,n.title??``),onStop:()=>rt(n.id),onChangeTitle:e=>it(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:ve===n.id,onContextMenuToggle:e=>ye(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:y,llmModel:n.llm_model,showLlmProfiles:x,agentKind:n.agent_kind,acpServer:n.acp_server,tags:n.tags,showTags:C,isPinned:s,onTogglePin:()=>le(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,r,it,nt,rt,e,ve,W,y,x,C,T,le]),J=xe||!Se,lt=!t&&!J&&Oe.length>0,ut=Se&&!xe&&!t&&Re&&!lt&&!De?.length;return(0,X.jsxs)(`div`,{ref:s,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:L(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,H?`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(R.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(Ur,{backendKind:o.kind}),(0,X.jsx)(Ir,{filterMenuOpen:B,setFilterMenuOpen:V,menuRef:ne,backendKind:o.kind,organizeMode:O,setOrganizeMode:j,conversationSort:N,setConversationSort:P,threadScope:F,setThreadScope:ee,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:y,toggleShowRepoBranchMetadata:b,showLlmProfiles:x,toggleShowLlmProfiles:S,showTagsMetadata:C,toggleShowTagsMetadata:w,showHoverMetadata:T,toggleShowHoverMetadata:D,totalConversationsCount:G.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:pe,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{U(e.currentTarget.scrollTop>0)},className:L(`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:[J&&(0,X.jsx)(Or,{compact:t}),!t&&ut&&(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(R.CONVERSATION$NO_CONVERSATIONS)})}),lt?(0,X.jsx)(ri,{pinnedConversations:Oe,isPreviewExpanded:se,onTogglePreviewExpanded:()=>ce(e=>!e),activeConversationId:r,showDivider:!t&&O===`chronological`,renderConversationCard:e=>ct(e,{inPinnedSection:!0})}):null,!t&&De?.map(t=>(0,X.jsx)(Ge,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Dr,{task:t})},t.id)),!J&&t?Fe.map(e=>ct(e)):null,!J&&!t&&O===`grouped`&&q&&q.length>0?(0,X.jsx)(ni,{groups:q,groupIds:Pe,groupFolderOrder:z,setGroupFolderOrder:te,collapsedGroupIds:re,expandedGroupPreviewIds:ae,onToggleGroupCollapsed:de,onToggleGroupPreviewExpanded:fe,isCreatingConversationFlow:et,activeConversationId:r,onLaunchFromGroup:tt,renderConversationCard:e=>ct(e)}):null,!J&&!t&&O===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:je.map(e=>ct(e))}):null,Qe&&(Ke?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(Or,{compact:t})}):(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`load-more-conversations`,onClick:We,className:`text-xs text-[var(--oh-muted)] hover:text-white`,children:n(R.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(Qt,{onConfirm:()=>{at(),l(!1),_e(null)},onCancel:()=>{l(!1),_e(null)},conversationTitle:ge??void 0}),m&&(0,X.jsx)(Qt,{title:n(R.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(R.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:G.length}),onConfirm:async()=>{await st(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)(Zt,{onConfirm:()=>{ot(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(rr,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function fi({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)(di,{})})})}var pi=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,mi=34,hi=Math.round(mi*30/46);function gi({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,collapseToggleLabel:i,onCollapse:a,onExpand:o,showCollapsedExpandButton:s,isExtensionsActive:c,currentPath:l,activeBackendHealth:u,collapsedBackendPopoverOpen:d,setCollapsedBackendPopoverOpen:f,collapsedBackendPopoverRef:p,collapsedBackendCloseTimer:m,onOpenAddBackend:h,onOpenManageBackends:g}){let{t:_}=v(`openhands`),y=m;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:Xe(e),children:[(0,X.jsxs)(`div`,{className:L(e&&t?Ze:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:L(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&s&&`opacity-0`),children:(0,X.jsx)(Fn,{logoWidth:mi,logoHeight:hi,logoClassName:`max-w-none`,className:L(Ke,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:L(Qe,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(b,{width:14,height:14})}):null]}),!e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:a,className:L(`hidden md:inline-flex ml-auto`,Ye,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(B,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(R.SIDEBAR$CLOSE_MENU),className:L(`inline-flex ml-auto`,Ye,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(B,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:qe(e),children:[(0,X.jsx)(er,{collapsed:e}),(0,X.jsx)(tt,{to:`/conversations`,end:!0,label:_(R.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(_e,{width:$,height:$})}),(0,X.jsx)(tt,{to:`/customize`,label:_(R.NAV$CUSTOMIZE),testId:`sidebar-skills-link`,collapsed:e,forceActive:c,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)(tt,{to:`/automations`,label:_(R.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(pi,{width:$,height:$})})]}),(0,X.jsx)(fi,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:L(qe(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(nt,{content:_(R.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Ge,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(R.SIDEBAR$SETTINGS),className:Je({collapsed:!0}),children:[(0,X.jsx)(et,{active:l.startsWith(`/settings`),children:(0,X.jsx)(be,{width:$,height:$})}),(0,X.jsx)(`span`,{className:$e(!0),children:_(R.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:p,onMouseEnter:()=>{y.current&&=(clearTimeout(y.current),null),f(!0)},onMouseLeave:()=>{y.current=setTimeout(()=>f(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":_(R.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:L(Je({collapsed:!0}),`relative`),children:[(0,X.jsx)(et,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(It,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(An,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:$e(!0),children:_(R.BACKEND$MANAGE)})]}),d?(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)(Zn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:L(`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)(Zn,{sidebarCollapsed:e,openUpward:!0})})]})}var _i=Y.lazy(()=>a(()=>import(`./settings-modal-CFnbQ8_4.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,51,52,53,54,55,56,57,58,59,60,61]))),vi=Y.lazy(()=>a(()=>Promise.resolve().then(()=>Un).then(e=>({default:e.AddBackendModal})),void 0)),yi=Y.lazy(()=>a(()=>import(`./manage-backends-modal-DhflyGTf.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([62,1,2,3,4,5,6,7,8,11,63,64,65,66,67,47,46,18,48,68,69,26,70,25,34,15,29,33,31,71,14,72,32,73,74]))),bi=250;function xi(){let{t:e}=v(`openhands`),{currentPath:t}=He(),{data:n}=je(),{data:r,error:i,isError:a,isFetching:o}=q(),{backends:s,active:c}=j(),l=K(s)[c.backend.id],u=xe(e=>e.collapsed),d=xe(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,y]=Y.useState(!1),[b,x]=Y.useState(!1),[S,C]=Y.useState(!1),w=Y.useRef(!1),[,T]=Y.useReducer(e=>e+1,0),{isOpen:E,close:D}=tn(),[O,k]=Y.useState(!1),[A,N]=Y.useState(!1),P=sn(()=>h(!1)),F=Pe(i);Y.useEffect(()=>{D()},[t,D]),Y.useEffect(()=>{if(E){k(!0);let e=requestAnimationFrame(()=>{N(!0)});return()=>cancelAnimationFrame(e)}N(!1);let e=window.setTimeout(()=>{k(!1)},bi);return()=>window.clearTimeout(e)},[E]),Y.useEffect(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E,D]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&F!==404?M(e(R.SETTINGS$FETCH_ERROR)):F===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,F,n?.feature_flags?.hide_llm_settings,e]);let I=e(u?R.SIDEBAR$EXPAND:R.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]),z={collapseToggleLabel:I,onCollapse:Y.useCallback(()=>{C(!1),w.current=!0,T(),d(!0),window.setTimeout(()=>{w.current=!1,T()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&S&&!w.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:P,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>y(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:ee,onMouseEnter:()=>{u&&C(!0)},onMouseLeave:()=>{C(!1)},className:L(`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)(gi,{collapsed:u,showCollapseToggle:!0,...z})}),O?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:L(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,A?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${bi}ms`},onClick:D,"aria-hidden":!A}),(0,X.jsx)(`aside`,{"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!A,className:L(`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`,A?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${bi}ms`},children:(0,X.jsx)(gi,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:D,...z})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(_i,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(vi,{onClose:()=>y(!1)})}),b&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(yi,{onClose:()=>x(!1)})})]})}var Si=`/settings`,Ci=`/customize`,wi=[`/skills`,`/mcp`,`/plugins`];function Ti(e){return e===Si?{mode:`menu`}:e.startsWith(`${Si}/`)&&e.length>9?{mode:`back`,backTo:Si,backLabelKey:R.SETTINGS$TITLE}:e===Ci?{mode:`menu`}:wi.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Ci,backLabelKey:R.NAV$CUSTOMIZE}:{mode:`menu`}}function Ei(){let{t:e}=v(`openhands`),{currentPath:t,navigate:n}=He(),r=Ti(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(R.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(an,{}),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??R.COMMON$BACK),className:nn,children:(0,X.jsx)(B,{size:20,className:$t,"aria-hidden":!0,strokeWidth:2})}):null]})}function Di(){let{backend:e}=A(),t=e.kind===`local`,{data:n}=cn(),{mutate:r,isPending:i}=Se(),a=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{a.current=null},[e.id]),(0,Y.useEffect)(()=>{if(!t||i||!n)return;let{profiles:e,active_profile:o}=n,s=o!=null&&e.some(e=>e.name===o);if(e.length===0||s){a.current=null;return}let c=e.find(e=>e.api_key_set)??e[0];a.current!==c.name&&(a.current=c.name,r(c.name))},[t,n,i,r])}var Oi=()=>{let{backend:e}=A(),{data:t}=q(),{mutate:n,isPending:r}=Fe(`personal`,{retry:2}),i=Y.useSyncExternalStore(Oe,Te,()=>null),a=Y.useRef(null);Y.useEffect(()=>{if(t!==void 0){if(i!==null){if((t.user_consents_to_analytics===!0?`granted`:t.user_consents_to_analytics===!1?`denied`:null)===i){a.current=null,e.kind===`cloud`&&ke(i);return}if(e.kind!==`cloud`)return;let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}t.user_consents_to_analytics!==null&&De(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])};function ki(){let{backend:e}=A(),t=Y.useSyncExternalStore(Oe,G,()=>`pending`),n=Y.useRef(null);Y.useEffect(()=>{if(e.kind!==`local`||t===`pending`)return;let r=`${e.id}:${e.host}:${e.apiKey??``}:${t}`;n.current!==r&&(n.current=r,Me.syncTelemetryConsent(t).catch(()=>{}))},[e.apiKey,e.host,e.id,e.kind,t])}var Ai=`agent_canvas_cloud_cookie_backend_added`,ji=new Set;function Mi(e,t){return`${Ai}:${e}:${t}`}function Ni(e,t){let n=Mi(e,t);if(typeof window>`u`)return!0;try{return window.sessionStorage.getItem(n)===`true`||ji.has(n)}catch{return ji.has(n)}}function Pi(e,t){let n=Mi(e,t);if(!(typeof window>`u`))try{window.sessionStorage.setItem(n,`true`)}catch{ji.add(n)}}var Fi=()=>{let{backend:e,orgId:t}=A(),{data:n}=q(),{trackBackendAdded:r}=Ne(),i=Y.useRef(r),a=At(),o=e.kind===`cloud`?a[e.id]:void 0,s=o?.isLoading??!0,c=o?.userId??null,l=(n?.email||n?.git_user_email)?.trim()||void 0;Y.useEffect(()=>{i.current=r},[r]),Y.useEffect(()=>{if(e.kind!==`cloud`){Ee(null);return}if(!s){if(!c){Ee(null);return}Ee({userId:c,email:l,orgId:t}),e.authMode===`cookie`&&l&&!Ni(e.id,c)&&(i.current({backendKind:`cloud`,connectionMethod:`cloud_cookie`,hasApiKey:!1,source:`cloud_auto_connect`}),Pi(e.id,c))}},[e.authMode,e.id,e.kind,l,s,t,c])};function Ii(e){switch(e){case P.RUNNING:return`🟢`;case P.FINISHED:case P.IDLE:case P.WAITING_FOR_CONFIRMATION:return`✅`;case P.PAUSED:return`⚪`;case P.ERROR:case P.STUCK:return`🔴`;default:return null}}var Li=`OpenHands`,Ri=()=>{let{conversationId:e}=s(),{data:t}=bn(e??null),n=Jt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Li}`:Li;if(!e)return i;let a=Ii(n??t?.execution_status??null);return a?`${a} ${i}`:i};function zi({children:e}){let{pathname:t}=c(),n=d(),r=_(),i=u(),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)(Ue,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Bi=Y.lazy(()=>a(()=>import(`./environment-switch-overlay-D0FgCMqs.js`),__vite__mapDeps([75,1,2,8,5,6,76,7]))),Vi=Y.lazy(()=>a(()=>import(`./alert-banner-C1nzoXBC.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([77,1,2,78,4,5,8,6,11,79,80,7,14,81,44,38]))),Hi=Y.lazy(()=>a(()=>import(`./command-menu-N_BriUy8.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([82,1,2,83,4,5,8,6,84,85,86,87,88,7,14]))),Ui=m(function(){let e=p(),{t}=v(`openhands`);return h(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(R.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(R.ERROR$UNKNOWN)})})}),Wi=f(function(){let e=c(),t=Ri(),{data:n}=q(),r=je();if(ki(),Oi(),Fi(),Di(),Y.useEffect(()=>{n?.language&&O.changeLanguage(n.language)},[n?.language]),r.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(Ae,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=W(e.search);return(0,X.jsx)(zi,{children:(0,X.jsxs)(Yt,{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)(xi,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[i?null:(0,X.jsx)(Ei,{}),r.data&&(r.data.maintenance_start_time||r.data.faulty_models&&r.data.faulty_models.length>0||r.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Vi,{maintenanceStartTime:r.data.maintenance_start_time,faultyModels:r.data.faulty_models,errorMessage:r.data.error_message,updatedAt:r.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(g,{})})]})]}),(0,X.jsxs)(Y.Suspense,{fallback:null,children:[(0,X.jsx)(Bi,{}),(0,X.jsx)(Hi,{})]}),a?(0,X.jsx)(pe,{}):null]})})});export{Ui as ErrorBoundary,Wi as default};
|