@openhands/agent-canvas 1.5.1 → 1.5.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-B8rMv0X9.js → active-backend-context-DHhm10VS.js} +1 -1
- package/build/assets/{add-backend-modal-CxC7BNEc.js → add-backend-modal-BoMkMyLB.js} +1 -1
- package/build/assets/{agent-profiles-settings-BJb8YXR1.js → agent-profiles-settings-CYPloKYK.js} +1 -1
- package/build/assets/{agent-server-compatibility-BWN-EIQn.js → agent-server-compatibility-C0MtTTwb.js} +1 -1
- package/build/assets/{agent-server-conversation-service.api-DSPIkMwJ.js → agent-server-conversation-service.api-lzc8dabY.js} +3 -3
- package/build/assets/{agent-settings-CgCnqaAA.js → agent-settings-GwiXe_6k.js} +1 -1
- package/build/assets/agent-settings-OdsyI2gX.js +1 -0
- package/build/assets/{api-key-entry-screen-iZc7n8AI.js → api-key-entry-screen-2gsoZAOK.js} +1 -1
- package/build/assets/{app-settings-B5zyipxJ.js → app-settings-CD9euh81.js} +1 -1
- package/build/assets/{automation-detail-CZsu2CoM.js → automation-detail-Bn8q0AG3.js} +1 -1
- package/build/assets/{automation-export-BwRX6H32.js → automation-export-Djc8Tf0M.js} +1 -1
- package/build/assets/{automations-list-lHAVzMoA.js → automations-list-Dtiolk1h.js} +1 -1
- package/build/assets/{backend-form-modal-RGcu909r.js → backend-form-modal-B8GtBA-J.js} +1 -1
- package/build/assets/{backend-synced-settings-badge-BSfN0AZA.js → backend-synced-settings-badge-yVh6Kf4E.js} +1 -1
- package/build/assets/{client-source-BZK8vRs2.js → client-source-CtQjJEy6.js} +1 -1
- package/build/assets/{cloud-funnel-analytics-Zcv57hfT.js → cloud-funnel-analytics-uzzLlLuj.js} +1 -1
- package/build/assets/{condenser-settings-BGlWn93P.js → condenser-settings-Q1rHh4Qe.js} +1 -1
- package/build/assets/conversation-B8d8_Upd.js +1 -0
- package/build/assets/{conversation-BoCYx8n2.js → conversation-Lmqm6VJC.js} +20 -20
- package/build/assets/conversation-panel-B8n40Swu.js +1 -0
- package/build/assets/{conversation-service.api-_f9GlIEi.js → conversation-service.api-D8QU-BiL.js} +1 -1
- package/build/assets/{entry.client-DNlPGxsu.js → entry.client-Dnnak-Hq.js} +1 -1
- package/build/assets/{extensions-hub-CCbLA7IM.js → extensions-hub-DqvwvpCi.js} +1 -1
- package/build/assets/{extensions-navigation-CPNjMNvR.js → extensions-navigation-BMc9Nluv.js} +1 -1
- package/build/assets/{files-tab-y4K7EXBO.js → files-tab-BAkaV4aO.js} +1 -1
- package/build/assets/{git-provider-icon-ITvsH4Ko.js → git-provider-icon-xvbukHaT.js} +1 -1
- package/build/assets/{home-BwbeOWwU.js → home-D01kSnmo.js} +1 -1
- package/build/assets/home-NZO2bF4N.js +1 -0
- package/build/assets/index-home-BsI6i0TC.js +1 -0
- package/build/assets/{install-server-modal-Qk1gwyI8.js → install-server-modal-BYjqoRyX.js} +1 -1
- package/build/assets/{launch-CAGavYl-.js → launch-DlXspDku.js} +1 -1
- package/build/assets/{lesson-plan-DMCPdtrf.js → lesson-plan-cNUjpdFx.js} +1 -1
- package/build/assets/{llm-not-configured-banner-C1ktyb3C.js → llm-not-configured-banner-DUPyoFIZ.js} +7 -7
- package/build/assets/{llm-settings-DFkJQr_w.js → llm-settings-Cs_iieFY.js} +1 -1
- package/build/assets/llm-settings-J2ke2foG.js +1 -0
- package/build/assets/{llm-subscription-service-Casyzgn1.js → llm-subscription-service-C0zN0-rH.js} +1 -1
- package/build/assets/{manage-backends-modal-CKQ46rvw.js → manage-backends-modal-nMoCZ2a0.js} +1 -1
- package/build/assets/{manifest-03478bbf.js → manifest-f1b46f62.js} +1 -1
- package/build/assets/{mcp-BapoJsDc.js → mcp-kZM-cAZw.js} +1 -1
- package/build/assets/{messages-CUBFMY5o.js → messages-CJAv5n4j.js} +1 -1
- package/build/assets/{model-selector-DJrMrFAr.js → model-selector-D51W2Q9b.js} +1 -1
- package/build/assets/{onboarding-6NMkdNxV.js → onboarding-Dx8n8HFr.js} +1 -1
- package/build/assets/{onboarding-modal-Q4AnpIdg.js → onboarding-modal-Bxuxpfdz.js} +1 -1
- package/build/assets/{organization-service.api-vrRNwOma.js → organization-service.api-Da2jiuBS.js} +1 -1
- package/build/assets/{path-utils-PNfCKQDV.js → path-utils-D53ZHUQU.js} +1 -1
- package/build/assets/{planner-tab-ByOw1he8.js → planner-tab-BM-pKx0z.js} +1 -1
- package/build/assets/{plugins-management-service-B75jyC56.js → plugins-management-service-DISfOL13.js} +1 -1
- package/build/assets/{profiles-service.api-BQTklD5D.js → profiles-service.api-DWetW2TL.js} +1 -1
- package/build/assets/{providers-DfTB2gPd.js → providers-C7lMslCi.js} +1 -1
- package/build/assets/{proxy-B3tCGf0X.js → proxy-G4ce0fnQ.js} +1 -1
- package/build/assets/{recommended-automations-launcher-Bj7PuHY1.js → recommended-automations-launcher-BWRRvMPE.js} +1 -1
- package/build/assets/{root-layout-DfYVlcRG.js → root-layout-ClEl-JlJ.js} +2 -2
- package/build/assets/{root-CDnuTToz.js → root-oT83qVlk.js} +2 -2
- package/build/assets/{schema-field-CUwk4wrQ.js → schema-field-CwdqUOnE.js} +1 -1
- package/build/assets/{sdk-section-page-DLLNrYjI.js → sdk-section-page-Cwj0T4gF.js} +1 -1
- package/build/assets/{secrets-service-CvyPWJhg.js → secrets-service-Ch7RH8eH.js} +1 -1
- package/build/assets/{secrets-settings-CHy72A5C.js → secrets-settings-Bc_pBX6F.js} +1 -1
- package/build/assets/{settings-index-BKDl2CQ-.js → settings-index-BzSIM1-N.js} +1 -1
- package/build/assets/{settings-modal-DeK11CyT.js → settings-modal-BnZ7mMu7.js} +1 -1
- package/build/assets/{settings-B9S8UVQr.js → settings-n9a395O0.js} +1 -1
- package/build/assets/{settings-service.api-DXk5TdeJ.js → settings-service.api-DPTFyRXL.js} +1 -1
- package/build/assets/{shared-conversation-9atDzTR4.js → shared-conversation-CIDDti9I.js} +1 -1
- package/build/assets/{sidebar-mobile-menu-toggle-giMMZctn.js → sidebar-mobile-menu-toggle-CTX7J4wM.js} +1 -1
- package/build/assets/{skills-plugins-Tropusio.js → skills-plugins-HZEbNDmX.js} +1 -1
- package/build/assets/{skills-settings-BvzBBCWk.js → skills-settings-BdqijFlC.js} +1 -1
- package/build/assets/{telemetry-C5JMEfqB.js → telemetry-SHxpVxk8.js} +1 -1
- package/build/assets/{terminal-DRXt2Lr4.js → terminal-BDTa1HEr.js} +1 -1
- package/build/assets/{use-acp-credential-form-Bm8qXdlc.js → use-acp-credential-form-DHd_Id-q.js} +1 -1
- package/build/assets/{use-activate-agent-profile-DlykqEfN.js → use-activate-agent-profile-BRDdSwQ0.js} +1 -1
- package/build/assets/{use-active-agent-profile-hI-x-UBa.js → use-active-agent-profile-BMDTXsay.js} +1 -1
- package/build/assets/{use-active-conversation-2qeez40F.js → use-active-conversation-BbeVgedA.js} +1 -1
- package/build/assets/{use-agent-profiles-0pr5bLS7.js → use-agent-profiles-Dn_S_Tkz.js} +1 -1
- package/build/assets/{use-agent-state-C6peDXUm.js → use-agent-state-5qM3X30V.js} +1 -1
- package/build/assets/{use-backends-health-CLHPitJM.js → use-backends-health-BagmAE_W.js} +1 -1
- package/build/assets/{use-can-manage-org-profiles-Ck_bsNbH.js → use-can-manage-org-profiles-CyYqfzeo.js} +1 -1
- package/build/assets/{use-cloud-current-user-id-DUCSxNjY.js → use-cloud-current-user-id-BwMX7jHW.js} +1 -1
- package/build/assets/{use-config-B5r8erYt.js → use-config-B39iHYFi.js} +1 -1
- package/build/assets/{use-create-conversation-r1JHfKO5.js → use-create-conversation-CkKUQVbP.js} +1 -1
- package/build/assets/{use-create-secret-Cf2N11d2.js → use-create-secret-DEgM0MXZ.js} +1 -1
- package/build/assets/{use-handle-plan-click-CsAW3FlH.js → use-handle-plan-click-BFcE0Xms.js} +1 -1
- package/build/assets/{use-llm-profiles-Dr5__SlZ.js → use-llm-profiles-CgRtnj74.js} +1 -1
- package/build/assets/{use-plugins-marketplace-BplU65ae.js → use-plugins-marketplace-DOJp9rlE.js} +1 -1
- package/build/assets/use-runtime-is-ready-ziHQvXZQ.js +1 -0
- package/build/assets/{use-save-agent-profile-RqUGqTv6.js → use-save-agent-profile-i4FcEP98.js} +1 -1
- package/build/assets/{use-save-settings-Chvzeu2s.js → use-save-settings-DiDEbIJw.js} +1 -1
- package/build/assets/{use-settings-CyxSlyTQ.js → use-settings-BeJap6YL.js} +1 -1
- package/build/assets/{use-settings-nav-items-zEkSO_Bf.js → use-settings-nav-items-D5JJjFHJ.js} +1 -1
- package/build/assets/{use-skills-xrVoKYrF.js → use-skills-Blpg2BqE.js} +1 -1
- package/build/assets/{use-tracking-D2Qg5Lpd.js → use-tracking-DFoPQUSU.js} +1 -1
- package/build/assets/{use-user-conversation-CnE4zhOA.js → use-user-conversation-BrN2xeQU.js} +1 -1
- package/build/assets/{verification-settings-CfkrXoSa.js → verification-settings-C8KzAdAX.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/hooks/query/use-task-polling.cjs +1 -1
- package/dist/hooks/query/use-task-polling.cjs.map +1 -1
- package/dist/hooks/query/use-task-polling.d.ts +19 -3
- package/dist/hooks/query/use-task-polling.js +36 -35
- package/dist/hooks/query/use-task-polling.js.map +1 -1
- package/dist/package.cjs +1 -1
- package/dist/package.cjs.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/routes/conversation.cjs +1 -1
- package/dist/routes/conversation.cjs.map +1 -1
- package/dist/routes/conversation.js +1 -1
- package/dist/routes/conversation.js.map +1 -1
- package/package.json +1 -1
- package/build/assets/agent-settings-DDkSavD7.js +0 -1
- package/build/assets/conversation-DgHqMjnY.js +0 -1
- package/build/assets/conversation-panel-78Rxh_-I.js +0 -1
- package/build/assets/home-DKPGQ5P3.js +0 -1
- package/build/assets/index-home-Bko2Itv5.js +0 -1
- package/build/assets/llm-settings-BBsZFi9l.js +0 -1
- package/build/assets/use-runtime-is-ready-vCFOcLFa.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useMutationState-OnAsCLA_.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{n as o}from"./active-backend-context-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useMutationState-OnAsCLA_.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{t as a}from"./declaration-BGsHjPEW.js";import{n as o}from"./active-backend-context-DHhm10VS.js";import{P as s,t as c}from"./utils-DB9LsAzA.js";import{t as l}from"./modal-backdrop-zVwfOJZr.js";import{n as u}from"./modal-classes-3qT9Ap7Q.js";import{t as d}from"./brand-button-B1izLAdR.js";import{n as f}from"./navigation-context-DPs2G0X8.js";import{a as p,o as ee}from"./conversation-local-storage-F6zVMM--.js";import{t as m}from"./conversation-store-LptbOvKa.js";import{t as h}from"./modal-close-button-BcIBUdSq.js";import{i as g}from"./settings-service.api-DPTFyRXL.js";import{r as _}from"./use-settings-BeJap6YL.js";import{t as v}from"./use-tracking-DFoPQUSU.js";import{n as y}from"./use-create-conversation-CkKUQVbP.js";import{i as b,n as x,r as S,t as C}from"./extension-module-card-classes-9V3J9J_b.js";import{c as w,d as T,f as E,h as D,o as O,t as k}from"./install-server-modal-BYjqoRyX.js";import{t as A}from"./vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js";import{n as j}from"./skill-card-pill-row-BPYKQ3IN.js";import{t as M}from"./circle-plus-check-toggle-DoFIjVE0.js";var N=e(t(),1),P=()=>{let e=f(),t=r({mutationKey:[`create-conversation`]}),{isNavigating:n}=e;return t>0||n},F=`${s.PRODUCTION}/settings/integrations`,I=[`github`,`slack`];function L(e){let t=e.requiredIntegrationIds;return t.length>0&&t.every(e=>I.includes(e))}function R(e){switch(e){case`local`:return{target:e,testId:`responder-deployment-option-local`,titleKey:a.RESPONDER_DEPLOYMENT$LOCAL_TITLE,descriptionKey:a.RESPONDER_DEPLOYMENT$LOCAL_DESCRIPTION,primaryActionKey:a.RESPONDER_DEPLOYMENT$LOCAL_ACTION,primaryActionTestId:`responder-deployment-continue-local`,action:{kind:`launch-local`}};case`openhands-cloud`:return{target:e,testId:`responder-deployment-option-openhands-cloud`,titleKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_TITLE,descriptionKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_DESCRIPTION,primaryActionKey:a.RESPONDER_DEPLOYMENT$OPENHANDS_CLOUD_ACTION,primaryActionTestId:`responder-deployment-open-openhands-cloud`,action:{kind:`open-url`,url:F}};case`user-cloud`:throw Error(`User Cloud responder deployment is not yet supported`);default:return e}}var z=[`local`,`openhands-cloud`],B=[{id:`github-pr-reviewer`,name:`GitHub Code Review Agent`,category:`Code review`,description:`Watch for a configurable label on GitHub pull requests, inspect full PR and repository context, and post an AI review comment once per label event.`,requiredIntegrationIds:[`github`],popularityRank:100,estimatedSetupMinutes:4,prompt:`/pr-reviewer:setup`,exampleImplementation:`Trigger: cron polling for open GitHub PRs with a configured label such as openhands-review
|
|
2
2
|
Required secret: GITHUB_PERSONAL_ACCESS_TOKEN
|
|
3
3
|
|
|
4
4
|
1. Read repository, trigger label, review tone, and polling schedule from setup.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,St as n,a as r,bt as i,xt as a}from"./vendor-styling-CI0PQ3ab.js";import{A as o,C as s,F as c,L as l,M as u,N as d,P as f,R as p,c as m,j as h,k as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{h as _,m as v,r as y,t as b}from"./path-utils-PNfCKQDV.js";import{t as x}from"./useQuery-D5pEZbY0.js";import{t as S}from"./useTranslation-Cbf5AGg_.js";import{t as C}from"./declaration-BGsHjPEW.js";import{C as w,F as T,S as E,n as D,r as O}from"./active-backend-context-B8rMv0X9.js";import{t as k}from"./createLucideIcon-D4Tak8A1.js";import{t as A}from"./bot-C-EA6685.js";import{t as j}from"./check-TbOEtHKj.js";import{n as M,t as N}from"./vendor~root-layout~conversation-panel~conversation-8tIsyrPj.js";import{r as P}from"./onboarding-modal-Q4AnpIdg.js";import{n as F,t as I}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js";import{a as ee,c as L,d as R,f as z,i as B,l as te,n as ne,o as re,p as ie,r as ae,s as oe,t as V,u as se}from"./onboarding-6NMkdNxV.js";import{n as ce,t as le}from"./format-time-delta-DhDbkD7V.js";import{n as ue}from"./refresh-cw-B9B7-vsy.js";import{t as de}from"./search-dIQ09UY2.js";import{n as fe,r as pe,t as me}from"./sidebar-store-uiUXBU1N.js";import{i as he}from"./llm-settings-DFkJQr_w.js";import{t as ge}from"./trash-2-BU6BlW4i.js";import{t as _e}from"./x-ZE4iplpF.js";import{S as ve,b as ye,t as H,y as be}from"./utils-DB9LsAzA.js";import{t as U}from"./common-CxbUL3nR.js";import{S as xe}from"./agent-server-compatibility-BWN-EIQn.js";import{a as Se,c as Ce,l as we,t as Te,u as W}from"./telemetry-C5JMEfqB.js";import{a as Ee}from"./use-backends-health-CLHPitJM.js";import{t as De}from"./modal-backdrop-zVwfOJZr.js";import{n as G}from"./modal-body-Cc2zp0xb.js";import{i as Oe,r as ke}from"./base-modal-CIF_785P.js";import{_ as Ae,c as je}from"./form-control-classes-CbdN5aO3.js";import{t as Me}from"./loading-spinner-BcdnT0mN.js";import{t as Ne}from"./use-config-B5r8erYt.js";import{n as Pe,t as Fe}from"./navigation-context-DPs2G0X8.js";import{t as Ie}from"./openhands-logo-bcNw5bkY.js";import{t as Le}from"./navigation-link-D8hfwvxI.js";import{a as Re,d as ze,f as Be,i as Ve,l as He,n as Ue,r as We,u as Ge}from"./sidebar-layout-Bm7pa3Vk.js";import{n as Ke,t as qe}from"./sidebar-nav-link-CHqyFXwV.js";import{t as Je}from"./styled-tooltip-B14i_Uac.js";import{a as Ye,d as Xe,f as Ze,i as K,l as Qe,n as $e,o as et,r as tt,u as nt}from"./dropdown-classes-D3wMJlXT.js";import{r as rt,t as it}from"./combobox-caret-CxZpqoSR.js";import{_ as at,a as ot,c as st,d as ct,f as lt,g as ut,h as dt,i as ft,l as pt,m as mt,n as ht,p as gt,r as _t,s as vt,t as yt,u as bt}from"./git-provider-icon-ITvsH4Ko.js";import{n as xt,t as St}from"./use-cloud-current-user-id-DUCSxNjY.js";import{s as Ct}from"./environment-switch-store-DkjlKWzN.js";import{t as wt}from"./react-DPDgL6du.js";import{r as Tt,t as Et}from"./middleware-DYHYNAnP.js";import{t as Dt}from"./conversation-store-LptbOvKa.js";import{o as Ot}from"./backend-form-modal-RGcu909r.js";import{r as kt,t as At}from"./use-settings-CyxSlyTQ.js";import{t as jt}from"./use-tracking-D2Qg5Lpd.js";import{t as Mt}from"./add-backend-modal-CxC7BNEc.js";import{t as Nt}from"./manage-backends-modal-CKQ46rvw.js";import{t as Pt}from"./agent-server-conversation-service.api-DSPIkMwJ.js";import{c as Ft,d as It,u as Lt}from"./acp-providers-DerAmTyY.js";import{t as Rt}from"./use-is-authed-BezEyfeh.js";import{a as zt,c as Bt,d as Vt,f as Ht,i as Ut,l as Wt,o as Gt,r as Kt,s as qt,t as Jt,u as Yt}from"./sidebar-mobile-menu-toggle-giMMZctn.js";import{t as Xt}from"./use-click-outside-element-D9BYdANT.js";import{t as Zt}from"./use-llm-profiles-Dr5__SlZ.js";import{n as Qt}from"./use-create-conversation-r1JHfKO5.js";import{r as $t}from"./recommended-automations-launcher-Bj7PuHY1.js";import{t as en}from"./conversation-service.api-_f9GlIEi.js";import{r as tn,t as nn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js";import{n as rn,t as q}from"./context-menu-list-item-6psNyl7X.js";import{i as J,r as an,t as on}from"./ellipsis-button-CbNnHlIq.js";import{t as sn}from"./u-edit-DL5LgKon.js";import{t as cn}from"./skills-EqzxYBvT.js";import{a as ln,o as un,t as dn}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js";import{t as fn}from"./search-BgOCR7_c.js";import{t as pn}from"./use-save-settings-Chvzeu2s.js";import{t as mn}from"./use-user-conversation-CnE4zhOA.js";import{t as hn}from"./conversation-state-store-B2Bp32XI.js";var gn=k(`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`}]]),_n=k(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),vn=k(`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`}]]),yn=k(`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`}]]),bn=k(`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`}]]),xn=k(`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`}]]),Sn=k(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Cn=k(`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`}]]),wn=k(`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`}]]),Tn=k(`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`}]]),En=k(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=i(),Dn=46,On=30;function kn({className:e,logoClassName:t,logoWidth:n=Dn,logoHeight:r=On}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Le,{to:`/conversations`,"aria-label":i(C.BRANDING$OPENHANDS_LOGO),className:H(e),children:(0,X.jsx)(Ie,{width:n,height:r,className:H(`shrink-0`,t)})})}function An(){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 jn({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(_e,{size:14})})}function Mn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:H(rt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(it,{})})}function Nn({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:H(`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:H(`p-0`,K)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:H(et,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:nt,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)(at,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Pn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:H(`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`,je,`px-0 not-italic text-inherit`)})})}var Fn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function In({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}=I({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===I.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:H(`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:Fn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Fn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:H(Ze,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)(Pn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(An,{}),n&&w&&(0,X.jsx)(jn,{onClear:()=>T(null)}),(0,X.jsx)(Mn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(Nn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Ln=`::`;function Rn(e,t){return t?`${e}${Ln}${t}`:e}function zn(e){let[t,n]=e.split(Ln);return{backendId:t,orgId:n??null}}function Bn(e){return(0,X.jsx)(Ot,{isConnected:e?.isConnected??null})}function Vn(){return(0,X.jsx)(Ot,{isConnected:`unavailable`})}function Hn(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:Rn(e.id,null),label:e.name,prefix:Bn(i[e.id])});for(let e of s){let o=n[e.id],s=Bn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Rn(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:Rn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Un({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:s=!1}={}){let{t:c}=S(`openhands`),{backends:l,active:d,setActive:f}=O(),p=xt(),m=St(),h=Ee(l),g=u(),_=o(`/settings`),v=o(`/settings/*`),y=o(`/conversations/:conversationId`),b=o(`/automations/:automationId`),[x,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=c(C.BACKEND$PERSONAL_WORKSPACE),k=Y.useMemo(()=>Hn(l,D,p,m,h),[l,D,p,m,h]),A=xe(d.backend),j=c(C.BACKEND$NO_BACKEND_AVAILABLE),M=Rn(d.backend.id,d.orgId),N=A?void 0:k.find(e=>e.value===M),P=!!(_||v),F=c(C.SIDEBAR$SETTINGS),I=Dt(e=>e.isRightPanelShown),ee=!s||y&&I?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(A||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,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)},[d,p,m,f,A]);let R=Y.useCallback(()=>{if(i){i(),r?.();return}w(!0)},[i,r]),z=Y.useCallback(()=>{if(a){a(),r?.();return}E(!0)},[a,r]),B=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=Y.useCallback(e=>{B(e),R()},[R,B]),ne=Y.useCallback(e=>{B(e),R()},[R,B]),re=Y.useCallback(e=>{B(e),z()},[z,B]),ie=Y.useCallback(e=>{B(e),z()},[z,B]),ae=(0,X.jsxs)(`div`,{className:K,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:ne,onClick:te,className:H($e,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:nt,"aria-hidden":!0,children:(0,X.jsx)(ue,{width:16,height:16})}),c(C.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:ie,onClick:re,className:H($e,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:nt,"aria-hidden":!0,children:(0,X.jsx)(pe,{width:16,height:16})}),c(C.BACKEND$MANAGE)]})]}),oe=Y.useCallback(async e=>{if(e===M)return;let{backendId:t,orgId:n}=zn(e),i=l.find(e=>e.id===t);i&&(Ct(k.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):b&&g(`/automations`),f(i.id,n),r?.())},[M,l,y,b,g,k,f,c,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)(In,{testId:`backend-selector`,defaultValue:N??{value:M,label:A?j:d.backend.name,prefix:A?Vn():Bn(h[d.backend.id])},footer:ae,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&oe(e.value)},placeholder:A?j:d.backend.name,loading:L,options:k,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}-${N?.label??``}`)}),t?null:(0,X.jsx)(Je,{content:F,placement:ee,offset:10,children:(0,X.jsx)(Le,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":P,"aria-label":F,className:H(P?`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`,Ae),children:(0,X.jsx)(pe,{width:16,height:16})})})]}),x?(0,X.jsx)(Mt,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(Nt,{onClose:()=>E(!1)}):null]})}var Wn=`command-menu-trigger`,Gn=18;function Kn({collapsed:e}){let{t}=S(`openhands`),n=fe(e=>e.open),r=t(C.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":Wn,"aria-label":r,onClick:n,className:H(Be({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)(Ke,{active:!1,children:(0,X.jsx)(de,{width:Gn,height:Gn})}):(0,X.jsx)(`span`,{className:H(Re,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(de,{width:Gn,height:Gn})}),(0,X.jsx)(`span`,{className:Ge(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(C.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(Je,{content:r,placement:`right`,children:i}):i}var qn=(e=20)=>{let{data:t}=Rt(),n=D(),r=!xe(n.backend);return _({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await Pt.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},Jn=(e=10)=>x({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Yn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(De,{onClose:n,children:(0,X.jsxs)(G,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(ke,{title:r(C.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Oe,{text:r(C.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Oe,{text:r(C.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function Xn({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:H(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var Zn=e=>{switch(e){case U.FINISHED:return`check`;case U.RUNNING:return`working`;case U.IDLE:case U.WAITING_FOR_CONFIRMATION:return`active`;case U.PAUSED:return`paused`;case U.ERROR:case U.STUCK:return`error`;default:return`unknown`}},Qn=(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 $n(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 er({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:Zn(e),o=r(Qn(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)(nn,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):$n(a)});return n?(0,X.jsx)(Je,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function tr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=mt(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)(er,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(Xn,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var nr=e(a(),1);function rr({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=D(),m=Xt(e,d),h=p.kind===`cloud`?C.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:C.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)(at,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(rn,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(sn,{width:16,height:16}),text:f(C.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(gt,{width:16,height:16}),text:f(C.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(cn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(C.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(lt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Bt,{width:16,height:16}),text:f(C.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Bt,{width:16,height:16}),text:f(C.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(qt,{width:16,height:16}),text:f(C.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(an,{width:16,height:16}),text:f(C.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function ir({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ve(s),d=ye(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)(on,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:H(u&&`opacity-60`)}),e&&m&&h?(0,nr.createPortal)((0,X.jsx)(rr,{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 ar(e){return e?e.split(`/`).pop()||e:null}var or={bitbucket:dn,bitbucket_data_center:dn,github:ln,gitlab:un};function sr({selectedRepository:e}){let t=e.git_provider?or[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)(ct,{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)(tn,{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 cr({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?b(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)(y,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(C.COMMON$NO_REPOSITORY)})]})}function lr({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=ve(r),p=null;if(c)if(l===`acp`){let e=Ft(u)??d(C.CONVERSATION$ACP_AGENT_GENERIC),t=Lt(u,s),n=t??e;p={kind:It(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:ar(s)??s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:H(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(P,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:H(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(sr,{selectedRepository:e}):(0,X.jsx)(cr,{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:`${le(t??n)} ${d(C.CONVERSATION$AGO)}`})})})]})]})}function ur(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(bt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(C.COMMON$ERROR)})]})}function dr({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null,isPinned:x=!1,onTogglePin:w,alwaysShowPinIcon:T=!1}){let{t:E}=S(`openhands`),{trackDownloadVsCodeButtonClicked:D}=jt(),[O,k]=Y.useState(`view`),{mutateAsync:A}=pt(),j=e=>{e!==``&&e!==a&&r?.(e),k(`view`)},M=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},N=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),k(`edit`),p?.(!1)},F=async e=>{if(e.preventDefault(),e.stopPropagation(),D(),l)try{let e=await en.getVSCodeUrl(l);if(e.vscode_url){let t=Wt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},I=async e=>{e.preventDefault(),e.stopPropagation(),l&&await A(l),p?.(!1)},ee=e=>{e.preventDefault(),e.stopPropagation(),w?.()},L=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":x,"aria-label":E(x?C.CONVERSATION_PANEL$UNPIN_CONVERSATION:C.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:ee,className:H(`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)(wn,{className:H(`h-3.5 w-3.5`,x&&`fill-current`),"aria-hidden":!0})}),R=!!(t||r||i),z=R||!!w,B=T&&x&&!!w,te=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:H(`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)(tr,{title:a,titleMode:O,onTitleSave:j,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(ur,{})]}),(0,X.jsxs)(`div`,{className:H(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,B?`min-w-[3.75rem]`:z&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!B&&(c??s)&&(0,X.jsx)(`p`,{className:H(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,z&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:le(s??c)})}),z?(0,X.jsxs)(`div`,{className:H(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,B?`pointer-events-auto visible opacity-100`:H(`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:[w?L():null,B&&(c??s)&&R?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:H(!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)(ir,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:H(`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:le(s??c)})})]}):null,!B&&R?(0,X.jsx)(ir,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),te&&(0,X.jsx)(lr,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}var fr={bitbucket:dn,bitbucket_data_center:dn,github:ln,gitlab:un};function pr({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 mr({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,createdAt:o}){let{t:s}=S(`openhands`),c=r?.selected_repository??null,l=r?.selected_branch??null,u=r?.git_provider??null,d=u?fr[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)(er,{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)(pr,{label:s(C.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)(ct,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(pr,{label:s(C.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(tn,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(pr,{label:s(C.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(ie,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(pr,{label:s(C.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(pr,{label:s(C.CONVERSATION$CREATED),children:f}):null]})]})}function hr({taskStatus:e}){return(0,X.jsx)(`div`,{className:H(`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 gr({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:H(`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(be(e))})}function _r({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)(hr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(gr,{taskStatus:t})]})}function vr({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:H(`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)(sr,{selectedRepository:e}):(0,X.jsx)(cr,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${le(t)} ${r(C.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function yr({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(C.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:H(`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)(_r,{title:r,taskStatus:e.status})}),(0,X.jsx)(vr,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function br({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 xr({conversationId:e,title:t,selectedRepository:n,executionStatus:i,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}){let{t:g}=S(`openhands`);return(0,X.jsx)(r,{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)(er,{executionStatus:i,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||g(C.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(lr,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:i,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h})]}),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)(Le,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>H(`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)(er,{executionStatus:i,sandboxStatus:a,showTooltip:!1})})})}var Sr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=wt()(Tt(e=>({...Sr,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})),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:Et(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,groupFolderOrder:e.groupFolderOrder})})),Cr=`px-2 pb-1 pt-1`,wr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Tr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:H(Cr,wr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:H(`flex items-baseline justify-between gap-2`,Cr),children:[(0,X.jsx)(`span`,{className:H(`min-w-0 truncate text-left`,wr),children:e}),t]})}function Er(){return(0,X.jsx)(at,{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:H(`group`,et,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:H(`h-3.5 w-3.5`,Qe),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(j,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Dr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Or({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,showHoverMetadata:g,toggleShowHoverMetadata:_,totalConversationsCount:v,onRequestDeleteAll:y}){let{t:b}=S(`openhands`),x=b(r===`local`?C.CONVERSATION_PANEL$BY_WORKSPACE:C.CONVERSATION_PANEL$BY_REPOSITORY),w=Y.useRef(null),T=Y.useRef(null),E=Y.useRef(e);return Y.useEffect(()=>{e?(T.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():E.current&&w.current?.focus(),E.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:w,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":b(C.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:H(`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)]`,tt),children:(0,X.jsx)(Sn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:T,role:`menu`,"aria-orientation":`vertical`,"aria-label":b(C.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=T.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:H(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,K,Xe),children:[(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:ie,label:x,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:_n,label:b(C.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:gn,label:b(C.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:vn,label:b(C.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:Cn,label:b(C.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:En,label:b(C.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:A,label:b(C.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:z,label:b(C.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:ce,label:b(C.CONVERSATION_PANEL$HOVER_METADATA),selected:g,testId:`toggle-hover-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:b(C.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:b(C.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?yn:bn,label:Dr(b(u?C.CONVERSATION$HIDE:C.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ge,label:Dr(b(C.CONVERSATION$DELETE_ALL)),disabled:v===0,onClick:()=>{v!==0&&(y(),t(!1))}})]}):null]})}var kr=H(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Ye);function Ar(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 jr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Pe(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Ar(u,{open:s,enabled:i}),{data:f,error:p}=oe(),m=f?.workspaceParents??[],{mutate:h}=te(),{mutate:g}=se(),{mutate:_}=L(),{mutate:v}=R(),{workspaces:y}=re(),b=ee(p,a),[x,w]=Y.useState(!1),[T,E]=Y.useState(!1),{mutate:D,isPending:O}=Qt(),k=$t(),A=O||k;Y.useEffect(()=>{if(!s||x||T)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,x,T]),Y.useEffect(()=>{if(!s||x||T)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,x,T]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=et,N=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!b,z=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,ne=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&w(!0)},className:M,children:a(C.HOME$ADD_WORKSPACES)}),ie=b?(0,X.jsx)(Je,{content:b,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:ne})}):ne;return(0,X.jsxs)(`div`,{className:H(!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:H(kr,!i&&H(`absolute top-full mt-0`,n)),style:z,children:[(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,K),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(C.HOME$NO_WORKSPACE_OPTION)})})}),y.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:nt,"aria-hidden":!0,children:(0,X.jsx)(st,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:H(`flex flex-col`,K),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(at,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),ie,(y.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(!0)},className:M,children:a(C.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(B,{isOpen:x,onClose:()=>w(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(ae,{isOpen:T,workspaces:y,workspaceParents:m,onClose:()=>E(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function Mr({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:nt,"aria-hidden":!0,children:(0,X.jsx)(st,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Nr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Pe(),{providers:s}=vt(),{lastSelectedProvider:c,setLastSelectedProvider:l}=ht(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Ar(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),y=_t(_,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:b,isLoading:x,isError:w,hasNextPage:T,isFetchingNextPage:E,fetchNextPage:D}=ot({provider:h}),{data:O,isLoading:k}=ft(y,h),A=Y.useMemo(()=>b?.pages.flatMap(e=>e.items)??[],[b]),j=y?O??[]:A,{mutate:M,isPending:N}=Qt(),P=$t(),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),v(``)},L=et;Y.useEffect(()=>{u&&(y||!T||E||x||j.length===0||j.length>=10||D())},[u,y,T,E,x,j.length,D]);let R=y?k:x,z=!y&&T&&j.length>0,B=Y.useCallback(()=>{d(e=>!e)},[]),te=u&&(!i||m!==null),ne=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:H(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:B,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),te&&(0,X.jsxs)(`div`,{"data-testid":r,className:H(kr,!i&&H(`absolute top-full mt-0`,n)),style:ne,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:H(`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)(yt,{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)(fn,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(C.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:H(`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)(at,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,K),children:[R&&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(C.HOME$LOADING_REPOSITORIES)}),w&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(C.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!R&&!w&&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(C.GITHUB$NO_RESULTS)}),j.map(e=>(0,X.jsx)(Mr,{repo:e,disabled:F,onSelect:I,itemClass:L},`${e.git_provider}:${e.id}`)),z&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:E,onClick:()=>D(),className:L,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(E?C.HOME$LOADING_MORE_REPOSITORIES:C.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Pr=H(`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 Fr({backendKind:e}){let{t}=S(`openhands`),n=t(C.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(xn,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(jr,{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:Pr,"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)(Nr,{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:Pr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Ir(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 Lr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Rr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function zr(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 Br(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Vr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Br(t[n])-Br(e[n]))}function Hr(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 Ur(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 Wr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?Hr(n):Ur(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=Vr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:zr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Br(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function Gr(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 Kr(e,t,n,r,i=`after`){if(n===r)return[...e];let a=Gr(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 qr({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:_}=S(`openhands`),v=(0,Y.useRef)(null),y=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,b=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:x,isPreviewTruncated:w,isShowingAll:T}=Ir(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(N.section,{ref:v,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":y,"data-testid":`thread-folder-${b}`,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-${b}`,className:H(`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:H(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:H(`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:y,"aria-expanded":t,"aria-controls":`thread-folder-content-${b}`,"data-testid":`thread-folder-drag-${b}`,"aria-label":_(t?C.CONVERSATION_PANEL$COLLAPSE_FOLDER:C.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=v.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:H(`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)(ie,{className:H(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(F,{className:H(`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:H(`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":_(C.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${b}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h()},children:(0,X.jsx)(ue,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,X.jsxs)(`div`,{id:`thread-folder-content-${b}`,className:`mt-0.5 space-y-0.5`,children:[x.map(g),w?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${b}`,onClick:m,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:_(T?C.CONVERSATION_PANEL$LESS:C.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function Jr({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}=S(`openhands`),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!1),x=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let w=(0,Y.useCallback)(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b(!1),x.current=null},300)},[]),T=(0,Y.useCallback)(()=>{m(null),g(null),v(null)},[]),E=(0,Y.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),D=(0,Y.useCallback)((e,i)=>{if(!p||p===e){T(),w();return}r(Kr(n,t,p,e,i)),T(),w()},[p,n,t,T,r,w]);return(0,X.jsx)(`nav`,{"aria-label":f(C.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(qr,{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:y,isCreatingConversationFlow:c,activeConversationId:l,onToggleExpanded:()=>o(e.id),onDragStart:()=>{b(!0),m(e.id)},onDragEnd:()=>{T(),w()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),g(e.id),v(E(t))},onDragLeave:()=>{g(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),D(e.id,E(t))},onTogglePreviewExpanded:()=>s(e.id),onLaunchFromGroup:()=>u(e.launch),renderConversationCard:d},e.id))})}function Yr({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=S(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Ir(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:H(`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)(wn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(C.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?C.CONVERSATION_PANEL$LESS:C.CONVERSATION_PANEL$MORE)})}):null]})}var Xr={pinsByBackendId:{}};function Zr(e,t){return e[t]??[]}var Qr=wt()(Tt((e,t)=>({...Xr,pinConversation:(n,r)=>{let i=Zr(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=Zr(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{Zr(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=Zr(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:Et(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),$r=()=>{},ei=[],ti=3600*1e3,ni=e=>{let t=Date.now()-ti,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 ri({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:i,navigate:a}=Pe(),{backend:o}=D(),s=Xt(e??$r),[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),v=Z(e=>e.showRepoBranchMetadata),y=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),x=Z(e=>e.toggleShowLlmProfiles),T=Z(e=>e.showHoverMetadata),O=Z(e=>e.toggleShowHoverMetadata),k=Z(e=>e.organizeMode),A=Z(e=>e.setOrganizeMode),j=Z(e=>e.conversationSort),M=Z(e=>e.setConversationSort),N=Z(e=>e.threadScope),P=Z(e=>e.setThreadScope),F=Z(e=>e.groupFolderOrder),I=Z(e=>e.setGroupFolderOrder),[ee,L]=Y.useState(!1),[R,z]=Y.useState(!1),B=Xt(()=>{L(!1)}),[te,ne]=Y.useState(()=>new Set),[re,ie]=Y.useState(()=>new Set),[ae,oe]=Y.useState(!1),V=Qr(e=>e.pinsByBackendId[o.id]??ei),se=Qr(e=>e.togglePin),ce=Qr(e=>e.pruneMissingConversations),le=Y.useCallback(e=>{ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ue=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{k!==`grouped`&&(ne(new Set),ie(new Set))},[k]);let de=Y.useRef(null),[fe,pe]=Y.useState(null),[me,he]=Y.useState(null),[ge,_e]=Y.useState(null),{data:ve,isLoading:be,isFetched:U,hasNextPage:xe,isFetching:Se,isFetchingNextPage:Ce,fetchNextPage:we}=qn(),{data:Te}=Jn(),W=Y.useMemo(()=>{let e=ve?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[ve]),Ee=Y.useMemo(()=>Lr(V,W),[W,V]);Y.useEffect(()=>{U&&ce(o.id,W.map(e=>e.id))},[o.id,W,U,ce]),Y.useEffect(()=>{V.length===0&&oe(!1)},[V.length]);let De=Y.useMemo(()=>{let e=N===`relevant`?W.filter(e=>ye(e.execution_status)):W;return t?e:Rr(e,V)},[t,W,V,N]),{recent:G,older:Oe}=Y.useMemo(()=>ni(De),[De]),ke=Y.useMemo(()=>Vr(g?[...G,...Oe]:G,j),[G,Oe,g,j]),Ae=Y.useMemo(()=>({emptyWorkspace:n(C.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(C.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),je=Y.useMemo(()=>t||k!==`grouped`?null:Wr([...G,...g?Oe:[]],o.kind,j,Ae),[o.kind,t,j,Ae,Oe,k,G,g]),Me=Y.useMemo(()=>je?Gr(je,F):null,[je,F]),Ne=Y.useMemo(()=>je?.map(e=>e.id)??[],[je]),Fe=Y.useMemo(()=>Vr(G.filter(e=>ye(e.execution_status)),j),[j,G]),Ie=ke.length,Re=Y.useMemo(()=>Me?Me.reduce((e,t)=>e+t.conversations.length,0):0,[Me]),ze=k===`grouped`&&!t?Re===0:Ie===0,Be=k===`grouped`&&!t?Re:Ie,[Ve,He]=Y.useState(null),Ue=Y.useRef(Be);Ue.current=Be;let We=Y.useCallback(()=>{xe&&He(Ue.current)},[xe]);Y.useEffect(()=>{if(Ve!==null){if(Be>Ve){He(null);return}if(!xe){He(null);return}Se||Ce||we()}},[Ve,Be,xe,Se,Ce,we]);let Ge=Ve!==null||Ce,{mutate:Ke,mutateAsync:qe}=ut(),{mutate:Je}=dt(),{mutate:Ye}=Yt(),Xe=Oe.length>0&&!g,Ze=!!xe&&!Xe&&!t&&!ze,{mutate:K}=Qt(),Qe=$t(),$e=Y.useCallback(e=>{Qe||K({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[K,Qe,a]),et=Y.useCallback((e,t)=>{l(!0),pe(e),he(t)},[]),tt=Y.useCallback(e=>{d(!0),pe(e)},[]),nt=Y.useCallback((e,t)=>{Ye({conversationId:e,newTitle:t},{onSuccess:()=>{w(n(C.CONVERSATION$TITLE_UPDATED))}})},[n,Ye]),rt=()=>{fe&&Ke({conversationId:fe},{onSuccess:()=>{fe===i&&a(`/conversations`)}})},it=()=>{fe&&Je({conversationId:fe})},at=async()=>{let e=W.map(e=>e.id),t=await Promise.allSettled(e.map(e=>qe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),r=t.length-n.length;i!==null&&n.includes(i)&&a(`/conversations`),r>0&&E(`${r} conversation${r===1?``:`s`} could not be deleted.`)},ot=Y.useCallback((n,a)=>{let s=V.includes(n.id);return t?(0,X.jsx)(xr,{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===i,onClose:e,showRepositoryMetadata:v,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(r,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!T||ge===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)(mr,{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)(Le,{to:`/conversations/${n.id}`,onClick:e,className:H(`block rounded-md transition-colors`,ge!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===i||ge===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(dr,{onDelete:()=>et(n.id,n.title??``),onStop:()=>tt(n.id),onChangeTitle:e=>nt(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:ge===n.id,onContextMenuToggle:e=>_e(e?n.id:null),isActive:n.id===i,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:v,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server,isPinned:s,onTogglePin:()=>se(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,i,nt,et,tt,e,ge,V,v,b,T,se]),st=be||!U,ct=!t&&!st&&Ee.length>0,lt=U&&!be&&!t&&ze&&!ct&&!Te?.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:H(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,R?`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(C.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(Fr,{backendKind:o.kind}),(0,X.jsx)(Or,{filterMenuOpen:ee,setFilterMenuOpen:L,menuRef:B,backendKind:o.kind,organizeMode:k,setOrganizeMode:A,conversationSort:j,setConversationSort:M,threadScope:N,setThreadScope:P,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:v,toggleShowRepoBranchMetadata:y,showLlmProfiles:b,toggleShowLlmProfiles:x,showHoverMetadata:T,toggleShowHoverMetadata:O,totalConversationsCount:W.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:de,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{z(e.currentTarget.scrollTop>0)},className:H(`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:[st&&(0,X.jsx)(br,{compact:t}),!t&<&&(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(C.CONVERSATION$NO_CONVERSATIONS)})}),ct?(0,X.jsx)(Yr,{pinnedConversations:Ee,isPreviewExpanded:ae,onTogglePreviewExpanded:()=>oe(e=>!e),activeConversationId:i,showDivider:!t&&k===`chronological`,renderConversationCard:e=>ot(e,{inPinnedSection:!0})}):null,!t&&Te?.map(t=>(0,X.jsx)(Le,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(yr,{task:t})},t.id)),!st&&t?Fe.map(e=>ot(e)):null,!st&&!t&&k===`grouped`&&Me&&Me.length>0?(0,X.jsx)(Jr,{groups:Me,groupIds:Ne,groupFolderOrder:F,setGroupFolderOrder:I,collapsedGroupIds:te,expandedGroupPreviewIds:re,onToggleGroupCollapsed:le,onToggleGroupPreviewExpanded:ue,isCreatingConversationFlow:Qe,activeConversationId:i,onLaunchFromGroup:$e,renderConversationCard:e=>ot(e)}):null,!st&&!t&&k===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:ke.map(e=>ot(e))}):null,Ze&&(Ge?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(br,{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(C.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(Ht,{onConfirm:()=>{rt(),l(!1),he(null)},onCancel:()=>{l(!1),he(null)},conversationTitle:me??void 0}),m&&(0,X.jsx)(Ht,{title:n(C.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(C.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:W.length}),onConfirm:async()=>{await at(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)(Vt,{onConfirm:()=>{it(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(Yn,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function ii({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)(ri,{})})})}var ai=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,oi=34,si=Math.round(oi*30/46);function ci({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:_}=S(`openhands`),y=m;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:He(e),children:[(0,X.jsxs)(`div`,{className:H(e&&t?Ue:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:H(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)(kn,{logoWidth:oi,logoHeight:si,logoClassName:`max-w-none`,className:H(Re,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:H(We,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(v,{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:H(`hidden md:inline-flex ml-auto`,Ve,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(C.SIDEBAR$CLOSE_MENU),className:H(`inline-flex ml-auto`,Ve,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:ze(e),children:[(0,X.jsx)(Kn,{collapsed:e}),(0,X.jsx)(qe,{to:`/conversations`,end:!0,label:_(C.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(ue,{width:$,height:$})}),(0,X.jsx)(qe,{to:`/customize`,label:_(C.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)(qe,{to:`/automations`,label:_(C.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(ai,{width:$,height:$})})]}),(0,X.jsx)(ii,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:H(ze(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(Je,{content:_(C.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Le,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(C.SIDEBAR$SETTINGS),className:Be({collapsed:!0}),children:[(0,X.jsx)(Ke,{active:l.startsWith(`/settings`),children:(0,X.jsx)(pe,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Ge(!0),children:_(C.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":_(C.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:H(Be({collapsed:!0}),`relative`),children:[(0,X.jsx)(Ke,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(Ot,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(Tn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Ge(!0),children:_(C.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)(Un,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:H(`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)(Un,{sidebarCollapsed:e,openUpward:!0})})]})}var li=Y.lazy(()=>n(()=>import(`./settings-modal-DeK11CyT.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]))),ui=Y.lazy(()=>n(()=>import(`./add-backend-modal-CxC7BNEc.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([39,1,2,40,6,7,14,9,15,3,4,5,8,10,11,12,41,37,36,42,23,18,24,28,26,43,29,44,45,46,47,16,35,34,32,33,27]))),di=Y.lazy(()=>n(()=>import(`./manage-backends-modal-CKQ46rvw.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([48,1,2,6,7,14,9,15,49,10,50,51,3,4,5,8,11,12,40,41,37,36,42,23,18,24,28,26,43,29,44,45,46,47,16,35,34,32,33,27,52,53]))),fi=250;function pi(){let{t:e}=S(`openhands`),{currentPath:t}=Pe(),{data:n}=Ne(),{data:r,error:i,isError:a,isFetching:o}=kt(),{backends:s,active:c}=O(),l=Ee(s)[c.backend.id],u=me(e=>e.collapsed),d=me(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[y,b]=Y.useState(!1),[x,w]=Y.useState(!1),T=Y.useRef(!1),[,D]=Y.useReducer(e=>e+1,0),{isOpen:k,close:A}=Gt(),[j,M]=Y.useState(!1),[N,P]=Y.useState(!1),F=Xt(()=>h(!1)),I=At(i);Y.useEffect(()=>{A()},[t,A]),Y.useEffect(()=>{if(k){M(!0);let e=requestAnimationFrame(()=>{P(!0)});return()=>cancelAnimationFrame(e)}P(!1);let e=window.setTimeout(()=>{M(!1)},fi);return()=>window.clearTimeout(e)},[k]),Y.useEffect(()=>{if(!k)return;let e=e=>{e.key===`Escape`&&A()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[k,A]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&I!==404?E(e(C.SETTINGS$FETCH_ERROR)):I===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,I,n?.feature_flags?.hide_llm_settings,e]);let ee=e(u?C.SIDEBAR$EXPAND:C.SIDEBAR$COLLAPSE),L=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),R={collapseToggleLabel:ee,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,D(),d(!0),window.setTimeout(()=>{T.current=!1,D()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&x&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:F,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>b(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:L,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:H(`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)(ci,{collapsed:u,showCollapseToggle:!0,...R})}),j?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:H(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,N?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${fi}ms`},onClick:A,"aria-hidden":!N}),(0,X.jsx)(`aside`,{"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!N,className:H(`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`,N?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${fi}ms`},children:(0,X.jsx)(ci,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:A,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(li,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ui,{onClose:()=>v(!1)})}),y&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(di,{onClose:()=>b(!1)})})]})}var mi=`/settings`,hi=`/customize`,gi=[`/skills`,`/mcp`,`/plugins`];function _i(e){return e===mi?{mode:`menu`}:e.startsWith(`${mi}/`)&&e.length>9?{mode:`back`,backTo:mi,backLabelKey:C.SETTINGS$TITLE}:e===hi?{mode:`menu`}:gi.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:hi,backLabelKey:C.NAV$CUSTOMIZE}:{mode:`menu`}}function vi(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Pe(),r=_i(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(Jt,{}),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??C.COMMON$BACK),className:Kt,children:(0,X.jsx)(M,{size:20,className:Ut,"aria-hidden":!0,strokeWidth:2})}):null]})}function yi(){let{backend:e}=D(),t=e.kind===`local`,{data:n}=Zt(),{mutate:r,isPending:i}=he(),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 bi=()=>{let{backend:e}=D(),{data:t}=kt(),{mutate:n,isPending:r}=pn(`personal`,{retry:2}),i=Y.useSyncExternalStore(W,Se,()=>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`&&Te(i);return}let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}Ce(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])},xi=()=>{let{backend:e}=D(),{data:t}=kt(),n=St(),r=e.kind===`cloud`?n[e.id]:void 0,i=r?.isLoading??!0,a=r?.userId??null,o=t?.email||t?.git_user_email||void 0;Y.useEffect(()=>{if(!(e.kind!==`cloud`||i)){if(!a){we(null);return}we(a,o?{email:o}:{})}},[e.kind,o,i,a])};function Si(e){switch(e){case U.RUNNING:return`🟢`;case U.FINISHED:case U.IDLE:case U.WAITING_FOR_CONFIRMATION:return`✅`;case U.PAUSED:return`⚪`;case U.ERROR:case U.STUCK:return`🔴`;default:return null}}var Ci=`OpenHands`,wi=()=>{let{conversationId:e}=f(),{data:t}=mn(e??null),n=hn(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Ci}`:Ci;if(!e)return i;let a=Si(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Ti({children:e}){let{pathname:t}=g(),n=u(),r=d(),i=h(),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)(Fe,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Ei=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-B1PFO8P8.js`),__vite__mapDeps([54,1,2,3,4,55]))),Di=Y.lazy(()=>n(()=>import(`./alert-banner-Dh51WURQ.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([56,1,2,57,3,4,58,59,11,12,29,60,61,20]))),Oi=Y.lazy(()=>n(()=>import(`./command-menu-oTvKDU3Y.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([62,1,2,10,63,64,65,66,67,68,69,3,4,11,12,29]))),ki=p(function(){let e=c(),{t}=S(`openhands`);return s(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(C.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(C.ERROR$UNKNOWN)})})}),Ai=l(function(){let e=g(),t=wi(),{data:n}=kt(),r=Ne();if(bi(),xi(),yi(),Y.useEffect(()=>{n?.language&&T.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)(Me,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=ne(e.search);return(0,X.jsx)(Ti,{children:(0,X.jsxs)(zt,{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)(pi,{}),(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)(vi,{}),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)(Di,{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)(m,{})})]})]}),(0,X.jsxs)(Y.Suspense,{fallback:null,children:[(0,X.jsx)(Ei,{}),(0,X.jsx)(Oi,{})]}),a?(0,X.jsx)(V,{}):null]})})});export{ki as ErrorBoundary,Ai as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-BnZ7mMu7.js","assets/rolldown-runtime-BFRubm34.js","assets/vendor-styling-CI0PQ3ab.js","assets/declaration-BGsHjPEW.js","assets/useTranslation-Cbf5AGg_.js","assets/active-backend-context-DHhm10VS.js","assets/agent-server-compatibility-C0MtTTwb.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js","assets/createLucideIcon-D4Tak8A1.js","assets/utils-DB9LsAzA.js","assets/common-CxbUL3nR.js","assets/model-selector-D51W2Q9b.js","assets/useQuery-D5pEZbY0.js","assets/suspense-DmZ3MSSh.js","assets/proxy-G4ce0fnQ.js","assets/combobox-caret-CxZpqoSR.js","assets/form-control-classes-CbdN5aO3.js","assets/sdk-settings-schema-CLR01YIK.js","assets/dist-CodhvuAP.js","assets/llm-subscription-DtsX5Lhg.js","assets/map-provider-BbIb12oh.js","assets/brand-button-B1izLAdR.js","assets/settings-input-BsgQWS5R.js","assets/base-modal-CIF_785P.js","assets/modal-body-Cc2zp0xb.js","assets/modal-classes-3qT9Ap7Q.js","assets/modal-backdrop-zVwfOJZr.js","assets/navigation-context-DPs2G0X8.js","assets/use-save-settings-DiDEbIJw.js","assets/useMutation-u8UgRgDK.js","assets/settings-service.api-DPTFyRXL.js","assets/settings-mQUckT0g.js","assets/use-settings-BeJap6YL.js","assets/use-tracking-DFoPQUSU.js","assets/telemetry-SHxpVxk8.js","assets/client-source-CtQjJEy6.js","assets/settings-utils-DzCVfiR3.js","assets/add-backend-modal-BoMkMyLB.js","assets/backend-form-modal-B8GtBA-J.js","assets/cloud-funnel-analytics-uzzLlLuj.js","assets/segmented-toggle-kzwZkLaj.js","assets/modal-close-button-BcIBUdSq.js","assets/use-backends-health-BagmAE_W.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js","assets/useQueries-BpIlT8Mt.js","assets/organization-service.api-Da2jiuBS.js","assets/manage-backends-modal-nMoCZ2a0.js","assets/pencil-CWhApFIT.js","assets/refresh-cw-B9B7-vsy.js","assets/trash-2-BU6BlW4i.js","assets/confirmation-modal-DGBWM2Ls.js","assets/use-cloud-current-user-id-BwMX7jHW.js","assets/environment-switch-overlay-B1PFO8P8.js","assets/environment-switch-store-DkjlKWzN.js","assets/alert-banner-Dh51WURQ.js","assets/vendor~conversation-panel~conversation~alert-banner-CxfzCmkN.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js","assets/iconBase-Dz51Zn5x.js","assets/close-DLFb5kfv.js","assets/typography-CzfoD9DY.js","assets/command-menu-oTvKDU3Y.js","assets/bot-C-EA6685.js","assets/list-todo-CAtvkzcy.js","assets/search-dIQ09UY2.js","assets/sidebar-store-uiUXBU1N.js","assets/middleware-DYHYNAnP.js","assets/react-DPDgL6du.js","assets/x-ZE4iplpF.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,St as n,a as r,bt as i,xt as a}from"./vendor-styling-CI0PQ3ab.js";import{A as o,C as s,F as c,L as l,M as u,N as d,P as f,R as p,c as m,j as h,k as g}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{h as _,m as v,r as y,t as b}from"./path-utils-D53ZHUQU.js";import{t as x}from"./useQuery-D5pEZbY0.js";import{t as S}from"./useTranslation-Cbf5AGg_.js";import{t as C}from"./declaration-BGsHjPEW.js";import{C as w,F as T,S as E,n as D,r as O}from"./active-backend-context-DHhm10VS.js";import{t as k}from"./createLucideIcon-D4Tak8A1.js";import{t as A}from"./bot-C-EA6685.js";import{t as j}from"./check-TbOEtHKj.js";import{n as M,t as N}from"./vendor~root-layout~conversation-panel~conversation-8tIsyrPj.js";import{r as P}from"./onboarding-modal-Bxuxpfdz.js";import{n as F,t as I}from"./vendor~root-layout~index-home~home~conversation-panel~conversation-BTvhGHHG.js";import{a as ee,c as L,d as R,f as z,i as B,l as te,n as ne,o as re,p as ie,r as ae,s as oe,t as V,u as se}from"./onboarding-Dx8n8HFr.js";import{n as ce,t as le}from"./format-time-delta-DhDbkD7V.js";import{n as ue}from"./refresh-cw-B9B7-vsy.js";import{t as de}from"./search-dIQ09UY2.js";import{n as fe,r as pe,t as me}from"./sidebar-store-uiUXBU1N.js";import{i as he}from"./llm-settings-Cs_iieFY.js";import{t as ge}from"./trash-2-BU6BlW4i.js";import{t as _e}from"./x-ZE4iplpF.js";import{S as ve,b as ye,t as H,y as be}from"./utils-DB9LsAzA.js";import{t as U}from"./common-CxbUL3nR.js";import{S as xe}from"./agent-server-compatibility-C0MtTTwb.js";import{a as Se,c as Ce,l as we,t as Te,u as W}from"./telemetry-SHxpVxk8.js";import{a as Ee}from"./use-backends-health-BagmAE_W.js";import{t as De}from"./modal-backdrop-zVwfOJZr.js";import{n as G}from"./modal-body-Cc2zp0xb.js";import{i as Oe,r as ke}from"./base-modal-CIF_785P.js";import{_ as Ae,c as je}from"./form-control-classes-CbdN5aO3.js";import{t as Me}from"./loading-spinner-BcdnT0mN.js";import{t as Ne}from"./use-config-B39iHYFi.js";import{n as Pe,t as Fe}from"./navigation-context-DPs2G0X8.js";import{t as Ie}from"./openhands-logo-bcNw5bkY.js";import{t as Le}from"./navigation-link-D8hfwvxI.js";import{a as Re,d as ze,f as Be,i as Ve,l as He,n as Ue,r as We,u as Ge}from"./sidebar-layout-Bm7pa3Vk.js";import{n as Ke,t as qe}from"./sidebar-nav-link-CHqyFXwV.js";import{t as Je}from"./styled-tooltip-B14i_Uac.js";import{a as Ye,d as Xe,f as Ze,i as K,l as Qe,n as $e,o as et,r as tt,u as nt}from"./dropdown-classes-D3wMJlXT.js";import{r as rt,t as it}from"./combobox-caret-CxZpqoSR.js";import{_ as at,a as ot,c as st,d as ct,f as lt,g as ut,h as dt,i as ft,l as pt,m as mt,n as ht,p as gt,r as _t,s as vt,t as yt,u as bt}from"./git-provider-icon-xvbukHaT.js";import{n as xt,t as St}from"./use-cloud-current-user-id-BwMX7jHW.js";import{s as Ct}from"./environment-switch-store-DkjlKWzN.js";import{t as wt}from"./react-DPDgL6du.js";import{r as Tt,t as Et}from"./middleware-DYHYNAnP.js";import{t as Dt}from"./conversation-store-LptbOvKa.js";import{o as Ot}from"./backend-form-modal-B8GtBA-J.js";import{r as kt,t as At}from"./use-settings-BeJap6YL.js";import{t as jt}from"./use-tracking-DFoPQUSU.js";import{t as Mt}from"./add-backend-modal-BoMkMyLB.js";import{t as Nt}from"./manage-backends-modal-nMoCZ2a0.js";import{t as Pt}from"./agent-server-conversation-service.api-lzc8dabY.js";import{c as Ft,d as It,u as Lt}from"./acp-providers-DerAmTyY.js";import{t as Rt}from"./use-is-authed-BezEyfeh.js";import{a as zt,c as Bt,d as Vt,f as Ht,i as Ut,l as Wt,o as Gt,r as Kt,s as qt,t as Jt,u as Yt}from"./sidebar-mobile-menu-toggle-CTX7J4wM.js";import{t as Xt}from"./use-click-outside-element-D9BYdANT.js";import{t as Zt}from"./use-llm-profiles-CgRtnj74.js";import{n as Qt}from"./use-create-conversation-CkKUQVbP.js";import{r as $t}from"./recommended-automations-launcher-BWRRvMPE.js";import{t as en}from"./conversation-service.api-D8QU-BiL.js";import{r as tn,t as nn}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-BrguKXCn.js";import{n as rn,t as q}from"./context-menu-list-item-6psNyl7X.js";import{i as J,r as an,t as on}from"./ellipsis-button-CbNnHlIq.js";import{t as sn}from"./u-edit-DL5LgKon.js";import{t as cn}from"./skills-EqzxYBvT.js";import{a as ln,o as un,t as dn}from"./vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation~aler~gfu7qdtz-BOKQkbc6.js";import{t as fn}from"./search-BgOCR7_c.js";import{t as pn}from"./use-save-settings-DiDEbIJw.js";import{t as mn}from"./use-user-conversation-BrN2xeQU.js";import{t as hn}from"./conversation-state-store-B2Bp32XI.js";var gn=k(`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`}]]),_n=k(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),vn=k(`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`}]]),yn=k(`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`}]]),bn=k(`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`}]]),xn=k(`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`}]]),Sn=k(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),Cn=k(`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`}]]),wn=k(`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`}]]),Tn=k(`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`}]]),En=k(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=i(),Dn=46,On=30;function kn({className:e,logoClassName:t,logoWidth:n=Dn,logoHeight:r=On}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Le,{to:`/conversations`,"aria-label":i(C.BRANDING$OPENHANDS_LOGO),className:H(e),children:(0,X.jsx)(Ie,{width:n,height:r,className:H(`shrink-0`,t)})})}function An(){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 jn({onClear:e}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-clear`,onClick:e,"aria-label":`Clear selection`,className:`text-white hover:text-[var(--oh-text-tertiary)]`,children:(0,X.jsx)(_e,{size:14})})}function Mn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:H(rt,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(it,{})})}function Nn({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:H(`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:H(`p-0`,K)}),children:[e&&t.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,children:r}),e&&t.map((e,t)=>(0,X.jsxs)(`li`,{...a({item:e,index:t,className:H(et,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:nt,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)(at,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function Pn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:H(`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`,je,`px-0 not-italic text-inherit`)})})}var Fn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function In({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}=I({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===I.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:H(`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:Fn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:Fn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:H(Ze,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)(Pn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(An,{}),n&&w&&(0,X.jsx)(jn,{onClear:()=>T(null)}),(0,X.jsx)(Mn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(Nn,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var Ln=`::`;function Rn(e,t){return t?`${e}${Ln}${t}`:e}function zn(e){let[t,n]=e.split(Ln);return{backendId:t,orgId:n??null}}function Bn(e){return(0,X.jsx)(Ot,{isConnected:e?.isConnected??null})}function Vn(){return(0,X.jsx)(Ot,{isConnected:`unavailable`})}function Hn(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:Rn(e.id,null),label:e.name,prefix:Bn(i[e.id])});for(let e of s){let o=n[e.id],s=Bn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Rn(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:Rn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Un({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:r,onOpenAddBackend:i,onOpenManageBackends:a,sidebarCollapsed:s=!1}={}){let{t:c}=S(`openhands`),{backends:l,active:d,setActive:f}=O(),p=xt(),m=St(),h=Ee(l),g=u(),_=o(`/settings`),v=o(`/settings/*`),y=o(`/conversations/:conversationId`),b=o(`/automations/:automationId`),[x,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=c(C.BACKEND$PERSONAL_WORKSPACE),k=Y.useMemo(()=>Hn(l,D,p,m,h),[l,D,p,m,h]),A=xe(d.backend),j=c(C.BACKEND$NO_BACKEND_AVAILABLE),M=Rn(d.backend.id,d.orgId),N=A?void 0:k.find(e=>e.value===M),P=!!(_||v),F=c(C.SIDEBAR$SETTINGS),I=Dt(e=>e.isRightPanelShown),ee=!s||y&&I?`top`:`left`,L=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(A||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,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)},[d,p,m,f,A]);let R=Y.useCallback(()=>{if(i){i(),r?.();return}w(!0)},[i,r]),z=Y.useCallback(()=>{if(a){a(),r?.();return}E(!0)},[a,r]),B=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),te=Y.useCallback(e=>{B(e),R()},[R,B]),ne=Y.useCallback(e=>{B(e),R()},[R,B]),re=Y.useCallback(e=>{B(e),z()},[z,B]),ie=Y.useCallback(e=>{B(e),z()},[z,B]),ae=(0,X.jsxs)(`div`,{className:K,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:ne,onClick:te,className:H($e,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:nt,"aria-hidden":!0,children:(0,X.jsx)(ue,{width:16,height:16})}),c(C.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:B,onTouchStart:B,onTouchEnd:ie,onClick:re,className:H($e,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:nt,"aria-hidden":!0,children:(0,X.jsx)(pe,{width:16,height:16})}),c(C.BACKEND$MANAGE)]})]}),oe=Y.useCallback(async e=>{if(e===M)return;let{backendId:t,orgId:n}=zn(e),i=l.find(e=>e.id===t);i&&(Ct(k.find(t=>t.value===e)?.label??i.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):b&&g(`/automations`),f(i.id,n),r?.())},[M,l,y,b,g,k,f,c,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)(In,{testId:`backend-selector`,defaultValue:N??{value:M,label:A?j:d.backend.name,prefix:A?Vn():Bn(h[d.backend.id])},footer:ae,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&oe(e.value)},placeholder:A?j:d.backend.name,loading:L,options:k,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}-${N?.label??``}`)}),t?null:(0,X.jsx)(Je,{content:F,placement:ee,offset:10,children:(0,X.jsx)(Le,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":P,"aria-label":F,className:H(P?`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`,Ae),children:(0,X.jsx)(pe,{width:16,height:16})})})]}),x?(0,X.jsx)(Mt,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(Nt,{onClose:()=>E(!1)}):null]})}var Wn=`command-menu-trigger`,Gn=18;function Kn({collapsed:e}){let{t}=S(`openhands`),n=fe(e=>e.open),r=t(C.COMMAND_MENU$OPEN_LABEL),i=(0,X.jsxs)(`button`,{type:`button`,"data-testid":Wn,"aria-label":r,onClick:n,className:H(Be({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)(Ke,{active:!1,children:(0,X.jsx)(de,{width:Gn,height:Gn})}):(0,X.jsx)(`span`,{className:H(Re,`text-[var(--oh-muted)] group-hover:text-white`),"aria-hidden":`true`,children:(0,X.jsx)(de,{width:Gn,height:Gn})}),(0,X.jsx)(`span`,{className:Ge(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(C.COMMAND_MENU$SHORTCUT)})]});return e?(0,X.jsx)(Je,{content:r,placement:`right`,children:i}):i}var qn=(e=20)=>{let{data:t}=Rt(),n=D(),r=!xe(n.backend);return _({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await Pt.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},Jn=(e=10)=>x({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function Yn({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(De,{onClose:n,children:(0,X.jsxs)(G,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(ke,{title:r(C.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(Oe,{text:r(C.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(Oe,{text:r(C.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}function Xn({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:H(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),children:t})}var Zn=e=>{switch(e){case U.FINISHED:return`check`;case U.RUNNING:return`working`;case U.IDLE:case U.WAITING_FOR_CONFIRMATION:return`active`;case U.PAUSED:return`paused`;case U.ERROR:case U.STUCK:return`error`;default:return`unknown`}},Qn=(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 $n(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 er({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:Zn(e),o=r(Qn(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)(nn,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):$n(a)});return n?(0,X.jsx)(Je,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function tr({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){let a=mt(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)(er,{executionStatus:r,sandboxStatus:i,showTooltip:!1})}),(0,X.jsx)(Xn,{title:e,titleMode:t,onSave:n,isConversationArchived:a})]})}var nr=e(a(),1);function rr({onClose:e,onDelete:t,onStop:n,onEdit:r,onDisplayCost:i,onShowAgentTools:a,onShowSkills:o,onDownloadViaVSCode:s,onDownloadConversation:c,position:l=`bottom`,floatingStyle:u,ignoreOutsideClickRef:d}){let{t:f}=S(`openhands`),{backend:p}=D(),m=Xt(e,d),h=p.kind===`cloud`?C.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:C.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)(at,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(rn,{ref:m,testId:`context-menu`,style:_?u:void 0,theme:_?`popover`:`default`,position:_?`none`:l,alignment:_?`none`:`right`,spacing:_?`none`:`default`,className:_?`mt-0 min-w-[200px] w-max max-w-[min(280px,100vw-16px)]`:`z-[200] mt-0`,children:[g([r&&(0,X.jsx)(q,{testId:`edit-button`,onClick:r,children:(0,X.jsx)(J,{icon:(0,X.jsx)(sn,{width:16,height:16}),text:f(C.BUTTON$RENAME)})},`edit-button`)],`edit-section`),g([a&&(0,X.jsx)(q,{testId:`show-agent-tools-button`,onClick:a,children:(0,X.jsx)(J,{icon:(0,X.jsx)(gt,{width:16,height:16}),text:f(C.BUTTON$SHOW_AGENT_TOOLS_AND_METADATA)})},`show-agent-tools-button`),o&&(0,X.jsx)(q,{testId:`show-skills-button`,onClick:o,children:(0,X.jsx)(J,{icon:(0,X.jsx)(cn,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(C.CONVERSATION$SHOW_SKILLS)})},`show-skills-button`)],`tools-section`),g([n&&(0,X.jsx)(q,{testId:`stop-button`,onClick:n,children:(0,X.jsx)(J,{icon:(0,X.jsx)(lt,{width:16,height:16}),text:f(h)})},`stop-button`),s&&(0,X.jsx)(q,{testId:`download-vscode-button`,onClick:s,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Bt,{width:16,height:16}),text:f(C.BUTTON$DOWNLOAD_VIA_VSCODE)})},`download-vscode-button`),c&&(0,X.jsx)(q,{testId:`download-trajectory-button`,onClick:c,children:(0,X.jsx)(J,{icon:(0,X.jsx)(Bt,{width:16,height:16}),text:f(C.BUTTON$DOWNLOAD_CONVERSATION_DATA)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(qt,{width:16,height:16}),text:f(C.BUTTON$DISPLAY_COST)})},`display-cost-button`),t&&(0,X.jsx)(q,{testId:`delete-button`,onClick:t,children:(0,X.jsx)(J,{icon:(0,X.jsx)(an,{width:16,height:16}),text:f(C.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function ir({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ve(s),d=ye(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)(on,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:H(u&&`opacity-60`)}),e&&m&&h?(0,nr.createPortal)((0,X.jsx)(rr,{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 ar(e){return e?e.split(`/`).pop()||e:null}var or={bitbucket:dn,bitbucket_data_center:dn,github:ln,gitlab:un};function sr({selectedRepository:e}){let t=e.git_provider?or[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)(ct,{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)(tn,{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 cr({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?b(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)(y,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(C.COMMON$NO_REPOSITORY)})]})}function lr({selectedRepository:e,lastUpdatedAt:t,createdAt:n,executionStatus:r,workspaceWorkingDir:i,showRepositoryMetadata:a=!0,showTimestamp:o=!0,llmModel:s,showAgentChip:c=!1,agentKind:l=null,acpServer:u=null}){let{t:d}=S(`openhands`),f=ve(r),p=null;if(c)if(l===`acp`){let e=Ft(u)??d(C.CONVERSATION$ACP_AGENT_GENERIC),t=Lt(u,s),n=t??e;p={kind:It(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:ar(s)??s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:H(`flex flex-col gap-0.5 mt-0.5 w-full min-w-0`,f&&`opacity-60`),children:[p?(0,X.jsx)(`div`,{className:m,children:(0,X.jsxs)(`span`,{"data-testid":`conversation-card-agent-chip`,className:`inline-flex items-center gap-1 text-xs text-[var(--oh-muted)] max-w-full min-w-0`,title:p.tooltip,children:[(0,X.jsx)(P,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:H(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(sr,{selectedRepository:e}):(0,X.jsx)(cr,{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:`${le(t??n)} ${d(C.CONVERSATION$AGO)}`})})})]})]})}function ur(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(bt,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(C.COMMON$ERROR)})]})}function dr({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null,isPinned:x=!1,onTogglePin:w,alwaysShowPinIcon:T=!1}){let{t:E}=S(`openhands`),{trackDownloadVsCodeButtonClicked:D}=jt(),[O,k]=Y.useState(`view`),{mutateAsync:A}=pt(),j=e=>{e!==``&&e!==a&&r?.(e),k(`view`)},M=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},N=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},P=e=>{e.preventDefault(),e.stopPropagation(),k(`edit`),p?.(!1)},F=async e=>{if(e.preventDefault(),e.stopPropagation(),D(),l)try{let e=await en.getVSCodeUrl(l);if(e.vscode_url){let t=Wt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},I=async e=>{e.preventDefault(),e.stopPropagation(),l&&await A(l),p?.(!1)},ee=e=>{e.preventDefault(),e.stopPropagation(),w?.()},L=()=>(0,X.jsx)(`button`,{type:`button`,"data-testid":l?`conversation-pin-toggle-${l}`:`conversation-pin-toggle`,"aria-pressed":x,"aria-label":E(x?C.CONVERSATION_PANEL$UNPIN_CONVERSATION:C.CONVERSATION_PANEL$PIN_CONVERSATION),onClick:ee,className:H(`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)(wn,{className:H(`h-3.5 w-3.5`,x&&`fill-current`),"aria-hidden":!0})}),R=!!(t||r||i),z=R||!!w,B=T&&x&&!!w,te=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:H(`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)(tr,{title:a,titleMode:O,onTitleSave:j,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(ur,{})]}),(0,X.jsxs)(`div`,{className:H(`relative ml-auto pl-2 flex items-center justify-end shrink-0`,B?`min-w-[3.75rem]`:z&&`group-hover:min-w-[3.75rem] group-focus-within:min-w-[3.75rem]`,f&&`min-w-[3.75rem]`),children:[!B&&(c??s)&&(0,X.jsx)(`p`,{className:H(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,z&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:le(s??c)})}),z?(0,X.jsxs)(`div`,{className:H(`absolute right-0 top-1/2 flex -translate-y-1/2 items-center gap-0.5 transition-opacity`,B?`pointer-events-auto visible opacity-100`:H(`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:[w?L():null,B&&(c??s)&&R?(0,X.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,X.jsx)(`div`,{className:H(!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)(ir,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i})}),(0,X.jsx)(`p`,{className:H(`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:le(s??c)})})]}):null,!B&&R?(0,X.jsx)(ir,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&M,onStop:n&&N,onEdit:r&&P,onDownloadViaVSCode:F,onDownloadConversation:I,executionStatus:u,conversationId:l,showOptions:i}):null]}):null]})]}),te&&(0,X.jsx)(lr,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}var fr={bitbucket:dn,bitbucket_data_center:dn,github:ln,gitlab:un};function pr({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 mr({title:e,executionStatus:t,sandboxStatus:n,selectedRepository:r,workspaceWorkingDir:i,llmModel:a,createdAt:o}){let{t:s}=S(`openhands`),c=r?.selected_repository??null,l=r?.selected_branch??null,u=r?.git_provider??null,d=u?fr[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)(er,{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)(pr,{label:s(C.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)(ct,{className:`mt-0.5 h-3 w-3 shrink-0`}):null,(0,X.jsx)(`span`,{className:`break-all`,children:c})]})}),l?(0,X.jsx)(pr,{label:s(C.CONVERSATION$BRANCH),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(tn,{size:11,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:l})]})}):null]}):i?(0,X.jsx)(pr,{label:s(C.CONVERSATION_PANEL$PREVIEW_DIRECTORY),children:(0,X.jsxs)(`span`,{className:`inline-flex min-w-0 items-start gap-1.5`,children:[(0,X.jsx)(ie,{size:12,className:`mt-0.5 shrink-0`}),(0,X.jsx)(`span`,{className:`break-all`,children:i})]})}):null,a?(0,X.jsx)(pr,{label:s(C.CONVERSATION_PANEL$PREVIEW_MODEL),children:(0,X.jsx)(`span`,{className:`break-all`,children:a})}):null,f?(0,X.jsx)(pr,{label:s(C.CONVERSATION$CREATED),children:f}):null]})]})}function hr({taskStatus:e}){return(0,X.jsx)(`div`,{className:H(`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 gr({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:H(`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(be(e))})}function _r({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)(hr,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(gr,{taskStatus:t})]})}function vr({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:H(`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)(sr,{selectedRepository:e}):(0,X.jsx)(cr,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${le(t)} ${r(C.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function yr({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(C.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:H(`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)(_r,{title:r,taskStatus:e.status})}),(0,X.jsx)(vr,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function br({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 xr({conversationId:e,title:t,selectedRepository:n,executionStatus:i,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}){let{t:g}=S(`openhands`);return(0,X.jsx)(r,{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)(er,{executionStatus:i,sandboxStatus:a,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||g(C.CONVERSATION$UNTITLED)})]}),(0,X.jsx)(lr,{selectedRepository:n,lastUpdatedAt:o,createdAt:s,executionStatus:i,workspaceWorkingDir:c,showRepositoryMetadata:d,llmModel:f,showAgentChip:p,agentKind:m,acpServer:h})]}),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)(Le,{to:`/conversations/${e}`,onClick:u,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>H(`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)(er,{executionStatus:i,sandboxStatus:a,showTooltip:!1})})})}var Sr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!0,showHoverMetadata:!0,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`,groupFolderOrder:[]},Z=wt()(Tt(e=>({...Sr,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})),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:Et(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,showHoverMetadata:e.showHoverMetadata,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope,groupFolderOrder:e.groupFolderOrder})})),Cr=`px-2 pb-1 pt-1`,wr=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function Tr({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:H(Cr,wr),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:H(`flex items-baseline justify-between gap-2`,Cr),children:[(0,X.jsx)(`span`,{className:H(`min-w-0 truncate text-left`,wr),children:e}),t]})}function Er(){return(0,X.jsx)(at,{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:H(`group`,et,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:H(`h-3.5 w-3.5`,Qe),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(j,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}var Dr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e;function Or({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,showHoverMetadata:g,toggleShowHoverMetadata:_,totalConversationsCount:v,onRequestDeleteAll:y}){let{t:b}=S(`openhands`),x=b(r===`local`?C.CONVERSATION_PANEL$BY_WORKSPACE:C.CONVERSATION_PANEL$BY_REPOSITORY),w=Y.useRef(null),T=Y.useRef(null),E=Y.useRef(e);return Y.useEffect(()=>{e?(T.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():E.current&&w.current?.focus(),E.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:w,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":b(C.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:H(`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)]`,tt),children:(0,X.jsx)(Sn,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:T,role:`menu`,"aria-orientation":`vertical`,"aria-label":b(C.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=T.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:H(`absolute right-0 top-full z-50 mt-0 w-64 rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-[var(--oh-foreground)] shadow-lg`,K,Xe),children:[(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:ie,label:x,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:_n,label:b(C.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:gn,label:b(C.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:vn,label:b(C.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:Cn,label:b(C.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:En,label:b(C.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{children:b(C.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:A,label:b(C.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:z,label:b(C.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(Q,{icon:ce,label:b(C.CONVERSATION_PANEL$HOVER_METADATA),selected:g,testId:`toggle-hover-metadata`,onClick:()=>{_(),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Tr,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:b(C.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:b(C.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?yn:bn,label:Dr(b(u?C.CONVERSATION$HIDE:C.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(Er,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ge,label:Dr(b(C.CONVERSATION$DELETE_ALL)),disabled:v===0,onClick:()=>{v!==0&&(y(),t(!1))}})]}):null]})}var kr=H(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Ye);function Ar(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 jr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Pe(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=Ar(u,{open:s,enabled:i}),{data:f,error:p}=oe(),m=f?.workspaceParents??[],{mutate:h}=te(),{mutate:g}=se(),{mutate:_}=L(),{mutate:v}=R(),{workspaces:y}=re(),b=ee(p,a),[x,w]=Y.useState(!1),[T,E]=Y.useState(!1),{mutate:D,isPending:O}=Qt(),k=$t(),A=O||k;Y.useEffect(()=>{if(!s||x||T)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,x,T]),Y.useEffect(()=>{if(!s||x||T)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,x,T]);let j=e=>{A||D({workingDir:e,entryPoint:`sidebar_local_menu`},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},M=et,N=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),P=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!b,z=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,ne=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&w(!0)},className:M,children:a(C.HOME$ADD_WORKSPACES)}),ie=b?(0,X.jsx)(Je,{content:b,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:ne})}):ne;return(0,X.jsxs)(`div`,{className:H(!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:H(kr,!i&&H(`absolute top-full mt-0`,n)),style:z,children:[(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,K),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(C.HOME$NO_WORKSPACE_OPTION)})})}),y.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:nt,"aria-hidden":!0,children:(0,X.jsx)(st,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:H(`flex flex-col`,K),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(at,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),ie,(y.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:N,onClick:e=>{e.preventDefault(),e.stopPropagation(),E(!0)},className:M,children:a(C.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(B,{isOpen:x,onClose:()=>w(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(ae,{isOpen:T,workspaces:y,workspaceParents:m,onClose:()=>E(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function Mr({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:nt,"aria-hidden":!0,children:(0,X.jsx)(st,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function Nr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Pe(),{providers:s}=vt(),{lastSelectedProvider:c,setLastSelectedProvider:l}=ht(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=Ar(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),y=_t(_,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:b,isLoading:x,isError:w,hasNextPage:T,isFetchingNextPage:E,fetchNextPage:D}=ot({provider:h}),{data:O,isLoading:k}=ft(y,h),A=Y.useMemo(()=>b?.pages.flatMap(e=>e.items)??[],[b]),j=y?O??[]:A,{mutate:M,isPending:N}=Qt(),P=$t(),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),v(``)},L=et;Y.useEffect(()=>{u&&(y||!T||E||x||j.length===0||j.length>=10||D())},[u,y,T,E,x,j.length,D]);let R=y?k:x,z=!y&&T&&j.length>0,B=Y.useCallback(()=>{d(e=>!e)},[]),te=u&&(!i||m!==null),ne=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:H(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:B,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),te&&(0,X.jsxs)(`div`,{"data-testid":r,className:H(kr,!i&&H(`absolute top-full mt-0`,n)),style:ne,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:H(`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)(yt,{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)(fn,{width:16,height:16,"aria-hidden":!0,className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-[var(--oh-muted)]`}),(0,X.jsx)(`input`,{type:`text`,"data-testid":`cloud-repo-search-input`,value:_,onChange:e=>v(e.target.value),placeholder:a(C.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:H(`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)(at,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:H(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,K),children:[R&&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(C.HOME$LOADING_REPOSITORIES)}),w&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(C.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!R&&!w&&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(C.GITHUB$NO_RESULTS)}),j.map(e=>(0,X.jsx)(Mr,{repo:e,disabled:F,onSelect:I,itemClass:L},`${e.git_provider}:${e.id}`)),z&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:E,onClick:()=>D(),className:L,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(E?C.HOME$LOADING_MORE_REPOSITORIES:C.CONVERSATION$LOAD_MORE)})})})]})]})]})}var Pr=H(`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 Fr({backendKind:e}){let{t}=S(`openhands`),n=t(C.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(xn,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(jr,{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:Pr,"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)(Nr,{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:Pr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function Ir(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 Lr(e,t){let n=new Map(t.map(e=>[e.id,e]));return e.map(e=>n.get(e)).filter(e=>e!=null)}function Rr(e,t){if(t.length===0)return[...e];let n=new Set(t);return e.filter(e=>!n.has(e.id))}function zr(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 Br(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Vr(e,t){let n=t===`created`?`created_at`:`updated_at`;return[...e].sort((e,t)=>Br(t[n])-Br(e[n]))}function Hr(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 Ur(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 Wr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?Hr(n):Ur(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=Vr(r.conversations,n);return{id:e,label:r.label,conversations:i,launch:zr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,Br(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}function Gr(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 Kr(e,t,n,r,i=`after`){if(n===r)return[...e];let a=Gr(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 qr({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:_}=S(`openhands`),v=(0,Y.useRef)(null),y=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,b=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),{visibleConversations:x,isPreviewTruncated:w,isShowingAll:T}=Ir(e.conversations,{expanded:n,activeConversationId:s});return(0,X.jsxs)(N.section,{ref:v,layout:a?`position`:!1,transition:{type:`spring`,stiffness:600,damping:45},"aria-labelledby":y,"data-testid":`thread-folder-${b}`,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-${b}`,className:H(`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:H(r&&`opacity-0`),children:[(0,X.jsxs)(`div`,{className:H(`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:y,"aria-expanded":t,"aria-controls":`thread-folder-content-${b}`,"data-testid":`thread-folder-drag-${b}`,"aria-label":_(t?C.CONVERSATION_PANEL$COLLAPSE_FOLDER:C.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=v.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:H(`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)(ie,{className:H(`h-4 w-4 shrink-0`,t?`hidden group-hover/folder:block`:`block group-hover/folder:hidden`),"aria-hidden":!0}),(0,X.jsx)(F,{className:H(`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:H(`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":_(C.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${b}`,onClick:e=>{e.preventDefault(),e.stopPropagation(),h()},children:(0,X.jsx)(ue,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),t?(0,X.jsxs)(`div`,{id:`thread-folder-content-${b}`,className:`mt-0.5 space-y-0.5`,children:[x.map(g),w?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${b}`,onClick:m,className:`cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:_(T?C.CONVERSATION_PANEL$LESS:C.CONVERSATION_PANEL$MORE)})}):null]}):null]})]})}function Jr({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}=S(`openhands`),[p,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!1),x=(0,Y.useRef)(null);(0,Y.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let w=(0,Y.useCallback)(()=>{x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{b(!1),x.current=null},300)},[]),T=(0,Y.useCallback)(()=>{m(null),g(null),v(null)},[]),E=(0,Y.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();return e.clientY<t.top+t.height/2?`before`:`after`},[]),D=(0,Y.useCallback)((e,i)=>{if(!p||p===e){T(),w();return}r(Kr(n,t,p,e,i)),T(),w()},[p,n,t,T,r,w]);return(0,X.jsx)(`nav`,{"aria-label":f(C.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:e.map(e=>(0,X.jsx)(qr,{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:y,isCreatingConversationFlow:c,activeConversationId:l,onToggleExpanded:()=>o(e.id),onDragStart:()=>{b(!0),m(e.id)},onDragEnd:()=>{T(),w()},onDragOver:t=>{t.preventDefault();let{dataTransfer:n}=t;n&&(n.dropEffect=`move`),g(e.id),v(E(t))},onDragLeave:()=>{g(t=>t===e.id?null:t)},onDrop:t=>{t.preventDefault(),D(e.id,E(t))},onTogglePreviewExpanded:()=>s(e.id),onLaunchFromGroup:()=>u(e.launch),renderConversationCard:d},e.id))})}function Yr({pinnedConversations:e,isPreviewExpanded:t,onTogglePreviewExpanded:n,activeConversationId:r,showDivider:i=!1,renderConversationCard:a}){let{t:o}=S(`openhands`),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=Ir(e,{limit:5,expanded:t,activeConversationId:r});return(0,X.jsxs)(`section`,{"data-testid":`conversation-panel-pinned-section`,className:H(`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)(wn,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),o(C.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?C.CONVERSATION_PANEL$LESS:C.CONVERSATION_PANEL$MORE)})}):null]})}var Xr={pinsByBackendId:{}};function Zr(e,t){return e[t]??[]}var Qr=wt()(Tt((e,t)=>({...Xr,pinConversation:(n,r)=>{let i=Zr(t().pinsByBackendId,n);i.includes(r)||e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:[r,...i]}}))},unpinConversation:(n,r)=>{let i=Zr(t().pinsByBackendId,n);i.includes(r)&&e(e=>({pinsByBackendId:{...e.pinsByBackendId,[n]:i.filter(e=>e!==r)}}))},togglePin:(e,n)=>{Zr(t().pinsByBackendId,e).includes(n)?t().unpinConversation(e,n):t().pinConversation(e,n)},pruneMissingConversations:(n,r)=>{let i=new Set(r),a=Zr(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:Et(()=>localStorage),partialize:e=>({pinsByBackendId:e.pinsByBackendId})})),$r=()=>{},ei=[],ti=3600*1e3,ni=e=>{let t=Date.now()-ti,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 ri({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:i,navigate:a}=Pe(),{backend:o}=D(),s=Xt(e??$r),[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),v=Z(e=>e.showRepoBranchMetadata),y=Z(e=>e.toggleShowRepoBranchMetadata),b=Z(e=>e.showLlmProfiles),x=Z(e=>e.toggleShowLlmProfiles),T=Z(e=>e.showHoverMetadata),O=Z(e=>e.toggleShowHoverMetadata),k=Z(e=>e.organizeMode),A=Z(e=>e.setOrganizeMode),j=Z(e=>e.conversationSort),M=Z(e=>e.setConversationSort),N=Z(e=>e.threadScope),P=Z(e=>e.setThreadScope),F=Z(e=>e.groupFolderOrder),I=Z(e=>e.setGroupFolderOrder),[ee,L]=Y.useState(!1),[R,z]=Y.useState(!1),B=Xt(()=>{L(!1)}),[te,ne]=Y.useState(()=>new Set),[re,ie]=Y.useState(()=>new Set),[ae,oe]=Y.useState(!1),V=Qr(e=>e.pinsByBackendId[o.id]??ei),se=Qr(e=>e.togglePin),ce=Qr(e=>e.pruneMissingConversations),le=Y.useCallback(e=>{ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),ue=Y.useCallback(e=>{ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{k!==`grouped`&&(ne(new Set),ie(new Set))},[k]);let de=Y.useRef(null),[fe,pe]=Y.useState(null),[me,he]=Y.useState(null),[ge,_e]=Y.useState(null),{data:ve,isLoading:be,isFetched:U,hasNextPage:xe,isFetching:Se,isFetchingNextPage:Ce,fetchNextPage:we}=qn(),{data:Te}=Jn(),W=Y.useMemo(()=>{let e=ve?.pages.flatMap(e=>e.items)??[],t=new Set;return e.filter(e=>t.has(e.id)?!1:(t.add(e.id),!0))},[ve]),Ee=Y.useMemo(()=>Lr(V,W),[W,V]);Y.useEffect(()=>{U&&ce(o.id,W.map(e=>e.id))},[o.id,W,U,ce]),Y.useEffect(()=>{V.length===0&&oe(!1)},[V.length]);let De=Y.useMemo(()=>{let e=N===`relevant`?W.filter(e=>ye(e.execution_status)):W;return t?e:Rr(e,V)},[t,W,V,N]),{recent:G,older:Oe}=Y.useMemo(()=>ni(De),[De]),ke=Y.useMemo(()=>Vr(g?[...G,...Oe]:G,j),[G,Oe,g,j]),Ae=Y.useMemo(()=>({emptyWorkspace:n(C.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(C.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),je=Y.useMemo(()=>t||k!==`grouped`?null:Wr([...G,...g?Oe:[]],o.kind,j,Ae),[o.kind,t,j,Ae,Oe,k,G,g]),Me=Y.useMemo(()=>je?Gr(je,F):null,[je,F]),Ne=Y.useMemo(()=>je?.map(e=>e.id)??[],[je]),Fe=Y.useMemo(()=>Vr(G.filter(e=>ye(e.execution_status)),j),[j,G]),Ie=ke.length,Re=Y.useMemo(()=>Me?Me.reduce((e,t)=>e+t.conversations.length,0):0,[Me]),ze=k===`grouped`&&!t?Re===0:Ie===0,Be=k===`grouped`&&!t?Re:Ie,[Ve,He]=Y.useState(null),Ue=Y.useRef(Be);Ue.current=Be;let We=Y.useCallback(()=>{xe&&He(Ue.current)},[xe]);Y.useEffect(()=>{if(Ve!==null){if(Be>Ve){He(null);return}if(!xe){He(null);return}Se||Ce||we()}},[Ve,Be,xe,Se,Ce,we]);let Ge=Ve!==null||Ce,{mutate:Ke,mutateAsync:qe}=ut(),{mutate:Je}=dt(),{mutate:Ye}=Yt(),Xe=Oe.length>0&&!g,Ze=!!xe&&!Xe&&!t&&!ze,{mutate:K}=Qt(),Qe=$t(),$e=Y.useCallback(e=>{Qe||K({workingDir:e.workingDir,repository:e.repository,entryPoint:`sidebar_relaunch_project`},{onSuccess:e=>{a(`/conversations/${e.conversation_id}`)}})},[K,Qe,a]),et=Y.useCallback((e,t)=>{l(!0),pe(e),he(t)},[]),tt=Y.useCallback(e=>{d(!0),pe(e)},[]),nt=Y.useCallback((e,t)=>{Ye({conversationId:e,newTitle:t},{onSuccess:()=>{w(n(C.CONVERSATION$TITLE_UPDATED))}})},[n,Ye]),rt=()=>{fe&&Ke({conversationId:fe},{onSuccess:()=>{fe===i&&a(`/conversations`)}})},it=()=>{fe&&Je({conversationId:fe})},at=async()=>{let e=W.map(e=>e.id),t=await Promise.allSettled(e.map(e=>qe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),r=t.length-n.length;i!==null&&n.includes(i)&&a(`/conversations`),r>0&&E(`${r} conversation${r===1?``:`s`} could not be deleted.`)},ot=Y.useCallback((n,a)=>{let s=V.includes(n.id);return t?(0,X.jsx)(xr,{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===i,onClose:e,showRepositoryMetadata:v,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(r,{placement:`right-start`,delay:1e3,closeDelay:100,isDisabled:!T||ge===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)(mr,{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)(Le,{to:`/conversations/${n.id}`,onClick:e,className:H(`block rounded-md transition-colors`,ge!==n.id&&`hover:bg-[var(--oh-surface)]`,(n.id===i||ge===n.id)&&`bg-[var(--oh-surface)]`),children:(0,X.jsx)(dr,{onDelete:()=>et(n.id,n.title??``),onStop:()=>tt(n.id),onChangeTitle:e=>nt(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:ge===n.id,onContextMenuToggle:e=>_e(e?n.id:null),isActive:n.id===i,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:v,llmModel:n.llm_model,showLlmProfiles:b,agentKind:n.agent_kind,acpServer:n.acp_server,isPinned:s,onTogglePin:()=>se(o.id,n.id),alwaysShowPinIcon:s&&!a?.inPinnedSection})})},n.id)},[o.id,t,i,nt,et,tt,e,ge,V,v,b,T,se]),st=be||!U,ct=!t&&!st&&Ee.length>0,lt=U&&!be&&!t&&ze&&!ct&&!Te?.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:H(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,R?`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(C.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(Fr,{backendKind:o.kind}),(0,X.jsx)(Or,{filterMenuOpen:ee,setFilterMenuOpen:L,menuRef:B,backendKind:o.kind,organizeMode:k,setOrganizeMode:A,conversationSort:j,setConversationSort:M,threadScope:N,setThreadScope:P,showOlderConversations:g,toggleShowOlderConversations:_,showRepoBranchMetadata:v,toggleShowRepoBranchMetadata:y,showLlmProfiles:b,toggleShowLlmProfiles:x,showHoverMetadata:T,toggleShowHoverMetadata:O,totalConversationsCount:W.length,onRequestDeleteAll:()=>h(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:de,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{z(e.currentTarget.scrollTop>0)},className:H(`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:[st&&(0,X.jsx)(br,{compact:t}),!t&<&&(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(C.CONVERSATION$NO_CONVERSATIONS)})}),ct?(0,X.jsx)(Yr,{pinnedConversations:Ee,isPreviewExpanded:ae,onTogglePreviewExpanded:()=>oe(e=>!e),activeConversationId:i,showDivider:!t&&k===`chronological`,renderConversationCard:e=>ot(e,{inPinnedSection:!0})}):null,!t&&Te?.map(t=>(0,X.jsx)(Le,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(yr,{task:t})},t.id)),!st&&t?Fe.map(e=>ot(e)):null,!st&&!t&&k===`grouped`&&Me&&Me.length>0?(0,X.jsx)(Jr,{groups:Me,groupIds:Ne,groupFolderOrder:F,setGroupFolderOrder:I,collapsedGroupIds:te,expandedGroupPreviewIds:re,onToggleGroupCollapsed:le,onToggleGroupPreviewExpanded:ue,isCreatingConversationFlow:Qe,activeConversationId:i,onLaunchFromGroup:$e,renderConversationCard:e=>ot(e)}):null,!st&&!t&&k===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:ke.map(e=>ot(e))}):null,Ze&&(Ge?(0,X.jsx)(`div`,{className:`py-1`,children:(0,X.jsx)(br,{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(C.CONVERSATION$LOAD_MORE)})}))]}),c&&(0,X.jsx)(Ht,{onConfirm:()=>{rt(),l(!1),he(null)},onCancel:()=>{l(!1),he(null)},conversationTitle:me??void 0}),m&&(0,X.jsx)(Ht,{title:n(C.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(C.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:W.length}),onConfirm:async()=>{await at(),h(!1)},onCancel:()=>h(!1)}),u&&(0,X.jsx)(Vt,{onConfirm:()=>{it(),d(!1)},onCancel:()=>d(!1)}),f&&(0,X.jsx)(Yn,{onConfirm:()=>{e?.()},onClose:()=>p(!1),onCancel:()=>p(!1)})]})}function ii({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)(ri,{})})})}var ai=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,oi=34,si=Math.round(oi*30/46);function ci({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:_}=S(`openhands`),y=m;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:He(e),children:[(0,X.jsxs)(`div`,{className:H(e&&t?Ue:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:H(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)(kn,{logoWidth:oi,logoHeight:si,logoClassName:`max-w-none`,className:H(Re,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":i,onClick:o,className:H(We,s?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`),children:(0,X.jsx)(v,{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:H(`hidden md:inline-flex ml-auto`,Ve,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null,!e&&n?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-mobile-drawer-close`,onClick:r,"aria-label":_(C.SIDEBAR$CLOSE_MENU),className:H(`inline-flex ml-auto`,Ve,`text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(M,{width:14,height:14})}):null]}),(0,X.jsxs)(`nav`,{className:ze(e),children:[(0,X.jsx)(Kn,{collapsed:e}),(0,X.jsx)(qe,{to:`/conversations`,end:!0,label:_(C.SIDEBAR$NEW_CHAT),testId:`sidebar-conversations-link`,collapsed:e,icon:(0,X.jsx)(ue,{width:$,height:$})}),(0,X.jsx)(qe,{to:`/customize`,label:_(C.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)(qe,{to:`/automations`,label:_(C.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,collapsed:e,icon:(0,X.jsx)(ai,{width:$,height:$})})]}),(0,X.jsx)(ii,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:H(ze(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(Je,{content:_(C.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Le,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":_(C.SIDEBAR$SETTINGS),className:Be({collapsed:!0}),children:[(0,X.jsx)(Ke,{active:l.startsWith(`/settings`),children:(0,X.jsx)(pe,{width:$,height:$})}),(0,X.jsx)(`span`,{className:Ge(!0),children:_(C.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":_(C.BACKEND$MANAGE),"aria-expanded":d,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:H(Be({collapsed:!0}),`relative`),children:[(0,X.jsx)(Ke,{active:d,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(Ot,{isConnected:u?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(Tn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:Ge(!0),children:_(C.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)(Un,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>f(!1),onOpenAddBackend:h,onOpenManageBackends:g})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:H(`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)(Un,{sidebarCollapsed:e,openUpward:!0})})]})}var li=Y.lazy(()=>n(()=>import(`./settings-modal-BnZ7mMu7.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]))),ui=Y.lazy(()=>n(()=>import(`./add-backend-modal-BoMkMyLB.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([39,1,2,40,6,7,14,9,15,3,4,5,8,10,11,12,41,37,36,42,23,18,24,28,26,43,29,44,45,46,47,16,35,34,32,33,27]))),di=Y.lazy(()=>n(()=>import(`./manage-backends-modal-nMoCZ2a0.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([48,1,2,6,7,14,9,15,49,10,50,51,3,4,5,8,11,12,40,41,37,36,42,23,18,24,28,26,43,29,44,45,46,47,16,35,34,32,33,27,52,53]))),fi=250;function pi(){let{t:e}=S(`openhands`),{currentPath:t}=Pe(),{data:n}=Ne(),{data:r,error:i,isError:a,isFetching:o}=kt(),{backends:s,active:c}=O(),l=Ee(s)[c.backend.id],u=me(e=>e.collapsed),d=me(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[y,b]=Y.useState(!1),[x,w]=Y.useState(!1),T=Y.useRef(!1),[,D]=Y.useReducer(e=>e+1,0),{isOpen:k,close:A}=Gt(),[j,M]=Y.useState(!1),[N,P]=Y.useState(!1),F=Xt(()=>h(!1)),I=At(i);Y.useEffect(()=>{A()},[t,A]),Y.useEffect(()=>{if(k){M(!0);let e=requestAnimationFrame(()=>{P(!0)});return()=>cancelAnimationFrame(e)}P(!1);let e=window.setTimeout(()=>{M(!1)},fi);return()=>window.clearTimeout(e)},[k]),Y.useEffect(()=>{if(!k)return;let e=e=>{e.key===`Escape`&&A()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[k,A]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&I!==404?E(e(C.SETTINGS$FETCH_ERROR)):I===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,I,n?.feature_flags?.hide_llm_settings,e]);let ee=e(u?C.SIDEBAR$EXPAND:C.SIDEBAR$COLLAPSE),L=Y.useCallback(e=>{if(!u)return;let t=e.target;t instanceof HTMLElement&&(t.closest(`a,button,input,textarea,select,[role='button'],[role='link']`)||d(!1))},[u,d]),R={collapseToggleLabel:ee,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,D(),d(!0),window.setTimeout(()=>{T.current=!1,D()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&x&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:F,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>b(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:L,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:H(`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)(ci,{collapsed:u,showCollapseToggle:!0,...R})}),j?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:H(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,N?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${fi}ms`},onClick:A,"aria-hidden":!N}),(0,X.jsx)(`aside`,{"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!N,className:H(`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`,N?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${fi}ms`},children:(0,X.jsx)(ci,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:A,...R})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(li,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(ui,{onClose:()=>v(!1)})}),y&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(di,{onClose:()=>b(!1)})})]})}var mi=`/settings`,hi=`/customize`,gi=[`/skills`,`/mcp`,`/plugins`];function _i(e){return e===mi?{mode:`menu`}:e.startsWith(`${mi}/`)&&e.length>9?{mode:`back`,backTo:mi,backLabelKey:C.SETTINGS$TITLE}:e===hi?{mode:`menu`}:gi.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:hi,backLabelKey:C.NAV$CUSTOMIZE}:{mode:`menu`}}function vi(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Pe(),r=_i(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(C.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(Jt,{}),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??C.COMMON$BACK),className:Kt,children:(0,X.jsx)(M,{size:20,className:Ut,"aria-hidden":!0,strokeWidth:2})}):null]})}function yi(){let{backend:e}=D(),t=e.kind===`local`,{data:n}=Zt(),{mutate:r,isPending:i}=he(),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 bi=()=>{let{backend:e}=D(),{data:t}=kt(),{mutate:n,isPending:r}=pn(`personal`,{retry:2}),i=Y.useSyncExternalStore(W,Se,()=>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`&&Te(i);return}let o=`${e.id}:${i}`;if(r||a.current===o)return;a.current=o,n({user_consents_to_analytics:i===`granted`});return}Ce(t.user_consents_to_analytics===!0?`granted`:`denied`,{syncToCloud:!1})}},[e.id,e.kind,r,i,n,t])},xi=()=>{let{backend:e}=D(),{data:t}=kt(),n=St(),r=e.kind===`cloud`?n[e.id]:void 0,i=r?.isLoading??!0,a=r?.userId??null,o=t?.email||t?.git_user_email||void 0;Y.useEffect(()=>{if(!(e.kind!==`cloud`||i)){if(!a){we(null);return}we(a,o?{email:o}:{})}},[e.kind,o,i,a])};function Si(e){switch(e){case U.RUNNING:return`🟢`;case U.FINISHED:case U.IDLE:case U.WAITING_FOR_CONFIRMATION:return`✅`;case U.PAUSED:return`⚪`;case U.ERROR:case U.STUCK:return`🔴`;default:return null}}var Ci=`OpenHands`,wi=()=>{let{conversationId:e}=f(),{data:t}=mn(e??null),n=hn(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Ci}`:Ci;if(!e)return i;let a=Si(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Ti({children:e}){let{pathname:t}=g(),n=u(),r=d(),i=h(),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)(Fe,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var Ei=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-B1PFO8P8.js`),__vite__mapDeps([54,1,2,3,4,55]))),Di=Y.lazy(()=>n(()=>import(`./alert-banner-Dh51WURQ.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([56,1,2,57,3,4,58,59,11,12,29,60,61,20]))),Oi=Y.lazy(()=>n(()=>import(`./command-menu-oTvKDU3Y.js`).then(e=>({default:e.CommandMenu})),__vite__mapDeps([62,1,2,10,63,64,65,66,67,68,69,3,4,11,12,29]))),ki=p(function(){let e=c(),{t}=S(`openhands`);return s(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(C.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(C.ERROR$UNKNOWN)})})}),Ai=l(function(){let e=g(),t=wi(),{data:n}=kt(),r=Ne();if(bi(),xi(),yi(),Y.useEffect(()=>{n?.language&&T.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)(Me,{size:`large`})});let i=/^\/conversations\/[^/]+/.test(e.pathname),a=ne(e.search);return(0,X.jsx)(Ti,{children:(0,X.jsxs)(zt,{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)(pi,{}),(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)(vi,{}),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)(Di,{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)(m,{})})]})]}),(0,X.jsxs)(Y.Suspense,{fallback:null,children:[(0,X.jsx)(Ei,{}),(0,X.jsx)(Oi,{})]}),a?(0,X.jsx)(V,{}):null]})})});export{ki as ErrorBoundary,Ai as default};
|
|
@@ -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-BFRubm34.js";import{Ct as t,St as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i,M as a,N as o,a as s,c,d as l,f as u,i as d,k as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{n as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{c as m,t as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as g}from"./useQuery-D5pEZbY0.js";import{t as _}from"./useTranslation-Cbf5AGg_.js";import{t as v}from"./declaration-BGsHjPEW.js";import{r as y}from"./providers-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/manage-backends-modal-nMoCZ2a0.js","assets/rolldown-runtime-BFRubm34.js","assets/vendor-styling-CI0PQ3ab.js","assets/agent-server-compatibility-C0MtTTwb.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~dhilvkxv-eGLBu60s.js","assets/useQuery-D5pEZbY0.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js","assets/suspense-DmZ3MSSh.js","assets/pencil-CWhApFIT.js","assets/createLucideIcon-D4Tak8A1.js","assets/refresh-cw-B9B7-vsy.js","assets/trash-2-BU6BlW4i.js","assets/declaration-BGsHjPEW.js","assets/useTranslation-Cbf5AGg_.js","assets/active-backend-context-DHhm10VS.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js","assets/utils-DB9LsAzA.js","assets/common-CxbUL3nR.js","assets/backend-form-modal-B8GtBA-J.js","assets/cloud-funnel-analytics-uzzLlLuj.js","assets/client-source-CtQjJEy6.js","assets/telemetry-SHxpVxk8.js","assets/segmented-toggle-kzwZkLaj.js","assets/brand-button-B1izLAdR.js","assets/form-control-classes-CbdN5aO3.js","assets/settings-input-BsgQWS5R.js","assets/modal-backdrop-zVwfOJZr.js","assets/modal-body-Cc2zp0xb.js","assets/modal-close-button-BcIBUdSq.js","assets/navigation-context-DPs2G0X8.js","assets/use-backends-health-BagmAE_W.js","assets/vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~ftka0fnu-cFNmfAE6.js","assets/useQueries-BpIlT8Mt.js","assets/organization-service.api-Da2jiuBS.js","assets/proxy-G4ce0fnQ.js","assets/use-tracking-DFoPQUSU.js","assets/use-settings-BeJap6YL.js","assets/settings-service.api-DPTFyRXL.js","assets/settings-mQUckT0g.js","assets/modal-classes-3qT9Ap7Q.js","assets/confirmation-modal-DGBWM2Ls.js","assets/use-cloud-current-user-id-BwMX7jHW.js","assets/api-key-entry-screen-2gsoZAOK.js","assets/onboarding-modal-Bxuxpfdz.js","assets/recommended-automations-launcher-BWRRvMPE.js","assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C4-GDgiF.js","assets/useMutationState-OnAsCLA_.js","assets/install-server-modal-BYjqoRyX.js","assets/useMutation-u8UgRgDK.js","assets/bot-C-EA6685.js","assets/v4-DbCkTSoU.js","assets/secrets-service-Ch7RH8eH.js","assets/styled-tooltip-B14i_Uac.js","assets/skill-card-pill-row-BPYKQ3IN.js","assets/extension-module-card-classes-9V3J9J_b.js","assets/circle-plus-check-toggle-DoFIjVE0.js","assets/checkmark-h7udgXMM.js","assets/x-mark-Batp6gXa.js","assets/use-create-conversation-CkKUQVbP.js","assets/use-agent-profiles-Dn_S_Tkz.js","assets/agent-server-conversation-service.api-lzc8dabY.js","assets/vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~j2jlu22h-mC0v44WR.js","assets/profiles-service.api-DWetW2TL.js","assets/llm-subscription-service-C0zN0-rH.js","assets/llm-subscription-DtsX5Lhg.js","assets/acp-providers-DerAmTyY.js","assets/canvas-ui-COgjltGz.js","assets/plugins-management-service-DISfOL13.js","assets/use-llm-profiles-CgRtnj74.js","assets/conversation-store-LptbOvKa.js","assets/middleware-DYHYNAnP.js","assets/react-DPDgL6du.js","assets/conversation-local-storage-F6zVMM--.js","assets/chat-send-button-BZHG2hAW.js","assets/check-TbOEtHKj.js","assets/loader-circle-CsAsfLIs.js","assets/llm-settings-Cs_iieFY.js","assets/back-nav-button-DVknCcSP.js","assets/navigation-link-D8hfwvxI.js","assets/copy-D1YGjP-C.js","assets/external-link-lhdITPqq.js","assets/vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js","assets/model-selector-D51W2Q9b.js","assets/combobox-caret-CxZpqoSR.js","assets/sdk-settings-schema-CLR01YIK.js","assets/dist-CodhvuAP.js","assets/map-provider-BbIb12oh.js","assets/ellipsis-button-CbNnHlIq.js","assets/dropdown-classes-D3wMJlXT.js","assets/use-can-manage-org-profiles-CyYqfzeo.js","assets/base-modal-CIF_785P.js","assets/sdk-section-page-Cwj0T4gF.js","assets/switch-skeleton-DqQwalyu.js","assets/schema-field-CwdqUOnE.js","assets/settings-dropdown-input-Dhx9ErGd.js","assets/settings-switch-Bes8dIlV.js","assets/toggle-switch-DX_k418f.js","assets/use-is-authed-BezEyfeh.js","assets/typography-CzfoD9DY.js","assets/use-save-settings-DiDEbIJw.js","assets/copy-to-clipboard-button-CFzH_NOX.js","assets/copy-BLmGeJcd.js","assets/loading-spinner-BcdnT0mN.js","assets/settings-section-header-context-COMOIaxV.js","assets/u-check-circle-BqoIxNz_.js","assets/u-edit-DL5LgKon.js","assets/settings-list-classes-DSJJX99U.js","assets/use-acp-credential-form-DHd_Id-q.js","assets/use-create-secret-DEgM0MXZ.js","assets/openhands-logo-bcNw5bkY.js","assets/use-activate-agent-profile-BRDdSwQ0.js","assets/use-save-agent-profile-i4FcEP98.js","assets/terminal-Cgf___rK.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,St as n,bt as r}from"./vendor-styling-CI0PQ3ab.js";import{L as i,M as a,N as o,a as s,c,d as l,f as u,i as d,k as f}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~jkpzbynd-CkpBIhVe.js";import{n as p}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~e0djk9ee-Cw6LUe8p.js";import{c as m,t as h}from"./vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~iztiaf2o-rqo6vRFz.js";import{t as g}from"./useQuery-D5pEZbY0.js";import{t as _}from"./useTranslation-Cbf5AGg_.js";import{t as v}from"./declaration-BGsHjPEW.js";import{r as y}from"./providers-C7lMslCi.js";import{R as b,d as x,r as ee,x as S}from"./active-backend-context-DHhm10VS.js";import{F as C,L as te,P as w,R as ne,i as re,n as T,o as E,y as D}from"./agent-server-compatibility-C0MtTTwb.js";import{c as O,d as k,m as A,n as j,o as M,p as N,u as P}from"./telemetry-SHxpVxk8.js";import{a as F,n as I,t as L}from"./use-backends-health-BagmAE_W.js";import{t as R}from"./modal-backdrop-zVwfOJZr.js";import{n as z}from"./modal-body-Cc2zp0xb.js";import{n as B,r as V}from"./base-modal-CIF_785P.js";import{t as H}from"./brand-button-B1izLAdR.js";import{t as U}from"./loading-spinner-BcdnT0mN.js";import{t as W}from"./use-config-B39iHYFi.js";import{t as G}from"./use-onboarding-completion-C_Swglzp.js";import{t as K}from"./navigation-context-DPs2G0X8.js";import{i as q,n as J}from"./color-themes-CHizm1xF.js";var Y=e(t(),1),X=`/api/authenticate`,ie=`/login`,ae=`returnTo`,oe=new Set([`localhost`,`127.0.0.1`,`::1`]);function se(){return typeof window>`u`?`/`:`${window.location.pathname}${window.location.search}${window.location.hash}`}function ce(){return typeof window>`u`?!1:oe.has(window.location.hostname)}function le(){return w()===`cookie`&&!ce()}async function ue(){try{return await m.post(X,null,{withCredentials:!0}),!0}catch(e){if(m.isAxiosError(e)&&e.response?.status===401)return!1;throw e}}function de(e=se()){return`${ie}?${new URLSearchParams({[ae]:e}).toString()}`}function fe(){typeof window>`u`||window.location.assign(de())}function pe(){let e=(0,Y.useSyncExternalStore)(P,M,()=>`pending`),t=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{t.current||(t.current=!0,N())},[]),(0,Y.useEffect)(()=>{e===`granted`&&A()},[e]);let n=(0,Y.useCallback)(()=>O(`granted`),[]),r=(0,Y.useCallback)(()=>O(`denied`),[]),i=(0,Y.useCallback)((e,t)=>{k(e,t)},[]),a=(0,Y.useCallback)(()=>j(),[]);return{consent:e,isEnabled:e===`granted`,showConsentPrompt:e===`pending`,grantConsent:n,denyConsent:r,track:i,clearData:a}}var Z=r();function me({onChoice:e}){let{t,ready:n}=_(`openhands`),{showConsentPrompt:r,grantConsent:i,denyConsent:a}=pe(),[o,s]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{if(n&&r){let e=setTimeout(()=>s(!0),50);return()=>clearTimeout(e)}s(!1)},[n,r]),o?(0,Z.jsx)(R,{elevated:!0,"aria-label":t(v.TELEMETRY$CONSENT_TITLE),children:(0,Z.jsx)(`form`,{"data-testid":`telemetry-consent-form`,onSubmit:t=>{t.preventDefault();let n=new FormData(t.currentTarget).get(`analytics`)===`on`;n?i():a(),e?.(n)},className:`flex flex-col gap-2`,children:(0,Z.jsxs)(z,{className:`border border-[var(--oh-border)]`,children:[(0,Z.jsx)(V,{title:t(v.TELEMETRY$CONSENT_TITLE)}),(0,Z.jsx)(B,{children:t(v.TELEMETRY$CONSENT_DESCRIPTION)}),(0,Z.jsxs)(`label`,{className:`flex gap-2 items-center self-start text-sm cursor-pointer`,children:[(0,Z.jsx)(`input`,{name:`analytics`,type:`checkbox`,defaultChecked:!0,className:`w-4 h-4 cursor-pointer`}),t(v.TELEMETRY$SEND_ANONYMOUS_DATA)]}),(0,Z.jsx)(H,{testId:`confirm-telemetry-preferences`,type:`submit`,variant:`primary`,className:`w-full`,children:t(v.TELEMETRY$CONFIRM_PREFERENCES)})]})})}):null}function Q(){return Y.useEffect(()=>{J(q())},[]),null}var he=Y.lazy(()=>n(()=>import(`./manage-backends-modal-nMoCZ2a0.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,35,36,37,38,39,40,41]))),ge=Y.lazy(()=>n(()=>import(`./api-key-entry-screen-2gsoZAOK.js`),__vite__mapDeps([42,1,2,3,4,12,13,14,15,6,9,16,17,18,5,7,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39]))),_e=Y.lazy(()=>n(()=>import(`./onboarding-modal-Bxuxpfdz.js`).then(e=>e.n).then(e=>({default:e.OnboardingModal})),__vite__mapDeps([43,1,2,3,4,44,45,46,6,12,13,14,15,9,16,17,37,34,38,47,48,49,50,51,23,24,25,52,26,28,36,5,7,39,53,54,55,56,57,29,58,59,60,61,31,20,62,63,64,65,66,67,68,35,21,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,33,90,27,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,19,18,22,30,32,109,110,111,112]))),ve=Y.lazy(()=>n(()=>import(`./backend-form-modal-B8GtBA-J.js`).then(e=>e.i).then(e=>({default:e.BackendFormModal})),__vite__mapDeps([18,1,2,3,4,5,6,7,12,13,14,15,9,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39])));function ye({children:e}){return(0,Z.jsxs)(`html`,{lang:`en`,children:[(0,Z.jsxs)(`head`,{children:[(0,Z.jsx)(`meta`,{charSet:`utf-8`}),(0,Z.jsx)(`meta`,{name:`viewport`,content:`width=device-width, initial-scale=1`}),(0,Z.jsx)(s,{}),(0,Z.jsx)(d,{})]}),(0,Z.jsxs)(`body`,{"data-agent-server-ui":``,className:`m-0`,children:[(0,Z.jsxs)(y,{contentClassName:`min-h-screen`,children:[(0,Z.jsx)(Q,{}),e,(0,Z.jsx)(h,{toastOptions:S}),(0,Z.jsx)(me,{}),(0,Z.jsx)(`div`,{id:`modal-portal-exit`})]}),(0,Z.jsx)(u,{}),(0,Z.jsx)(l,{})]})]})}function $(){return(0,Z.jsx)(`main`,{className:`min-h-screen bg-base px-6 py-10 text-white`,children:(0,Z.jsx)(`div`,{className:`mx-auto flex min-h-screen max-w-6xl items-center justify-center`,children:(0,Z.jsx)(`div`,{className:`rounded-3xl border border-white/10 bg-base/80 px-8 py-10 shadow-2xl`,children:(0,Z.jsx)(U,{size:`large`})})})})}function be(){let e=p(),t=Y.useCallback(()=>{D()&&(T(),e.invalidateQueries({queryKey:x.WEB_CLIENT_CONFIG}))},[e]);return(0,Z.jsx)(`main`,{"data-testid":`agent-server-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,Z.jsx)(Y.Suspense,{fallback:null,children:(0,Z.jsx)(he,{onClose:t,recoveryMode:!0})})})}function xe({onClose:e}){let t=f(),n=a(),r=o(),i=t.pathname.match(/^\/conversations\/([^/]+)/)?.[1]??null,s=Y.useMemo(()=>({currentPath:t.pathname,conversationId:i,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[i,t.pathname,n,r.location]);return C()===null?(0,Z.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,Z.jsx)(K,{value:s,children:(0,Z.jsx)(Y.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(_e,{onClose:e})})})}):(0,Z.jsx)(`main`,{"data-testid":`first-run-onboarding-screen`,className:`min-h-screen bg-base`,children:(0,Z.jsx)(Y.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(ve,{mode:`add`,onClose:e,source:`manage_backends_modal`,hideCloseButton:!0})})})}var Se=()=>[{rel:`icon`,type:`image/svg+xml`,href:b(`/favicon.svg`)}],Ce=()=>[{title:`OpenHands`},{name:`description`,content:`Let's Start Building!`}],we=i(function(){let e=te(),t=!!D()?.apiKey,n=e&&!t,{active:r}=ee(),i=C(),a=w(),o=i!==null,s=o&&r.backend.kind===`cloud`&&ne(r.backend.host,i),{isCompleted:l,markCompleted:u}=G(),d=le(),f=o?!d&&(!s||a!==`cookie`&&!l):!l,p=g({queryKey:x.MAIN_APP_COOKIE_AUTH,queryFn:ue,enabled:d&&!f,retry:!1,staleTime:1e3*60*5,meta:{disableToast:!0}}),m=d&&!f&&p.isPending&&!p.isError,h=d&&p.data===!1,_=!d||p.data===!0||p.isError;Y.useEffect(()=>{h&&fe()},[h]);let v=W({enabled:!n&&!f&&_}),y=F(r.backend.kind===`cloud`&&_?[r.backend]:[])[r.backend.id],b=r.backend.kind===`cloud`&&y?.isConnected===!1&&I(y.lastError),S=r.backend.kind===`cloud`&&y?.disabled===!0&&L(y.lastError);return f?(0,Z.jsx)(xe,{onClose:u}):m||h?(0,Z.jsx)($,{}):n||re(v.error)?(0,Z.jsx)(Y.Suspense,{fallback:(0,Z.jsx)($,{}),children:(0,Z.jsx)(ge,{})}):v.isPending||v.isLoading?(0,Z.jsx)($,{}):b||S||E(v.error)?(0,Z.jsx)(be,{}):(0,Z.jsx)(c,{})});export{ye as Layout,we as default,Se as links,Ce as meta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useQuery-D5pEZbY0.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{n as a}from"./active-backend-context-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-BFRubm34.js";import{Ct as t,bt as n}from"./vendor-styling-CI0PQ3ab.js";import{t as r}from"./useQuery-D5pEZbY0.js";import{t as i}from"./useTranslation-Cbf5AGg_.js";import{n as a}from"./active-backend-context-DHhm10VS.js";import{t as o}from"./utils-DB9LsAzA.js";import{S as s}from"./agent-server-compatibility-C0MtTTwb.js";import{h as c,l}from"./form-control-classes-CbdN5aO3.js";import{n as u,t as d}from"./settings-input-BsgQWS5R.js";import{t as f}from"./settings-service.api-DPTFyRXL.js";import{i as p}from"./llm-subscription-DtsX5Lhg.js";import{t as m}from"./use-is-authed-BezEyfeh.js";import{f as h,g,h as _,m as v,p as y}from"./sdk-settings-schema-CLR01YIK.js";import{t as b}from"./settings-dropdown-input-Dhx9ErGd.js";import{r as x}from"./typography-CzfoD9DY.js";import{t as S}from"./settings-switch-Bes8dIlV.js";var C=e(t(),1),w=`llm`;function T(e){if(!e?.sections)return e;let t=!1,n=e.sections.map(e=>{if(e.key!==w)return e;let n=new Set(e.fields.map(e=>e.key)),r=p.filter(e=>!n.has(e.key));return r.length===0?e:(t=!0,{...e,fields:[...e.fields,...r]})});return t?{...e,sections:n}:e}var E=(e,t)=>{let{data:n}=m(),{backend:i,orgId:o}=a(),c=!s(i),{data:l,error:u,isLoading:d,isFetching:p}=r({queryKey:[`settings-schema`,e,i.id,o,i.kind,i.host,i.apiKey],queryFn:e===`conversation`?f.getConversationSettingsSchema:f.getSettingsSchema,retry:!1,refetchOnWindowFocus:!1,staleTime:1e3*60*5,gcTime:1e3*60*15,enabled:!t&&!!n&&c,meta:{disableToast:!0}}),h=(0,C.useMemo)(()=>e===`agent`?T(t):t,[t,e]),g=(0,C.useMemo)(()=>e===`agent`?T(l):l,[l,e]);return t?{data:h,error:null,isLoading:!1,isFetching:!1}:{data:g,error:u,isLoading:d,isFetching:p}},D=e=>E(`agent`,e),O=e=>E(`conversation`,e),k=n(),A={"llm.api_key":{textKey:`SCHEMA$LLM$API_KEY$HELP_TEXT`,linkTextKey:`SCHEMA$LLM$API_KEY$HELP_LINK_TEXT`,href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`},"verification.critic_api_key":{textKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_TEXT`,linkTextKey:`SETTINGS$NAV_API_KEYS`,suffixKey:`SCHEMA$VERIFICATION$CRITIC_API_KEY$HELP_SUFFIX`,href:`https://app.all-hands.dev/settings/api-keys`,hideDescription:!0}};function j({field:e}){let{t}=i(`openhands`),n=A[e.key],r=v(t,e.key,e.description);return(0,k.jsxs)(k.Fragment,{children:[r&&!n?.hideDescription?(0,k.jsx)(x.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,k.jsx)(g,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,suffix:n.suffixKey?` ${t(n.suffixKey)}`:void 0,size:`settings`,linkColor:`white`}):null]})}var M=new Set([`verification.critic_api_key`]);function N(e){return e.choices.length>0}function P(e){return e.value_type===`boolean`&&!N(e)}function F(e){return e.value_type===`array`||e.value_type===`object`}function I(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function L(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&I(e)?`url`:`text`}function R({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),s=_(a,e.key,e.label),f=h(e.key);return P(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(S,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:s}),(0,k.jsx)(`div`,{className:c,children:(0,k.jsx)(j,{field:e})})]}):N(e)?(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(b,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,items:e.choices.map(t=>({key:String(t.value),label:y(a,e.key,t.value,t.label)})),selectedKey:t===``?void 0:String(t),isClearable:!e.required,required:e.required,showOptionalTag:!e.required,isDisabled:n,onSelectionChange:e=>r(String(e??``))}),(0,k.jsx)(j,{field:e})]}):F(e)?(0,k.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-sm`,children:s}),e.required?null:(0,k.jsx)(u,{})]}),(0,k.jsx)(`textarea`,{"data-testid":`sdk-settings-${e.key}`,name:e.key,value:String(t??``),required:e.required,disabled:n,onChange:e=>r(e.target.value),className:o(l,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,k.jsx)(j,{field:e})]}):(0,k.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,k.jsx)(d,{testId:`sdk-settings-${e.key}`,name:e.key,label:s,type:L(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:f?.min,max:f?.max,step:f?.step}),(0,k.jsx)(j,{field:e})]})}export{O as i,R as n,D as r,M as t};
|