import{u,A as h,j as e,d as s,R as i,D as d,L as p,a as x,b as m,g as j,i as g,N as o}from"./index-C88DWJny.js";const N=()=>{const{data:a}=u(),t=a?.auth_methods?.includes(h.OIDC);return e.jsxs("div",{className:"auth-options-container",children:[e.jsxs(s.Card,{className:"auth-option-card u-flex-column",children:[e.jsx(s.Icon,{name:"security",className:"auth-option-icon u-hide--small"}),e.jsx("h2",{className:"p-heading--4",children:"SSO"}),e.jsxs("ul",{className:"auth-option-pros-cons-list",children:[e.jsx("li",{children:"Centralized access control for teams"}),e.jsx("li",{children:"Requires an external identity provider"})]}),t&&e.jsx("a",{className:"p-button--positive auth-option-link",href:`${i}/oidc/login`,children:"Login with SSO"}),!t&&e.jsx(d,{docPath:"/howto/oidc",className:"p-button--positive auth-option-link",children:"Set up SSO login"})]}),e.jsxs(s.Card,{className:"auth-option-card u-flex-column",children:[e.jsx(s.Icon,{name:"certificate",className:"auth-option-icon u-hide--small"}),e.jsx("h2",{className:"p-heading--4",children:"TLS"}),e.jsxs("ul",{className:"auth-option-pros-cons-list",children:[e.jsx("li",{children:"Quick setup with a browser certificate"}),e.jsx("li",{children:"No external identity provider required"})]}),e.jsx(p,{className:"p-button auth-option-link",to:`${i}/ui/login/certificate-generate`,children:"Set up TLS login"})]})]})},S=()=>{const{isAuthLoading:a,isAuthenticated:t,authMethod:c,authExpiresAt:r}=x(),l=m(r),n=j(l);return a?e.jsx(s.Spinner,{className:"u-loader",text:"Loading...",isMainComponent:!0}):t&&g(c)?e.jsx(o,{to:`${i}/ui/permissions/identities`,replace:!0}):t?e.jsx(s.CustomLayout,{contentClassName:"authentication-setup empty-state",children:e.jsxs(s.Row,{children:[e.jsx("h1",{className:"p-heading--4 u-sv3",children:"Set up permanent access"}),n&&e.jsx(s.Notification,{severity:"caution",children:n}),e.jsx(N,{})]})}):e.jsx(o,{to:`${i}/ui/login`,replace:!0})};export{S as default};
