import{a as g,b as O}from"./chunk-IG5E4SFP.js";import{k as b,l as q}from"./chunk-YKFXM3J7.js";import{D as S,E as j}from"./chunk-I7GW4F3B.js";import{a as v,b as k}from"./chunk-MOK7XOAA.js";import{gc as o,hc as U}from"./chunk-BPZQKZKD.js";import{B as h,I as R}from"./chunk-HTXYTVN4.js";import{Jb as a,Sa as P,Sb as l,T as d,Ub as f,be as A,ia as u,ka as p,x as m}from"./chunk-WL5U2YIT.js";import{e as I}from"./chunk-ADEKKGI2.js";var L,T=I(()=>{O();P();U();A();q();j();R();k();L=(()=>{let t=class t extends g{constructor(e,i,s,r){super(i,s,r),this.repositoryService=e}ngOnInit(){super.ngOnInit(),this.paging={pageSize:this.currentUserService.webSettingsSnapshot.defaultPageSize,pageNumber:1,sortOrder:1},this.beforeSubscribeToQueryParams().pipe(d(1)).subscribe(()=>this.subscribeToQueryParams())}beforeSubscribeToQueryParams(){return this.repositoryService.getCurrentUserRepositories(this.requiredAdministrativePermission,!1,!1,!0,!0).pipe(u(this.destroyed$),p(e=>{let i=e.find(n=>n.id===this.parameters.vaultId),s=this.storageService.get().lastSharedVaultId;this.requiredAdministrativePermission&&(i&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.Repository,i.id)&&(i=null),s&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.Repository,s)&&(s=null));let r=e.find(n=>n.id===s)??e.find(n=>this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.Repository,n.id));if(!r&&e.length>0&&(r=e[0]),!r){this.fallbackVault=null;return}let y=i?{id:i.id,name:i.name}:{id:r.id,name:r.name};this.parameters.vaultId||(this.fallbackVault=y.id)}),m(()=>null))}};t.\u0275fac=function(i){return new(i||t)(a(b),a(S),a(h),a(v))},t.\u0275dir=l({type:t,features:[f]});let c=t;return c})()});export{L as a,T as b};
