import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{un as t,zt as n}from"./app-initial~avatarOverlayCompositionSurface~index-9fQ9wihu~index-BFCcxPM5~mapbox-gl-DVWlwqb~kppdhley-CabsBVhy.js";import{d as r,g as i,o as a}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~dejrazf4-CyNQP50P.js";import{c as o,l as s}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~dg0b1kws-BsrA2AI_.js";import{i as c,n as l}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~g8980z4e-CwatHxhA.js";import{r as u,s as d,t as f}from"./app-initial~artifact-tab-content.electron~notebook-preview-panel~app-main~appgen-settings-p~evbmo86c-BAVWa1vf.js";import{c as p,g as m,h,l as g}from"./app-initial~app-main~new-thread-panel-page~settings-page~projects-index-page~appgen-library~lo3xk1s3-BCJngGjH.js";import{a as _,c as v}from"./app-initial~app-main~settings-command-menu-section-items~appgen-settings-page~page~pull-req~nb6vzw6f-CUA7JZmW.js";function y(e){let t=(0,x.c)(39),{connectedRemoteConnections:n,disabled:a,onSelectHost:s,selectedHostId:l,align:d,contentWidth:m,localIcon:g,localLabel:v,showConnectedIndicator:y,triggerClassName:C,triggerColor:w}=e,T=a===void 0?!1:a,E=g===void 0?h:g,D=y===void 0?!1:y,O=i(),k;t[0]!==n||t[1]!==l?(k=n.find(e=>e.hostId===l)??null,t[0]=n,t[1]=l,t[2]=k):k=t[2];let A=k,j;t[3]!==O||t[4]!==v?(j=v??O.formatMessage({id:`settings.hostDropdown.local`,defaultMessage:`Local`,description:`Label for the local host in settings connection dropdowns`}),t[3]=O,t[4]=v,t[5]=j):j=t[5];let M=j,N=A?.displayName??M,P;t[6]===M?P=t[7]:(P={hostId:c,displayName:M},t[6]=M,t[7]=P);let F;t[8]!==n||t[9]!==P?(F=[P,...n],t[8]=n,t[9]=P,t[10]=F):F=t[10];let I=F,L=T?`hidden`:void 0,R;t[11]!==E||t[12]!==A?(R=A==null?(0,S.jsx)(E,{className:`icon-xs shrink-0 text-token-foreground`}):(0,S.jsx)(p,{className:`icon-xs shrink-0`,hostId:A.hostId}),t[11]=E,t[12]=A,t[13]=R):R=t[13];let z;t[14]===N?z=t[15]:(z=(0,S.jsx)(`span`,{className:`truncate text-left text-token-foreground`,children:N}),t[14]=N,t[15]=z);let B;t[16]!==A||t[17]!==D?(B=A!=null&&D?(0,S.jsx)(b,{}):null,t[16]=A,t[17]=D,t[18]=B):B=t[18];let V;t[19]!==T||t[20]!==z||t[21]!==B||t[22]!==L||t[23]!==R||t[24]!==C||t[25]!==w?(V=(0,S.jsxs)(_,{className:C,color:w,disabled:T,chevronClassName:L,children:[R,z,B]}),t[19]=T,t[20]=z,t[21]=B,t[22]=L,t[23]=R,t[24]=C,t[25]=w,t[26]=V):V=t[26];let H=V;if(T)return H;let U=d??`end`,W=m??`menuWide`,G;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,S.jsx)(u.Title,{children:(0,S.jsx)(r,{id:`settings.hostDropdown.title`,defaultMessage:`Host`,description:`Title for the Host dropdown shown in settings pages`})}),t[27]=G):G=t[27];let K;t[28]!==E||t[29]!==I||t[30]!==s||t[31]!==l||t[32]!==D?(K=(0,S.jsx)(u.Section,{className:`max-h-40 overflow-y-auto`,children:I.map(e=>(0,S.jsx)(u.Item,{RightIcon:e.hostId===l?o:void 0,onSelect:()=>{s(e.hostId)},children:(0,S.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[e.hostId===`local`?(0,S.jsx)(E,{className:`icon-xs shrink-0`}):(0,S.jsx)(p,{className:`icon-xs shrink-0`,hostId:e.hostId}),(0,S.jsx)(`span`,{className:`truncate`,children:e.displayName}),e.hostId!==`local`&&D?(0,S.jsx)(b,{}):null]})},e.hostId))}),t[28]=E,t[29]=I,t[30]=s,t[31]=l,t[32]=D,t[33]=K):K=t[33];let q;return t[34]!==U||t[35]!==W||t[36]!==K||t[37]!==H?(q=(0,S.jsxs)(f,{align:U,contentWidth:W,triggerButton:H,children:[G,K]}),t[34]=U,t[35]=W,t[36]=K,t[37]=H,t[38]=q):q=t[38],q}function b(){let e=(0,x.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,S.jsx)(`span`,{"aria-hidden":!0,className:`block size-2 shrink-0 rounded-full bg-green-500`}),e[0]=t):t=e[0],t}var x,S,C=e((()=>{x=t(),a(),d(),g(),s(),m(),l(),v(),S=n()}));export{C as n,y as t};
//# sourceMappingURL=settings-host-dropdown-BHYosch6.js.map