import{a as S,b as D}from"./chunk-43BVWFV6.js";import{a as b,b as j}from"./chunk-6Q7YU3GA.js";import{k as v,l as k}from"./chunk-6G52AAKU.js";import{P as f,Q as U}from"./chunk-JE2X3YFA.js";import{o as h,v as A}from"./chunk-HW6LKGMV.js";import{$b as R,_b as o}from"./chunk-GDJMZZ4C.js";import{Fb as a,Rd as I,Sb as u,T as m,Ub as l,ia as d,ka as p,na as y,x as c}from"./chunk-4HFZZ7HS.js";import{e as P}from"./chunk-SZAW6ZBW.js";var F,O=P(()=>{D();y();R();I();k();U();A();j();F=(()=>{class n extends S{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(m(1)).subscribe(()=>this.subscribeToQueryParams())}beforeSubscribeToQueryParams(){return this.repositoryService.getCurrentUserRepositories().pipe(d(this.destroyed$),p(e=>{let i=e.find(s=>s.id===this.parameters.vaultId),t=this.storageService.get().lastSharedVaultId;this.requiredAdministrativePermission&&(i&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.Repository,i.id)&&(i=null),t&&!this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.Repository,t)&&(t=null));let r=e.find(s=>s.id===t)??e.find(s=>this.currentUserService.hasPermission(this.requiredAdministrativePermission,o.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)}),c(()=>null))}static{this.\u0275fac=function(i){return new(i||n)(a(v),a(f),a(h),a(b))}}static{this.\u0275dir=u({type:n,features:[l]})}}return n})()});export{F as a,O as b};
