import {S,C}from'./chunk-D6370M2b.js';import {J,a5 as fh,f_ as qt,c as tS,au as pe,a7 as si,G as vl,b2 as v,a9 as zt,bE as ff,aJ as hf,g0 as U,ah as ot,w as wo,aE as je,ac as Dr,M as ie,bc as I,bW as JT,bu as dy}from'./main-WUGO6e7n.js';var F,D=J(()=>{S();fh();qt();tS();pe();si();vl();v();F=(()=>{class n extends C{constructor(e,i,t,r){super(i,t,r),this.repositoryService=e;}ngOnInit(){super.ngOnInit(),this.paging={pageSize:this.currentUserService.webSettingsSnapshot.defaultPageSize,pageNumber:1,sortOrder:1},this.beforeSubscribeToQueryParams().pipe(zt(1)).subscribe(()=>this.subscribeToQueryParams());}beforeSubscribeToQueryParams(){return this.repositoryService.getCurrentUserRepositories(this.requiredAdministrativePermission,!1,!1,!0,!0).pipe(ff(this.destroyed$),hf(e=>{let i=e.find(s=>s.id===this.parameters.vaultId),t=this.storageService.get().lastSharedVaultId;this.requiredAdministrativePermission&&(i&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,U.Repository,i.id)&&(i=null),t&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,U.Repository,t)&&(t=null));let r=e.find(s=>s.id===t)??e.find(s=>this.currentUserService.hasPermission(this.requiredAdministrativePermission,U.Repository,s.id));if(!r&&e.length>0&&(r=e[0]),!r){this.fallbackVault=null;return}let g=i?{id:i.id,name:i.name}:{id:r.id,name:r.name};this.parameters.vaultId||(this.fallbackVault=g.id);}),ot(()=>null))}static{this.\u0275fac=function(i){return new(i||n)(wo(je),wo(Dr),wo(ie),wo(I))};}static{this.\u0275dir=JT({type:n,features:[dy]});}}return n})();});export{D,F};