import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{D as t,b as n,un as r,x as i,y as a,zt as o}from"./app-initial~avatarOverlayCompositionSurface~index-9fQ9wihu~index-BFCcxPM5~mapbox-gl-DVWlwqb~kppdhley-CabsBVhy.js";import{m as s,p as c}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~ngwudnyz-D_QFwR2V.js";import{d as l,g as u,o as d}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~dejrazf4-CyNQP50P.js";import{a as f,s as p}from"./app-initial~avatarOverlayCompositionSurface~artifact-tab-content.electron~notebook-preview-~nssizff1-CJzQAI5S.js";import{Df as m,Vg as h,hh as g,kf as _}from"./app-initial~artifact-tab-content.electron~notebook-preview-panel~app-main~business-checkout~oxnpxkxc-CRvN_72X.js";import{o as v,r as y}from"./app-initial~artifact-tab-content.electron~notebook-preview-panel~app-main~business-checkout~c1u3yp5s-gStRzqf8.js";import{i as b,r as x}from"./app-initial~artifact-tab-content.electron~notebook-preview-panel~app-main~settings-command-~ab38dkdb-Bi8FgRuL.js";import{d as S,u as C}from"./app-initial~artifact-tab-content.electron~app-main~settings-command-menu-section-items~pull~opk4tq05-DMxVyjJC.js";import{Ht as w,Ut as T}from"./app-initial~app-main~settings-command-menu-section-items~new-thread-panel-page~settings-pag~bzu8y8ld-CsDn751h.js";import{l as E,u as D}from"./app-initial~app-main~settings-command-menu-section-items~appgen-settings-page~page~pull-req~nb6vzw6f-CUA7JZmW.js";import{a as O,i as k,n as A,o as j,r as M,s as N,t as P}from"./use-visible-settings-sections-YADj2flH.js";function F(e){let t=(0,z.c)(8),{close:n,isSelectedHostLocal:r,selectedHostId:i}=e,a=p(O),{visibleSettingsSections:o}=A(null,r,i),s;t[0]===o?s=t[1]:(s=o.filter(I),t[0]=o,t[1]=s);let c=s;if(c.length===0)return null;let l;t[2]===a?l=t[3]:(l=[j.account,...a?[j.securitySettings]:[]],t[2]=a,t[3]=l);let u;return t[4]!==n||t[5]!==c||t[6]!==l?(u=(0,B.jsx)(L,{close:n,externalItems:l,settingsSections:c}),t[4]=n,t[5]=c,t[6]=l,t[7]=u):u=t[7],u}function I(e){return!e.disabled}function L(e){let t=(0,z.c)(17),{close:n,externalItems:r,settingsSections:i}=e,a=u(),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,B.jsx)(`span`,{className:`block px-2 pt-2 text-sm text-token-description-foreground`,children:(0,B.jsx)(l,{id:`codex.commandMenu.settingsGroup`,defaultMessage:`Settings`,description:`Command group label for settings sections in the command menu`})}),t[0]=o):o=t[0];let s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s={gap:`var(--spacing)`},t[1]=s):s=t[1];let c;if(t[2]!==n||t[3]!==i){let e;t[5]===n?e=t[6]:(e=e=>(0,B.jsx)(R,{close:n,section:e},e.slug),t[5]=n,t[6]=e),c=i.map(e),t[2]=n,t[3]=i,t[4]=c}else c=t[4];let d;if(t[7]!==n||t[8]!==r||t[9]!==a){let e;t[11]!==n||t[12]!==a?(e=e=>{let t=a.formatMessage(e.message);return(0,B.jsx)(w,{value:`settings ${t}`,title:t,LeftIcon:e.icon,RightIcon:x,onSelect:()=>{v({href:e.href,initiator:`open_in_browser_bridge`,openTarget:`external-browser`}),n()}},e.href)},t[11]=n,t[12]=a,t[13]=e):e=t[13],d=r.map(e),t[7]=n,t[8]=r,t[9]=a,t[10]=d}else d=t[10];let f;return t[14]!==c||t[15]!==d?(f=(0,B.jsxs)(C.Group,{heading:o,className:`flex flex-col`,style:s,children:[c,d]}),t[14]=c,t[15]=d,t[16]=f):f=t[16],f}function R(e){let n=(0,z.c)(14),{close:r,section:i}=e,o=t(a),c=u(),l;n[0]!==c||n[1]!==i.slug?(l=c.formatMessage(E(i.slug)),n[0]=c,n[1]=i.slug,n[2]=l):l=n[2];let d=l,f=`settings ${d}${i.slug===`mcp-settings`?` mcp settings`:i.slug===`personalization`?` personality tone`:``}`,p=M[i.slug],m=i.externalUrl==null?void 0:x,h;n[3]!==r||n[4]!==o||n[5]!==i.externalUrl||n[6]!==i.slug?(h=()=>{i.externalUrl==null?(i.slug===`profile`&&_(o,g,{source:`command_menu`}),s.dispatchHostMessage({type:`navigate-to-route`,path:`/settings/${i.slug}`})):v({href:i.externalUrl,initiator:`open_in_browser_bridge`}),r()},n[3]=r,n[4]=o,n[5]=i.externalUrl,n[6]=i.slug,n[7]=h):h=n[7];let y;return n[8]!==f||n[9]!==p||n[10]!==m||n[11]!==h||n[12]!==d?(y=(0,B.jsx)(w,{value:f,title:d,LeftIcon:p,RightIcon:m,onSelect:h}),n[8]=f,n[9]=p,n[10]=m,n[11]=h,n[12]=d,n[13]=y):y=n[13],y}var z,B;e((()=>{z=r(),h(),S(),i(),d(),y(),T(),b(),c(),m(),n(),N(),k(),D(),P(),f(),B=o()}))();export{F as VisibleSettingsCommandMenuSectionItems};
//# sourceMappingURL=settings-command-menu-section-items-CuU1Qq6y.js.map