@openhands/agent-canvas 1.0.0-beta.7 → 1.0.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +2 -2
  2. package/build/assets/{acp-providers-CPdgcp13.js → acp-providers-BAX8OU5C.js} +1 -1
  3. package/build/assets/{acp-route-guard-BoVmCn0e.js → acp-route-guard-HPk6TV-L.js} +1 -1
  4. package/build/assets/{active-backend-context-Beu-LZL-.js → active-backend-context-BSPE-W72.js} +1 -1
  5. package/build/assets/{add-backend-modal-BheqYXHK.js → add-backend-modal-mXKmfMI2.js} +1 -1
  6. package/build/assets/agent-server-client-options-9agOSarV.js +1 -0
  7. package/build/assets/{agent-server-compatibility-CdI3N7dr.js → agent-server-compatibility-B7QStIcH.js} +1 -1
  8. package/build/assets/{agent-server-conversation-service.api-CORdqJZg.js → agent-server-conversation-service.api-B9TUYJon.js} +3 -3
  9. package/build/assets/{agent-settings-UFvcGjoI.js → agent-settings-g3F623RJ.js} +1 -1
  10. package/build/assets/{analytics-consent-form-modal-CVNugqzu.js → analytics-consent-form-modal-BQCNeNVt.js} +1 -1
  11. package/build/assets/{api-key-entry-screen-M6su2VSf.js → api-key-entry-screen-myuWMqzW.js} +1 -1
  12. package/build/assets/{app-settings-BlvBhBdc.js → app-settings-CCcX8ZEH.js} +1 -1
  13. package/build/assets/{automation-detail-BWrQk4Oa.js → automation-detail-BDHLHSJd.js} +1 -1
  14. package/build/assets/{automations-list-ux9KvYsU.js → automations-list-CiNtQhq_.js} +1 -1
  15. package/build/assets/{backend-form-modal-CDnEYjaU.js → backend-form-modal-D3bDMO3C.js} +1 -1
  16. package/build/assets/{backend-synced-settings-badge-BTIj-Ffq.js → backend-synced-settings-badge-BkW5evM0.js} +1 -1
  17. package/build/assets/{condenser-settings-BolbDvm5.js → condenser-settings-DCTulgLO.js} +1 -1
  18. package/build/assets/conversation-BKhikfYl.js +1 -0
  19. package/build/assets/{conversation-D0N4dw_p.js → conversation-DTn8jN8L.js} +3 -3
  20. package/build/assets/conversation-panel-DfHR42mG.js +1 -0
  21. package/build/assets/{conversation-service.api-BsJy6uuL.js → conversation-service.api-B6CkzaKD.js} +1 -1
  22. package/build/assets/{conversation-websocket-context-DvHgx_FE.js → conversation-websocket-context-DShEuLjh.js} +1 -1
  23. package/build/assets/{edit-automation-modal-BpX-t-HD.js → edit-automation-modal-DamwL0s0.js} +1 -1
  24. package/build/assets/{entry.client-Ck9rQCg-.js → entry.client-Cn71WM8q.js} +1 -1
  25. package/build/assets/{extensions-hub-CE9QOb5n.js → extensions-hub-CUEmfvGy.js} +1 -1
  26. package/build/assets/{extensions-navigation-DSLGNGbS.js → extensions-navigation-VQ-3umJ7.js} +1 -1
  27. package/build/assets/{files-tab-cL668j1I.js → files-tab-C47fQEeL.js} +1 -1
  28. package/build/assets/{git-control-bar-branch-button-DtIrOrie.js → git-control-bar-branch-button-BT0aWH-o.js} +1 -1
  29. package/build/assets/{git-provider-icon-CHdGBdU2.js → git-provider-icon-Pi-Cxpgv.js} +1 -1
  30. package/build/assets/{home-Cz2Veg56.js → home-C3k6sFvB.js} +1 -1
  31. package/build/assets/{install-server-modal-B9nXCS3u.js → install-server-modal-6fuq-TU6.js} +1 -1
  32. package/build/assets/{launch-CWz0dm4o.js → launch-DGghLfGx.js} +1 -1
  33. package/build/assets/{llm-client-CYEaUjGx.js → llm-client-BqyLKgUN.js} +1 -1
  34. package/build/assets/{llm-settings-DFkXHuvT.js → llm-settings-BKraGtOu.js} +1 -1
  35. package/build/assets/llm-settings-DRQTgOF1.js +1 -0
  36. package/build/assets/{manage-backends-modal-DpBD_vR9.js → manage-backends-modal-CRMwyU0t.js} +1 -1
  37. package/build/assets/{manage-workspaces-modal-CtRbxREx.js → manage-workspaces-modal-BYmGD1W7.js} +1 -1
  38. package/build/assets/{manifest-eed90ff5.js → manifest-99b06a11.js} +1 -1
  39. package/build/assets/{mcp-BUe7kiYM.js → mcp-CfDRAmPn.js} +1 -1
  40. package/build/assets/{messages-dqp_KYyl.js → messages-Ba1vaw6t.js} +1 -1
  41. package/build/assets/{model-selector-BvSTrkhT.js → model-selector-DcztJSxT.js} +1 -1
  42. package/build/assets/{option-service.api-DmNVxAvS.js → option-service.api-CGNANEcT.js} +1 -1
  43. package/build/assets/{organization-service.api-DbnougaQ.js → organization-service.api-BeuMC9QL.js} +1 -1
  44. package/build/assets/{path-utils-onx24uF5.js → path-utils-z12iCrQO.js} +1 -1
  45. package/build/assets/{planner-tab-CmIjLz7q.js → planner-tab-Dte6Vzza.js} +1 -1
  46. package/build/assets/{profiles-client-fEmgWkCW.js → profiles-client-BrqNmaDV.js} +1 -1
  47. package/build/assets/{providers-CbD7fiic.js → providers-eUyo6pgr.js} +1 -1
  48. package/build/assets/{proxy-BAdHH8QB.js → proxy-BqDMnUY-.js} +1 -1
  49. package/build/assets/{recommended-automations-launcher-uTyODuzB.js → recommended-automations-launcher-D5ADbXao.js} +1 -1
  50. package/build/assets/{root-DmjpFpTu.js → root-BmhaEJJ8.js} +2 -2
  51. package/build/assets/{root-layout-DejMsKhy.js → root-layout-CNggm0d8.js} +2 -2
  52. package/build/assets/{sdk-section-page-BgDlMhcq.js → sdk-section-page-CRCRY3PG.js} +1 -1
  53. package/build/assets/{secrets-service-B7CxNinp.js → secrets-service-B9AFn9OE.js} +1 -1
  54. package/build/assets/{secrets-settings-yK7CqIpm.js → secrets-settings-0UrKMS60.js} +1 -1
  55. package/build/assets/{server-client-Kh4QSwDJ.js → server-client-DYv_GHPl.js} +1 -1
  56. package/build/assets/{settings-DN5PpgRD.js → settings-6t6LGW04.js} +1 -1
  57. package/build/assets/{settings-index-DKC8IY1P.js → settings-index-CR6Ou73o.js} +1 -1
  58. package/build/assets/{settings-modal-DJ4kGzUx.js → settings-modal-T_Yk1Zfo.js} +1 -1
  59. package/build/assets/{settings-service.api-C3rxTtPj.js → settings-service.api-DwtyDeGh.js} +1 -1
  60. package/build/assets/{shared-conversation-h9YnBtCU.js → shared-conversation-BzccsVej.js} +1 -1
  61. package/build/assets/{sidebar-mobile-menu-toggle-D0-AvsnT.js → sidebar-mobile-menu-toggle-DGlRg6jG.js} +1 -1
  62. package/build/assets/{sidebar-nav-link-OhIeFyna.js → sidebar-nav-link-dgVb8Fpy.js} +1 -1
  63. package/build/assets/{skills-plugins-DNcsNF88.js → skills-plugins-DctDrZ8Y.js} +1 -1
  64. package/build/assets/{skills-settings-7liFiSY6.js → skills-settings-rvxImDj_.js} +1 -1
  65. package/build/assets/{terminal-CDhQGDua.js → terminal-KldRPIRT.js} +1 -1
  66. package/build/assets/{use-active-conversation-DHGcmjCK.js → use-active-conversation-sPgfSkql.js} +1 -1
  67. package/build/assets/{use-agent-settings-schema-CLoTOSJI.js → use-agent-settings-schema-B66kGIi_.js} +1 -1
  68. package/build/assets/{use-agent-state-PKrUPMJ3.js → use-agent-state-Dp3pD1h3.js} +1 -1
  69. package/build/assets/{use-cloud-current-user-id-Ddr75hEz.js → use-cloud-current-user-id-ClKFPjFz.js} +1 -1
  70. package/build/assets/{use-config-OIMQLQ2s.js → use-config-C9pvb0Sm.js} +1 -1
  71. package/build/assets/{use-create-conversation-Bszyp13O.js → use-create-conversation-B-lwTnfE.js} +1 -1
  72. package/build/assets/{use-get-secrets-8Jby8ele.js → use-get-secrets-oyC7PFRz.js} +1 -1
  73. package/build/assets/{use-handle-plan-click-CohJPvvW.js → use-handle-plan-click-DP6Rs-YP.js} +1 -1
  74. package/build/assets/{use-llm-profiles-C861aFAq.js → use-llm-profiles-Bh5JqZUZ.js} +1 -1
  75. package/build/assets/use-runtime-is-ready-BakOUVU-.js +1 -0
  76. package/build/assets/{use-save-settings-DkAOEfD9.js → use-save-settings-uXXkqvD7.js} +1 -1
  77. package/build/assets/{use-settings-D5hbTS9t.js → use-settings-DeO7nvpM.js} +1 -1
  78. package/build/assets/{use-settings-nav-items-BcSbo02d.js → use-settings-nav-items-BGMFn25b.js} +1 -1
  79. package/build/assets/{use-skills-D7PS0fH0.js → use-skills-DWIK3l3a.js} +1 -1
  80. package/build/assets/{use-unified-vscode-url-DEoe-NRI.js → use-unified-vscode-url-DXPtB317.js} +1 -1
  81. package/build/assets/{use-user-conversation-Cs5H1pUF.js → use-user-conversation-DJen4YIP.js} +1 -1
  82. package/build/assets/{vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-hTzSytKK.js → vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~dp08i1qy-D8soyAAx.js} +1 -1
  83. package/build/assets/{verification-settings-Dlt8pINd.js → verification-settings-C_zHuDx9.js} +1 -1
  84. package/build/assets/{vscode-tab-DgepcYtF.js → vscode-tab-DH9x7xXS.js} +1 -1
  85. package/build/index.html +4 -4
  86. package/dist/api/agent-server-config.cjs +1 -1
  87. package/dist/api/agent-server-config.cjs.map +1 -1
  88. package/dist/api/agent-server-config.d.ts +17 -0
  89. package/dist/api/agent-server-config.js +7 -1
  90. package/dist/api/agent-server-config.js.map +1 -1
  91. package/dist/package.cjs +1 -1
  92. package/dist/package.cjs.map +1 -1
  93. package/dist/package.js +1 -1
  94. package/dist/package.js.map +1 -1
  95. package/package.json +1 -1
  96. package/scripts/static-server.mjs +15 -3
  97. package/build/assets/agent-server-client-options-HEOwGVIU.js +0 -1
  98. package/build/assets/conversation-DhRJuZLG.js +0 -1
  99. package/build/assets/conversation-panel-CNqHbS_Z.js +0 -1
  100. package/build/assets/llm-settings-DhrdCXqX.js +0 -1
  101. package/build/assets/use-runtime-is-ready-Do2h_hRl.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-DJ4kGzUx.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-BvSTrkhT.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~hkqzh1hb-BZ0HXuHD.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js","assets/declaration-CR6HMp29.js","assets/react-CM_dJw1Z.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js","assets/react-dom-hVBnwgwZ.js","assets/agent-server-client-options-HEOwGVIU.js","assets/llm-client-CYEaUjGx.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js","assets/QueryClientProvider-Cnr-Yl3j.js","assets/useTranslation-B6voJV4y.js","assets/context-CEQZwATj.js","assets/brand-button-DJ_S16rO.js","assets/utils-DCVfKFRt.js","assets/common-DqjLSBOt.js","assets/combobox-caret-BJC7XJsz.js","assets/sdk-settings-schema-CLmJ9sho.js","assets/dist-C3NfioQC.js","assets/sdk-settings-field-metadata-DQiaIBie.js","assets/map-provider-BJ_8KZKU.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js","assets/settings-input-CehsXnb3.js","assets/base-modal-C2oy2EBG.js","assets/modal-body-aoa2fx5W.js","assets/modal-classes-6YqcqA6y.js","assets/modal-backdrop-RfNCrSpK.js","assets/navigation-context-BdKYH32C.js","assets/use-save-settings-DkAOEfD9.js","assets/useMutation-GSSKKebK.js","assets/mutation-D0OogFCz.js","assets/settings-service.api-C3rxTtPj.js","assets/proxy-BAdHH8QB.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js","assets/settings-DGY6n4J2.js","assets/query-keys-tAsQcc_9.js","assets/use-settings-D5hbTS9t.js","assets/active-backend-context-Beu-LZL-.js","assets/health-store-B5f0S2FY.js","assets/settings-utils-DY04tWG1.js","assets/add-backend-modal-BheqYXHK.js","assets/backend-form-modal-CDnEYjaU.js","assets/server-client-Kh4QSwDJ.js","assets/organization-service.api-DbnougaQ.js","assets/agent-server-compatibility-CdI3N7dr.js","assets/modal-close-button-CtWOUMmw.js","assets/manage-backends-modal-DpBD_vR9.js","assets/pencil-Dr0b2jL1.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/plus-DT-M0FA1.js","assets/trash-2-CbVljPko.js","assets/confirmation-modal-B5Ca6qFE.js","assets/environment-switch-overlay-Tf_BIfeR.js","assets/environment-switch-store-CiurvTtK.js","assets/analytics-consent-form-modal-CVNugqzu.js","assets/handle-capture-consent-3XrjZ8wi.js","assets/alert-banner-DFnn_lC6.js","assets/vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-d2oallMa.js","assets/iconBase-DE30Zj_-.js","assets/close-BU5iTc66.js","assets/typography-BDgnT7Yp.js"])))=>i.map(i=>d[i]);
