1import{b as k}from"./chunk-JXZHDPXA.js";import{a as E}from"./chunk-SORVIIVG.js";import{a as D}from"./chunk-5KHC7EZS.js";import{a as Ce,b as he,c as be}from"./chunk-FWTG5XIZ.js";import{i as _e}from"./chunk-ACJ3NLO5.js";import{B as fe,G as ue,J as ge,d as oe,f as se,g as ce,l as le,m as de,y as me,z as pe}from"./chunk-GPVZISOV.js";import"./chunk-45WCVJBT.js";import"./chunk-74CDSVWG.js";import{U as ie,Z as ne,ga as re,na as ae,q as S}from"./chunk-SEQCRKB6.js";import{$a as W,Aa as M,C as O,D as $,Db as T,E as h,Ea as g,F as H,Fa as _,Ga as c,O as G,Pb as ee,Tb as te,U as b,V as L,Y as s,Ya as K,Z as f,_ as u,_a as Q,cb as v,db as F,ia as l,la as q,ma as z,n as N,ob as X,pa as J,pb as Y,qa as x,rb as Z,s as y,u as B,xa as o,ya as d,za as m}from"./chunk-HBLARLGW.js";var I=class{},A=class{},U=class{};var w=class extends ne{};var j=(()=>{let n=class n{constructor(){this.http=s(T),this.accessService=s(D),this.config=s(w),this.pages=s(ae),this.flowsService=s(E),this.protectedUiService=s(k)}getFidoCredentialManagement(){return this.fetchFidoCredentials().pipe(H(t=>this.flowsService.retrieveSelfServiceFlows().pipe(y(e=>this.createManagement(t,e)))))}navigateToExitTarget(){this.pages.routes.navigateTo(this.config.pageExitTarget)}startFlowToAddFidoCredential(){let t=this.config.flowToRegisterCredential;return this.protectedUiService.startFlow(t).pipe(h(e=>this.handleAccessError(e,this.pages.routes.protected.select.flow.append(t).url,t)))}startFlowToEditCredential(t){return this.startFlowAndSelectCredential(t,this.config.flowToChangeDisplayName,"select")}startFlowToDeleteCredential(t){return this.startFlowAndSelectCredential(t,this.config.flowToDeleteCredential,"remove")}startFlowToDisableCredential(t){return this.startFlowAndSelectCredential(t,this.config.flowToDisableCredential,"disable")}startFlowToEnableCredential(t){return this.startFlowAndSelectCredential(t,this.config.flowToEnableCredential,"enable")}getUiConfig(){return N(this.config)}fetchFidoCredentials(){return this.http.get(S(["/protected","self-service","fido","credentials"])).pipe(y(t=>this.toCredentials(t.data)),h(t=>this.handleErrorResponse(t)))}createManagement(t,e){let a=new U;return a.credentials=t,a.canRegister=e.isAccessible(this.config.flowToRegisterCredential),a.canRename=e.isAccessible(this.config.flowToChangeDisplayName),a.canDelete=e.isAccessible(this.config.flowToDeleteCredential),a.canDisable=e.isAccessible(this.config.flowToDisableCredential),a.canEnable=e.isAccessible(this.config.flowToEnableCredential),a.hasExitTarget=!!this.config.pageExitTarget,a}handleErrorResponse(t){return t.status===404?N([]):this.handleAccessError(t,this.pages.routes.protected.tokens.fido.credentials.url)}handleAccessError(t,e,a){return this.accessService.handleAccessError(t,e,a)}toCredentials(t){return t.map(e=>this.toCredential(e))}toCredential(t){let e=new I;return e.id=t.id,e.displayName=t.attributes.displayName,e.registrationDate=t.attributes.registrationDate,e.lastUsageDate=t.attributes.lastUsageDate,e.enabled=t.attributes.enabled,e.authenticator=this.toAuthenticator(t.attributes),e}toAuthenticator(t){let e=new A;if(e.aaguid=t.authenticator?.aaguid,e.model=t.authenticator?.model,e.aaguid||e.model)return e}startFlowAndSelectCredential(t,e,a){return this.protectedUiService.startFlow(e).pipe(B(()=>this.selectFidoCredential(t.id,a)),h(P=>this.handleAccessError(P,this.pages.routes.protected.tokens.fido.credentials.url,e)))}selectFidoCredential(t,e){return this.http.post(S(["/protected","self-service","fido","credentials",t,e]),null,{observe:"response"}).pipe(y(a=>new re(a)))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=b({token:n,factory:n.\u0275fac});let i=n;return i})();var R=(()=>{let n=class n{constructor(){this.http=s(T)}getCredentialManagementUiConfig(){return this.http.get(S(["protected","self-service","ui","configuration","tokens","fido"]))}};n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=b({token:n,factory:n.\u0275fac});let i=n;return i})();var p=class p{constructor(){this.service=s(R),this.accessService=s(D),this.routes=s(ie)}resolve(){return this.service.getCredentialManagementUiConfig().pipe(h(n=>
1(n.status===404?this.routes.error.notFound.navigate():this.accessService.handleAccessError(n,this.routes.protected.tokens.fido.credentials.url),O)))}static resolveConfig(n){return n.snapshot.data.credentialManagementConfig}};p.PROVIDER={provide:w,useFactory:p.resolveConfig,deps:[ee]},p.\u0275fac=function(r){return new(r||p)},p.\u0275prov=b({token:p,factory:p.\u0275fac});var C=p;var ve=i=>({keyPrefix:"protected.tokens.fido.credential.states",values:i}),Fe=(i,n)=>({type:i,state:n});function we(i,n){i&1&&M(0,"iam-alert",5),i&2&&o("id","fidoCredentialsMissing")("text","protected.tokens.fido.credential.missing")("type","info")}function Se(i,n){if(i&1&&(M(0,"iam-text-row",7),v(1,"formatDate")),i&2){let r=c(),t=r.$implicit,e=r.index;o("id","fidoCredentialLastUsage["+e+"]")("label","protected.tokens.fido.credential.last-usage")("value",F(1,3,t.lastUsageDate))}}function ye(i,n){if(i&1){let r=g();d(0,"iam-button",11),_("buttonClick",function(){f(r);let e=c().$implicit,a=c(2);return u(a.changeFidoCredentialDisplayName(e))}),m()}if(i&2){let r=c().index;o("id","renameFidoCredential["+r+"]")("text","protected.tokens.fido.credential.actions.rename")}}function Me(i,n){if(i&1){let r=g();d(0,"iam-button",11),_("buttonClick",function(){f(r);let e=c().$implicit,a=c(2);return u(a.enableFidoCredential(e))}),m()}if(i&2){let r=c().index;o("id","enableFidoCredential["+r+"]")("text","protected.tokens.fido.credential.actions.enable")}}function Te(i,n){if(i&1){let r=g();d(0,"iam-button",11),_("buttonClick",function(){f(r);let e=c().$implicit,a=c(2);return u(a.disableFidoCredential(e))}),m()}if(i&2){let r=c().index;o("id","disableFidoCredential["+r+"]")("text","protected.tokens.fido.credential.actions.disable")}}function De(i,n){if(i&1){let r=g();d(0,"iam-button",12),_("buttonClick",function(){f(r);let e=c().$implicit,a=c(2);return u(a.showCredentialDeleteConfirmationDialog(e))}),m()}if(i&2){let r=c().index;o("id","deleteFidoCredential["+r+"]")("type","error")("text","protected.tokens.fido.credential.actions.delete")}}function ke(i,n){if(i&1&&(d(0,"iam-card",6),v(1,"translate"),v(2,"translatedEnum"),M(3,"iam-text-row",7)(4,"iam-text-row",7),v(5,"formatDate"),x(6,Se,2,5,"iam-text-row",8),d(7,"iam-button-row"),x(8,ye,1,2,"iam-button",9)(9,Me,1,2,"iam-button",9)(10,Te,1,2,"iam-button",9)(11,De,1,3,"iam-button",10),m()()),i&2){let r=n.$implicit,t=n.index,e=c().ngIf;o("id","fidoCredential["+t+"]")("title","protected.tokens.fido.credential.title")("titleArguments",W(23,Fe,r.authenticator!=null&&r.authenticator.model?r.authenticator.model:F(1,15,"protected.tokens.fido.credential.unknown-type"),"("+F(2,17,Q(21,ve,r.enabled?"active":"inactive"))+")"))("detailCard",!0),l(3),o("id","fidoCredentialDisplayName["+t+"]")("label","protected.tokens.fido.credential.display-name")("value",r.displayName),l(),o("id","fidoCredentialRegistrationDate["+t+"]")("label","protected.tokens.fido.credential.registered-at")("value",F(5,19,r.registrationDate)),l(2),o("ngIf",r.lastUsageDate),l(2),o("ngIf",e.canRename),l(),o("ngIf",e.canEnable&&!r.enabled),l(),o("ngIf",e.canDisable&&r.enabled),l(),o("ngIf",e.canDelete)}}function Ee(i,n){if(i&1){let r=g();d(0,"iam-button",11),_("buttonClick",function(){f(r);let e=c(3);return u(e.registerFidoCredential())}),m()}i&2&&o("id","registerFidoCredential")("text","protected.tokens.fido.actions.register-credential")}function Ie(i,n){if(i&1){let r=g();d(0,"iam-button",11),_("buttonClick",function(){f(r);let e=c(3);return u(e.navigateToExitTarget())}),m()}i&2&&o("id","exitFidoCredentialManagement")("text","protected.tokens.fido.actions.exit")}function Ae(i,n){if(i&1&&(d(0,"iam-button-row",13),x(1,Ee,1,2,"iam-button",9)(2,Ie,1,2,"iam-button",9),m()),i&2){let r=c().ngIf;o("rowNgClass","iam-mt-3"),l(),o("ngIf",r.canRegister),l(),o("ngIf",r.hasExitTarget)}}function Ue(i,n){if(i&1&&(d(0,"iam-page",1),x(1,we,1,3,"iam-alert",2)(2,ke,12,26,"iam-card",3)(3,Ae,3,3,"iam-button-row",4),m()),i&2){let r=n.ngIf,t=c();o("pageId",t.pageId)("title","protected.tokens.fido.title")("bodyAttributes",t.bodyAttributes)("hideMaintenanceMessages",!0),l(),o("ngIf",r.credentials.length===0),l(),o("ngForOf",r.credentials),l(),o("ngIf",r.canRegister||r.hasExitTarget)}}var xe=(()=>{let n=class n extends he{constructor(){super(),this.bodyAttributes={[Ce]:be.ProtectedSelfService},this.pageId="iamProtectedFidoCredentialManagement",this.credentialManagementService=s(j),this.protectedUiService=s(k),this.pageDialog=s(ue)}ngOnInit(){this.fidoCredentialManagement=this.initUiConfig().pipe(G(()=>this.credentialManagementService.getFidoCredentialManagement()))}navigateToExitTarget(){this.credentialManagementService.navigateToExitTarget()}registerFidoCredential(){this.credentialManagementService.startFlowToAddFidoCredential().subscribe({next:t=>this.protectedUiService.handleSuccessfulStep(t),error:t=>this.protectedUiService.handleFailedStep(t)})}changeFidoCredentialDisplayName(t){this.credentialManagementService.startFlowToEditCredential(t).subscribe({next:e=>this.protectedUiService.handleSuccessfulStep(e),error:e=>this.protectedUiService.handleFailedStep(e)})}disableFidoCredential(t){this.credentialManagementService.startFlowToDisableCredential(t).subscribe({next:e=>this.protectedUiService.handleSuccessfulStep(e),error:e=>this.protectedUiService.handleFailedStep(e)})}enableFidoCredential(t){this.credentialManagementService.startFlowToEnableCredential(t).subscribe({next:e=>this.protectedUiService.handleSuccessfulStep(e),error:e=>this.protectedUiService.handleFailedStep(e)})}showCredentialDeleteConfirmationDialog(t){this.showDialog("protected.tokens.fido.deleti
1on.dialog.title","protected.tokens.fido.deletion.dialog.text",()=>this.deleteFidoCredential(t))}getUiConfig(){return this.credentialManagementService.getUiConfig()}showDialog(t,e,a){this.pageDialog.show({title:t,text:e}).pipe($(P=>P.ok)).subscribe(a)}deleteFidoCredential(t){this.credentialManagementService.startFlowToDeleteCredential(t).subscribe({next:e=>this.protectedUiService.handleSuccessfulStep(e),error:e=>this.protectedUiService.handleFailedStep(e)})}};n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=q({type:n,selectors:[["ng-component"]],standalone:!1,features:[K([j,C.PROVIDER,E]),J],decls:2,vars:3,consts:[[3,"pageId","title","bodyAttributes","hideMaintenanceMessages",4,"ngIf"],[3,"pageId","title","bodyAttributes","hideMaintenanceMessages"],[3,"id","text","type",4,"ngIf"],[3,"id","title","titleArguments","detailCard",4,"ngFor","ngForOf"],[3,"rowNgClass",4,"ngIf"],[3,"id","text","type"],[3,"id","title","titleArguments","detailCard"],[3,"id","label","value"],[3,"id","label","value",4,"ngIf"],[3,"id","text","buttonClick",4,"ngIf"],[3,"id","type","text","buttonClick",4,"ngIf"],[3,"buttonClick","id","text"],[3,"buttonClick","id","type","text"],[3,"rowNgClass"]],template:function(e,a){e&1&&(x(0,Ue,4,7,"iam-page",0),v(1,"async")),e&2&&o("ngIf",F(1,1,a.fidoCredentialManagement))},dependencies:[X,Y,de,se,ce,le,me,ge,Z,oe,pe,fe],encapsulation:2});let i=n;return i})();var Ve=[{path:"",pathMatch:"full",redirectTo:"credentials"},{path:"credentials",component:xe,resolve:{credentialManagementConfig:()=>s(C).resolve()},runGuardsAndResolvers:"always"}],Ht=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=z({type:n}),n.\u0275inj=L({providers:[C,R],imports:[te.forChild(Ve),_e]});let i=n;return i})();export{Ht as FidoCredentialManagementModule};
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.