1import{r as u,j as e}from"./index-gbXHz-HS.js";import{u as j,a as g,b as v,S as y,P as D,z as C,T as m,B as c,D as b,C as N,E as L,F as S,G as $}from"./KcAccountUi-CbyT35HH.js";import{E as w,D as I}from"./EmptyRow-8X8eSPGK.js";import{f as k}from"./formatDate-D-Baz9Me.js";import{T as E}from"./Trans-Bu6jal5q.js";import{S as A,a as x}from"./SplitItem-CCBQUU0x.js";import{D as T,a as M,b as P}from"./DataListItemRow-C_ROuSAP.js";import{D as F,a as h}from"./DataListItemCells--Y3bhETT.js";import"./KcPage-Cf3e0vqV.js";import"./assert-lEPzpKR_.js";const R=({title:a,onClick:d,testid:n})=>{const[l,p]=u.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(b,{popperProps:{position:"right"},onOpenChange:r=>p(r),toggle:r=>e.jsx(N,{className:"pf-v5-u-display-none-on-lg",ref:r,variant:"plain",onClick:()=>p(!l),isExpanded:l,children:e.jsx(L,{})}),isOpen:l,children:e.jsx(S,{onClick:d,children:a},"1")}),e.jsx(c,{variant:"link",onClick:d,className:"pf-v5-u-display-none pf-v5-u-display-inline-flex-on-lg","data-testid":n,children:a})]})},H=()=>{const{t:a}=j(),d=g(),{login:n}=d.keycloak,[l,p]=u.useState();v(s=>$({signal:s,context:d}),p,[]);const r=s=>{const t=s.credential,i={"--pf-v5-u-max-width--MaxWidth":"300px"},o=[e.jsx(h,{"data-testrole":"label",className:"pf-v5-u-max-width",style:i,children:a(t.userLabel)||a(t.type)},"title")];return t.createdDate&&o.push(e.jsx(h,{"data-testrole":"created-at",children:e.jsxs(E,{i18nKey:"credentialCreatedAt",children:[e.jsx("strong",{className:"pf-v5-u-mr-md"}),{date:k(new Date(t.createdDate))}]})},"created"+t.id)),o};if(!l)return e.jsx(y,{});const f=[...new Set(l.map(s=>s.category))];return e.jsx(D,{title:a("signingIn"),description:a("signingInDescription"),children:f.map(s=>e.jsxs(C,{variant:"light",className:"pf-v5-u-px-0",children:[e.jsx(m,{headingLevel:"h2",size:"xl",id:`${s}-categ-title`,children:a(s)}),l.filter(t=>t.category==s).map(t=>e.jsxs(e.Fragment,{children:[e.jsxs(A,{className:"pf-v5-u-mt-lg pf-v5-u-mb-lg",children:[e.jsxs(x,{children:[e.jsx(m,{headingLevel:"h3",size:"md",className:"pf-v5-u-mb-md","data-testid":`${t.type}/help`,children:e.jsx("span",{className:"cred-title pf-v5-u-display-block","data-testid":`${t.type}/title`,children:a(t.displayName)})}),e.jsx("span",{"data-testid":`${t.type}/help-text`,children:a(t.helptext)})]}),t.createAction&&e.jsx(x,{isFilled:!0,children:e.jsx("div",{className:"pf-v5-u-float-right",children:e.jsx(R,{onClick:()=>n({action:t.createAction}),title:a("setUpNew",{name:a(`${t.type}-display-name`)}),testid:`${t.type}/create`})})})]}),e.jsxs(T,{"aria-label":"credential list",className:"pf-v5-u-mb-xl","data-testid":`${t.type}/credential-list`,children:[t.userCredentialMetadatas.length===0&&e.jsx(w,{message:a("notSetUp",{name:a(t.displayName)}),"data-testid":`${t.type}/not-set-up`}),t.userCredentialMetadatas.map(i=>e.jsx(M,{children:e.jsx(P,{id:`cred-${i.credential.id}`,children:e.jsx(F,{className:"pf-v5-u-py-0",dataListCells:[...r(i),e.jsx(I,{id:`action-${i.credential.id}`,"aria-label":a("updateCredAriaLabel"),"aria-labelledby":`cred-${i.credential.id}`,children:t.removeable?e.jsx(c,{variant:"danger","data-testrole":"remove",onClick:()=>{n({action:"delete_credential:"+i.credential.id})},children:a("delete")}):e.jsx(c,{variant:"secondary",onClick:()=>{t.updateAction&&n({action:t.updateAction})},"data-testrole":"update",children:a("update")})},"action")]})})},i.credential.id))]})]}))]},s))})};export{H as SigningIn,H as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.