2
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{t as h}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js";import{d as g,t as _,u as v}from"./path-utils-onx24uF5.js";import{o as y,t as b}from"./declaration-CR6HMp29.js";import{t as x}from"./use-is-creating-conversation-DX2qSlfL.js";import{t as S}from"./useTranslation-B6voJV4y.js";import{a as C}from"./i18n-DET2iOyh.js";import{t as w}from"./createLucideIcon-Ddu8jDOQ.js";import{n as T,r as E,t as D}from"./git-branch-DQS2nMK4.js";import{t as O}from"./check-CYxAHs85.js";import{a as k,c as A,d as j,f as M,i as N,l as P,o as ee,r as F,s as I,t as te,u as L}from"./sidebar-mobile-menu-toggle-D0-AvsnT.js";import{n as ne,r as re}from"./custom-toast-handlers-ufGJ6_Rc.js";import{t as ie}from"./plus-DT-M0FA1.js";import{t as ae}from"./trash-2-CbVljPko.js";import{t as oe}from"./x-JOBEVLW0.js";import{t as R,v as se,x as ce,y as le}from"./utils-DCVfKFRt.js";import{t as z}from"./common-DqjLSBOt.js";import{g as ue}from"./agent-server-client-options-HEOwGVIU.js";import{n as de,r as B}from"./active-backend-context-Beu-LZL-.js";import{n as fe}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js";import{t as pe}from"./agent-server-conversation-service.api-CORdqJZg.js";import{t as me}from"./modal-backdrop-RfNCrSpK.js";import{n as he}from"./modal-body-aoa2fx5W.js";import{i as ge,r as _e}from"./base-modal-C2oy2EBG.js";import{g as ve,s as ye}from"./brand-button-DJ_S16rO.js";import{t as be}from"./loading-spinner-5GT9q1xy.js";import{t as xe}from"./use-config-OIMQLQ2s.js";import{t as Se}from"./openhands-logo-CCo0wJZX.js";import{n as Ce,t as we}from"./navigation-context-BdKYH32C.js";import{t as Te}from"./navigation-link-U4vY9i_C.js";import{a as Ee,d as V,f as De,i as H,m as U,n as Oe,o as ke,p as W,s as Ae,t as je}from"./use-cloud-current-user-id-Ddr75hEz.js";import{n as Me,t as Ne}from"./sidebar-nav-link-OhIeFyna.js";import{t as Pe}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js";import{t as Fe}from"./vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js";import{t as Ie}from"./styled-tooltip-hdfMXPQC.js";import{a as Le,d as Re,f as ze,i as G,l as Be,n as Ve,o as He,r as Ue,u as K}from"./dropdown-classes-BsVmxlNG.js";import{r as We,t as Ge}from"./combobox-caret-BJC7XJsz.js";import{_ as Ke,a as qe,c as Je,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,p as rt,r as it,s as at,t as ot,u as st}from"./git-provider-icon-CHdGBdU2.js";import{a as ct,r as lt}from"./backend-form-modal-CDnEYjaU.js";import{s as ut}from"./environment-switch-store-CiurvTtK.js";import{t as dt}from"./react-Dy05vyj5.js";import{r as ft,t as pt}from"./middleware-CfatjPYZ.js";import{t as mt}from"./conversation-store-CC-isCnP.js";import{t as ht}from"./add-backend-modal-BheqYXHK.js";import{t as gt}from"./manage-backends-modal-DpBD_vR9.js";import{c as _t,l as vt,o as yt}from"./acp-providers-CPdgcp13.js";import{t as bt}from"./use-is-authed-dw2026rR.js";import{t as xt}from"./use-click-outside-element-DhxCUyWl.js";import{r as St,t as Ct}from"./use-settings-D5hbTS9t.js";import{t as wt}from"./use-create-conversation-Bszyp13O.js";import{t as Tt}from"./vscode-url-helper-Cwy1A62q.js";import{t as Et}from"./conversation-service.api-BsJy6uuL.js";import{r as Dt,t as Ot}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DW31UyBp.js";import{n as kt,t as q}from"./context-menu-list-item-7tAcm2c3.js";import{i as J,r as At,t as jt}from"./ellipsis-button-Vh5MvRZa.js";import{t as Mt}from"./u-edit-BbrptMCa.js";import{t as Nt}from"./skills-0GRKX5Xj.js";import{a as Pt,c as Ft,i as It,l as Lt,n as Rt,o as zt,r as Bt,s as Vt,t as Ht,u as Ut}from"./manage-workspaces-modal-CtRbxREx.js";import{o as Wt,s as Gt,t as Kt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-d2oallMa.js";import{t as qt}from"./search-SuJctqNJ.js";import{t as Jt}from"./sidebar-store-DnQAJAE5.js";import{t as Yt}from"./handle-capture-consent-3XrjZ8wi.js";import{t as Xt}from"./use-save-settings-DkAOEfD9.js";import{t as Zt}from"./use-user-conversation-Cs5H1pUF.js";import{t as Qt}from"./conversation-state-store-D-w0uurj.js";var $t=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),en=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),tn=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),nn=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),rn=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),an=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),on=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),sn=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),cn=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ln=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),un=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=y(),dn=46,fn=30;function pn({className:e,logoClassName:t,logoWidth:n=dn,logoHeight:r=fn}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Te,{to:`/conversations`,"aria-label":i(b.BRANDING$OPENHANDS_LOGO),className:R(e),children:(0,X.jsx)(Se,{width:n,height:r,className:R(`shrink-0`,t)})})}function mn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-white/20 border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function hn({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)(oe,{size:14})})}function gn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:R(We,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(Ge,{})})}function _n({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:R(`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:R(`p-0`,G)}),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:R(He,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:K,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)(Ke,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function vn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:R(`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`,ye,`px-0 not-italic text-inherit`)})})}var yn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function bn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=Fe({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===Fe.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:R(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.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:yn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:yn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:R(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)(vn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(mn,{}),n&&w&&(0,X.jsx)(hn,{onClear:()=>T(null)}),(0,X.jsx)(gn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(_n,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var xn=`::`;function Sn(e,t){return t?`${e}${xn}${t}`:e}function Cn(e){let[t,n]=e.split(xn);return{backendId:t,orgId:n??null}}function wn(e){return(0,X.jsx)(lt,{isConnected:e?.isConnected??null})}function Tn(){return(0,X.jsx)(lt,{isConnected:`unavailable`})}function En(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:Sn(e.id,null),label:e.name,prefix:wn(i[e.id])});for(let e of s){let o=n[e.id],s=wn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Sn(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:Sn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Dn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=B(),p=Oe(),m=je(),h=ct(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),y=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(b.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>En(u,D,p,m,h),[u,D,p,m,h]),k=ue(d.backend),A=l(b.BACKEND$NO_BACKEND_AVAILABLE),j=Sn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(b.SIDEBAR$SETTINGS),ee=mt(e=>e.isRightPanelShown),F=!c||y&&ee?`top`:`left`,I=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let te=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),L=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),ne=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),re=(0,X.jsxs)(`div`,{className:G,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:ne,onClick:te,className:R(Ve,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(ie,{width:16,height:16})}),l(b.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:ne,onClick:L,className:R(Ve,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(ln,{width:16,height:16})}),l(b.BACKEND$MANAGE)]})]}),ae=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=Cn(e),r=u.find(e=>e.id===t);r&&(ut(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,y,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(bn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?Tn():wn(h[d.backend.id])},footer:re,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ae(e.value)},placeholder:k?A:d.backend.name,loading:I,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(Ie,{content:P,placement:F,offset:10,children:(0,X.jsx)(Te,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:R(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,ve),children:(0,X.jsx)(ln,{width:16,height:16})})})]}),C?(0,X.jsx)(ht,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(gt,{onClose:()=>E(!1)}):null]})}var On=(e=20)=>{let{data:t}=bt(),n=de(),r=!ue(n.backend);return g({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await pe.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},kn=(e=10)=>h({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function An({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(me,{onClose:n,children:(0,X.jsxs)(he,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(_e,{title:r(b.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(ge,{text:r(b.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(ge,{text:r(b.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var jn=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Mn=e=>{let t=typeof e==`string`?jn(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Nn({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:R(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var Pn=e=>{switch(e){case z.FINISHED:return`check`;case z.RUNNING:return`working`;case z.IDLE:case z.WAITING_FOR_CONFIRMATION:return`active`;case z.PAUSED:return`paused`;case z.ERROR:case z.STUCK:return`error`;default:return`unknown`}},Fn=(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 In(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 Ln({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:Pn(e),o=r(Fn(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)(Ot,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):In(a)});return n?(0,X.jsx)(Ie,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Rn({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(Ln,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Nn,{title:e,titleMode:t,onSave:n,isConversationArchived:i===`MISSING`||i===`ERROR`})]})}var zn=e(m(),1);function Bn({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}=de(),m=xt(e,d),h=p.kind===`cloud`?b.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:b.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)(Ke,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(kt,{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)(Mt,{width:16,height:16}),text:f(b.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)(tt,{width:16,height:16}),text:f(b.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)(Nt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(b.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)(rt,{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)(A,{width:16,height:16}),text:f(b.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)(A,{width:16,height:16}),text:f(b.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(I,{width:16,height:16}),text:f(b.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)(At,{width:16,height:16}),text:f(b.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Vn({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ce(s),d=le(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)(jt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:R(u&&`opacity-60`)}),e&&m&&h?(0,zn.createPortal)((0,X.jsx)(Bn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var Hn={bitbucket:Kt,bitbucket_data_center:Kt,github:Wt,gitlab:Gt};function Un({selectedRepository:e}){let t=e.git_provider?Hn[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)(Xe,{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)(Dt,{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 Wn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?_(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Ye,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(b.COMMON$NO_REPOSITORY)})]})}function Gn({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=ce(r),p=null;if(c)if(l===`acp`){let e=yt(u)??d(b.CONVERSATION$ACP_AGENT_GENERIC),t=_t(u,s),n=t??e;p={kind:vt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:R(`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)(Ut,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:R(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Un,{selectedRepository:e}):(0,X.jsx)(Wn,{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:`${Mn(t??n)} ${d(b.CONVERSATION$AGO)}`})})})]})]})}function Kn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(st,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(b.COMMON$ERROR)})]})}function qn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let x=fe(),[S,C]=Y.useState(`view`),{mutateAsync:w}=et(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x.capture(`download_via_vscode_button_clicked`),l)try{let e=await Et.getVSCodeUrl(l);if(e.vscode_url){let t=Tt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:R(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Rn,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Kn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:R(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Mn(s??c)})}),j&&(0,X.jsx)(`div`,{className:R(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Vn,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(Gn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function Jn({taskStatus:e}){return(0,X.jsx)(`div`,{className:R(`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 Yn({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:R(`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(se(e))})}function Xn({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)(Jn,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Yn,{taskStatus:t})]})}function Zn({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:R(`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)(Un,{selectedRepository:e}):(0,X.jsx)(Wn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Mn(t)} ${r(b.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function Qn({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(b.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:R(`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)(Xn,{title:r,taskStatus:e.status})}),(0,X.jsx)(Zn,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function $n({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 er({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Pe,{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)(Ln,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(Gn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(Te,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>R(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(Ln,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var tr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=dt()(ft(e=>({...tr,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:pt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),nr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,rr=`px-2 pb-1 pt-1`,ir=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function ar({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:R(rr,ir),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:R(`flex items-baseline justify-between gap-2`,rr),children:[(0,X.jsx)(`span`,{className:R(`min-w-0 truncate text-left`,ir),children:e}),t]})}function or(){return(0,X.jsx)(Ke,{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:R(`group`,He,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:R(`h-3.5 w-3.5`,Be),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(O,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function sr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),y=v(r===`local`?b.CONVERSATION_PANEL$BY_WORKSPACE:b.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:R(`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)]`,Ue),children:(0,X.jsx)(on,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:R(`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`,G,Re),children:[(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:T,label:y,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:en,label:v(b.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:$t,label:v(b.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:tn,label:v(b.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:sn,label:v(b.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:un,label:v(b.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:E,label:v(b.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:D,label:v(b.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(b.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(b.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?nn:rn,label:nr(v(u?b.CONVERSATION$HIDE:b.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ae,label:nr(v(b.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var cr=R(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Le);function lr(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 ur({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ce(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=lr(u,{open:s,enabled:i}),{data:f,error:p}=Pt(),m=f?.workspaceParents??[],{mutate:h}=Vt(),{mutate:g}=Ft(),{mutate:_}=zt(),{mutate:v}=Lt(),{workspaces:y}=It(),C=Bt(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=wt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=He,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ee=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!C,te=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,L=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&T(!0)},className:N,children:a(b.HOME$ADD_WORKSPACES)}),ne=C?(0,X.jsx)(Ie,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:L})}):L;return(0,X.jsxs)(`div`,{className:R(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:ee,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:R(cr,!i&&R(`absolute top-full mt-0`,n)),style:te,children:[(0,X.jsxs)(`ul`,{className:R(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,G),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(b.HOME$NO_WORKSPACE_OPTION)})})}),y.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(Je,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:R(`flex flex-col`,G),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(Ke,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),ne,(y.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(b.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(Rt,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(Ht,{isOpen:E,workspaces:y,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function dr({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:K,"aria-hidden":!0,children:(0,X.jsx)(Je,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function fr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ce(),{providers:s}=at(),{lastSelectedProvider:c,setLastSelectedProvider:l}=nt(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=lr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),y=it(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=qe({provider:h}),{data:k,isLoading:A}=$e(y,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=y?k??[]:j,{mutate:N,isPending:P}=wt(),ee=x(),F=P||ee;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||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},te=e=>{g(e),l(e),v(``)},L=He;Y.useEffect(()=>{u&&(y||!E||D||w||M.length===0||M.length>=10||O())},[u,y,E,D,w,M.length,O]);let ne=y?A:w,re=!y&&E&&M.length>0,ie=Y.useCallback(()=>{d(e=>!e)},[]),ae=u&&(!i||m!==null),oe=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:R(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ie,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),ae&&(0,X.jsxs)(`div`,{"data-testid":r,className:R(cr,!i&&R(`absolute top-full mt-0`,n)),style:oe,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:()=>te(e),className:R(`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)(ot,{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)(qt,{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(b.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:R(`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)(Ke,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:R(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,G),children:[ne&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(b.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(b.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!ne&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(b.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(dr,{repo:e,disabled:F,onSelect:I,itemClass:L},`${e.git_provider}:${e.id}`)),re&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:L,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?b.HOME$LOADING_MORE_REPOSITORIES:b.CONVERSATION$LOAD_MORE)})})})]})]})]})}var pr=R(`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 mr({backendKind:e}){let{t}=S(`openhands`),n=t(b.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(an,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(ur,{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)(fr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:pr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function hr(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function gr(e,t,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 _r(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)=>_r(t[n])-_r(e[n]))}function yr(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 br(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 xr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?yr(n):br(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:gr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,_r(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var Sr=()=>{},Cr=3600*1e3,wr=e=>{let t=Date.now()-Cr,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 Tr({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Ce(),{backend:a}=de(),o=xt(e??Sr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),y=Z(e=>e.showLlmProfiles),C=Z(e=>e.toggleShowLlmProfiles),w=Z(e=>e.organizeMode),E=Z(e=>e.setOrganizeMode),D=Z(e=>e.conversationSort),O=Z(e=>e.setConversationSort),k=Z(e=>e.threadScope),A=Z(e=>e.setThreadScope),[M,N]=Y.useState(!1),[ee,F]=Y.useState(!1),I=xt(()=>{N(!1)}),[te,ae]=Y.useState(()=>new Set),[oe,se]=Y.useState(()=>new Set),ce=Y.useCallback(e=>{ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),z=Y.useCallback(e=>{se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{w!==`grouped`&&(ae(new Set),se(new Set))},[w]);let ue=Y.useRef(null),[B,fe]=Y.useState(null),[pe,me]=Y.useState(null),[he,ge]=Y.useState(null),{data:_e,isLoading:ve,isFetched:ye,hasNextPage:xe,isFetchingNextPage:Se,fetchNextPage:we}=On(),{data:Ee}=kn(),V=Y.useMemo(()=>_e?.pages.flatMap(e=>e.items)??[],[_e]),De=Y.useMemo(()=>k===`relevant`?V.filter(e=>le(e.execution_status)):V,[V,k]),{recent:H,older:U}=Y.useMemo(()=>wr(De),[De]),Oe=Y.useMemo(()=>vr(h?[...H,...U]:H,D),[H,U,h,D]),ke=Y.useMemo(()=>({emptyWorkspace:n(b.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(b.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),W=Y.useMemo(()=>t||w!==`grouped`?null:xr([...H,...h?U:[]],a.kind,D,ke),[a.kind,t,D,ke,U,w,H,h]),Ae=Y.useMemo(()=>vr(H.filter(e=>le(e.execution_status)),D),[D,H]),je=Oe.length,Me=Y.useMemo(()=>W?W.reduce((e,t)=>e+t.conversations.length,0):0,[W]),Ne=w===`grouped`&&!t?Me===0:je===0,{mutate:Pe,mutateAsync:Fe}=Ze(),{mutate:Ie}=Qe(),{mutate:Le}=P(),Re=U.length>0&&!h,ze=!!xe&&!Re&&!t&&!Ne,{mutate:G}=wt(),Be=x(),Ve=Y.useCallback(e=>{Be||G({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[G,Be,i]),He=Y.useCallback((e,t)=>{c(!0),fe(e),me(t)},[]),Ue=Y.useCallback(e=>{u(!0),fe(e)},[]),K=Y.useCallback((e,t)=>{Le({conversationId:e,newTitle:t},{onSuccess:()=>{re(n(b.CONVERSATION$TITLE_UPDATED))}})},[n,Le]),We=()=>{B&&Pe({conversationId:B},{onSuccess:()=>{B===r&&i(`/conversations`)}})},Ge=()=>{B&&Ie({conversationId:B})},Ke=async()=>{let e=V.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Fe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&ne(`${a} conversation${a===1?``:`s`} could not be deleted.`)},qe=Y.useCallback(n=>t?(0,X.jsx)(er,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(Te,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(qn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>K(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:he===n.id,onContextMenuToggle:e=>ge(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,K,He,Ue,e,he,_,y]),Je=ve||!ye,Ye=ye&&!ve&&!t&&Ne&&!Ee?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:R(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,ee?`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(b.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(mr,{backendKind:a.kind}),(0,X.jsx)(sr,{filterMenuOpen:M,setFilterMenuOpen:N,menuRef:I,backendKind:a.kind,organizeMode:w,setOrganizeMode:E,conversationSort:D,setConversationSort:O,threadScope:k,setThreadScope:A,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:y,toggleShowLlmProfiles:C,totalConversationsCount:V.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:ue,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{F(e.currentTarget.scrollTop>0)},className:R(`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:[Je&&(0,X.jsx)($n,{compact:t}),!t&&Ye&&(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(b.CONVERSATION$NO_CONVERSATIONS)})}),!t&&Ee?.map(t=>(0,X.jsx)(Te,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Qn,{task:t})},t.id)),!Je&&t?Ae.map(qe):null,!Je&&!t&&w===`grouped`&&W&&W.length>0?(0,X.jsx)(`nav`,{"aria-label":n(b.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:W.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!te.has(e.id),o=oe.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=hr(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:R(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>ce(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(T,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:R(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(b.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(qe),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>z(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?b.CONVERSATION_PANEL$LESS:b.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!Je&&!t&&w===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Oe.map(qe)}):null,ze&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:Se?(0,X.jsx)(be,{size:`small`}):(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(b.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(j,{onConfirm:()=>{We(),c(!1),me(null)},onCancel:()=>{c(!1),me(null)},conversationTitle:pe??void 0}),p&&(0,X.jsx)(j,{title:n(b.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(b.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:V.length}),onConfirm:async()=>{await Ke(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(L,{onConfirm:()=>{Ge(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(An,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function Er({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)(Tr,{})})})}var Dr=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,Or=34,kr=Math.round(Or*30/46);function Ar({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:h,onOpenAddBackend:g,onOpenManageBackends:_}){let{t:y}=S(`openhands`),x=h;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:V(e),children:[(0,X.jsxs)(`div`,{className:R(e&&t?H:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:R(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(pn,{logoWidth:Or,logoHeight:kr,logoClassName:`max-w-none`,className:R(Ae,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:R(Ee,c?`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":a,onClick:o,className:R(`hidden md:inline-flex ml-auto`,ke,`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":y(b.SIDEBAR$CLOSE_MENU),className:R(`inline-flex ml-auto`,ke,`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:W(e),children:[(0,X.jsx)(Ne,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(ie,{width:$,height:$})}),(0,X.jsx)(Ne,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(Ne,{to:`/automations`,label:y(b.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(Dr,{width:$,height:$})})]}),(0,X.jsx)(Er,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:R(W(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(Ie,{content:y(b.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Te,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":y(b.SIDEBAR$SETTINGS),className:U({collapsed:!0}),children:[(0,X.jsx)(Me,{active:u.startsWith(`/settings`),children:(0,X.jsx)(ln,{width:$,height:$})}),(0,X.jsx)(`span`,{className:De(!0),children:y(b.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":y(b.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:R(U({collapsed:!0}),`relative`),children:[(0,X.jsx)(Me,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(lt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(cn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:De(!0),children:y(b.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Dn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:g,onOpenManageBackends:_})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:R(`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)(Dn,{sidebarCollapsed:e,openUpward:!0})})]})}var jr=Y.lazy(()=>n(()=>import(`./settings-modal-DJ4kGzUx.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]))),Mr=Y.lazy(()=>n(()=>import(`./add-backend-modal-BheqYXHK.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([48,1,9,49,13,50,51,16,15,17,10,41,40,18,19,52,46,20,21,7,22,30,34,12,32,53,35,45,33]))),Nr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-DpBD_vR9.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([54,1,13,50,15,16,17,9,10,55,56,57,58,18,19,49,51,41,40,52,46,20,21,7,22,30,34,12,32,53,35,45,33,59]))),Pr=250;function Fr(){let{t:e}=S(`openhands`),{currentPath:t}=Ce(),{data:n}=xe(),{data:r,error:i,isError:a,isFetching:o}=St(),{backends:s,active:c}=B(),l=ct(s)[c.backend.id],u=Jt(e=>e.collapsed),d=Jt(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[y,x]=Y.useState(!1),[C,w]=Y.useState(!1),T=Y.useRef(!1),[,E]=Y.useReducer(e=>e+1,0),{isOpen:D,close:O}=ee(),[k,A]=Y.useState(!1),[j,M]=Y.useState(!1),N=xt(()=>h(!1)),P=Ct(i);Y.useEffect(()=>{O()},[t,O]),Y.useEffect(()=>{if(D){A(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{A(!1)},Pr);return()=>window.clearTimeout(e)},[D]),Y.useEffect(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D,O]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&P!==404?ne(`Something went wrong while fetching settings. Please reload the page.`):P===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,P,n?.feature_flags?.hide_llm_settings]);let F=r?.email_verified===!1,I=e(u?b.SIDEBAR$EXPAND:b.SIDEBAR$COLLAPSE),te=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]),L={linkDisabled:F,collapseToggleLabel:I,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,E(),d(!0),window.setTimeout(()=>{T.current=!1,E()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:te,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:R(`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)(Ar,{collapsed:u,showCollapseToggle:!0,...L})}),k?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:R(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,j?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Pr}ms`},onClick:O,"aria-hidden":!j}),(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!j,className:R(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,j?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Pr}ms`},children:(0,X.jsx)(Ar,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:O,...L})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(jr,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Mr,{onClose:()=>v(!1)})}),y&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Nr,{onClose:()=>x(!1)})})]})}var Ir=`/settings`,Lr=`/customize`,Rr=[`/skills`,`/mcp`,`/plugins`];function zr(e){return e===Ir?{mode:`menu`}:e.startsWith(`${Ir}/`)&&e.length>9?{mode:`back`,backTo:Ir,backLabelKey:b.SETTINGS$TITLE}:e===Lr?{mode:`menu`}:Rr.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Lr,backLabelKey:b.NAV$CUSTOMIZE}:{mode:`menu`}}function Br(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Ce(),r=zr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(te,{}),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??b.COMMON$BACK),className:F,children:(0,X.jsx)(M,{size:20,className:N,"aria-hidden":!0,strokeWidth:2})}):null]})}var Vr=()=>{let e=fe(),{mutate:t}=Xt();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{Yt(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}},Hr=()=>{let e=fe(),{data:t}=St(),n=Y.useRef(!1);Y.useEffect(()=>{if(!e||t===void 0||n.current)return;let r=t.user_consents_to_analytics;if(r!==null){let t=e.has_opted_in_capturing(),i=e.has_opted_out_capturing();(r===!0&&!t||r===!1&&!i)&&Yt(e,r),n.current=!0}},[e,t])};function Ur(e){switch(e){case z.RUNNING:return`🟢`;case z.FINISHED:case z.IDLE:case z.WAITING_FOR_CONFIRMATION:return`✅`;case z.PAUSED:return`⚪`;case z.ERROR:case z.STUCK:return`🔴`;default:return null}}var Wr=`OpenHands`,Gr=()=>{let{conversationId:e}=l(),{data:t}=Zt(e??null),n=Qt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Wr}`:Wr;if(!e)return i;let a=Ur(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Kr({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(we,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var qr=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-Tf_BIfeR.js`),__vite__mapDeps([60,1,12,10,9,18,19,61]))),Jr=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-CVNugqzu.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([62,28,1,29,10,9,18,19,20,21,7,22,31,32,33,34,12,36,37,16,38,17,39,13,40,41,42,43,44,15,45,46,63]))),Yr=Y.lazy(()=>n(()=>import(`./alert-banner-DFnn_lC6.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([64,1,65,10,9,18,19,66,67,21,7,22,35,68,69,25]))),Xr=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(b.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(b.ERROR$UNKNOWN)})})}),Zr=o(function(){let e=p(),t=Gr(),{data:n}=St(),{migrateUserConsent:r}=Vr(),i=xe(),[a,o]=Y.useState(!1);if(Hr(),Y.useEffect(()=>{n?.language&&C.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(be,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname);return(0,X.jsx)(Kr,{children:(0,X.jsxs)(k,{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)(Fr,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Br,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Yr,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Jr,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(qr,{})})]})})});export{Xr as ErrorBoundary,Zr as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/settings-modal-T_Yk1Zfo.js","assets/rolldown-runtime-BFRubm34.js","assets/model-selector-DcztJSxT.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-m8dOii0J.js","assets/preload-helper-CT1Z6Pdu.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-tTR8C6m0.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~iguv7bgw-6Rm8U_Sr.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~hkqzh1hb-BZ0HXuHD.js","assets/vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~i4kjfqhl-CbAhtEMv.js","assets/declaration-CR6HMp29.js","assets/react-CM_dJw1Z.js","assets/vendor~home~mcp~llm-settings~agent-settings~condenser-settings~verification-settings~app-se~ocm3mykx-CjJdFLoM.js","assets/react-dom-hVBnwgwZ.js","assets/agent-server-client-options-9agOSarV.js","assets/llm-client-BqyLKgUN.js","assets/vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~extensions~g56ukk6u-DsSvIDZQ.js","assets/QueryClientProvider-Cnr-Yl3j.js","assets/useTranslation-B6voJV4y.js","assets/context-CEQZwATj.js","assets/brand-button-DJ_S16rO.js","assets/utils-DCVfKFRt.js","assets/common-DqjLSBOt.js","assets/combobox-caret-BJC7XJsz.js","assets/sdk-settings-schema-CLmJ9sho.js","assets/dist-C3NfioQC.js","assets/sdk-settings-field-metadata-DQiaIBie.js","assets/map-provider-BJ_8KZKU.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js","assets/vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~zm51vy4j-BClAMeFe.js","assets/settings-input-CehsXnb3.js","assets/base-modal-C2oy2EBG.js","assets/modal-body-aoa2fx5W.js","assets/modal-classes-6YqcqA6y.js","assets/modal-backdrop-RfNCrSpK.js","assets/navigation-context-BdKYH32C.js","assets/use-save-settings-uXXkqvD7.js","assets/useMutation-GSSKKebK.js","assets/mutation-D0OogFCz.js","assets/settings-service.api-DwtyDeGh.js","assets/proxy-BqDMnUY-.js","assets/vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js","assets/settings-DGY6n4J2.js","assets/query-keys-tAsQcc_9.js","assets/use-settings-DeO7nvpM.js","assets/active-backend-context-BSPE-W72.js","assets/health-store-B5f0S2FY.js","assets/settings-utils-DY04tWG1.js","assets/add-backend-modal-mXKmfMI2.js","assets/backend-form-modal-D3bDMO3C.js","assets/server-client-DYv_GHPl.js","assets/organization-service.api-BeuMC9QL.js","assets/agent-server-compatibility-B7QStIcH.js","assets/modal-close-button-CtWOUMmw.js","assets/manage-backends-modal-CRMwyU0t.js","assets/pencil-Dr0b2jL1.js","assets/createLucideIcon-Ddu8jDOQ.js","assets/plus-DT-M0FA1.js","assets/trash-2-CbVljPko.js","assets/confirmation-modal-B5Ca6qFE.js","assets/environment-switch-overlay-Tf_BIfeR.js","assets/environment-switch-store-CiurvTtK.js","assets/analytics-consent-form-modal-BQCNeNVt.js","assets/handle-capture-consent-3XrjZ8wi.js","assets/alert-banner-DFnn_lC6.js","assets/vendor~conversation-panel~conversation~alert-banner-w-I2sY6c.js","assets/vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-d2oallMa.js","assets/iconBase-DE30Zj_-.js","assets/close-BU5iTc66.js","assets/typography-BDgnT7Yp.js"])))=>i.map(i=>d[i]);
2
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{t as n}from"./preload-helper-CT1Z6Pdu.js";import{A as r,C as i,F as a,L as o,M as s,N as c,P as l,R as u,c as d,j as f,k as p}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as m}from"./react-dom-hVBnwgwZ.js";import{t as h}from"./vendor~root~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-s~f2l2lr17-DYXOLEck.js";import{d as g,t as _,u as v}from"./path-utils-z12iCrQO.js";import{o as y,t as b}from"./declaration-CR6HMp29.js";import{t as x}from"./use-is-creating-conversation-DX2qSlfL.js";import{t as S}from"./useTranslation-B6voJV4y.js";import{a as C}from"./i18n-DET2iOyh.js";import{t as w}from"./createLucideIcon-Ddu8jDOQ.js";import{n as T,r as E,t as D}from"./git-branch-DQS2nMK4.js";import{t as O}from"./check-CYxAHs85.js";import{a as k,c as A,d as j,f as M,i as N,l as P,o as ee,r as F,s as I,t as te,u as L}from"./sidebar-mobile-menu-toggle-DGlRg6jG.js";import{n as ne,r as re}from"./custom-toast-handlers-ufGJ6_Rc.js";import{t as ie}from"./plus-DT-M0FA1.js";import{t as ae}from"./trash-2-CbVljPko.js";import{t as oe}from"./x-JOBEVLW0.js";import{t as R,v as se,x as ce,y as le}from"./utils-DCVfKFRt.js";import{t as z}from"./common-DqjLSBOt.js";import{g as ue}from"./agent-server-client-options-9agOSarV.js";import{n as de,r as B}from"./active-backend-context-BSPE-W72.js";import{n as fe}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js";import{t as pe}from"./agent-server-conversation-service.api-B9TUYJon.js";import{t as me}from"./modal-backdrop-RfNCrSpK.js";import{n as he}from"./modal-body-aoa2fx5W.js";import{i as ge,r as _e}from"./base-modal-C2oy2EBG.js";import{g as ve,s as ye}from"./brand-button-DJ_S16rO.js";import{t as be}from"./loading-spinner-5GT9q1xy.js";import{t as xe}from"./use-config-C9pvb0Sm.js";import{t as Se}from"./openhands-logo-CCo0wJZX.js";import{n as Ce,t as we}from"./navigation-context-BdKYH32C.js";import{t as Te}from"./navigation-link-U4vY9i_C.js";import{a as Ee,d as V,f as De,i as H,m as U,n as Oe,o as ke,p as W,s as Ae,t as je}from"./use-cloud-current-user-id-ClKFPjFz.js";import{n as Me,t as Ne}from"./sidebar-nav-link-dgVb8Fpy.js";import{t as Pe}from"./vendor~root-layout~home~conversation-panel~conversation~extensions-hub~skills-settings~skil~k776hupu-BJbu9kpL.js";import{t as Fe}from"./vendor~root-layout~home~conversation-panel~conversation-B5WNMnt4.js";import{t as Ie}from"./styled-tooltip-hdfMXPQC.js";import{a as Le,d as Re,f as ze,i as G,l as Be,n as Ve,o as He,r as Ue,u as K}from"./dropdown-classes-BsVmxlNG.js";import{r as We,t as Ge}from"./combobox-caret-BJC7XJsz.js";import{_ as Ke,a as qe,c as Je,d as Ye,f as Xe,g as Ze,h as Qe,i as $e,l as et,m as tt,n as nt,p as rt,r as it,s as at,t as ot,u as st}from"./git-provider-icon-Pi-Cxpgv.js";import{a as ct,r as lt}from"./backend-form-modal-D3bDMO3C.js";import{s as ut}from"./environment-switch-store-CiurvTtK.js";import{t as dt}from"./react-Dy05vyj5.js";import{r as ft,t as pt}from"./middleware-CfatjPYZ.js";import{t as mt}from"./conversation-store-CC-isCnP.js";import{t as ht}from"./add-backend-modal-mXKmfMI2.js";import{t as gt}from"./manage-backends-modal-CRMwyU0t.js";import{c as _t,l as vt,o as yt}from"./acp-providers-BAX8OU5C.js";import{t as bt}from"./use-is-authed-dw2026rR.js";import{t as xt}from"./use-click-outside-element-DhxCUyWl.js";import{r as St,t as Ct}from"./use-settings-DeO7nvpM.js";import{t as wt}from"./use-create-conversation-B-lwTnfE.js";import{t as Tt}from"./vscode-url-helper-Cwy1A62q.js";import{t as Et}from"./conversation-service.api-B6CkzaKD.js";import{r as Dt,t as Ot}from"./vendor~root-layout~conversation-panel~conversation~shared-conversation-DW31UyBp.js";import{n as kt,t as q}from"./context-menu-list-item-7tAcm2c3.js";import{i as J,r as At,t as jt}from"./ellipsis-button-Vh5MvRZa.js";import{t as Mt}from"./u-edit-BbrptMCa.js";import{t as Nt}from"./skills-0GRKX5Xj.js";import{a as Pt,c as Ft,i as It,l as Lt,n as Rt,o as zt,r as Bt,s as Vt,t as Ht,u as Ut}from"./manage-workspaces-modal-BYmGD1W7.js";import{o as Wt,s as Gt,t as Kt}from"./vendor~root-layout~home~conversation-panel~conversation~shared-conversation~alert-banner~pl~rqjteh0a-d2oallMa.js";import{t as qt}from"./search-SuJctqNJ.js";import{t as Jt}from"./sidebar-store-DnQAJAE5.js";import{t as Yt}from"./handle-capture-consent-3XrjZ8wi.js";import{t as Xt}from"./use-save-settings-uXXkqvD7.js";import{t as Zt}from"./use-user-conversation-DJen4YIP.js";import{t as Qt}from"./conversation-state-store-D-w0uurj.js";var $t=w(`calendar-arrow-down`,[[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`path`,{d:`M18 14v8`,key:`irew45`}],[`path`,{d:`M21 11.354V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h7.343`,key:`bse4f3`}],[`path`,{d:`M3 10h18`,key:`8toen8`}],[`path`,{d:`M8 2v4`,key:`1cmpym`}]]),en=w(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),tn=w(`clock-arrow-down`,[[`path`,{d:`M12 6v6l2 1`,key:`19cm8n`}],[`path`,{d:`M12.337 21.994a10 10 0 1 1 9.588-8.767`,key:`28moa`}],[`path`,{d:`m14 18 4 4 4-4`,key:`1waygx`}],[`path`,{d:`M18 14v8`,key:`irew45`}]]),nn=w(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),rn=w(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),an=w(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),on=w(`list-filter`,[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]),sn=w(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),cn=w(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ln=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),un=w(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Y=e(t(),1),X=y(),dn=46,fn=30;function pn({className:e,logoClassName:t,logoWidth:n=dn,logoHeight:r=fn}={}){let{t:i}=S(`openhands`);return(0,X.jsx)(Te,{to:`/conversations`,"aria-label":i(b.BRANDING$OPENHANDS_LOGO),className:R(e),children:(0,X.jsx)(Se,{width:n,height:r,className:R(`shrink-0`,t)})})}function mn(){return(0,X.jsx)(`div`,{className:`animate-spin h-4 w-4 border-2 border-white/20 border-t-white rounded-full`,"data-testid":`dropdown-loading`})}function hn({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)(oe,{size:14})})}function gn({isOpen:e,isDisabled:t,getToggleButtonProps:n}){return(0,X.jsx)(`button`,{type:`button`,"data-testid":`dropdown-trigger`,...n({disabled:t,className:R(We,`text-current`,e&&`rotate-180`,t&&`cursor-not-allowed`)}),children:(0,X.jsx)(Ge,{})})}function _n({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:R(`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:R(`p-0`,G)}),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:R(He,`focus:outline-none`,n?.value===e.value&&`bg-[var(--oh-interactive-selected)] text-white`)}),children:[e.prefix?(0,X.jsx)(`span`,{className:K,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)(Ke,{inset:`menu`}),(0,X.jsx)(`div`,{className:`p-0`,children:o})]}):null]})}function vn({placeholder:e,isDisabled:t,getInputProps:n,italicPlaceholder:r=!0,fitContent:i=!1}){return(0,X.jsx)(`input`,{...n({placeholder:e,disabled:t,className:R(`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`,ye,`px-0 not-italic text-inherit`)})})}var yn={position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,border:0};function bn({options:e,emptyMessage:t=`No options`,clearable:n=!1,loading:r=!1,disabled:i=!1,placeholder:a,defaultValue:o,onChange:s,testId:c,className:l,footer:u,openUpward:d=!1,hideTrigger:f=!1,defaultOpen:p=!1,openOnHover:m=!1,italicPlaceholder:h=!0,fitContent:g=!1}){let _=Y.useRef(null),[v,y]=(0,Y.useState)(o?.label??``),[b,x]=(0,Y.useState)(``),S=e.filter(e=>e.label.toLowerCase().includes(b.toLowerCase())),{isOpen:C,selectedItem:w,selectItem:T,openMenu:E,closeMenu:D,getToggleButtonProps:O,getMenuProps:k,getItemProps:A,getInputProps:j}=Fe({items:S,itemToString:e=>e?.label??``,inputValue:v,stateReducer:(e,t)=>t.type===Fe.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:R(`relative`,g?`inline-block w-auto`:`w-full`),"data-testid":c,onMouseEnter:m?()=>{_.current&&=(clearTimeout(_.current),null),E()}:void 0,onMouseLeave:m?()=>{_.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:yn}),(0,X.jsx)(`button`,{type:`button`,...O({tabIndex:-1}),style:yn,"aria-hidden":!0})]}):(0,X.jsxs)(`div`,{className:R(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)(vn,{placeholder:a,isDisabled:M,getInputProps:P,italicPlaceholder:h,fitContent:g}),r&&(0,X.jsx)(mn,{}),n&&w&&(0,X.jsx)(hn,{onClear:()=>T(null)}),(0,X.jsx)(gn,{isOpen:C,isDisabled:M,getToggleButtonProps:O})]}),(0,X.jsx)(_n,{isOpen:C,filteredOptions:S,selectedItem:w,emptyMessage:t,getMenuProps:k,getItemProps:A,footer:u,openUpward:d,fitContent:g})]})}var xn=`::`;function Sn(e,t){return t?`${e}${xn}${t}`:e}function Cn(e){let[t,n]=e.split(xn);return{backendId:t,orgId:n??null}}function wn(e){return(0,X.jsx)(lt,{isConnected:e?.isConnected??null})}function Tn(){return(0,X.jsx)(lt,{isConnected:`unavailable`})}function En(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:Sn(e.id,null),label:e.name,prefix:wn(i[e.id])});for(let e of s){let o=n[e.id],s=wn(i[e.id]);if(!o||o.orgs.length===0)a.push({value:Sn(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:Sn(e.id,r.id),label:`${e.name} – ${i}`,prefix:s})}}}return a}function Dn({openUpward:e=!1,hideTrigger:t=!1,defaultOpen:n=!1,onSelectOption:i,onOpenAddBackend:a,onOpenManageBackends:o,sidebarCollapsed:c=!1}={}){let{t:l}=S(`openhands`),{backends:u,active:d,setActive:f}=B(),p=Oe(),m=je(),h=ct(u),g=s(),_=r(`/settings`),v=r(`/settings/*`),y=r(`/conversations/:conversationId`),x=r(`/automations/:automationId`),[C,w]=Y.useState(!1),[T,E]=Y.useState(!1),D=l(b.BACKEND$PERSONAL_WORKSPACE),O=Y.useMemo(()=>En(u,D,p,m,h),[u,D,p,m,h]),k=ue(d.backend),A=l(b.BACKEND$NO_BACKEND_AVAILABLE),j=Sn(d.backend.id,d.orgId),M=k?void 0:O.find(e=>e.value===j),N=!!(_||v),P=l(b.SIDEBAR$SETTINGS),ee=mt(e=>e.isRightPanelShown),F=!c||y&&ee?`top`:`left`,I=Object.values(p).some(e=>e.isLoading);Y.useEffect(()=>{if(k||d.backend.kind!==`cloud`||d.orgId)return;let{backend:e}=d,t=p[e.id];if(!t||t.orgs.length===0)return;let n=m[e.id]?.userId??null,r=(n?t.orgs.find(e=>e.id===n):void 0)??t.orgs[0];r&&f(e.id,r.id)},[d,p,m,f,k]);let te=Y.useCallback(()=>{if(a){a(),i?.();return}w(!0)},[a,i]),L=Y.useCallback(()=>{if(o){o(),i?.();return}E(!0)},[o,i]),ne=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),re=(0,X.jsxs)(`div`,{className:G,children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`add-backend-menu-item`,onMouseDown:ne,onClick:te,className:R(Ve,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(ie,{width:16,height:16})}),l(b.BACKEND$ADD)]}),(0,X.jsxs)(`button`,{type:`button`,"data-testid":`manage-backends-menu-item`,onMouseDown:ne,onClick:L,className:R(Ve,`cursor-pointer rounded-md`),children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(ln,{width:16,height:16})}),l(b.BACKEND$MANAGE)]})]}),ae=Y.useCallback(async e=>{if(e===j)return;let{backendId:t,orgId:n}=Cn(e),r=u.find(e=>e.id===t);r&&(ut(O.find(t=>t.value===e)?.label??r.name),await new Promise(e=>{setTimeout(e,400)}),y?g(`/conversations`):x&&g(`/automations`),f(r.id,n),i?.())},[j,u,y,x,g,O,f,l,i]);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 w-full`,children:[(0,X.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,X.jsx)(bn,{testId:`backend-selector`,defaultValue:M??{value:j,label:k?A:d.backend.name,prefix:k?Tn():wn(h[d.backend.id])},footer:re,openUpward:e,hideTrigger:t,defaultOpen:n,openOnHover:!t,onChange:e=>{e&&ae(e.value)},placeholder:k?A:d.backend.name,loading:I,options:O,className:`h-10 px-2 py-0 bg-transparent border-transparent hover:bg-[var(--oh-surface-raised)] focus-within:bg-[var(--oh-surface-raised)] focus-within:border-transparent focus-within:ring-0`},`${j}-${M?.label??``}`)}),t?null:(0,X.jsx)(Ie,{content:P,placement:F,offset:10,children:(0,X.jsx)(Te,{to:`/settings`,"data-testid":`backend-selector-settings-link`,"data-active":N,"aria-label":P,className:R(N?`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md bg-tertiary text-white font-normal cursor-pointer`:`inline-flex items-center justify-center shrink-0 w-9 h-9 rounded-md text-[var(--oh-muted)] hover:text-white hover:bg-[var(--oh-surface-raised)] cursor-pointer`,ve),children:(0,X.jsx)(ln,{width:16,height:16})})})]}),C?(0,X.jsx)(ht,{onClose:()=>w(!1)}):null,T?(0,X.jsx)(gt,{onClose:()=>E(!1)}):null]})}var On=(e=20)=>{let{data:t}=bt(),n=de(),r=!ue(n.backend);return g({queryKey:[`user`,`conversations`,`paginated`,e,n.backend.id,n.orgId],queryFn:async({pageParam:t})=>await pe.searchConversations(e,t),enabled:!!t&&r,getNextPageParam:e=>e.next_page_id,initialPageParam:void 0,refetchInterval:1e4,meta:{backendId:n.backend.id}})},kn=(e=10)=>h({queryKey:[`start-tasks`,`search`,e],queryFn:()=>[],select:e=>e.filter(e=>e.status!==`READY`&&e.status!==`ERROR`)});function An({onConfirm:e,onClose:t,onCancel:n}){let{t:r}=S(`openhands`);return(0,X.jsx)(me,{onClose:n,children:(0,X.jsxs)(he,{testID:`confirm-new-conversation-modal`,children:[(0,X.jsx)(_e,{title:r(b.CONVERSATION$EXIT_WARNING)}),(0,X.jsxs)(`div`,{className:`flex w-full justify-end gap-2`,children:[(0,X.jsx)(ge,{text:r(b.BUTTON$CANCEL),onClick:t,className:`bg-tertiary`}),(0,X.jsx)(ge,{text:r(b.ACTION$CONFIRM),onClick:e,className:`bg-[#C63143]`})]})]})})}var jn=e=>e.includes(`Z`)||e.match(/[+-]\d{2}:\d{2}$/)!==null?new Date(e):new Date(`${e}Z`),Mn=e=>{let t=typeof e==`string`?jn(e):e,n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24),s=Math.floor(o/30),c=Math.floor(s/12);return r<60?`${r}s`:i<60?`${i}m`:a<24?`${a}h`:o<30?`${o}d`:s<12?`${s}mo`:`${c}y`};function Nn({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:R(`text-xs leading-6 font-semibold bg-transparent truncate overflow-hidden`,r&&`opacity-60`),title:t,children:t})}var Pn=e=>{switch(e){case z.FINISHED:return`check`;case z.RUNNING:return`working`;case z.IDLE:case z.WAITING_FOR_CONFIRMATION:return`active`;case z.PAUSED:return`paused`;case z.ERROR:case z.STUCK:return`error`;default:return`unknown`}},Fn=(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 In(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 Ln({executionStatus:e,sandboxStatus:t,showTooltip:n=!0}){let{t:r}=S(`openhands`),i=t===`MISSING`,a=t===`ERROR`?`error`:i?`paused`:Pn(e),o=r(Fn(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)(Ot,{"data-testid":`conversation-status-archived`,size:10,className:`shrink-0 text-[var(--oh-muted)] opacity-60`,"aria-hidden":!0}):In(a)});return n?(0,X.jsx)(Ie,{content:o,placement:`right`,showArrow:!0,tooltipClassName:`bg-base text-white text-xs shadow-lg`,children:s}):s}function Rn({title:e,titleMode:t,onTitleSave:n,executionStatus:r,sandboxStatus:i}){return(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[r!==void 0&&(0,X.jsx)(`div`,{className:`flex w-[18px] shrink-0 items-center justify-center`,children:(0,X.jsx)(Ln,{executionStatus:r,sandboxStatus:i})}),(0,X.jsx)(Nn,{title:e,titleMode:t,onSave:n,isConversationArchived:i===`MISSING`||i===`ERROR`})]})}var zn=e(m(),1);function Bn({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}=de(),m=xt(e,d),h=p.kind===`cloud`?b.COMMON$CLOSE_CONVERSATION_STOP_RUNTIME:b.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)(Ke,{inset:`menu`})]},t):null},[]),_=u!=null;return(0,X.jsxs)(kt,{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)(Mt,{width:16,height:16}),text:f(b.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)(tt,{width:16,height:16}),text:f(b.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)(Nt,{width:16,height:16,className:`stroke-[1.75]`,"aria-hidden":!0}),text:f(b.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)(rt,{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)(A,{width:16,height:16}),text:f(b.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)(A,{width:16,height:16}),text:f(b.BUTTON$EXPORT_CONVERSATION)})},`download-trajectory-button`)],`control-section`),g([i&&(0,X.jsx)(q,{testId:`display-cost-button`,onClick:i,children:(0,X.jsx)(J,{icon:(0,X.jsx)(I,{width:16,height:16}),text:f(b.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)(At,{width:16,height:16}),text:f(b.COMMON$DELETE_CONVERSATION)})},`delete-button`)],`info-section`,!0)]})}function Vn({contextMenuOpen:e,onContextMenuToggle:t,onDelete:n,onStop:r,onEdit:i,onDownloadViaVSCode:a,onDownloadConversation:o,executionStatus:s,conversationId:c,showOptions:l}){let u=ce(s),d=le(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)(jt,{ref:f,onClick:n=>{n.preventDefault(),n.stopPropagation(),t(!e)},className:R(u&&`opacity-60`)}),e&&m&&h?(0,zn.createPortal)((0,X.jsx)(Bn,{ignoreOutsideClickRef:f,floatingStyle:m,onClose:()=>t(!1),onDelete:n,onStop:d?r:void 0,onEdit:i,onDownloadViaVSCode:c&&l?a:void 0,onDownloadConversation:c?o:void 0,position:`bottom`}),h):null]})}var Hn={bitbucket:Kt,bitbucket_data_center:Kt,github:Wt,gitlab:Gt};function Un({selectedRepository:e}){let t=e.git_provider?Hn[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)(Xe,{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)(Dt,{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 Wn({workspaceWorkingDir:e}){let{t}=S(`openhands`),n=e?_(e).trim():``;return n?(0,X.jsx)(`span`,{className:`truncate min-w-0 text-xs text-[var(--oh-muted)] flex-1`,title:e??void 0,children:n}):(0,X.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[var(--oh-muted)] flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Ye,{width:14,height:14,className:`text-[var(--oh-muted)]`}),(0,X.jsx)(`span`,{className:`truncate min-w-0`,children:t(b.COMMON$NO_REPOSITORY)})]})}function Gn({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=ce(r),p=null;if(c)if(l===`acp`){let e=yt(u)??d(b.CONVERSATION$ACP_AGENT_GENERIC),t=_t(u,s),n=t??e;p={kind:vt(u),text:n,tooltip:t?`${e} · ${t}`:e}}else s&&(p={kind:`openhands`,text:s,tooltip:s});let m=r===void 0?void 0:`pl-[26px]`;return(0,X.jsxs)(`div`,{className:R(`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)(Ut,{kind:p.kind}),(0,X.jsx)(`span`,{className:`truncate`,children:p.text})]})}):null,(0,X.jsxs)(`div`,{className:R(`flex flex-row items-center gap-2 w-full min-w-0`,a&&m),children:[a&&(e?.selected_repository?(0,X.jsx)(Un,{selectedRepository:e}):(0,X.jsx)(Wn,{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:`${Mn(t??n)} ${d(b.CONVERSATION$AGO)}`})})})]})]})}function Kn(){let{t:e}=S(`openhands`);return(0,X.jsxs)(`span`,{"data-testid":`error-badge`,className:`flex items-center gap-1 px-1.5 py-0.5 bg-[var(--oh-status-error)] text-white text-xs font-medium rounded-full`,children:[(0,X.jsx)(st,{className:`text-white w-3 h-3`}),(0,X.jsx)(`span`,{children:e(b.COMMON$ERROR)})]})}function qn({onClick:e,onDelete:t,onStop:n,onChangeTitle:r,showOptions:i,title:a,selectedRepository:o,lastUpdatedAt:s,createdAt:c,conversationId:l,executionStatus:u,sandboxStatus:d,contextMenuOpen:f=!1,onContextMenuToggle:p,isActive:m=!1,workspaceWorkingDir:h,showRepositoryMetadata:g=!0,llmModel:_=null,showLlmProfiles:v=!1,agentKind:y=null,acpServer:b=null}){let x=fe(),[S,C]=Y.useState(`view`),{mutateAsync:w}=et(),T=e=>{e!==``&&e!==a&&r?.(e),C(`view`)},E=e=>{e.preventDefault(),e.stopPropagation(),t?.(),p?.(!1)},D=e=>{e.preventDefault(),e.stopPropagation(),n?.(),p?.(!1)},O=e=>{e.preventDefault(),e.stopPropagation(),C(`edit`),p?.(!1)},k=async e=>{if(e.preventDefault(),e.stopPropagation(),x.capture(`download_via_vscode_button_clicked`),l)try{let e=await Et.getVSCodeUrl(l);if(e.vscode_url){let t=Tt(e.vscode_url);t&&window.open(t,`_blank`)}}catch{}p?.(!1)},A=async e=>{e.preventDefault(),e.stopPropagation(),l&&await w(l),p?.(!1)},j=!!(t||r||i),M=g||v&&(y===`acp`||!!_);return(0,X.jsxs)(`div`,{"data-testid":`conversation-card`,"data-context-menu-open":f.toString(),"data-active":m?`true`:`false`,onClick:e,className:R(`group relative h-auto w-full cursor-pointer rounded-md py-1 pl-2 pr-1 transition-colors`,`data-[context-menu-open=false]:hover:bg-[var(--oh-surface)]`,`data-[active=true]:bg-[var(--oh-surface)]`),children:[(0,X.jsxs)(`div`,{className:`flex items-center w-full min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 flex-1 min-w-0 overflow-hidden`,children:[(0,X.jsx)(Rn,{title:a,titleMode:S,onTitleSave:T,executionStatus:u,sandboxStatus:d}),d===`ERROR`&&(0,X.jsx)(Kn,{})]}),(0,X.jsxs)(`div`,{className:`relative ml-auto pl-2 flex items-center justify-end shrink-0`,children:[(c??s)&&(0,X.jsx)(`p`,{className:R(`text-xs text-[var(--oh-muted)] text-right whitespace-nowrap transition-opacity -translate-x-1.5`,j&&`group-hover:opacity-0 group-focus-within:opacity-0`,f&&`opacity-0`),children:(0,X.jsx)(`time`,{children:Mn(s??c)})}),j&&(0,X.jsx)(`div`,{className:R(`absolute right-0 top-1/2 -translate-y-1/2 transition-opacity`,`opacity-0 invisible group-hover:opacity-100 group-hover:visible`,f&&`visible opacity-100`),children:(0,X.jsx)(Vn,{contextMenuOpen:f,onContextMenuToggle:p||(()=>{}),onDelete:t&&E,onStop:n&&D,onEdit:r&&O,onDownloadViaVSCode:k,onDownloadConversation:A,executionStatus:u,conversationId:l,showOptions:i})})]})]}),M&&(0,X.jsx)(Gn,{selectedRepository:o,lastUpdatedAt:s,createdAt:c,executionStatus:u,workspaceWorkingDir:h,showRepositoryMetadata:g,showTimestamp:!1,llmModel:_,showAgentChip:v,agentKind:y,acpServer:b})]})}function Jn({taskStatus:e}){return(0,X.jsx)(`div`,{className:R(`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 Yn({taskStatus:e}){let{t}=S(`openhands`);return e===`WORKING`?null:(0,X.jsx)(`span`,{className:R(`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(se(e))})}function Xn({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)(Jn,{taskStatus:t})}),(0,X.jsx)(`h3`,{className:`text-sm font-medium text-content-2 truncate flex-1`,children:e}),(0,X.jsx)(Yn,{taskStatus:t})]})}function Zn({selectedRepository:e,createdAt:t,detail:n}){let{t:r}=S(`openhands`);return(0,X.jsxs)(`div`,{className:R(`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)(Un,{selectedRepository:e}):(0,X.jsx)(Wn,{}),t&&(0,X.jsx)(`p`,{className:`text-xs text-[var(--oh-muted)] flex-1 text-right`,children:(0,X.jsx)(`time`,{children:`${Mn(t)} ${r(b.CONVERSATION$AGO)}`})})]}),n&&(0,X.jsx)(`div`,{className:`text-xs text-[var(--oh-text-subtle)] truncate`,children:n})]})}function Qn({task:e,onClick:t}){let{t:n}=S(`openhands`),r=e.request.title||e.detail||n(b.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:R(`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)(Xn,{title:r,taskStatus:e.status})}),(0,X.jsx)(Zn,{selectedRepository:i,createdAt:e.created_at,detail:e.detail})]})}function $n({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 er({conversationId:e,title:t,selectedRepository:n,executionStatus:r,sandboxStatus:i,lastUpdatedAt:a,createdAt:o,workspaceWorkingDir:s,isActive:c=!1,onClose:l,showRepositoryMetadata:u=!0,llmModel:d=null,showLlmProfiles:f=!1,agentKind:p=null,acpServer:m=null}){return(0,X.jsx)(Pe,{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)(Ln,{executionStatus:r,sandboxStatus:i,showTooltip:!1}),(0,X.jsx)(`span`,{className:`text-sm font-medium text-white truncate`,title:t,children:t||`(untitled)`})]}),(0,X.jsx)(Gn,{selectedRepository:n,lastUpdatedAt:a,createdAt:o,executionStatus:r,workspaceWorkingDir:s,showRepositoryMetadata:u,llmModel:d,showAgentChip:f,agentKind:p,acpServer:m})]}),placement:`right`,closeDelay:100,className:`bg-[var(--oh-surface)] text-white border border-[var(--oh-border-subtle)] shadow-xl p-0`,disableAnimation:!1,children:(0,X.jsx)(Te,{to:`/conversations/${e}`,onClick:l,"data-testid":`compact-conversation-row`,"data-conversation-id":e,"aria-label":t||e,className:({isActive:e})=>R(`flex items-center justify-center w-10 h-9 mx-auto rounded-md`,`transition-colors cursor-pointer`,e||c?`bg-tertiary`:`hover:bg-[var(--oh-surface-raised)]`),children:(0,X.jsx)(Ln,{executionStatus:r,sandboxStatus:i,showTooltip:!1})})})}var tr={showOlderConversations:!0,showRepoBranchMetadata:!1,showLlmProfiles:!1,organizeMode:`chronological`,conversationSort:`updated`,threadScope:`all`},Z=dt()(ft(e=>({...tr,setShowOlderConversations:t=>e(()=>({showOlderConversations:t})),toggleShowOlderConversations:()=>e(e=>({showOlderConversations:!e.showOlderConversations})),setShowRepoBranchMetadata:t=>e(()=>({showRepoBranchMetadata:t})),toggleShowRepoBranchMetadata:()=>e(e=>({showRepoBranchMetadata:!e.showRepoBranchMetadata})),setShowLlmProfiles:t=>e(()=>({showLlmProfiles:t})),toggleShowLlmProfiles:()=>e(e=>({showLlmProfiles:!e.showLlmProfiles})),setOrganizeMode:t=>e(()=>({organizeMode:t})),setConversationSort:t=>e(()=>({conversationSort:t})),setThreadScope:t=>e(()=>({threadScope:t}))}),{name:`conversation-panel-preferences`,storage:pt(()=>localStorage),partialize:e=>({showOlderConversations:e.showOlderConversations,showRepoBranchMetadata:e.showRepoBranchMetadata,showLlmProfiles:e.showLlmProfiles,organizeMode:e.organizeMode,conversationSort:e.conversationSort,threadScope:e.threadScope})})),nr=e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1):e,rr=`px-2 pb-1 pt-1`,ir=`text-[11px] font-semibold uppercase tracking-wide text-[var(--oh-muted)]`;function ar({children:e,suffix:t}){return t==null?(0,X.jsx)(`div`,{role:`presentation`,className:R(rr,ir),children:e}):(0,X.jsxs)(`div`,{role:`presentation`,className:R(`flex items-baseline justify-between gap-2`,rr),children:[(0,X.jsx)(`span`,{className:R(`min-w-0 truncate text-left`,ir),children:e}),t]})}function or(){return(0,X.jsx)(Ke,{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:R(`group`,He,`text-[var(--oh-foreground)] disabled:opacity-50`),children:[(0,X.jsx)(e,{className:R(`h-3.5 w-3.5`,Be),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t}),n?(0,X.jsx)(O,{className:`ml-auto h-3.5 w-3.5 shrink-0 text-white`,"aria-hidden":!0}):null]})}function sr({filterMenuOpen:e,setFilterMenuOpen:t,menuRef:n,backendKind:r,organizeMode:i,setOrganizeMode:a,conversationSort:o,setConversationSort:s,threadScope:c,setThreadScope:l,showOlderConversations:u,toggleShowOlderConversations:d,showRepoBranchMetadata:f,toggleShowRepoBranchMetadata:p,showLlmProfiles:m,toggleShowLlmProfiles:h,totalConversationsCount:g,onRequestDeleteAll:_}){let{t:v}=S(`openhands`),y=v(r===`local`?b.CONVERSATION_PANEL$BY_WORKSPACE:b.CONVERSATION_PANEL$BY_REPOSITORY),x=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(e);return Y.useEffect(()=>{e?(C.current?.querySelector(`[role="menuitem"], [role="menuitemradio"]`))?.focus():w.current&&x.current?.focus(),w.current=e},[e]),(0,X.jsxs)(`div`,{ref:n,className:`relative shrink-0 pr-0.5`,children:[(0,X.jsx)(`button`,{ref:x,type:`button`,"data-testid":`older-conversations-filter-toggle`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),"aria-haspopup":`menu`,"aria-expanded":e,onClick:()=>t(!e),className:R(`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)]`,Ue),children:(0,X.jsx)(on,{className:`lucide lucide-list-filter shrink-0`,width:14,height:14,strokeWidth:2,"aria-hidden":!0})}),e?(0,X.jsxs)(`div`,{ref:C,role:`menu`,"aria-orientation":`vertical`,"aria-label":v(b.CONVERSATION_PANEL$FILTER_LABEL),tabIndex:-1,"data-testid":`older-conversations-filter-menu`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),t(!1);return}if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let n=C.current;if(!n)return;let r=Array.from(n.querySelectorAll(`[role="menuitem"], [role="menuitemradio"]`)).filter(e=>!e.disabled);if(r.length===0)return;let i=r.indexOf(document.activeElement),a=e.key===`ArrowDown`?1:-1,o=((i===-1?0:i)+a+r.length)%r.length;e.preventDefault(),r[o]?.focus()},className:R(`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`,G,Re),children:[(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$ORGANIZE)}),(0,X.jsx)(Q,{icon:T,label:y,selected:i===`grouped`,onClick:()=>{a(`grouped`),t(!1)}}),(0,X.jsx)(Q,{icon:en,label:v(b.CONVERSATION_PANEL$CHRONOLOGICAL),selected:i===`chronological`,onClick:()=>{a(`chronological`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$SORT_BY)}),(0,X.jsx)(Q,{icon:$t,label:v(b.CONVERSATION_PANEL$SORT_CREATED),selected:o===`created`,onClick:()=>{s(`created`),t(!1)}}),(0,X.jsx)(Q,{icon:tn,label:v(b.CONVERSATION_PANEL$SORT_UPDATED),selected:o===`updated`,onClick:()=>{s(`updated`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$SHOW)}),(0,X.jsx)(Q,{icon:sn,label:v(b.CONVERSATION_PANEL$ALL_THREADS),selected:c===`all`,onClick:()=>{l(`all`),t(!1)}}),(0,X.jsx)(Q,{icon:un,label:v(b.CONVERSATION_PANEL$RELEVANT_THREADS),selected:c===`relevant`,onClick:()=>{l(`relevant`),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{children:v(b.CONVERSATION_PANEL$METADATA)}),(0,X.jsx)(Q,{icon:E,label:v(b.CONVERSATION_PANEL$LLM_MODEL),selected:m,testId:`toggle-llm-profiles`,onClick:()=>{h(),t(!1)}}),(0,X.jsx)(Q,{icon:D,label:v(b.CONVERSATION_PANEL$REPO_BRANCH),selected:f,testId:`toggle-repo-branch-metadata`,onClick:()=>{p(),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(ar,{suffix:(0,X.jsx)(`span`,{className:`shrink-0 text-right text-[10px] font-medium normal-case tracking-normal text-[var(--oh-muted)]/70`,children:v(b.CONVERSATION_PANEL$OLDER_OVER_ONE_HOUR)}),children:v(b.CONVERSATION_PANEL$OLDER_SECTION)}),(0,X.jsx)(Q,{testId:`toggle-older-conversations`,icon:u?nn:rn,label:nr(v(u?b.CONVERSATION$HIDE:b.CONVERSATION$SHOW_ALL)),onClick:()=>{d(),t(!1)}}),(0,X.jsx)(or,{}),(0,X.jsx)(Q,{testId:`delete-all-conversations`,icon:ae,label:nr(v(b.CONVERSATION$DELETE_ALL)),disabled:g===0,onClick:()=>{g!==0&&(_(),t(!1))}})]}):null]})}var cr=R(`z-50 flex flex-col rounded-md border border-[var(--oh-border-subtle)] bg-tertiary px-1 py-1 text-white shadow-lg`,Le);function lr(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 ur({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ce(),[s,c]=Y.useState(!1),l=Y.useRef(null),u=Y.useRef(null),d=lr(u,{open:s,enabled:i}),{data:f,error:p}=Pt(),m=f?.workspaceParents??[],{mutate:h}=Vt(),{mutate:g}=Ft(),{mutate:_}=zt(),{mutate:v}=Lt(),{workspaces:y}=It(),C=Bt(p,a),[w,T]=Y.useState(!1),[E,D]=Y.useState(!1),{mutate:O,isPending:k}=wt(),A=x(),j=k||A;Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{l.current&&!l.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s,w,E]),Y.useEffect(()=>{if(!s||w||E)return;let e=e=>{e.key===`Escape`&&c(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s,w,E]);let M=e=>{j||O({workingDir:e},{onSuccess:e=>{c(!1),o(`/conversations/${e.conversation_id}`)}})},N=He,P=Y.useCallback(e=>{e.preventDefault(),e.stopPropagation()},[]),ee=Y.useCallback(()=>{c(e=>!e)},[]),F=s&&(!i||d!==null),I=!!C,te=i&&d?{position:`fixed`,top:d.top,left:d.left,width:d.width}:void 0,L=(0,X.jsx)(`button`,{type:`button`,"data-testid":`add-workspaces-button`,disabled:I,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),!I&&T(!0)},className:N,children:a(b.HOME$ADD_WORKSPACES)}),ne=C?(0,X.jsx)(Ie,{content:C,placement:`top`,children:(0,X.jsx)(`span`,{className:`block`,children:L})}):L;return(0,X.jsxs)(`div`,{className:R(!i&&`relative`,t),ref:l,children:[(0,X.jsx)(`span`,{ref:u,className:`inline-flex`,children:e({onClick:ee,"aria-expanded":s,"aria-haspopup":`menu`,disabled:j})}),F&&(0,X.jsxs)(`div`,{"data-testid":r,className:R(cr,!i&&R(`absolute top-full mt-0`,n)),style:te,children:[(0,X.jsxs)(`ul`,{className:R(`max-h-[40vh] overflow-y-auto sm:max-h-[280px]`,G),children:[(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,disabled:j,"data-testid":`launch-no-workspace`,onClick:()=>M(),className:N,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-muted)]`,children:a(b.HOME$NO_WORKSPACE_OPTION)})})}),y.map(e=>(0,X.jsx)(`li`,{children:(0,X.jsxs)(`button`,{type:`button`,disabled:j,"data-testid":`launch-workspace`,"data-workspace-path":e.path,onClick:()=>M(e.path),className:N,children:[(0,X.jsx)(`span`,{className:K,"aria-hidden":!0,children:(0,X.jsx)(Je,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))]}),(0,X.jsxs)(`div`,{className:R(`flex flex-col`,G),"data-testid":`new-conversation-menu-footer`,children:[(0,X.jsx)(Ke,{inset:`menu`,testId:`new-conversation-menu-footer-divider`}),ne,(y.length>0||m.length>0)&&(0,X.jsx)(`button`,{type:`button`,"data-testid":`manage-workspaces-button`,onMouseDown:P,onClick:e=>{e.preventDefault(),e.stopPropagation(),D(!0)},className:N,children:a(b.HOME$MANAGE_WORKSPACES)})]})]}),(0,X.jsx)(Rt,{isOpen:w,onClose:()=>T(!1),onAdd:e=>h(e),onAddParent:e=>_(e)}),(0,X.jsx)(Ht,{isOpen:E,workspaces:y,workspaceParents:m,onClose:()=>D(!1),onRemove:e=>g(e),onRemoveParent:e=>v(e)})]})}function dr({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:K,"aria-hidden":!0,children:(0,X.jsx)(Je,{width:14,height:14})}),(0,X.jsx)(`span`,{className:`truncate`,children:e.full_name})]})})}function fr({trigger:e,className:t,popoverClassName:n,popoverTestId:r=`new-conversation-popover`,useFixedPlacement:i=!1}){let{t:a}=S(`openhands`),{navigate:o}=Ce(),{providers:s}=at(),{lastSelectedProvider:c,setLastSelectedProvider:l}=nt(),[u,d]=Y.useState(!1),f=Y.useRef(null),p=Y.useRef(null),m=lr(p,{open:u,enabled:i}),[h,g]=Y.useState(c??null),[_,v]=Y.useState(``),y=it(_,300);Y.useEffect(()=>{if(s.length===0){h!==null&&g(null);return}h&&s.includes(h)||g(c&&s.includes(c)?c:s[0])},[s,h,c]);let{data:C,isLoading:w,isError:T,hasNextPage:E,isFetchingNextPage:D,fetchNextPage:O}=qe({provider:h}),{data:k,isLoading:A}=$e(y,h),j=Y.useMemo(()=>C?.pages.flatMap(e=>e.items)??[],[C]),M=y?k??[]:j,{mutate:N,isPending:P}=wt(),ee=x(),F=P||ee;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||N({repository:{name:e.full_name,gitProvider:e.git_provider,branch:e.main_branch??`main`}},{onSuccess:e=>{d(!1),o(`/conversations/${e.conversation_id}`)}})},te=e=>{g(e),l(e),v(``)},L=He;Y.useEffect(()=>{u&&(y||!E||D||w||M.length===0||M.length>=10||O())},[u,y,E,D,w,M.length,O]);let ne=y?A:w,re=!y&&E&&M.length>0,ie=Y.useCallback(()=>{d(e=>!e)},[]),ae=u&&(!i||m!==null),oe=i&&m?{position:`fixed`,top:m.top,left:m.left,width:m.width}:void 0;return(0,X.jsxs)(`div`,{className:R(!i&&`relative`,t),ref:f,children:[(0,X.jsx)(`span`,{ref:p,className:`inline-flex`,children:e({onClick:ie,"aria-expanded":u,"aria-haspopup":`menu`,disabled:F})}),ae&&(0,X.jsxs)(`div`,{"data-testid":r,className:R(cr,!i&&R(`absolute top-full mt-0`,n)),style:oe,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:()=>te(e),className:R(`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)(ot,{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)(qt,{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(b.COMMON$SEARCH_REPOSITORIES),disabled:!h,className:R(`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)(Ke,{inset:`menu`}),(0,X.jsxs)(`ul`,{className:R(`max-h-[40vh] overflow-y-auto custom-scrollbar-always sm:max-h-[280px]`,G),children:[ne&&M.length===0&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-loading`,children:a(b.HOME$LOADING_REPOSITORIES)}),T&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[#F87171]`,"data-testid":`cloud-repo-error`,children:a(b.HOME$FAILED_TO_LOAD_REPOSITORIES)}),!ne&&!T&&M.length===0&&!!h&&(0,X.jsx)(`li`,{className:`px-2 py-2 text-sm text-[var(--oh-muted)] italic`,"data-testid":`cloud-repo-empty`,children:a(b.GITHUB$NO_RESULTS)}),M.map(e=>(0,X.jsx)(dr,{repo:e,disabled:F,onSelect:I,itemClass:L},`${e.git_provider}:${e.id}`)),re&&(0,X.jsx)(`li`,{children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`cloud-repo-load-more`,disabled:D,onClick:()=>O(),className:L,children:(0,X.jsx)(`span`,{className:`text-[var(--oh-text-secondary)]`,children:a(D?b.HOME$LOADING_MORE_REPOSITORIES:b.CONVERSATION$LOAD_MORE)})})})]})]})]})}var pr=R(`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 mr({backendKind:e}){let{t}=S(`openhands`),n=t(b.CONVERSATION_PANEL$NEW_THREAD_FOLDER_ARIA),r=(0,X.jsx)(an,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0,strokeWidth:2});return e===`local`?(0,X.jsx)(ur,{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)(fr,{useFixedPlacement:!0,popoverTestId:`conversation-panel-new-thread-popover`,popoverClassName:``,trigger:({onClick:e,"aria-expanded":t,disabled:i,"aria-haspopup":a})=>(0,X.jsx)(`button`,{type:`button`,className:pr,"aria-label":n,"aria-expanded":t,"aria-haspopup":a,disabled:i,"data-testid":`conversation-panel-new-thread-picker`,onClick:e,children:r})})}function hr(e,t){let n=t.limit??5;if(t.expanded||e.length<=n)return{visibleConversations:[...e],isPreviewTruncated:e.length>n,isShowingAll:!0};let r=t.activeConversationId==null?-1:e.findIndex(e=>e.id===t.activeConversationId);if(r>=n){let t=e[r];return{visibleConversations:[...e.slice(0,n-1),t],isPreviewTruncated:!0,isShowingAll:!1}}return{visibleConversations:e.slice(0,n),isPreviewTruncated:e.length>n,isShowingAll:!1}}function gr(e,t,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 _r(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)=>_r(t[n])-_r(e[n]))}function yr(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 br(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 xr(e,t,n,r){let i=new Map;for(let n of e){let{id:e,label:a}=t===`local`?yr(n):br(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:gr(e,t,i)}}),o=e=>e.conversations.reduce((e,t)=>Math.max(e,_r(n===`created`?t.created_at:t.updated_at)),0);return a.sort((e,t)=>o(t)-o(e)),a}var Sr=()=>{},Cr=3600*1e3,wr=e=>{let t=Date.now()-Cr,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 Tr({onClose:e,compact:t=!1}){let{t:n}=S(`openhands`),{conversationId:r,navigate:i}=Ce(),{backend:a}=de(),o=xt(e??Sr),[s,c]=Y.useState(!1),[l,u]=Y.useState(!1),[d,f]=Y.useState(!1),[p,m]=Y.useState(!1),h=Z(e=>e.showOlderConversations),g=Z(e=>e.toggleShowOlderConversations),_=Z(e=>e.showRepoBranchMetadata),v=Z(e=>e.toggleShowRepoBranchMetadata),y=Z(e=>e.showLlmProfiles),C=Z(e=>e.toggleShowLlmProfiles),w=Z(e=>e.organizeMode),E=Z(e=>e.setOrganizeMode),D=Z(e=>e.conversationSort),O=Z(e=>e.setConversationSort),k=Z(e=>e.threadScope),A=Z(e=>e.setThreadScope),[M,N]=Y.useState(!1),[ee,F]=Y.useState(!1),I=xt(()=>{N(!1)}),[te,ae]=Y.useState(()=>new Set),[oe,se]=Y.useState(()=>new Set),ce=Y.useCallback(e=>{ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),z=Y.useCallback(e=>{se(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);Y.useEffect(()=>{w!==`grouped`&&(ae(new Set),se(new Set))},[w]);let ue=Y.useRef(null),[B,fe]=Y.useState(null),[pe,me]=Y.useState(null),[he,ge]=Y.useState(null),{data:_e,isLoading:ve,isFetched:ye,hasNextPage:xe,isFetchingNextPage:Se,fetchNextPage:we}=On(),{data:Ee}=kn(),V=Y.useMemo(()=>_e?.pages.flatMap(e=>e.items)??[],[_e]),De=Y.useMemo(()=>k===`relevant`?V.filter(e=>le(e.execution_status)):V,[V,k]),{recent:H,older:U}=Y.useMemo(()=>wr(De),[De]),Oe=Y.useMemo(()=>vr(h?[...H,...U]:H,D),[H,U,h,D]),ke=Y.useMemo(()=>({emptyWorkspace:n(b.CONVERSATION_PANEL$NO_WORKSPACE),emptyRepository:n(b.CONVERSATION_PANEL$NO_REPOSITORY)}),[n]),W=Y.useMemo(()=>t||w!==`grouped`?null:xr([...H,...h?U:[]],a.kind,D,ke),[a.kind,t,D,ke,U,w,H,h]),Ae=Y.useMemo(()=>vr(H.filter(e=>le(e.execution_status)),D),[D,H]),je=Oe.length,Me=Y.useMemo(()=>W?W.reduce((e,t)=>e+t.conversations.length,0):0,[W]),Ne=w===`grouped`&&!t?Me===0:je===0,{mutate:Pe,mutateAsync:Fe}=Ze(),{mutate:Ie}=Qe(),{mutate:Le}=P(),Re=U.length>0&&!h,ze=!!xe&&!Re&&!t&&!Ne,{mutate:G}=wt(),Be=x(),Ve=Y.useCallback(e=>{Be||G({workingDir:e.workingDir,repository:e.repository},{onSuccess:e=>{i(`/conversations/${e.conversation_id}`)}})},[G,Be,i]),He=Y.useCallback((e,t)=>{c(!0),fe(e),me(t)},[]),Ue=Y.useCallback(e=>{u(!0),fe(e)},[]),K=Y.useCallback((e,t)=>{Le({conversationId:e,newTitle:t},{onSuccess:()=>{re(n(b.CONVERSATION$TITLE_UPDATED))}})},[n,Le]),We=()=>{B&&Pe({conversationId:B},{onSuccess:()=>{B===r&&i(`/conversations`)}})},Ge=()=>{B&&Ie({conversationId:B})},Ke=async()=>{let e=V.map(e=>e.id),t=await Promise.allSettled(e.map(e=>Fe({conversationId:e}))),n=t.flatMap((t,n)=>t.status===`fulfilled`?[e[n]]:[]),a=t.length-n.length;r!==null&&n.includes(r)&&i(`/conversations`),a>0&&ne(`${a} conversation${a===1?``:`s`} could not be deleted.`)},qe=Y.useCallback(n=>t?(0,X.jsx)(er,{conversationId:n.id,title:n.title??``,selectedRepository:{selected_repository:n.selected_repository,selected_branch:n.selected_branch,git_provider:n.git_provider},executionStatus:n.execution_status,sandboxStatus:n.sandbox_status,lastUpdatedAt:n.updated_at,createdAt:n.created_at,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,isActive:n.id===r,onClose:e,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server},n.id):(0,X.jsx)(Te,{to:`/conversations/${n.id}`,onClick:e,className:`block`,children:(0,X.jsx)(qn,{onDelete:()=>He(n.id,n.title??``),onStop:()=>Ue(n.id),onChangeTitle:e=>K(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:he===n.id,onContextMenuToggle:e=>ge(e?n.id:null),isActive:n.id===r,workspaceWorkingDir:n.selected_workspace??n.workspace?.working_dir,showRepositoryMetadata:_,llmModel:n.llm_model,showLlmProfiles:y,agentKind:n.agent_kind,acpServer:n.acp_server})},n.id),[t,r,K,He,Ue,e,he,_,y]),Je=ve||!ye,Ye=ye&&!ve&&!t&&Ne&&!Ee?.length;return(0,X.jsxs)(`div`,{ref:o,"data-testid":`conversation-panel`,className:`flex h-full min-h-0 w-full flex-col`,children:[!t&&(0,X.jsx)(`div`,{className:R(`-ml-2.5 w-[calc(100%+0.625rem)] max-w-none box-border border-b`,ee?`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(b.SIDEBAR$CONVERSATIONS)}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-0.5`,children:[(0,X.jsx)(mr,{backendKind:a.kind}),(0,X.jsx)(sr,{filterMenuOpen:M,setFilterMenuOpen:N,menuRef:I,backendKind:a.kind,organizeMode:w,setOrganizeMode:E,conversationSort:D,setConversationSort:O,threadScope:k,setThreadScope:A,showOlderConversations:h,toggleShowOlderConversations:g,showRepoBranchMetadata:_,toggleShowRepoBranchMetadata:v,showLlmProfiles:y,toggleShowLlmProfiles:C,totalConversationsCount:V.length,onRequestDeleteAll:()=>m(!0)})]})]})}),(0,X.jsxs)(`div`,{ref:ue,"data-testid":`conversation-panel-list-scroll`,onScroll:e=>{F(e.currentTarget.scrollTop>0)},className:R(`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:[Je&&(0,X.jsx)($n,{compact:t}),!t&&Ye&&(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(b.CONVERSATION$NO_CONVERSATIONS)})}),!t&&Ee?.map(t=>(0,X.jsx)(Te,{to:`/conversations/task-${t.id}`,onClick:e,className:`block`,children:(0,X.jsx)(Qn,{task:t})},t.id)),!Je&&t?Ae.map(qe):null,!Je&&!t&&w===`grouped`&&W&&W.length>0?(0,X.jsx)(`nav`,{"aria-label":n(b.SIDEBAR$CONVERSATIONS),className:`space-y-1 md:space-y-0.5 pb-1`,children:W.map(e=>{let t=`thread-folder-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,i=e.id.replace(/[^a-zA-Z0-9_-]/g,`-`),a=!te.has(e.id),o=oe.has(e.id),{visibleConversations:s,isPreviewTruncated:c,isShowingAll:l}=hr(e.conversations,{expanded:o,activeConversationId:r});return(0,X.jsxs)(`section`,{"aria-labelledby":t,children:[(0,X.jsxs)(`div`,{className:R(`flex h-8 w-full min-w-0 items-center gap-0.5 rounded-md pl-2 pr-1 text-sm font-normal`,`text-[var(--oh-muted)] transition-colors`,`hover:bg-[var(--oh-surface-raised)] hover:text-white`),children:[(0,X.jsxs)(`button`,{type:`button`,id:t,"aria-expanded":a,onClick:()=>ce(e.id),className:`flex min-h-8 min-w-0 flex-1 items-center gap-2 rounded-md py-1 text-left text-inherit outline-none transition-colors focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,children:[(0,X.jsx)(T,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,X.jsx)(`button`,{type:`button`,className:R(`inline-flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-inherit transition-colors`,`hover:bg-white/10 hover:text-white`,`focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--oh-border)]`,`disabled:cursor-not-allowed disabled:opacity-50`),disabled:Be,"aria-label":n(b.CONVERSATION_PANEL$ADD_CONVERSATION_TO_GROUP,{label:e.label}),"data-testid":`add-conversation-to-group-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),Ve(e.launch)},children:(0,X.jsx)(ie,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":!0,strokeWidth:2})})]}),a?(0,X.jsxs)(`div`,{className:`mt-0.5 space-y-0.5`,children:[s.map(qe),c?(0,X.jsx)(`div`,{className:`pl-2`,children:(0,X.jsx)(`button`,{type:`button`,"data-testid":`thread-folder-view-more-${i}`,onClick:()=>z(e.id),className:`ml-[26px] cursor-pointer text-xs text-[var(--oh-text-dim)] hover:text-white`,children:n(l?b.CONVERSATION_PANEL$LESS:b.CONVERSATION_PANEL$MORE)})}):null]}):null]},e.id)})}):null,!Je&&!t&&w===`chronological`?(0,X.jsx)(`div`,{className:`space-y-0.5`,children:Oe.map(qe)}):null,ze&&(0,X.jsx)(`div`,{className:`flex justify-center py-4`,children:Se?(0,X.jsx)(be,{size:`small`}):(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(b.CONVERSATION$LOAD_MORE)})})]}),s&&(0,X.jsx)(j,{onConfirm:()=>{We(),c(!1),me(null)},onCancel:()=>{c(!1),me(null)},conversationTitle:pe??void 0}),p&&(0,X.jsx)(j,{title:n(b.CONVERSATION$CONFIRM_DELETE_ALL_TITLE),description:n(b.CONVERSATION$CONFIRM_DELETE_ALL_DESC,{count:V.length}),onConfirm:async()=>{await Ke(),m(!1)},onCancel:()=>m(!1)}),l&&(0,X.jsx)(L,{onConfirm:()=>{Ge(),u(!1)},onCancel:()=>u(!1)}),d&&(0,X.jsx)(An,{onConfirm:()=>{e?.()},onClose:()=>f(!1),onCancel:()=>f(!1)})]})}function Er({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)(Tr,{})})})}var Dr=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,Or=34,kr=Math.round(Or*30/46);function Ar({collapsed:e,showCollapseToggle:t,showMobileCloseButton:n=!1,onCloseMobile:r,linkDisabled:i,collapseToggleLabel:a,onCollapse:o,onExpand:s,showCollapsedExpandButton:c,isExtensionsActive:l,currentPath:u,activeBackendHealth:d,collapsedBackendPopoverOpen:f,setCollapsedBackendPopoverOpen:p,collapsedBackendPopoverRef:m,collapsedBackendCloseTimer:h,onOpenAddBackend:g,onOpenManageBackends:_}){let{t:y}=S(`openhands`),x=h;return(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{className:V(e),children:[(0,X.jsxs)(`div`,{className:R(e&&t?H:`flex min-w-0 shrink-0 items-center`),children:[(0,X.jsx)(`div`,{className:R(e&&t&&`flex h-full w-full items-center justify-start pl-2.5 transition-opacity duration-150`,e&&c&&`opacity-0`),children:(0,X.jsx)(pn,{logoWidth:Or,logoHeight:kr,logoClassName:`max-w-none`,className:R(Ae,`overflow-visible`)})}),e&&t?(0,X.jsx)(`button`,{type:`button`,"data-testid":`sidebar-collapse-toggle`,"aria-pressed":e,"aria-label":a,onClick:s,className:R(Ee,c?`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":a,onClick:o,className:R(`hidden md:inline-flex ml-auto`,ke,`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":y(b.SIDEBAR$CLOSE_MENU),className:R(`inline-flex ml-auto`,ke,`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:W(e),children:[(0,X.jsx)(Ne,{to:`/conversations`,end:!0,label:`New Chat`,testId:`sidebar-conversations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(ie,{width:$,height:$})}),(0,X.jsx)(Ne,{to:`/customize`,label:`Customize`,testId:`sidebar-skills-link`,disabled:i,collapsed:e,forceActive:l,icon:(0,X.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:$,height:$,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}),(0,X.jsx)(`path`,{d:`m7 16.5-4.74-2.85`}),(0,X.jsx)(`path`,{d:`m7 16.5 5-3`}),(0,X.jsx)(`path`,{d:`M7 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}),(0,X.jsx)(`path`,{d:`m17 16.5-5-3`}),(0,X.jsx)(`path`,{d:`m17 16.5 4.74-2.85`}),(0,X.jsx)(`path`,{d:`m17 16.5v5.17`}),(0,X.jsx)(`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}),(0,X.jsx)(`path`,{d:`M12 8 7.26 5.15`}),(0,X.jsx)(`path`,{d:`m12 8 4.74-2.85`}),(0,X.jsx)(`path`,{d:`M12 13.5V8`})]})}),(0,X.jsx)(Ne,{to:`/automations`,label:y(b.SIDEBAR$AUTOMATIONS),testId:`sidebar-automations-link`,disabled:i,collapsed:e,icon:(0,X.jsx)(Dr,{width:$,height:$})})]}),(0,X.jsx)(Er,{collapsed:e}),e&&t?(0,X.jsxs)(`nav`,{className:R(W(e),`mt-auto pb-2 cursor-pointer`),children:[(0,X.jsx)(Ie,{content:y(b.SIDEBAR$SETTINGS),placement:`right`,children:(0,X.jsxs)(Te,{to:`/settings`,"data-testid":`collapsed-settings-link`,"aria-label":y(b.SIDEBAR$SETTINGS),className:U({collapsed:!0}),children:[(0,X.jsx)(Me,{active:u.startsWith(`/settings`),children:(0,X.jsx)(ln,{width:$,height:$})}),(0,X.jsx)(`span`,{className:De(!0),children:y(b.SIDEBAR$SETTINGS)})]})}),(0,X.jsxs)(`div`,{className:`relative`,ref:m,onMouseEnter:()=>{x.current&&=(clearTimeout(x.current),null),p(!0)},onMouseLeave:()=>{x.current=setTimeout(()=>p(!1),150)},children:[(0,X.jsxs)(`button`,{type:`button`,"data-testid":`collapsed-backend-selector-link`,"aria-label":y(b.BACKEND$MANAGE),"aria-expanded":f,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onMouseUp:e=>e.stopPropagation(),className:R(U({collapsed:!0}),`relative`),children:[(0,X.jsx)(Me,{active:f,children:(0,X.jsxs)(`span`,{className:`relative inline-flex size-[18px] shrink-0 items-center justify-center`,children:[(0,X.jsx)(lt,{isConnected:d?.isConnected??null,className:`absolute -left-0.5 -top-0.5 z-[1] pointer-events-none`}),(0,X.jsx)(cn,{width:$,height:$})]})}),(0,X.jsx)(`span`,{className:De(!0),children:y(b.BACKEND$MANAGE)})]}),f?(0,X.jsx)(`div`,{className:`absolute bottom-[-4px] left-full pl-2.5 z-40 w-[272px]`,onClick:e=>e.stopPropagation(),children:(0,X.jsx)(Dn,{sidebarCollapsed:e,hideTrigger:!0,defaultOpen:!0,openUpward:!0,onSelectOption:()=>p(!1),onOpenAddBackend:g,onOpenManageBackends:_})}):null]})]}):null,e?null:(0,X.jsx)(`div`,{className:R(`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)(Dn,{sidebarCollapsed:e,openUpward:!0})})]})}var jr=Y.lazy(()=>n(()=>import(`./settings-modal-T_Yk1Zfo.js`).then(e=>({default:e.SettingsModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47]))),Mr=Y.lazy(()=>n(()=>import(`./add-backend-modal-mXKmfMI2.js`).then(e=>e.n).then(e=>({default:e.AddBackendModal})),__vite__mapDeps([48,1,9,49,13,50,51,16,15,17,10,41,40,18,19,52,46,20,21,7,22,30,34,12,32,53,35,45,33]))),Nr=Y.lazy(()=>n(()=>import(`./manage-backends-modal-CRMwyU0t.js`).then(e=>e.n).then(e=>({default:e.ManageBackendsModal})),__vite__mapDeps([54,1,13,50,15,16,17,9,10,55,56,57,58,18,19,49,51,41,40,52,46,20,21,7,22,30,34,12,32,53,35,45,33,59]))),Pr=250;function Fr(){let{t:e}=S(`openhands`),{currentPath:t}=Ce(),{data:n}=xe(),{data:r,error:i,isError:a,isFetching:o}=St(),{backends:s,active:c}=B(),l=ct(s)[c.backend.id],u=Jt(e=>e.collapsed),d=Jt(e=>e.setCollapsed),[f,p]=Y.useState(!1),[m,h]=Y.useState(!1),g=Y.useRef(null),[_,v]=Y.useState(!1),[y,x]=Y.useState(!1),[C,w]=Y.useState(!1),T=Y.useRef(!1),[,E]=Y.useReducer(e=>e+1,0),{isOpen:D,close:O}=ee(),[k,A]=Y.useState(!1),[j,M]=Y.useState(!1),N=xt(()=>h(!1)),P=Ct(i);Y.useEffect(()=>{O()},[t,O]),Y.useEffect(()=>{if(D){A(!0);let e=requestAnimationFrame(()=>{M(!0)});return()=>cancelAnimationFrame(e)}M(!1);let e=window.setTimeout(()=>{A(!1)},Pr);return()=>window.clearTimeout(e)},[D]),Y.useEffect(()=>{if(!D)return;let e=e=>{e.key===`Escape`&&O()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[D,O]),Y.useEffect(()=>{t===`/settings`?p(!1):!o&&a&&P!==404?ne(`Something went wrong while fetching settings. Please reload the page.`):P===404&&!n?.feature_flags?.hide_llm_settings&&p(!0)},[t,o,a,P,n?.feature_flags?.hide_llm_settings]);let F=r?.email_verified===!1,I=e(u?b.SIDEBAR$EXPAND:b.SIDEBAR$COLLAPSE),te=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]),L={linkDisabled:F,collapseToggleLabel:I,onCollapse:Y.useCallback(()=>{w(!1),T.current=!0,E(),d(!0),window.setTimeout(()=>{T.current=!1,E()},250)},[d]),onExpand:()=>d(!1),showCollapsedExpandButton:u&&C&&!T.current,isExtensionsActive:t===`/customize`||t.startsWith(`/skills`)||t===`/plugins`||t===`/mcp`,currentPath:t,activeBackendHealth:l,collapsedBackendPopoverOpen:m,setCollapsedBackendPopoverOpen:h,collapsedBackendPopoverRef:N,collapsedBackendCloseTimer:g,onOpenAddBackend:()=>v(!0),onOpenManageBackends:()=>x(!0)};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-collapsed":u?`true`:`false`,onClick:te,onMouseEnter:()=>{u&&w(!0)},onMouseLeave:()=>{w(!1)},className:R(`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)(Ar,{collapsed:u,showCollapseToggle:!0,...L})}),k?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`div`,{className:R(`fixed inset-0 z-40 bg-black/50 md:hidden`,`transition-opacity ease-in-out motion-reduce:transition-none`,j?`opacity-100`:`pointer-events-none opacity-0`),style:{transitionDuration:`${Pr}ms`},onClick:O,"aria-hidden":!j}),(0,X.jsx)(`aside`,{"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),"data-testid":`sidebar-mobile-drawer`,"aria-hidden":!j,className:R(`fixed inset-y-0 left-0 z-50 flex min-h-0 w-[min(300px,85vw)] flex-col bg-base`,`border-r border-[var(--oh-border)] pb-2 pl-2.5 pr-0 md:hidden`,`transition-transform ease-in-out motion-reduce:transition-none`,j?`translate-x-0`:`-translate-x-full`),style:{transitionDuration:`${Pr}ms`},children:(0,X.jsx)(Ar,{collapsed:!1,showCollapseToggle:!1,showMobileCloseButton:!0,onCloseMobile:O,...L})})]}):null,f&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(jr,{settings:r,onClose:()=>p(!1)})}),_&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Mr,{onClose:()=>v(!1)})}),y&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Nr,{onClose:()=>x(!1)})})]})}var Ir=`/settings`,Lr=`/customize`,Rr=[`/skills`,`/mcp`,`/plugins`];function zr(e){return e===Ir?{mode:`menu`}:e.startsWith(`${Ir}/`)&&e.length>9?{mode:`back`,backTo:Ir,backLabelKey:b.SETTINGS$TITLE}:e===Lr?{mode:`menu`}:Rr.some(t=>e===t||e.startsWith(`${t}/`))?{mode:`back`,backTo:Lr,backLabelKey:b.NAV$CUSTOMIZE}:{mode:`menu`}}function Br(){let{t:e}=S(`openhands`),{currentPath:t,navigate:n}=Ce(),r=zr(t);return(0,X.jsxs)(`header`,{className:`flex md:hidden h-12 shrink-0 items-center gap-2 px-2.5`,"aria-label":e(b.SIDEBAR$NAVIGATION_LABEL),children:[(0,X.jsx)(te,{}),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??b.COMMON$BACK),className:F,children:(0,X.jsx)(M,{size:20,className:N,"aria-hidden":!0,strokeWidth:2})}):null]})}var Vr=()=>{let e=fe(),{mutate:t}=Xt();return{migrateUserConsent:Y.useCallback(async n=>{let r=localStorage.getItem(`analytics-consent`);r&&(n?.handleAnalyticsWasPresentInLocalStorage(),t({user_consents_to_analytics:r===`true`},{onSuccess:()=>{Yt(e,r===`true`)}}),localStorage.removeItem(`analytics-consent`))},[e,t])}},Hr=()=>{let e=fe(),{data:t}=St(),n=Y.useRef(!1);Y.useEffect(()=>{if(!e||t===void 0||n.current)return;let r=t.user_consents_to_analytics;if(r!==null){let t=e.has_opted_in_capturing(),i=e.has_opted_out_capturing();(r===!0&&!t||r===!1&&!i)&&Yt(e,r),n.current=!0}},[e,t])};function Ur(e){switch(e){case z.RUNNING:return`🟢`;case z.FINISHED:case z.IDLE:case z.WAITING_FOR_CONFIRMATION:return`✅`;case z.PAUSED:return`⚪`;case z.ERROR:case z.STUCK:return`🔴`;default:return null}}var Wr=`OpenHands`,Gr=()=>{let{conversationId:e}=l(),{data:t}=Zt(e??null),n=Qt(e=>e.execution_status),r=t?.title,i=e&&r?`${r} | ${Wr}`:Wr;if(!e)return i;let a=Ur(n??t?.execution_status??null);return a?`${a} ${i}`:i};function Kr({children:e}){let{pathname:t}=p(),n=s(),r=c(),i=f(),a=Y.useMemo(()=>{for(let e=i.length-1;e>=0;--e){let t=i[e]?.params?.conversationId;if(t)return t}return null},[i]);return(0,X.jsx)(we,{value:Y.useMemo(()=>({currentPath:t,conversationId:a,isNavigating:!!r.location,navigate:(e,t)=>n(e,t)}),[t,a,r.location,n]),children:e})}var qr=Y.lazy(()=>n(()=>import(`./environment-switch-overlay-Tf_BIfeR.js`),__vite__mapDeps([60,1,12,10,9,18,19,61]))),Jr=Y.lazy(()=>n(()=>import(`./analytics-consent-form-modal-BQCNeNVt.js`).then(e=>({default:e.AnalyticsConsentFormModal})),__vite__mapDeps([62,28,1,29,10,9,18,19,20,21,7,22,31,32,33,34,12,36,37,16,38,17,39,13,40,41,42,43,44,15,45,46,63]))),Yr=Y.lazy(()=>n(()=>import(`./alert-banner-DFnn_lC6.js`).then(e=>({default:e.AlertBanner})),__vite__mapDeps([64,1,65,10,9,18,19,66,67,21,7,22,35,68,69,25]))),Xr=u(function(){let e=a(),{t}=S(`openhands`);return i(e)?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:e.status}),(0,X.jsx)(`p`,{children:e.statusText}),(0,X.jsx)(`pre`,{children:e.data instanceof Object?JSON.stringify(e.data):e.data})]}):e instanceof Error?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{children:t(b.ERROR$GENERIC)}),(0,X.jsx)(`pre`,{children:e.message})]}):(0,X.jsx)(`div`,{children:(0,X.jsx)(`h1`,{children:t(b.ERROR$UNKNOWN)})})}),Zr=o(function(){let e=p(),t=Gr(),{data:n}=St(),{migrateUserConsent:r}=Vr(),i=xe(),[a,o]=Y.useState(!1);if(Hr(),Y.useEffect(()=>{n?.language&&C.changeLanguage(n.language)},[n?.language]),Y.useEffect(()=>{o(n?.user_consents_to_analytics===null)},[n?.user_consents_to_analytics]),Y.useEffect(()=>{r({handleAnalyticsWasPresentInLocalStorage:()=>{o(!1)}})},[r]),i.isLoading)return(0,X.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-base`,children:(0,X.jsx)(be,{size:`large`})});let s=/^\/conversations\/[^/]+/.test(e.pathname);return(0,X.jsx)(Kr,{children:(0,X.jsxs)(k,{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)(Fr,{}),(0,X.jsxs)(`div`,{className:`flex min-h-0 flex-col w-full min-w-0 h-full gap-3`,children:[s?null:(0,X.jsx)(Br,{}),i.data&&(i.data.maintenance_start_time||i.data.faulty_models&&i.data.faulty_models.length>0||i.data.error_message)&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Yr,{maintenanceStartTime:i.data.maintenance_start_time,faultyModels:i.data.faulty_models,errorMessage:i.data.error_message,updatedAt:i.data.updated_at})}),(0,X.jsx)(`div`,{id:`root-outlet`,className:`relative flex-1 overflow-auto px-0 custom-scrollbar`,children:(0,X.jsx)(d,{})})]}),a&&(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(Jr,{onClose:()=>{o(!1)}})})]}),(0,X.jsx)(Y.Suspense,{fallback:null,children:(0,X.jsx)(qr,{})})]})})});export{Xr as ErrorBoundary,Zr as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{t as a}from"./retrieve-axios-error-message-BY-yIkIq.js";import{n as o,r as s}from"./custom-toast-handlers-ufGJ6_Rc.js";import{t as c}from"./utils-DCVfKFRt.js";import{c as l,g as u,m as d,t as ee}from"./brand-button-DJ_S16rO.js";import{t as f}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js";import{n as p,t as m}from"./settings-input-CehsXnb3.js";import{r as te}from"./use-settings-D5hbTS9t.js";import{t as ne}from"./use-save-settings-DkAOEfD9.js";import{r as h}from"./typography-BDgnT7Yp.js";import{a as re,c as ie,d as g,l as ae,n as oe,o as se,r as ce,s as le,t as ue}from"./sdk-settings-schema-CLmJ9sho.js";import{n as de,t as fe}from"./use-agent-settings-schema-CLoTOSJI.js";import{n as _,t as v}from"./switch-skeleton-DSKqSx2A.js";import{i as y,n as b,r as x,t as S}from"./sdk-settings-field-metadata-DQiaIBie.js";import{t as C}from"./settings-dropdown-input-BtoovFre.js";import{t as w}from"./settings-switch-BiBuS3xa.js";var T=e(t(),1),E=n();function D(){return(0,E.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function O(){return(0,E.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,E.jsx)(v,{}),(0,E.jsx)(_,{}),(0,E.jsx)(_,{}),(0,E.jsx)(_,{}),(0,E.jsx)(D,{}),(0,E.jsx)(v,{}),(0,E.jsx)(v,{}),(0,E.jsx)(_,{})]})}var k={"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`}};function A({field:e}){let{t}=i(`openhands`),n=k[e.key],r=x(t,e.key,e.description);return(0,E.jsxs)(E.Fragment,{children:[r?(0,E.jsx)(h.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,E.jsx)(g,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,size:`settings`,linkColor:`white`}):null]})}function j(e){return e.choices.length>0}function M(e){return e.value_type===`boolean`&&!j(e)}function N(e){return e.value_type===`array`||e.value_type===`object`}function P(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function F(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&P(e)?`url`:`text`}function pe({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),o=y(a,e.key,e.label),s=S(e.key);return M(e)?(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(w,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:o}),(0,E.jsx)(`div`,{className:d,children:(0,E.jsx)(A,{field:e})})]}):j(e)?(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(C,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,items:e.choices.map(t=>({key:String(t.value),label:b(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,E.jsx)(A,{field:e})]}):N(e)?(0,E.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-sm`,children:o}),e.required?null:(0,E.jsx)(p,{})]}),(0,E.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:c(l,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,E.jsx)(A,{field:e})]}):(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(m,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,type:F(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:s?.min,max:s?.max,step:s?.step}),(0,E.jsx)(A,{field:e})]})}var I=(e,t)=>c(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,u,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function me({view:e,setView:t,showAdvanced:n,showAll:a,isDisabled:o=!1}){let{t:s}=i(`openhands`);return!n&&!a?null:(0,E.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[(0,E.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:I(e===`basic`,o),onClick:()=>t(`basic`),children:s(r.SETTINGS$BASIC)}),n?(0,E.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:I(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(r.SETTINGS$ADVANCED)}):null,a?(0,E.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:I(e===`all`,o),onClick:()=>t(`all`),children:s(r.SETTINGS$ALL)}):null]})}var he=new Set,L={basic:0,advanced:1,all:2},ge=(e,t)=>L[t]<L[e]?t:e,_e=(e,{showAdvanced:t,showAll:n})=>e===`all`?n?`all`:t?`advanced`:`basic`:e===`advanced`?t?`advanced`:n?`all`:`basic`:`basic`,ve=(e,t)=>e instanceof f?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function R({sectionKeys:e,excludeKeys:t=he,scope:n=`personal`,settingsSource:c=`agent_settings`,header:l,extraDirty:u=!1,buildPayload:d,onSaveSuccess:f,getInitialView:p,forceShowAdvancedView:m=!1,allowAllView:g=!0,initialValueOverrides:_,embedded:v=!1,hideSaveButton:y=!1,onSaveControlChange:b,testId:x=`sdk-section-settings-screen`}){let{t:S}=i(`openhands`),{mutate:C,isPending:w}=ne(n),{data:D,isLoading:k,isFetching:A}=te(n),j=fe(D?.agent_settings_schema),M=de(D?.conversation_settings_schema),N=c===`conversation_settings`?M:j,P=N.data,F=N.isLoading,[I,L]=T.useState(`basic`),[R,z]=T.useState({}),[B,V]=T.useState({}),H=T.useRef(!1),U=T.useMemo(()=>JSON.stringify(e),[e]),W=T.useMemo(()=>JSON.parse(U),[U]),G=T.useMemo(()=>{if(!ae(P))return null;let e=new Set(W);return{...P,sections:P.sections.filter(t=>e.has(t.key))}},[P,W]),K=m||se(G),q=g&&le(G),ye=T.useMemo(()=>ve(N.error,S(r.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[N.error,S]),be=T.useMemo(()=>_?JSON.stringify(_):``,[_]),J=T.useMemo(()=>{if(!D||!G)return null;let e=ue(D,G,c);return _?{...e,..._}:e},[D,G,c,be]),Y=T.useMemo(()=>!D||!G?null:_e(p?p(D,G):ie(D,G,c),{showAdvanced:K,showAll:q}),[D,G,p,c,K,q]);T.useEffect(()=>{H.current=!1,L(`basic`),z({}),V({})},[n,c,U]),T.useEffect(()=>{!J||!Y||(z(J),V(_?Object.fromEntries(Object.keys(_).map(e=>[e,!0])):{}),L(e=>H.current?ge(e,Y):(H.current=!0,Y)))},[J,Y]);let xe=T.useMemo(()=>G?re(G,R,I,t):[],[G,R,I,t]),X=T.useCallback((e,t)=>{z(n=>({...n,[e]:t})),V(t=>({...t,[e]:!0}))},[]),Se=T.useCallback(e=>{o(a(e)||S(r.ERROR$GENERIC))},[S]),Z=T.useRef(()=>{}),Ce=T.useCallback(()=>{Z.current()},[]),Q=T.useRef(()=>({})),we=T.useCallback(()=>Q.current(),[]),Te=()=>{if(!G)return;let e;try{let t=ce(G,R,B,I),n;n=c===`conversation_settings`?{conversation_settings_diff:t}:{agent_settings_diff:t},e=d?d(t,{values:R,dirty:B,view:I}):n}catch(e){o(e instanceof Error?e.message:S(r.ERROR$GENERIC));return}Object.keys(e).length!==0&&C(e,{onError:Se,onSuccess:()=>{s(S(r.SETTINGS$SAVED_WARNING)),V({}),f?.()}})};Z.current=Te,Q.current=()=>G?oe(G,R,B):{};let $=Object.keys(B).length>0||u;return T.useEffect(()=>{b&&b({save:Ce,isSaving:w,isDirty:$,values:R,view:I,getDirtyPayload:we})},[w,$,R,I]),k||A||F?(0,E.jsx)(O,{}):!G||G.sections.length===0?(0,E.jsx)(h.Paragraph,{className:`text-tertiary-alt`,children:ye}):Object.keys(R).length===0?(0,E.jsx)(O,{}):(0,E.jsxs)(`div`,{"data-testid":x,className:v?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,E.jsx)(me,{view:I,setView:L,showAdvanced:K,showAll:q,isDisabled:!1}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[l?.({values:R,isDisabled:!1,view:I,onChange:X}),xe.map((e,t)=>(0,E.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,E.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.fields.map(e=>(0,E.jsx)(pe,{field:e,value:R[e.key],isDisabled:!1,onChange:t=>X(e.key,t)},e.key))})},`${e.key}-${t}`)),y?null:(0,E.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,E.jsx)(ee,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:w||Object.keys(B).length===0&&!u,onClick:Te,children:S(w?r.SETTINGS$SAVING:r.SETTINGS$SAVE_CHANGES)})})]})]})}export{R as t};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{t as a}from"./retrieve-axios-error-message-BY-yIkIq.js";import{n as o,r as s}from"./custom-toast-handlers-ufGJ6_Rc.js";import{t as c}from"./utils-DCVfKFRt.js";import{c as l,g as u,m as d,t as ee}from"./brand-button-DJ_S16rO.js";import{t as f}from"./vendor~root-layout~home~conversation-panel~conversation~launch~extensions-hub~skills-settin~ninslayh-CLlsvdNP.js";import{n as p,t as m}from"./settings-input-CehsXnb3.js";import{r as te}from"./use-settings-DeO7nvpM.js";import{t as ne}from"./use-save-settings-uXXkqvD7.js";import{r as h}from"./typography-BDgnT7Yp.js";import{a as re,c as ie,d as g,l as ae,n as oe,o as se,r as ce,s as le,t as ue}from"./sdk-settings-schema-CLmJ9sho.js";import{n as de,t as fe}from"./use-agent-settings-schema-B66kGIi_.js";import{n as _,t as v}from"./switch-skeleton-DSKqSx2A.js";import{i as y,n as b,r as x,t as S}from"./sdk-settings-field-metadata-DQiaIBie.js";import{t as C}from"./settings-dropdown-input-BtoovFre.js";import{t as w}from"./settings-switch-BiBuS3xa.js";var T=e(t(),1),E=n();function D(){return(0,E.jsx)(`div`,{className:`w-[250px] h-[20px] skeleton`})}function O(){return(0,E.jsxs)(`div`,{"data-testid":`app-settings-skeleton`,className:`px-11 py-9 flex flex-col gap-6`,children:[(0,E.jsx)(v,{}),(0,E.jsx)(_,{}),(0,E.jsx)(_,{}),(0,E.jsx)(_,{}),(0,E.jsx)(D,{}),(0,E.jsx)(v,{}),(0,E.jsx)(v,{}),(0,E.jsx)(_,{})]})}var k={"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`}};function A({field:e}){let{t}=i(`openhands`),n=k[e.key],r=x(t,e.key,e.description);return(0,E.jsxs)(E.Fragment,{children:[r?(0,E.jsx)(h.Paragraph,{className:`text-tertiary-alt text-xs leading-5`,children:r}):null,n?(0,E.jsx)(g,{testId:`help-link-${e.key}`,text:t(n.textKey),linkText:t(n.linkTextKey),href:n.href,size:`settings`,linkColor:`white`}):null]})}function j(e){return e.choices.length>0}function M(e){return e.value_type===`boolean`&&!j(e)}function N(e){return e.value_type===`array`||e.value_type===`object`}function P(e){return e.key.endsWith(`url`)||e.key.endsWith(`_url`)}function F(e){return e.secret?`password`:e.value_type===`integer`||e.value_type===`number`?`number`:e.value_type===`string`&&P(e)?`url`:`text`}function pe({field:e,value:t,isDisabled:n,onChange:r}){let{t:a}=i(`openhands`),o=y(a,e.key,e.label),s=S(e.key);return M(e)?(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(w,{testId:`sdk-settings-${e.key}`,isToggled:!!t,isDisabled:n,onToggle:r,children:o}),(0,E.jsx)(`div`,{className:d,children:(0,E.jsx)(A,{field:e})})]}):j(e)?(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(C,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,items:e.choices.map(t=>({key:String(t.value),label:b(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,E.jsx)(A,{field:e})]}):N(e)?(0,E.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`text-sm`,children:o}),e.required?null:(0,E.jsx)(p,{})]}),(0,E.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:c(l,`min-h-32 font-mono placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)}),(0,E.jsx)(A,{field:e})]}):(0,E.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,E.jsx)(m,{testId:`sdk-settings-${e.key}`,name:e.key,label:o,type:F(e),value:String(t??``),required:e.required,showOptionalTag:!e.required,isDisabled:n,onChange:r,className:`w-full`,min:s?.min,max:s?.max,step:s?.step}),(0,E.jsx)(A,{field:e})]})}var I=(e,t)=>c(`w-fit px-2 py-2 text-sm cursor-pointer rounded-none bg-transparent`,u,`border-b-2 pb-2`,e?`text-white border-white`:`text-[var(--oh-muted)] border-transparent hover:text-white`,t&&`pointer-events-none opacity-30 cursor-not-allowed`);function me({view:e,setView:t,showAdvanced:n,showAll:a,isDisabled:o=!1}){let{t:s}=i(`openhands`);return!n&&!a?null:(0,E.jsxs)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mb-6 flex items-center gap-2`,children:[(0,E.jsx)(`button`,{"data-testid":`sdk-section-basic-toggle`,type:`button`,role:`tab`,"aria-selected":e===`basic`,disabled:o,className:I(e===`basic`,o),onClick:()=>t(`basic`),children:s(r.SETTINGS$BASIC)}),n?(0,E.jsx)(`button`,{"data-testid":`sdk-section-advanced-toggle`,type:`button`,role:`tab`,"aria-selected":e===`advanced`,disabled:o,className:I(e===`advanced`,o),onClick:()=>t(`advanced`),children:s(r.SETTINGS$ADVANCED)}):null,a?(0,E.jsx)(`button`,{"data-testid":`sdk-section-all-toggle`,type:`button`,role:`tab`,"aria-selected":e===`all`,disabled:o,className:I(e===`all`,o),onClick:()=>t(`all`),children:s(r.SETTINGS$ALL)}):null]})}var he=new Set,L={basic:0,advanced:1,all:2},ge=(e,t)=>L[t]<L[e]?t:e,_e=(e,{showAdvanced:t,showAll:n})=>e===`all`?n?`all`:t?`advanced`:`basic`:e===`advanced`?t?`advanced`:n?`all`:`basic`:`basic`,ve=(e,t)=>e instanceof f?e.response?.status===401?`${t} This agent server requires X-Session-API-Key. Set VITE_SESSION_API_KEY in the frontend to the same value used by the backend SESSION_API_KEY or OH_SESSION_API_KEYS_0.`:e.response?.status===404?`${t} This backend does not expose /api/settings/* schema endpoints. Upgrade to a recent openhands-agent-server release.`:t:t;function R({sectionKeys:e,excludeKeys:t=he,scope:n=`personal`,settingsSource:c=`agent_settings`,header:l,extraDirty:u=!1,buildPayload:d,onSaveSuccess:f,getInitialView:p,forceShowAdvancedView:m=!1,allowAllView:g=!0,initialValueOverrides:_,embedded:v=!1,hideSaveButton:y=!1,onSaveControlChange:b,testId:x=`sdk-section-settings-screen`}){let{t:S}=i(`openhands`),{mutate:C,isPending:w}=ne(n),{data:D,isLoading:k,isFetching:A}=te(n),j=fe(D?.agent_settings_schema),M=de(D?.conversation_settings_schema),N=c===`conversation_settings`?M:j,P=N.data,F=N.isLoading,[I,L]=T.useState(`basic`),[R,z]=T.useState({}),[B,V]=T.useState({}),H=T.useRef(!1),U=T.useMemo(()=>JSON.stringify(e),[e]),W=T.useMemo(()=>JSON.parse(U),[U]),G=T.useMemo(()=>{if(!ae(P))return null;let e=new Set(W);return{...P,sections:P.sections.filter(t=>e.has(t.key))}},[P,W]),K=m||se(G),q=g&&le(G),ye=T.useMemo(()=>ve(N.error,S(r.SETTINGS$SDK_SCHEMA_UNAVAILABLE)),[N.error,S]),be=T.useMemo(()=>_?JSON.stringify(_):``,[_]),J=T.useMemo(()=>{if(!D||!G)return null;let e=ue(D,G,c);return _?{...e,..._}:e},[D,G,c,be]),Y=T.useMemo(()=>!D||!G?null:_e(p?p(D,G):ie(D,G,c),{showAdvanced:K,showAll:q}),[D,G,p,c,K,q]);T.useEffect(()=>{H.current=!1,L(`basic`),z({}),V({})},[n,c,U]),T.useEffect(()=>{!J||!Y||(z(J),V(_?Object.fromEntries(Object.keys(_).map(e=>[e,!0])):{}),L(e=>H.current?ge(e,Y):(H.current=!0,Y)))},[J,Y]);let xe=T.useMemo(()=>G?re(G,R,I,t):[],[G,R,I,t]),X=T.useCallback((e,t)=>{z(n=>({...n,[e]:t})),V(t=>({...t,[e]:!0}))},[]),Se=T.useCallback(e=>{o(a(e)||S(r.ERROR$GENERIC))},[S]),Z=T.useRef(()=>{}),Ce=T.useCallback(()=>{Z.current()},[]),Q=T.useRef(()=>({})),we=T.useCallback(()=>Q.current(),[]),Te=()=>{if(!G)return;let e;try{let t=ce(G,R,B,I),n;n=c===`conversation_settings`?{conversation_settings_diff:t}:{agent_settings_diff:t},e=d?d(t,{values:R,dirty:B,view:I}):n}catch(e){o(e instanceof Error?e.message:S(r.ERROR$GENERIC));return}Object.keys(e).length!==0&&C(e,{onError:Se,onSuccess:()=>{s(S(r.SETTINGS$SAVED_WARNING)),V({}),f?.()}})};Z.current=Te,Q.current=()=>G?oe(G,R,B):{};let $=Object.keys(B).length>0||u;return T.useEffect(()=>{b&&b({save:Ce,isSaving:w,isDirty:$,values:R,view:I,getDirtyPayload:we})},[w,$,R,I]),k||A||F?(0,E.jsx)(O,{}):!G||G.sections.length===0?(0,E.jsx)(h.Paragraph,{className:`text-tertiary-alt`,children:ye}):Object.keys(R).length===0?(0,E.jsx)(O,{}):(0,E.jsxs)(`div`,{"data-testid":x,className:v?`relative flex min-h-0 w-full flex-1 flex-col`:`relative w-full min-h-0`,children:[(0,E.jsx)(me,{view:I,setView:L,showAdvanced:K,showAll:q,isDisabled:!1}),(0,E.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[l?.({values:R,isDisabled:!1,view:I,onChange:X}),xe.map((e,t)=>(0,E.jsx)(`section`,{className:`flex flex-col gap-4`,children:(0,E.jsx)(`div`,{className:`flex flex-col gap-4`,children:e.fields.map(e=>(0,E.jsx)(pe,{field:e,value:R[e.key],isDisabled:!1,onChange:t=>X(e.key,t)},e.key))})},`${e.key}-${t}`)),y?null:(0,E.jsx)(`div`,{className:`flex justify-start pt-2`,children:(0,E.jsx)(ee,{testId:`save-button`,type:`button`,variant:`primary`,isDisabled:w||Object.keys(B).length===0&&!u,onClick:Te,children:S(w?r.SETTINGS$SAVING:r.SETTINGS$SAVE_CHANGES)})})]})]})}export{R as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-BFRubm34.js";import{d as t,n,s as r}from"./agent-server-client-options-HEOwGVIU.js";import{t as i}from"./proxy-BAdHH8QB.js";var a=100;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud secrets call requires a cloud backend.`);return e}async function s(){let e=o(),t=[],n=null;do{let r=new URLSearchParams({limit:String(a)});n&&r.set(`page_id`,n);let o=await i({backend:e,method:`GET`,path:`/api/v1/secrets/search?${r.toString()}`});t.push(...o.items??[]),n=o.next_page_id}while(n);return t}async function c(e,t,n){await i({backend:o(),method:`POST`,path:`/api/v1/secrets`,body:{name:e,value:t,description:n}})}async function l(e,t,n){await i({backend:o(),method:`PUT`,path:`/api/v1/secrets/${encodeURIComponent(e)}`,body:{name:t,description:n}})}async function u(e){await i({backend:o(),method:`DELETE`,path:`/api/v1/secrets/${encodeURIComponent(e)}`})}var d=e({SecretsService:()=>p});async function f(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var p=class{static async getSecrets(){try{return t().backend.kind===`cloud`?await f(()=>s()):(await f(()=>new r(n()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async createSecret(e,i,a){if(t().backend.kind===`cloud`){await f(()=>c(e,i,a));return}await f(()=>new r(n()).upsertSecret({name:e,value:i,description:a}))}static async updateSecret(e,n,r){if(t().backend.kind===`cloud`){await f(()=>l(e,n,r));return}await this.createSecret(e,n,r)}static async deleteSecret(e){try{if(t().backend.kind===`cloud`){await f(()=>u(e));return}await f(()=>new r(n()).deleteSecret(e))}catch(e){if(e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};export{d as n,p as t};
1
+ import{r as e}from"./rolldown-runtime-BFRubm34.js";import{d as t,n,s as r}from"./agent-server-client-options-9agOSarV.js";import{t as i}from"./proxy-BqDMnUY-.js";var a=100;function o(){let e=t().backend;if(e.kind!==`cloud`)throw Error(`Cloud secrets call requires a cloud backend.`);return e}async function s(){let e=o(),t=[],n=null;do{let r=new URLSearchParams({limit:String(a)});n&&r.set(`page_id`,n);let o=await i({backend:e,method:`GET`,path:`/api/v1/secrets/search?${r.toString()}`});t.push(...o.items??[]),n=o.next_page_id}while(n);return t}async function c(e,t,n){await i({backend:o(),method:`POST`,path:`/api/v1/secrets`,body:{name:e,value:t,description:n}})}async function l(e,t,n){await i({backend:o(),method:`PUT`,path:`/api/v1/secrets/${encodeURIComponent(e)}`,body:{name:t,description:n}})}async function u(e){await i({backend:o(),method:`DELETE`,path:`/api/v1/secrets/${encodeURIComponent(e)}`})}var d=e({SecretsService:()=>p});async function f(e,t=3,n=500){for(let r=0;r<t;r+=1)try{return await e()}catch(e){if(r>=t-1)throw e;let i=n*2**r;await new Promise(e=>{setTimeout(e,i)})}throw Error(`Retry attempts exhausted`)}var p=class{static async getSecrets(){try{return t().backend.kind===`cloud`?await f(()=>s()):(await f(()=>new r(n()).listSecrets())).secrets.map(e=>({name:e.name,description:e.description}))}catch(e){return console.error(`Failed to fetch secrets after retries:`,e),[]}}static async createSecret(e,i,a){if(t().backend.kind===`cloud`){await f(()=>c(e,i,a));return}await f(()=>new r(n()).upsertSecret({name:e,value:i,description:a}))}static async updateSecret(e,n,r){if(t().backend.kind===`cloud`){await f(()=>l(e,n,r));return}await this.createSecret(e,n,r)}static async deleteSecret(e){try{if(t().backend.kind===`cloud`){await f(()=>u(e));return}await f(()=>new r(n()).deleteSecret(e))}catch(e){if(e&&typeof e==`object`&&`response`in e&&e.response?.status===404)return;throw e}}};export{d as n,p as t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./useMutation-GSSKKebK.js";import{o as i,t as a}from"./declaration-CR6HMp29.js";import{n as o}from"./QueryClientProvider-Cnr-Yl3j.js";import{t as s}from"./useTranslation-B6voJV4y.js";import{t as c}from"./back-nav-button-7dQJ2k3O.js";import{t as l}from"./pencil-Dr0b2jL1.js";import{t as u}from"./trash-2-CbVljPko.js";import{t as d}from"./utils-DCVfKFRt.js";import{c as f,d as p,t as m}from"./brand-button-DJ_S16rO.js";import{t as h}from"./loading-spinner-5GT9q1xy.js";import{n as g,t as _}from"./settings-input-CehsXnb3.js";import{t as v}from"./confirmation-modal-B5Ca6qFE.js";import{r as y}from"./typography-BDgnT7Yp.js";import{a as b,c as x,i as S,l as C,o as w,r as T,s as E}from"./settings-list-classes-E3v_f6QG.js";import{t as D}from"./secrets-service-B7CxNinp.js";import{n as O,t as k}from"./use-get-secrets-8Jby8ele.js";var A=e(t(),1),j=()=>r({mutationFn:e=>D.deleteSecret(e)}),M=()=>r({mutationFn:({secretToEdit:e,name:t,description:n})=>D.updateSecret(e,t,n)}),N=i();function P({mode:e,selectedSecret:t,onCancel:n}){let r=o(),{t:i}=s(`openhands`),{data:c}=k(),{mutate:l}=O(),{mutate:u}=M(),[h,v]=A.useState(null),y=e===`edit`&&t&&c?.find(e=>e.name===t)?.description?.trim()||``,b=()=>{r.invalidateQueries({queryKey:[`secrets-search`]}),r.invalidateQueries({queryKey:[`secrets`]})},x=(e,t,r)=>{l({name:e,value:t,description:r},{onSettled:n,onSuccess:b})},S=(e,t,r)=>{u({secretToEdit:e,name:t,description:r},{onSettled:n,onSuccess:b})};return(0,N.jsxs)(`form`,{"data-testid":e===`add`?`add-secret-form`:`edit-secret-form`,onSubmit:n=>{n.preventDefault();let r=new FormData(n.currentTarget),a=r.get(`secret-name`)?.toString(),o=r.get(`secret-value`)?.toString().trim(),s=r.get(`secret-description`)?.toString();if(a){if(v(null),c?.some(e=>e.name===a&&e.name!==t)){v(i(`SECRETS$SECRET_ALREADY_EXISTS`));return}if(e===`add`){if(!o){v(i(`SECRETS$SECRET_VALUE_REQUIRED`));return}x(a,o,s||void 0)}else e===`edit`&&t&&S(t,a,s||void 0)}},className:`flex flex-col items-start gap-6`,children:[(0,N.jsx)(_,{testId:`name-input`,name:`secret-name`,type:`text`,label:`Name`,className:`w-full min-w-0`,required:!0,defaultValue:e===`edit`&&t?t:``,placeholder:i(`SECRETS$API_KEY_EXAMPLE`),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:`Must start with a letter, contain only letters/numbers/underscores, and be 1-64 characters`}),h&&(0,N.jsx)(`p`,{className:`text-red-500 text-sm`,children:h}),e===`add`&&(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:i(a.FORM$VALUE)}),(0,N.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:!0,className:d(`resize-none`,f,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:i(a.FORM$DESCRIPTION)}),(0,N.jsx)(g,{})]}),(0,N.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,defaultValue:y,className:d(p,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(m,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:i(a.BUTTON$CANCEL)}),(0,N.jsxs)(m,{testId:`submit-button`,type:`submit`,variant:`primary`,children:[e===`add`&&i(`SECRETS$ADD_SECRET`),e===`edit`&&i(`SECRETS$EDIT_SECRET`)]})]})]})}function F(){return(0,N.jsxs)(`div`,{className:d(S,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function I({title:e,description:t,onEdit:n,onDelete:r}){return(0,N.jsxs)(`tr`,{"data-testid":`secret-item`,className:C,children:[(0,N.jsx)(`td`,{className:d(w,`text-content-2 truncate`),title:e,children:e}),(0,N.jsx)(`td`,{className:d(w,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,N.jsx)(`td`,{className:w,children:(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,N.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:T,children:(0,N.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,N.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:T,children:(0,N.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var L={hideTitle:!0};function R(){let e=o(),{t}=s(`openhands`),n=(0,A.useRef)(null),{data:r,isLoading:i,hasNextPage:l,isFetchingNextPage:u,onLoadMore:f}=k(),{mutate:p}=j(),[g,_]=A.useState(`list`),[S,C]=A.useState(null),[w,T]=A.useState(!1),D=(0,A.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&l&&!u&&f()},[l,u,f]),O=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},M=e=>{p(e,{onSettled:()=>{T(!1)},onSuccess:O,onError:O})},L=()=>{S&&M(S)},R=()=>{T(!1)},z=()=>{_(`list`),C(null)},B=g===`add-secret-form`||g===`edit-secret-form`,V=t(g===`add-secret-form`?a.SECRETS$ADD_A_SECRET:a.SECRETS$EDIT_A_SECRET);return(0,N.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[g===`list`?(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(y.H2,{children:t(a.SETTINGS$NAV_SECRETS)}),(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(a.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,N.jsx)(m,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(`add-secret-form`),isDisabled:i,children:t(`SECRETS$ADD_NEW_SECRET`)})]}):null,B?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(a.BUTTON$BACK)}),(0,N.jsx)(y.H2,{testId:`secret-editor-title`,children:V})]}):null,i&&g===`list`&&(0,N.jsxs)(`ul`,{children:[(0,N.jsx)(F,{}),(0,N.jsx)(F,{}),(0,N.jsx)(F,{})]}),g===`list`&&!i&&(0,N.jsxs)(`div`,{ref:n,className:b,onScroll:D,children:[(0,N.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,N.jsx)(`thead`,{className:E,children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{className:d(x,`w-1/4`),children:t(a.SETTINGS$NAME)}),(0,N.jsx)(`th`,{className:d(x,`w-1/2`),children:t(a.SECRETS$DESCRIPTION)}),(0,N.jsx)(`th`,{className:d(x,`w-1/4 text-right`),children:t(a.SETTINGS$ACTIONS)})]})}),(0,N.jsx)(`tbody`,{children:r?.map(e=>(0,N.jsx)(I,{title:e.name,description:e.description,onEdit:()=>{_(`edit-secret-form`),C(e.name)},onDelete:()=>{T(!0),C(e.name)}},e.name))})]}),u&&(0,N.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,N.jsx)(h,{size:`small`})})]}),(g===`add-secret-form`||g===`edit-secret-form`)&&(0,N.jsx)(P,{mode:g===`add-secret-form`?`add`:`edit`,selectedSecret:S,onCancel:z}),w&&(0,N.jsx)(v,{text:t(`SECRETS$CONFIRM_DELETE_KEY`),onConfirm:L,onCancel:R})]})}var z=n(R);export{z as default,L as handle};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{L as n}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{t as r}from"./useMutation-GSSKKebK.js";import{o as i,t as a}from"./declaration-CR6HMp29.js";import{n as o}from"./QueryClientProvider-Cnr-Yl3j.js";import{t as s}from"./useTranslation-B6voJV4y.js";import{t as c}from"./back-nav-button-7dQJ2k3O.js";import{t as l}from"./pencil-Dr0b2jL1.js";import{t as u}from"./trash-2-CbVljPko.js";import{t as d}from"./utils-DCVfKFRt.js";import{c as f,d as p,t as m}from"./brand-button-DJ_S16rO.js";import{t as h}from"./loading-spinner-5GT9q1xy.js";import{n as g,t as _}from"./settings-input-CehsXnb3.js";import{t as v}from"./confirmation-modal-B5Ca6qFE.js";import{r as y}from"./typography-BDgnT7Yp.js";import{a as b,c as x,i as S,l as C,o as w,r as T,s as E}from"./settings-list-classes-E3v_f6QG.js";import{t as D}from"./secrets-service-B9AFn9OE.js";import{n as O,t as k}from"./use-get-secrets-oyC7PFRz.js";var A=e(t(),1),j=()=>r({mutationFn:e=>D.deleteSecret(e)}),M=()=>r({mutationFn:({secretToEdit:e,name:t,description:n})=>D.updateSecret(e,t,n)}),N=i();function P({mode:e,selectedSecret:t,onCancel:n}){let r=o(),{t:i}=s(`openhands`),{data:c}=k(),{mutate:l}=O(),{mutate:u}=M(),[h,v]=A.useState(null),y=e===`edit`&&t&&c?.find(e=>e.name===t)?.description?.trim()||``,b=()=>{r.invalidateQueries({queryKey:[`secrets-search`]}),r.invalidateQueries({queryKey:[`secrets`]})},x=(e,t,r)=>{l({name:e,value:t,description:r},{onSettled:n,onSuccess:b})},S=(e,t,r)=>{u({secretToEdit:e,name:t,description:r},{onSettled:n,onSuccess:b})};return(0,N.jsxs)(`form`,{"data-testid":e===`add`?`add-secret-form`:`edit-secret-form`,onSubmit:n=>{n.preventDefault();let r=new FormData(n.currentTarget),a=r.get(`secret-name`)?.toString(),o=r.get(`secret-value`)?.toString().trim(),s=r.get(`secret-description`)?.toString();if(a){if(v(null),c?.some(e=>e.name===a&&e.name!==t)){v(i(`SECRETS$SECRET_ALREADY_EXISTS`));return}if(e===`add`){if(!o){v(i(`SECRETS$SECRET_VALUE_REQUIRED`));return}x(a,o,s||void 0)}else e===`edit`&&t&&S(t,a,s||void 0)}},className:`flex flex-col items-start gap-6`,children:[(0,N.jsx)(_,{testId:`name-input`,name:`secret-name`,type:`text`,label:`Name`,className:`w-full min-w-0`,required:!0,defaultValue:e===`edit`&&t?t:``,placeholder:i(`SECRETS$API_KEY_EXAMPLE`),pattern:`^[a-zA-Z][a-zA-Z0-9_]{0,63}$`,title:`Must start with a letter, contain only letters/numbers/underscores, and be 1-64 characters`}),h&&(0,N.jsx)(`p`,{className:`text-red-500 text-sm`,children:h}),e===`add`&&(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:i(a.FORM$VALUE)}),(0,N.jsx)(`textarea`,{"data-testid":`value-input`,name:`secret-value`,required:!0,className:d(`resize-none`,f,`placeholder:italic`,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)] disabled:cursor-not-allowed`),rows:8})]}),(0,N.jsxs)(`label`,{className:`flex flex-col gap-2.5 w-full min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`span`,{className:`text-sm`,children:i(a.FORM$DESCRIPTION)}),(0,N.jsx)(g,{})]}),(0,N.jsx)(`input`,{"data-testid":`description-input`,name:`secret-description`,defaultValue:y,className:d(p,`disabled:bg-[var(--oh-surface-raised)] disabled:border-[var(--oh-border-subtle)]`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,N.jsx)(m,{testId:`cancel-button`,type:`button`,variant:`secondary`,onClick:n,children:i(a.BUTTON$CANCEL)}),(0,N.jsxs)(m,{testId:`submit-button`,type:`submit`,variant:`primary`,children:[e===`add`&&i(`SECRETS$ADD_SECRET`),e===`edit`&&i(`SECRETS$EDIT_SECRET`)]})]})]})}function F(){return(0,N.jsxs)(`div`,{className:d(S,`justify-between border-t border-[var(--oh-border)] first:border-t-0`),children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-4`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-1/2`})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`}),(0,N.jsx)(`span`,{className:`skeleton h-4 w-4`})]})]})}function I({title:e,description:t,onEdit:n,onDelete:r}){return(0,N.jsxs)(`tr`,{"data-testid":`secret-item`,className:C,children:[(0,N.jsx)(`td`,{className:d(w,`text-content-2 truncate`),title:e,children:e}),(0,N.jsx)(`td`,{className:d(w,`truncate text-content-2 opacity-80`),title:t||``,children:t||``}),(0,N.jsx)(`td`,{className:w,children:(0,N.jsxs)(`div`,{className:`flex items-center justify-end gap-0.5`,children:[(0,N.jsx)(`button`,{"data-testid":`edit-secret-button`,type:`button`,onClick:n,"aria-label":`Edit ${e}`,className:T,children:(0,N.jsx)(l,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})}),(0,N.jsx)(`button`,{"data-testid":`delete-secret-button`,type:`button`,onClick:r,"aria-label":`Delete ${e}`,className:T,children:(0,N.jsx)(u,{"aria-hidden":!0,className:`size-4`,strokeWidth:2})})]})})]})}var L={hideTitle:!0};function R(){let e=o(),{t}=s(`openhands`),n=(0,A.useRef)(null),{data:r,isLoading:i,hasNextPage:l,isFetchingNextPage:u,onLoadMore:f}=k(),{mutate:p}=j(),[g,_]=A.useState(`list`),[S,C]=A.useState(null),[w,T]=A.useState(!1),D=(0,A.useCallback)(e=>{let t=e.currentTarget;t.scrollHeight-t.scrollTop<=t.clientHeight+100&&l&&!u&&f()},[l,u,f]),O=()=>{e.invalidateQueries({queryKey:[`secrets-search`]}),e.invalidateQueries({queryKey:[`secrets`]})},M=e=>{p(e,{onSettled:()=>{T(!1)},onSuccess:O,onError:O})},L=()=>{S&&M(S)},R=()=>{T(!1)},z=()=>{_(`list`),C(null)},B=g===`add-secret-form`||g===`edit-secret-form`,V=t(g===`add-secret-form`?a.SECRETS$ADD_A_SECRET:a.SECRETS$EDIT_A_SECRET);return(0,N.jsxs)(`div`,{"data-testid":`secrets-settings-screen`,className:`flex flex-col gap-6`,children:[g===`list`?(0,N.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,N.jsx)(y.H2,{children:t(a.SETTINGS$NAV_SECRETS)}),(0,N.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:t(a.SETTINGS$PAGE_SECRETS_SUBLINE)})]}),(0,N.jsx)(m,{testId:`add-secret-button`,type:`button`,variant:`primary`,className:`shrink-0 whitespace-nowrap`,onClick:()=>_(`add-secret-form`),isDisabled:i,children:t(`SECRETS$ADD_NEW_SECRET`)})]}):null,B?(0,N.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,N.jsx)(c,{testId:`back-to-secrets`,onClick:z,children:t(a.BUTTON$BACK)}),(0,N.jsx)(y.H2,{testId:`secret-editor-title`,children:V})]}):null,i&&g===`list`&&(0,N.jsxs)(`ul`,{children:[(0,N.jsx)(F,{}),(0,N.jsx)(F,{}),(0,N.jsx)(F,{})]}),g===`list`&&!i&&(0,N.jsxs)(`div`,{ref:n,className:b,onScroll:D,children:[(0,N.jsxs)(`table`,{className:`w-full min-w-full table-fixed`,children:[(0,N.jsx)(`thead`,{className:E,children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{className:d(x,`w-1/4`),children:t(a.SETTINGS$NAME)}),(0,N.jsx)(`th`,{className:d(x,`w-1/2`),children:t(a.SECRETS$DESCRIPTION)}),(0,N.jsx)(`th`,{className:d(x,`w-1/4 text-right`),children:t(a.SETTINGS$ACTIONS)})]})}),(0,N.jsx)(`tbody`,{children:r?.map(e=>(0,N.jsx)(I,{title:e.name,description:e.description,onEdit:()=>{_(`edit-secret-form`),C(e.name)},onDelete:()=>{T(!0),C(e.name)}},e.name))})]}),u&&(0,N.jsx)(`div`,{className:`flex justify-center p-4`,children:(0,N.jsx)(h,{size:`small`})})]}),(g===`add-secret-form`||g===`edit-secret-form`)&&(0,N.jsx)(P,{mode:g===`add-secret-form`?`add`:`edit`,selectedSecret:S,onCancel:z}),w&&(0,N.jsx)(v,{text:t(`SECRETS$CONFIRM_DELETE_KEY`),onConfirm:L,onCancel:R})]})}var z=n(R);export{z as default,L as handle};
@@ -1 +1 @@
1
- import{c as e}from"./agent-server-client-options-HEOwGVIU.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async getRoot(){return(await this.client.get(`/`)).data}async getAlive(){return(await this.client.get(`/alive`)).data}async getHealth(){return(await this.client.get(`/health`)).data}async getReady(){return(await this.client.get(`/ready`,{acceptableStatusCodes:new Set([200,503])})).data}async getServerInfo(){return(await this.client.get(`/server_info`)).data}close(){this.client.close()}};export{t};
1
+ import{c as e}from"./agent-server-client-options-9agOSarV.js";var t=class{constructor(t){this.host=t.host.replace(/\/$/,``),this.apiKey=t.apiKey,this.client=new e({baseUrl:this.host,apiKey:this.apiKey,timeout:t.timeout||6e4})}async getRoot(){return(await this.client.get(`/`)).data}async getAlive(){return(await this.client.get(`/alive`)).data}async getHealth(){return(await this.client.get(`/health`)).data}async getReady(){return(await this.client.get(`/ready`,{acceptableStatusCodes:new Set([200,503])})).data}async getServerInfo(){return(await this.client.get(`/server_info`)).data}close(){this.client.close()}};export{t};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{E as n,L as r,c as i,j as a,k as o}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{r as s}from"./query-client-config-CRnGSujB.js";import{o as c,t as l}from"./declaration-CR6HMp29.js";import{t as u}from"./useTranslation-B6voJV4y.js";import{n as d,t as f}from"./use-settings-nav-items-BcSbo02d.js";import{t as p}from"./utils-DCVfKFRt.js";import{t as m}from"./option-service.api-DmNVxAvS.js";import{i as h,t as g}from"./query-keys-tAsQcc_9.js";import"./navigation-link-U4vY9i_C.js";import"./use-cloud-current-user-id-Ddr75hEz.js";import{t as _}from"./sidebar-nav-link-OhIeFyna.js";import"./close-BU5iTc66.js";import{r as v}from"./typography-BDgnT7Yp.js";import"./settings-gear-Dd8K2_8B.js";import{n as y,r as b}from"./settings-utils-DY04tWG1.js";import{t as x}from"./settings-section-header-context-DewwJ0-F.js";import{t as S}from"./use-breakpoint-DF_RiQ6s.js";import{t as C}from"./backend-synced-settings-badge-BTIj-Ffq.js";import{t as w}from"./settings-like-page-layout-classes-D7YjdTd0.js";import{t as T}from"./acp-route-guard-BoVmCn0e.js";var E=e(t(),1),D=c();function O({navigationItems:e}){let{t}=u(`openhands`),n=e.filter(e=>e.type===`item`);return(0,D.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:p(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,D.jsx)(v.Text,{className:`px-2 text-sm font-normal text-white`,children:t(l.SETTINGS$TITLE)}),(0,D.jsx)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:n.map(e=>(0,D.jsx)(_,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon,disabled:e.disabled,disabledReason:e.disabled&&e.disabledAgentName?t(l.SETTINGS$AGENT_DISABLED_TOOLTIP,{agentName:e.disabledAgentName}):void 0},e.item.to))}),(0,D.jsx)(`div`,{className:`px-2 pt-3`,children:(0,D.jsx)(C,{})})]})}function k({children:e,navigationItems:t}){return(0,D.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,D.jsx)(O,{navigationItems:t}),(0,D.jsx)(`main`,{className:w,children:(0,D.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}var A=async({request:e})=>{let{pathname:t}=new URL(e.url),r=(await s.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:m.getConfig,...g}))?.feature_flags;if(b(t,r)){let e=y(r);if(e&&e!==t)return n(e)}if(d.find(e=>e.to===t)?.disabledByAcp){let e=await T();if(e)return e}return null};function j(){let{t:e}=u(`openhands`),t=o(),n=a(),r=f(),s=S(768),[c,l]=(0,E.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:p}=(0,E.useMemo)(()=>{let e=r.find(e=>e.type===`item`&&e.item.to===t.pathname);if(e?.type===`item`)return{currentSectionTitle:e.item.text,currentSectionSubtitle:e.item.subtitle};let n=r.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[r,t.pathname]),m=n.find(e=>e.pathname===t.pathname)?.handle,h=s&&t.pathname===`/settings`;return(0,D.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,D.jsx)(x,{setHideSectionHeader:l,children:(0,D.jsx)(k,{navigationItems:r,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(m?.hideTitle===!0||h||c)&&(0,D.jsxs)(`header`,{className:`space-y-1`,children:[(0,D.jsx)(v.H2,{children:e(d)}),p?(0,D.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(p)}):null]}),(0,D.jsx)(i,{})]})})})})}var M=r(j);export{A as clientLoader,M as default};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{E as n,L as r,c as i,j as a,k as o}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{r as s}from"./query-client-config-CRnGSujB.js";import{o as c,t as l}from"./declaration-CR6HMp29.js";import{t as u}from"./useTranslation-B6voJV4y.js";import{n as d,t as f}from"./use-settings-nav-items-BGMFn25b.js";import{t as p}from"./utils-DCVfKFRt.js";import{t as m}from"./option-service.api-CGNANEcT.js";import{i as h,t as g}from"./query-keys-tAsQcc_9.js";import"./navigation-link-U4vY9i_C.js";import"./use-cloud-current-user-id-ClKFPjFz.js";import{t as _}from"./sidebar-nav-link-dgVb8Fpy.js";import"./close-BU5iTc66.js";import{r as v}from"./typography-BDgnT7Yp.js";import"./settings-gear-Dd8K2_8B.js";import{n as y,r as b}from"./settings-utils-DY04tWG1.js";import{t as x}from"./settings-section-header-context-DewwJ0-F.js";import{t as S}from"./use-breakpoint-DF_RiQ6s.js";import{t as C}from"./backend-synced-settings-badge-BkW5evM0.js";import{t as w}from"./settings-like-page-layout-classes-D7YjdTd0.js";import{t as T}from"./acp-route-guard-HPk6TV-L.js";var E=e(t(),1),D=c();function O({navigationItems:e}){let{t}=u(`openhands`),n=e.filter(e=>e.type===`item`);return(0,D.jsxs)(`aside`,{"data-testid":`settings-navbar-desktop`,className:p(`hidden md:flex md:w-[260px] md:shrink-0 md:flex-col md:gap-2`,`md:sticky md:top-8 md:self-start md:pl-8`),children:[(0,D.jsx)(v.Text,{className:`px-2 text-sm font-normal text-white`,children:t(l.SETTINGS$TITLE)}),(0,D.jsx)(`div`,{className:`flex flex-col gap-0.5 pt-0.5`,children:n.map(e=>(0,D.jsx)(_,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon,disabled:e.disabled,disabledReason:e.disabled&&e.disabledAgentName?t(l.SETTINGS$AGENT_DISABLED_TOOLTIP,{agentName:e.disabledAgentName}):void 0},e.item.to))}),(0,D.jsx)(`div`,{className:`px-2 pt-3`,children:(0,D.jsx)(C,{})})]})}function k({children:e,navigationItems:t}){return(0,D.jsx)(`div`,{className:`flex h-full flex-col md:pt-8`,children:(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 gap-10 md:items-start`,children:[(0,D.jsx)(O,{navigationItems:t}),(0,D.jsx)(`main`,{className:w,children:(0,D.jsx)(`div`,{className:`mx-auto w-full min-w-0 max-w-[800px]`,children:e})})]})})}var A=async({request:e})=>{let{pathname:t}=new URL(e.url),r=(await s.fetchQuery({queryKey:h.WEB_CLIENT_CONFIG,queryFn:m.getConfig,...g}))?.feature_flags;if(b(t,r)){let e=y(r);if(e&&e!==t)return n(e)}if(d.find(e=>e.to===t)?.disabledByAcp){let e=await T();if(e)return e}return null};function j(){let{t:e}=u(`openhands`),t=o(),n=a(),r=f(),s=S(768),[c,l]=(0,E.useState)(!1),{currentSectionTitle:d,currentSectionSubtitle:p}=(0,E.useMemo)(()=>{let e=r.find(e=>e.type===`item`&&e.item.to===t.pathname);if(e?.type===`item`)return{currentSectionTitle:e.item.text,currentSectionSubtitle:e.item.subtitle};let n=r.find(e=>e.type===`item`);return n?.type===`item`?{currentSectionTitle:n.item.text,currentSectionSubtitle:n.item.subtitle}:{currentSectionTitle:`SETTINGS$TITLE`,currentSectionSubtitle:null}},[r,t.pathname]),m=n.find(e=>e.pathname===t.pathname)?.handle,h=s&&t.pathname===`/settings`;return(0,D.jsx)(`main`,{"data-testid":`settings-screen`,className:`min-h-0`,children:(0,D.jsx)(x,{setHideSectionHeader:l,children:(0,D.jsx)(k,{navigationItems:r,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-6 pb-8`,children:[!(m?.hideTitle===!0||h||c)&&(0,D.jsxs)(`header`,{className:`space-y-1`,children:[(0,D.jsx)(v.H2,{children:e(d)}),p?(0,D.jsx)(`p`,{"data-testid":`settings-page-subtitle`,className:`text-sm leading-5 text-tertiary-light`,children:e(p)}):null]}),(0,D.jsx)(i,{})]})})})})}var M=r(j);export{A as clientLoader,M as default};
@@ -1 +1 @@
1
- import{L as e,s as t}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{t as a}from"./use-settings-nav-items-BcSbo02d.js";import{t as o}from"./use-config-OIMQLQ2s.js";import{t as s}from"./sidebar-nav-link-OhIeFyna.js";import{r as c}from"./typography-BDgnT7Yp.js";import{n as l}from"./settings-utils-DY04tWG1.js";import{t as u}from"./use-breakpoint-DF_RiQ6s.js";import{t as d}from"./backend-synced-settings-badge-BTIj-Ffq.js";var f=n();function p({navigationItems:e}){let{t}=i(`openhands`),n=e.filter(e=>e.type===`item`);return(0,f.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,f.jsx)(c.H2,{children:t(r.SETTINGS$TITLE)}),(0,f.jsx)(`nav`,{className:`flex flex-col gap-0.5`,children:n.map(e=>(0,f.jsx)(s,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to))}),(0,f.jsx)(`div`,{className:`pt-1`,children:(0,f.jsx)(d,{})})]})}var m=e(function(){let e=u(768),n=a(),{data:r}=o();return e?(0,f.jsx)(p,{navigationItems:n}):(0,f.jsx)(t,{to:l(r?.feature_flags)??`/settings/app`,replace:!0})});export{m as default};
1
+ import{L as e,s as t}from"./vendor~entry.client~root~root-layout~index-redirect~home~conversation-panel~conversation~la~cnj3raoq-DTEXlLSB.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{t as a}from"./use-settings-nav-items-BGMFn25b.js";import{t as o}from"./use-config-C9pvb0Sm.js";import{t as s}from"./sidebar-nav-link-dgVb8Fpy.js";import{r as c}from"./typography-BDgnT7Yp.js";import{n as l}from"./settings-utils-DY04tWG1.js";import{t as u}from"./use-breakpoint-DF_RiQ6s.js";import{t as d}from"./backend-synced-settings-badge-BkW5evM0.js";var f=n();function p({navigationItems:e}){let{t}=i(`openhands`),n=e.filter(e=>e.type===`item`);return(0,f.jsxs)(`div`,{"data-testid":`settings-mobile-hub`,className:`flex flex-col gap-4 px-4 py-2 md:hidden`,children:[(0,f.jsx)(c.H2,{children:t(r.SETTINGS$TITLE)}),(0,f.jsx)(`nav`,{className:`flex flex-col gap-0.5`,children:n.map(e=>(0,f.jsx)(s,{to:e.item.to,label:t(e.item.text),end:!0,testId:`sidebar-settings-${e.item.to}`,icon:e.item.icon},e.item.to))}),(0,f.jsx)(`div`,{className:`pt-1`,children:(0,f.jsx)(d,{})})]})}var m=e(function(){let e=u(768),n=a(),{data:r}=o();return e?(0,f.jsx)(p,{navigationItems:n}):(0,f.jsx)(t,{to:l(r?.feature_flags)??`/settings/app`,replace:!0})});export{m as default};
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{N as a,t as o}from"./utils-DCVfKFRt.js";import{n as s}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js";import{t as c}from"./modal-backdrop-RfNCrSpK.js";import{r as l,t as u}from"./modal-body-aoa2fx5W.js";import{t as d}from"./base-modal-C2oy2EBG.js";import{t as f}from"./modal-classes-6YqcqA6y.js";import{t as p}from"./brand-button-DJ_S16rO.js";import{n as m}from"./navigation-context-BdKYH32C.js";import{t as h}from"./model-selector-BvSTrkhT.js";import{t as g}from"./settings-input-CehsXnb3.js";import{t as _}from"./settings-DGY6n4J2.js";import{t as v}from"./use-save-settings-DkAOEfD9.js";import{t as y}from"./settings-utils-DY04tWG1.js";import{d as b,i as x}from"./sdk-settings-schema-CLmJ9sho.js";var S=e(t(),1),C=n();function w({testId:e,title:t,description:n,buttons:r}){return(0,C.jsx)(d,{testId:e,title:t,description:n,buttons:[{text:r.danger.text,onClick:r.danger.onClick,className:`bg-danger`},{text:r.cancel.text,onClick:r.cancel.onClick,className:`bg-[var(--oh-interactive-selected)]`}]})}function T({settings:e,onClose:t}){let n=s(),{mutate:o}=v(),{currentPath:l}=m(),{t:u}=i(`openhands`),d=S.useRef(null),[f,_]=S.useState(!1),T=async e=>{let r=y(e);await o(r,{onSuccess:()=>{t();let e=r.agent_settings_diff?.llm??{};n.capture(`settings_saved`,{LLM_MODEL:e.model,LLM_API_KEY_SET:e.api_key?`SET`:`UNSET`,SEARCH_API_KEY_SET:r.search_api_key?`SET`:`UNSET`,REMOTE_RUNTIME_RESOURCE_FACTOR:r.remote_runtime_resource_factor})}})},E=()=>{T(new FormData(d.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);l.startsWith(`/conversations/`)?_(!0):T(t)},O=e.llm_api_key_set,k=x(e,`llm.model`),A=x(e,`llm.base_url`);return(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`form`,{ref:d,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,C.jsx)(h,{currentModel:typeof k==`string`?k:void 0,currentBaseUrl:typeof A==`string`?A:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(g,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(r.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(b,{testId:`llm-api-key-help-anchor`,text:u(r.SETTINGS$DONT_KNOW_API_KEY),linkText:u(r.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,C.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,C.jsx)(p,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:u(r.BUTTON$SAVE)})})]}),f&&(0,C.jsx)(c,{children:(0,C.jsx)(w,{title:u(r.MODAL$END_SESSION_TITLE),description:u(r.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(r.BUTTON$END_SESSION),onClick:E},cancel:{text:u(r.BUTTON$CANCEL),onClick:()=>_(!1)}}})})]})}function E({onClose:e,settings:t}){let{t:n}=i(`openhands`);return(0,C.jsx)(c,{children:(0,C.jsxs)(`div`,{"data-testid":`ai-config-modal`,className:o(`bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal`,l(`md`),u),children:[(0,C.jsx)(`span`,{className:f,children:n(r.AI_SETTINGS$TITLE)}),(0,C.jsx)(b,{testId:`advanced-settings-link`,text:`${n(r.SETTINGS$DESCRIPTION)}. ${n(r.SETTINGS$FOR_OTHER_OPTIONS)} ${n(r.COMMON$SEE)}`,linkText:n(r.COMMON$ADVANCED_SETTINGS),href:`/settings`,suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,C.jsx)(T,{settings:t||_,onClose:e})]})})}export{E as SettingsModal};
1
+ import{a as e}from"./rolldown-runtime-BFRubm34.js";import{t}from"./react-CM_dJw1Z.js";import{o as n,t as r}from"./declaration-CR6HMp29.js";import{t as i}from"./useTranslation-B6voJV4y.js";import{N as a,t as o}from"./utils-DCVfKFRt.js";import{n as s}from"./vendor~entry.client~root~root-layout~home~conversation-panel~conversation~launch~skills-set~jfc6hidu-DJS-rJdI.js";import{t as c}from"./modal-backdrop-RfNCrSpK.js";import{r as l,t as u}from"./modal-body-aoa2fx5W.js";import{t as d}from"./base-modal-C2oy2EBG.js";import{t as f}from"./modal-classes-6YqcqA6y.js";import{t as p}from"./brand-button-DJ_S16rO.js";import{n as m}from"./navigation-context-BdKYH32C.js";import{t as h}from"./model-selector-DcztJSxT.js";import{t as g}from"./settings-input-CehsXnb3.js";import{t as _}from"./settings-DGY6n4J2.js";import{t as v}from"./use-save-settings-uXXkqvD7.js";import{t as y}from"./settings-utils-DY04tWG1.js";import{d as b,i as x}from"./sdk-settings-schema-CLmJ9sho.js";var S=e(t(),1),C=n();function w({testId:e,title:t,description:n,buttons:r}){return(0,C.jsx)(d,{testId:e,title:t,description:n,buttons:[{text:r.danger.text,onClick:r.danger.onClick,className:`bg-danger`},{text:r.cancel.text,onClick:r.cancel.onClick,className:`bg-[var(--oh-interactive-selected)]`}]})}function T({settings:e,onClose:t}){let n=s(),{mutate:o}=v(),{currentPath:l}=m(),{t:u}=i(`openhands`),d=S.useRef(null),[f,_]=S.useState(!1),T=async e=>{let r=y(e);await o(r,{onSuccess:()=>{t();let e=r.agent_settings_diff?.llm??{};n.capture(`settings_saved`,{LLM_MODEL:e.model,LLM_API_KEY_SET:e.api_key?`SET`:`UNSET`,SEARCH_API_KEY_SET:r.search_api_key?`SET`:`UNSET`,REMOTE_RUNTIME_RESOURCE_FACTOR:r.remote_runtime_resource_factor})}})},E=()=>{T(new FormData(d.current??void 0))},D=e=>{e.preventDefault();let t=new FormData(e.currentTarget);l.startsWith(`/conversations/`)?_(!0):T(t)},O=e.llm_api_key_set,k=x(e,`llm.model`),A=x(e,`llm.base_url`);return(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`form`,{ref:d,"data-testid":`settings-form`,className:`flex flex-col gap-6`,onSubmit:D,children:[(0,C.jsxs)(`div`,{className:`flex flex-col gap-[17px]`,children:[(0,C.jsx)(h,{currentModel:typeof k==`string`?k:void 0,currentBaseUrl:typeof A==`string`?A:void 0,wrapperClassName:`!flex-col !gap-[17px]`,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(g,{testId:`llm-api-key-input`,name:`llm-api-key-input`,label:u(r.SETTINGS_FORM$API_KEY),type:`password`,className:`w-full`,placeholder:O?`<hidden>`:``,labelClassName:a.LABEL_CLASSNAME}),(0,C.jsx)(b,{testId:`llm-api-key-help-anchor`,text:u(r.SETTINGS$DONT_KNOW_API_KEY),linkText:u(r.SETTINGS$CLICK_FOR_INSTRUCTIONS),href:`https://docs.openhands.dev/usage/local-setup#getting-an-api-key`,size:`settings`,linkColor:`white`})]}),(0,C.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,C.jsx)(p,{testId:`save-settings-button`,type:`submit`,variant:`primary`,className:`w-full`,children:u(r.BUTTON$SAVE)})})]}),f&&(0,C.jsx)(c,{children:(0,C.jsx)(w,{title:u(r.MODAL$END_SESSION_TITLE),description:u(r.MODAL$END_SESSION_MESSAGE),buttons:{danger:{text:u(r.BUTTON$END_SESSION),onClick:E},cancel:{text:u(r.BUTTON$CANCEL),onClick:()=>_(!1)}}})})]})}function E({onClose:e,settings:t}){let{t:n}=i(`openhands`);return(0,C.jsx)(c,{children:(0,C.jsxs)(`div`,{"data-testid":`ai-config-modal`,className:o(`bg-[var(--oh-surface)] m-4 p-6 rounded-xl flex flex-col gap-[17px] border border-[var(--oh-border)] api-configuration-modal`,l(`md`),u),children:[(0,C.jsx)(`span`,{className:f,children:n(r.AI_SETTINGS$TITLE)}),(0,C.jsx)(b,{testId:`advanced-settings-link`,text:`${n(r.SETTINGS$DESCRIPTION)}. ${n(r.SETTINGS$FOR_OTHER_OPTIONS)} ${n(r.COMMON$SEE)}`,linkText:n(r.COMMON$ADVANCED_SETTINGS),href:`/settings`,suffix:`.`,size:`settings`,linkColor:`white`,suffixClassName:`text-white`}),(0,C.jsx)(T,{settings:t||_,onClose:e})]})})}export{E as SettingsModal};