"use strict";(self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[]).push([[922],{6922(n,t,o){o.d(t,{OrgImportComponent:()=>$});var i=o(72245),e=o(3204),r=o(23965),a=o(67553),c=o(3633),s=o(5076),u=o(28020),d=o(43215),l=o(36801),f=o(72932),p=o(25065),v=o(74208),m=function(n,t,o,i){return new(o||(o=Promise))(function(e,r){function a(n){try{s(i.next(n))}catch(t){r(t)}}function c(n){try{s(i.throw(n))}catch(t){r(t)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof o?t:new o(function(n){n(t)})).then(a,c)}s((i=i.apply(n,t||[])).next())})};class h{constructor(n){this.collectionAdminService=n}getAllAdminCollections(n,t){return m(this,void 0,void 0,function*(){return yield(0,i._)(this.collectionAdminService.collectionAdminViews$(n,t))})}}h.ɵfac=function(n){return new(n||h)(v.KVO(r.vE))},h.ɵprov=v.jDH({token:h,factory:h.ɵfac});var g=o(33812),b=o(23649),I=o(35500),w=o(26657),y=o(56898),_=o(10672),z=o(49112),S=o(25740),U=function(n,t,o,i){return new(o||(o=Promise))(function(e,r){function a(n){try{s(i.next(n))}catch(t){r(t)}}function c(n){try{s(i.throw(n))}catch(t){r(t)}}function s(n){var t;n.done?e(n.value):(t=n.value,t instanceof o?t:new o(function(n){n(t)})).then(a,c)}s((i=i.apply(n,t||[])).next())})};class ${constructor(n,t,o,i){this.route=n,this.organizationService=t,this.router=o,this.accountService=i,this.routeOrgId=void 0,this.loading=!1,this.disabled=!1}ngOnInit(){const n=this.route.snapshot.paramMap.get("organizationId");if(void 0===n)throw new Error("`organizationId` is a required route parameter");if(!(0,s.e)(n))throw new Error("Invalid OrganizationId provided in route parameter `organizationId`");this.routeOrgId=n}onSuccessfulImport(n){return U(this,void 0,void 0,function*(){const t=yield(0,i._)((0,c.F6)(this.accountService.activeAccount$)),o=yield(0,i._)(this.organizationService.organizations$(t).pipe((0,e.T)(t=>t.find(t=>t.id===n))));null!=o&&(0,a.of)(o)&&(yield this.router.navigate(["organizations",n,"vault"]))})}}$.ɵfac=function(n){return new(n||$)(g.rXU(b.nX),g.rXU(a.PV),g.rXU(b.Ix),g.rXU(I.D))},$.ɵcmp=g.VBU({type:$,selectors:[["ng-component"]],features:[g.Jv_([...d.F3,(0,l.F)({provide:u.UN,useClass:u.bf,deps:[d.Uz]}),{provide:u.H7,useClass:h,deps:[r.vE]}])],decls:6,vars:7,consts:[[3,"formDisabled","formLoading","onSuccessfulImport","organizationId"],["form","import_form_importForm","bitButton","","type","submit","bitFormButton","","buttonType","primary",3,"disabled","loading"]],template:function(n,t){1&n&&(g.nrm(0,"app-header"),g.j41(1,"bit-container")(2,"tools-import",0),g.bIt("formDisabled",function(n){return t.disabled=n})("formLoading",function(n){return t.loading=n})("onSuccessfulImport",function(n){return t.onSuccessfulImport(n)}),g.k0s(),g.j41(3,"button",1),g.EFF(4),g.nI1(5,"i18n"),g.k0s()()),2&n&&(g.R7$(2),g.Y8G("organizationId",g.mNQ(t.routeOrgId)),g.R7$(),g.Y8G("disabled",t.disabled)("loading",t.loading),g.R7$(),g.SpI(" ",g.bMT(5,5,"importVerb")," "))},dependencies:[p.G,w.$,y.Q,_.H,d.Pi,f.G,z.f,S.$],encapsulation:2})},28020(n,t,o){o.d(t,{H7:()=>i.H7,UN:()=>i.UN,bf:()=>i.bf});o(83586);var i=o(68052)}}]);
//# sourceMappingURL=922.4c1fca313f1dfe75cf04.js.map