import{r as l,j as t}from"./vendor-react-wBh_31cN.js";import{T as x,a as d,b as v}from"./tabs-DF7ID_Y6.js";import{L as h}from"./list-page-header-DZysveul.js";import{A as j}from"./AppHeader-DMf8cB_5.js";import{S as b}from"./Suspense-Cri_MelV.js";import{G as A}from"./GlobalErrors-Cf38luW9.js";import{E as N}from"./ErrorBoundary-CEgFNZGX.js";import{$ as g,r as o}from"./index-BKr2rJhV.js";import{a as C,u as k,m as n,O as w}from"./vendor-router-D1GqFWiT.js";import{b1 as p,b2 as T,b3 as u,b4 as y,b5 as E}from"./vendor-icons-BUUmD6ht.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-radix-BRyWS4bQ.js";import"./animated-progress-BdqEbBYd.js";import"./separator-2OqrG5Vy.js";import"./value-76ihWpF6.js";import"./useColorMode-Drvxu4lz.js";import"./Search-BDh3P0Yy.js";import"./textarea-Co48BFy3.js";import"./popover-DNRIgB96.js";import"./useDebounce-BiuGz9t2.js";import"./tooltip-Da8-EbK8.js";import"./useProjectId-Ck57b-tn.js";import"./AnimatedLoadingIcon-TR9RzU0m.js";import"./includes-D04d5Ytc.js";import"./concat-AxOj0lUI.js";import"./getHopsDoc-BWSxyuXn.js";import"./sortBy-DS9fyPwj.js";import"./card-DISTA6Ay.js";import"./useLastProject-CDGr1y3w.js";import"./useSortedProjects-B0vFqd_s.js";import"./index-BeaoFlb1.js";import"./apply-BmJxqxKH.js";import"./juxt-BvCFisbd.js";import"./converge-BDz-h6lA.js";import"./icon-button-FETOk6q1.js";import"./index-30yM3lNV.js";import"./useProjectRunningActivity-DvgBm99d.js";import"./index-CHdS1Zyb.js";import"./utils-C3tzOLw4.js";import"./index-DdhqPQ_t.js";import"./time-utils-tK1noPML.js";import"./addDays-DjM7nKyN.js";import"./always-CtAmwIxm.js";import"./init-BDcDHUTz.js";import"./formatDistance-qDinyJzC.js";import"./join-DatdAzSt.js";import"./add-DCChD-X4.js";import"./lensPath-CdufhmA3.js";import"./mergeRight-Cv2eiGXV.js";import"./avatar-U0jpGcgI.js";import"./breadcrumb-B9p6X9XZ.js";import"./editable-select-Co_-YcCr.js";import"./vendor-redux-CJZrIb6x.js";import"./index-DkvW68Om.js";import"./dropdown-menu-CUHqMoVG.js";import"./useHotkeysShortcut-BupQRiR8.js";import"./slider-DINFTIw7.js";import"./switch-CZFcibv-.js";import"./input-H6_qmzms.js";import"./label-Dnebucx5.js";import"./purify.es-t2lEkcJL.js";import"./useNotifier-BCEAoFCf.js";import"./notifications-x-pTFTQl.js";import"./toast-3g7Fh-a0.js";import"./Error-ehOSFm_s.js";import"./Error404-B4n3go6x.js";import"./titles-CzjGGAB3.js";import"./vendor-grid-CeFlDWv4.js";const L=()=>{const a=C(),m=k(),{isServiceUser:s}=g(),i=l.useCallback(c=>()=>{m(c)},[m]),r=l.useCallback(c=>Array.isArray(c)?c.some(f=>!!n(f,a.pathname)):!!n(c,a.pathname),[a]),e="w-4 h-4";return{tabs:l.useMemo(()=>[...s?[]:[{title:"Profile",icon:t.jsx(p,{className:e}),isActive:r(o.account.profile),onClick:i(o.account.profile)},{title:"Authentication",icon:t.jsx(T,{className:e}),isActive:r(o.account.auth),onClick:i(o.account.auth)}],{title:"API",icon:t.jsx(u,{className:e}),isActive:r([o.account.api.edit,o.account.api.create,o.account.api.list]),onClick:i(o.account.api.list)},{title:"Secrets",icon:t.jsx(y,{className:e}),isActive:r([o.account.secrets.create,o.account.secrets.list]),onClick:i(o.account.secrets.list)},...s?[]:[{title:"Git Providers",icon:t.jsx(E,{className:e}),isActive:r([o.account.git]),onClick:i(o.account.git)}],...s?[]:[{title:"Environment Variables",icon:t.jsx(u,{className:e}),isActive:r([o.account.envVars]),onClick:i(o.account.envVars)}],...s?[{title:"Profile",icon:t.jsx(p,{className:e}),isActive:r(o.account.profile),onClick:i(o.account.profile)}]:[]],[r,i,s])}},Dt=()=>{var s;const{tabs:a}=L(),m=(s=a.find(i=>i.isActive))==null?void 0:s.title;return t.jsxs("div",{className:"flex w-full h-full flex-col overflow-x-hidden",children:[t.jsx(j,{sectionTitle:"Account settings"}),t.jsx(h,{portal:!1,tabs:t.jsx(x,{value:m,onValueChange:i=>{var r;return(r=a.find(e=>e.title===i))==null?void 0:r.onClick()},children:t.jsx(d,{variant:"line",children:a.map(i=>t.jsxs(v,{value:i.title,className:"flex items-center gap-1.5",children:[i.icon,i.title]},i.title))})})}),t.jsx("div",{className:"flex w-full flex-1 min-h-0 overflow-hidden",children:t.jsx("div",{className:"flex-grow flex justify-center min-w-[900px] p-5 pb-0 relative bg-muted overflow-auto",id:"content",children:t.jsx("div",{className:"flex w-full h-full max-w-[1000px] min-h-full flex-col",children:t.jsx(N,{children:t.jsx(b,{children:t.jsx(A,{children:t.jsx(w,{})})})})})})})]})};export{Dt as default};
